perf(screens): track remaining startup, relay/NAT, and low-latency decode optimizations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 12/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- java, rust, swift, typescript
- Domain
- networking, performance
Research direction
This is an umbrella tracking issue spanning the whole remote screen stack, not a single change — pick one bullet and split it out before touching code. Start by reading station/src/screens/win-desktop.ts (#start) or station/src/screens/desktop.ts (open()/refresh) if you take the cold-start items, cloud/src/relay-worker.ts for the relay path, or station/src/mesh/screens.ts for the KIND.input/KIND.ack/KIND.setClipboard stream split. Each item names its current behaviour and a proposal; done means the described latency gap is measurably closed and validated on a real link, which needs profiling access most newcomers will not have.
Written by the indexing model from the issue text.
Description
After auditing the current remote screen stack on main (95f976d6c3), several major latency improvements have already landed recently—including QUIC datagrams with adaptive RS-FEC and zero-JSI pointer tap (#7422), link-aware initial bitrate, moving-screen sharpening, and binary cursor frames (#7402), Opus system audio with 1-back RED (#6481, #6497, #7422), macOS single-window capture, full-chroma 4:4:4, and noq-proto BBR fixes (noq#852, noq#802).
This tracking issue collects the remaining startup, transport, and decode latency gaps verified on 95f976d6c3 so they can be evaluated and split into focused PRs:
1. First-frame & cold-start latency
- Keep Windows
stillfail-screen.exeas a persistent daemon- Current:
station/src/screens/win-desktop.ts(#start) spawns a newstillfail-screen.exe viewsubprocess for every view, re-initializing COM, D3D11,Windows.Graphics.Capture, and Media Foundation hardware encoders on each open/reconnect. - Proposal: Mirror the persistent macOS
still.fail Helperdaemon model so GPU and capture contexts stay warm across view opens and reconnects.
- Current:
- Avoid blocking permission refresh and cold encoder setup on macOS
- Current:
station/src/screens/desktop.tsblocksopen()onawait this.refresh(true)every time, andstation/native/helper/Sources/StillfailHelper/ScreenView.swiftcold-createsVTCompressionSessionper view. - Proposal: Use a short TTL cache for permission status (start the stream optimistically and refresh/prompt only on failure), and consider pooling/pre-warming
VTCompressionSessionto cut first-frame and resolution-switch stalls.
- Current:
- Hot-switch
control,quality, andfpsin-stream instead of reopening- Current:
client/core-ts/src/screens.tstriggersreopenoncontrol()andbounds()changes, tearing down and recreating the view stream, capture pipeline, and encoder. - Proposal: Apply
control,quality, andfpschanges via in-stream control frames (similar tolookandrate) to avoid reconnect glitches and cold starts.
- Current:
- Optional local encrypted last-frame placeholder on clients
- Current:
apps/mbui/src/sfpages/screen.mbtkeeps the last frame in memory across background/foreground transitions, but reopening a closed screen waits for stream setup and the first decoded frame. - Proposal: Optionally cache an encrypted local thumbnail of each screen's latest frame (keyed in Apple Keychain / Android Keystore, device-only, never uploaded, toggleable with TTL eviction) to show immediately on tap and fade out once the first live frame renders.
- Current:
2. Transport, NAT traversal & relay tail latency
- Evaluate promoting the fixed BBR3 congestion controller to default (or for screen views)
- Current:
station/native/mesh/src/lib.rsalready buildsnoq-protowith fixes forn0-computer/noq#852(idlemax_bwcollapse),noq#802(initial startup pacing rate), andloss_thresh(0.30), yet defaults tocubic, which halves congestion window on random packet loss. - Proposal: Benchmark and validate the patched BBR3 on real WAN/cross-border links and evaluate making it the default (or enabling it for screen traffic).
- Current:
- Add a UDP relay path alongside WebSocket fallback
- Current:
cloud/src/relay-worker.tsonly accepts WebSocket (TCP) upgrades. Whenever P2P hole-punching falls back to relay, #7422's QUIC datagrams + RS-FEC are encapsulated over TCP WebSockets, reintroducing TCP-over-TCP recovery and high tail latency under packet loss. - Proposal: Support a UDP relay transport with automatic fallback to WebSocket where UDP 443 is blocked.
- Current:
- Bind physical interfaces / exclude VPN & TUN adapters for direct probing
- Current: Many developer machines run always-on TUN/VPN proxies (e.g., Clash, Surge, Mihomo), which frequently intercept UDP hole-punching probes and force traffic onto relays.
- Proposal: Support excluding virtual TUN/VPN adapters and probing/binding physical network interfaces in
station/native/meshand mobile direct discovery to raise LAN and WAN P2P success rates.
3. Decode, input isolation & host frame path
- Broaden Android MediaCodec low-latency vendor keys and operating rate
- Current:
libs/ui/android/app/src/main/java/dev/mbui/Streams.javasets Qualcomm vendor keys (vendor.qti-ext-dec-picture-order.enable,vendor.qti-ext-dec-low-latency.enable) forc2.qti.*/OMX.qcom.*, but does not configure HiSilicon (vendor.hisi-ext-low-latency-video-dec.*), generic/MTK low-latency keys (vendor.rtc-ext-dec-low-latency.enable,vendor.low-latency.enable), orMediaFormat.KEY_OPERATING_RATE. - Proposal: Add vendor-gated low-latency keys and
KEY_OPERATING_RATEon supported API levels / codecs.
- Current:
- Isolate large clipboard transfers from
input/ack- Current: In
station/src/mesh/screens.ts,KIND.input(16),KIND.ack(17), andKIND.setClipboard(19, up to 8 MB PNG) share the same ordered stream, so pasting a large image can briefly block input events and frame ACKs. - Proposal: Move large clipboard payloads off the control stream, or give
input/acka dedicated high-priority stream (and/or datagrams for high-frequency pointer moves).
- Current: In
- Shorten host frame forwarding path & evaluate 144 fps
- Current: On the TS station path, encoded frames traverse
Helper / stillfail-screen→ Unix socket/pipe → Node.jsBuffer→ N-API → Rustmesh.node(wherescreen-pace.tsLoopStallhas observed 40–140 ms Node event-loop stalls);FPS_CHOICES/MAX_FPScaps at 120 fps. - Proposal: As the native/MoonBit station matures, consider forwarding media frames more directly between the capture helper and the Rust mesh transport to eliminate extra copies and event-loop jitter, and evaluate adding a 144 fps tier for direct high-refresh displays.
- Current: On the TS station path, encoded frames traverse
- Dominant language
- MoonBit
- Stars
- 68
- Forks
- 22
- Avg merge
- 1h 52m
- Merged PRs (30d)
- 934
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AFK-surf/monoid
-
Station notices show in the station's language, not the reader'sPossibly taken @XMLHexagram claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 1/100
Maintainers usually reply within 1 day
-
i18n: send station notices and refusals as codes so each reader sees them in their own languagePossibly taken @XMLHexagram claimed this today. Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
Maintainers usually reply within 1 day
-
fix(ui): button_node moves_for trails words over reflowed row siblings when label shrinksPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
AFK-surf/monoid#10035 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
home-assistant/frontend#56449 ·
Maintainers usually reply within 1 day
-
bot-scan bug migration-prioritized
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Hudson-Pufferfish/local-party-console#223 ·
Maintainers usually reply within 1 day
-
priority: low python
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
LearningCircuit/local-deep-research#10346 ·
Maintainers usually reply within 1 day
-
XHTTP over HTTP/3 with `finalmask.quicParams.congestion: "brutal"` panics at the first dial; `-test` passesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
C-py I-defect
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
SeleniumHQ/selenium#18438 ·
Maintainers usually reply within 1 day