Repository navigation
Conversation
…eues When a retransmission fills a gap, the reorder queue releases every frame it held behind it in one burst: 7-9 frames for the 52 ms wait at 120 fps. The transport hands frames to the core through an 8-slot channel with try_send, so the ninth was dropped, a keyframe was requested, and the frames already queued were discarded with the broken chain. A loss that the retransmission had repaired still cost a keyframe wait. In a 3-minute 3840x2160@120 AV1 session over Starlink with small frames, this happened 6 times, 67-97 ms after a packet-loss burst, each discarding 3-14 frames and waiting 27-75 ms for the keyframe. Raise the channel to 32 frames and the Linux decoder's encoded queue from 16 to 32, comfortably above a 52 ms release at 240 fps. Both stay bounded. After the change, no such drop in four 3-minute sessions. Co-Authored-By: Claude Fable 5.2 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a retransmission fills a gap, the FEC reorder queue releases every frame it held behind it in one burst: 7–9 frames for the 52 ms wait at 120 fps, 13 at 240 fps. The transport hands frames to the core through an 8-slot
sync_channelwithtry_send(deliver_media_frame). The ninth frame then fails withMediaConsumerBackpressured, and three things follow:VideoQueuediscards the chain it already holds.A loss that the retransmission had repaired still costs a keyframe wait.
Evidence: one 3-minute 3840×2160@120 AV1 session over Starlink, near-static content at 1–3 Mbps. It hit this 6 times, each 67–97 ms after a loss burst and with no gap given up. Each time it discarded 3–14 queued frames and waited 27–75 ms for the keyframe. The log signature is a transport WARN line followed within 5 ms by "compressed chain invalidated".
The bug shows mostly with small frames. There the burst release outpaces the consumer thread; with large frames, assembly is slower and the consumer keeps up. Before the change, the higher-bitrate sessions had 0–1 such events each.
Change
ENCODED_MEDIA_QUEUE_CAPACITYinopennow-streamer-core: 8 → 32.encoded_queue_depthdefault: 16 → 32, so the burst doesn't overflow the next queue instead.Both stay bounded. 32 frames is comfortably above a 52 ms release at 240 fps. In steady state the queues stay near empty, so latency is unchanged. Windows and macOS share only the core channel change.
Verification
Linux x86_64, Steam Runtime 4 SDK container:
cargo fmt --manifest-path native/opennow-streamer/Cargo.toml --all -- --check: cleancargo clippy --locked --manifest-path native/opennow-streamer/Cargo.toml --workspace --all-targets -- -D warnings: cleancargo test --locked --manifest-path native/opennow-streamer/Cargo.toml --workspace: 1462 passed, 0 failed, 14 ignoredAfter the change, there were no such drops in two 3-minute sessions on the same link, but both ran at 18–66 Mbps. I did not get another small-frame session, so the live "after" evidence is weaker than the "before" evidence. The fix rests mainly on the mechanism above. Windows and macOS were not run.
Related: #1450 (FEC gap waits run side by side). This PR is independent of it.
🤖 Generated with Claude Code