Skip to content

fix: negotiate Opus NACK in single and dual PC modes - #1296

Merged
xianshijing-lk merged 2 commits into
hiroshi/single-pcfrom
sxian/fix-single-pc-opus-nack
Nov 18, 2026
Merged

xianshijing-lk merged 2 commits into
hiroshi/single-pcfrom
sxian/fix-single-pc-opus-nack

Conversation

@xianshijing-lk

@xianshijing-lk xianshijing-lk commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Single-PC offers omit plain NACK feedback for Opus, including when the first audio section is send-only. Dual-PC subscriber answers also need to restore NACK when the server offers it. This adds NACK to every Opus payload in single-PC audio offers and accepts server-offered NACK in the corresponding dual-PC answer sections. With RED disabled, this enables retransmission of lost audio.

This PR targets hiroshi/single-pc, which contains Flutter's single-PC implementation and has not yet merged into main. It ports livekit/client-sdk-js#2270 and aligns dual-PC answers with the existing JS and Swift behavior.

The offer setting follows the effective connection mode, preserving dual-PC publisher offers after fallback. Subscriber answers match sections by MID and resolve their own Opus payload types. Existing plain or wildcard feedback is retained, NACK PLI does not suppress plain NACK, and repeated munging does not duplicate feedback.

The existing SDP fallback handles rejection of modified offers and answers. Only the applied description is signaled; if both modified and original descriptions are rejected, negotiation fails without signaling an unapplied description. Includes a changeset.

Validation:

  • 161 core tests passed with one existing skip, using Flutter 3.44.9.
  • 20 Opus NACK tests cover offer-mode gating, audio directions, multiple payloads, feedback preservation, send-only-first offers, renegotiation, selective subscriber answers, reordered MIDs, different payload types, fallback, and final failure.
  • Static analysis on changed Dart files, formatting, import sorting, and git diff --check passed.
  • Device/server negotiation and controlled packet-loss tests were not run. No dependency or lockfile changes are included.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@xianshijing-lk xianshijing-lk changed the title fix: negotiate Opus NACK in single-PC audio offers fix: negotiate Opus NACK in single and dual PC modes Nov 18, 2026
@xianshijing-lk
xianshijing-lk merged commit 0a37927 into hiroshi/single-pc Nov 18, 2026
2 checks passed
@xianshijing-lk
xianshijing-lk deleted the sxian/fix-single-pc-opus-nack branch November 18, 2026 22:44
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.

2 participants