Skip to content

Fix bounded Opus packet-loss concealment in embedded Linux audio - #955

Merged
zortos293 merged 1 commit into
devfrom
capy/fix-bounded-opus-packet
Sep 15, 2026
Merged

zortos293 merged 1 commit into
devfrom
capy/fix-bounded-opus-packet

Conversation

@zortos293

Copy link
Copy Markdown
Collaborator

Changes

Preserve the sender SSRC and RTP timestamp through the embedded Linux audio handoff. Measure unrecovered loss from the RTP timeline and synthesize Opus concealment in valid sample chunks, capped at 100 ms and the existing PCM buffer capacity.

Reset Opus state when the sender source changes. Carrying the SSRC on every packet preserves this reset even if a bounded queue drops the first packet from the new source. RED-recovered packets are decoded normally without duplicate concealment.

Verification

Independently reviewed the final diff and reran:

  • Linux audio tests against real libopus: 19 passed, with 2 existing device-dependent tests ignored.
  • Audio transport regressions: 11 passed.
  • Full native streamer workspace tests: all passed, including 192 transport and 102 Linux platform tests.
  • Workspace formatting and Clippy: passed.

Regressions cover RTP wrap, short and burst losses, varying packet durations, backward timestamps, source reset, a dropped first packet after source change, and RED recovery.

Limits

No live GFN session, hardware decode, or real playback-device packet-loss test was available. The evidence is transport and real-libopus regression testing, not live gameplay validation. Audio-only failure isolation is a separate dependent change. No UI or FFI ABI changes.

Open in Capy

@coderabbitai

coderabbitai Bot commented Sep 15, 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

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 4ce4610e-aa22-4685-a7c3-8481f5e61b77

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

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

Comment @coderabbitai help to get the list of available commands.

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 2 other findings in Capy.

Open in Capy

@zortos293
zortos293 merged commit d41f07c into dev Sep 15, 2026
14 checks passed
@capy-ai

capy-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review replacement: #959. This PR was marked merged when a dependent task accidentally pushed directly to dev. The user authorized repair, and dev has now been restored to 7a76b0c965087750d46411901ce8d04ba1b2524a with an exact force-with-lease. The unchanged PLC commit is preserved on capy/linux-opus-plc-review and requires review through #959. Audio failure isolation is separately stacked in #960. The historical merged status here is not evidence that these changes are currently on dev.

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