Repository navigation
Conversation
The FEC reorder queue started a block's 52 ms retransmission wait, and sent its first NACK, only when the block reached the head of the queue. A loss that damaged N blocks therefore held the queue for N x 52 ms, and with it the reference-invalidation request (queued when the next frame assembles) and the recovery frame the server sends in reply. The backlog was then released at once, which overflowed the decoder hand-off and cost another IDR round trip. A block's wait now starts when a packet from a later block arrives, and a hole's when the block behind it arrives. All waits run in parallel: - every gap is requested as soon as it is evident, with up to eight NACK reports per 4 ms tick instead of one; - a stalled block asks for every missing data run it needs to reconstruct, because its wait is no longer extended for a second round; - giving up on a gap forgets only that gap's NACK requests instead of all; - the queue reports one discontinuity per pass, so a complete frame between two abandoned gaps is delivered instead of discarded. Evidence, five 2-minute 3840x2160@120 AV1 sessions on a link that loses packets every 15 s (48 loss episodes): 21 gave up on two or more gaps in series, 52 ms apart, before the first invalidation left. The six longest (0.65-1.5 s) gave up on 15 to 66 gaps each, and in five of them a recovery keyframe was released 4-52 ms before another keyframe that the server had sent 0.3-0.5 s after it: both had been waiting in the queue. The plain reorder queue (streams without an FEC layout) is unchanged. 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
The FEC reorder queue starts a damaged block's 52 ms retransmission wait, and sends its first NACK, only when that block reaches the head of the queue. A burst that damages N blocks therefore holds the queue for N × 52 ms. The 0x301 invalidation request (queued when the next frame assembles) waits behind it, and so does the recovery frame the server sends in reply. The backlog is then released at once, which overflows the decoder hand-off and costs another IDR round trip.
On a link that drops packets around periodic handovers (Starlink, every 15 s), five 2-minute 3840×2160@120 AV1 sessions had 48 loss episodes. In 21 of them the queue gave up on two or more gaps in series, 52 ms apart, before the first invalidation left. The six longest (0.65–1.5 s from first gap to a usable frame) gave up on 15–66 gaps each.
Change
FecReorderBuffer(nvst.rs). Waits now run side by side:forget_nacks_through) instead of all of them.The plain reorder queue (streams without an FEC layout) is unchanged.
docs/streamer-comparison/transport-recovery.mddescribes the new behaviour.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: 1468 passed, 0 failed, 14 ignoredThe 6 new tests are in
nvst_recovery_tests.rs:consecutive_damaged_frames_share_one_nack_windowa_recovery_frame_between_two_expired_gaps_is_deliveredgiving_up_on_a_gap_keeps_the_requests_for_later_gapsfec_holes_wait_from_the_packet_that_revealed_thema_block_that_fills_a_hole_does_not_restart_the_waita_stalled_block_requests_every_run_it_needs_at_oncemultiple_reorder_gaps_do_not_revalidate_post_gap_referencesnow expects the gaps to be reported together.Live comparison: two 160 s 3840×2160@120 AV1 10-bit sessions on the same link, back to back, on v1.0.5 with local patches (including #1305 and #1306), one session without this change and one with it. Each session had 12 loss episodes.
Not shown, and why:
A repaired gap can still overflow the core's 8-slot media channel. #1451 fixes that separately.
🤖 Generated with Claude Code