Skip to content

fix(linux): clear the keyframe latch when recovery replaces queued frames - #1414

Closed
TheWeaklessOne wants to merge 1 commit into
OpenCloudGaming:devfrom
TheWeaklessOne:fix/linux-recovery-keyframe-latch
Closed

TheWeaklessOne wants to merge 1 commit into
OpenCloudGaming:devfrom
TheWeaklessOne:fix/linux-recovery-keyframe-latch

Conversation

@TheWeaklessOne

Copy link
Copy Markdown

A decoder queue overflow on Linux could freeze the stream for seconds. After an overflow the recovery keyframe replaces the stale decode work in the queue, and queue_video_command reported that as PushOutcome::DroppedOldest, although the keyframe itself was queued. run_embedded_linux_video clears keyframe_requested and video_desynced only on Queued, so both stayed set. Every later overflow then saw a request already pending and sent none, and the stream stayed stuck until an IDR happened to arrive.

Changes:

  • A keyframe that replaced decode work now reports Queued, in both the recovery path and the overflow-boundary path. overflow_preserves_recovery_keyframe_and_rejects_inter_frames_until_it_arrives asserted the old outcome and is updated.
  • If frames are still being dropped 250 ms after the request, the request is sent again (linux_keyframe_retry_due), so one lost request cannot leave the stream frozen.

Verification:

  • New tests: keyframe_at_the_overflow_boundary_reports_itself_queued and linux_keyframe_retry_rearms_after_the_interval.
  • cargo test --release -p opennow-streamer-platform-linux --features ffmpeg-bundled,vaapi (the features the app build uses) on clean dev with this change: 253 passed, against 252 on clean dev. The one failure, fixed_audio_output_never_falls_back_and_stays_isolated, also fails on clean dev on that device (ALSA device enumeration returns -2). opennow-streamer-platform: 208 passed.
  • GeForce NOW on an Odin 2 Portal (AV1 10-bit HDR, 120 fps, around 95 Mbps) with this change on a tree carrying other local changes: 0 overflows and 0 keyframe requests in steady streaming; a decode stall injected for 1500 ms recovered within 1.6 s.

🤖 Generated with Claude Code

…ames

After a decoder queue overflow the recovery keyframe replaces the stale
decode work. queue_video_command reported that as DroppedOldest, so the
caller kept keyframe_requested and video_desynced set, and every later
overflow believed a request was already pending: the stream froze until an
IDR happened to arrive. Report the queued keyframe as Queued, including at
the overflow boundary, and request the keyframe again if none has come
within 250 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 942bb8cb-79e4-46eb-9b89-392173dc67bd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T20:44:41.033434Z d123428 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TheWeaklessOne

Copy link
Copy Markdown
Author

Folded into #1470 together with the other Linux decode fixes, rebased on dev and retested on the Portal. Closing this one in favour of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant