Repository navigation
fix: negotiate Opus NACK in single and dual PC modes - #1072
Merged
Merged
Conversation
xianshijing-lk
requested review from
MaxHeimbrock and
davidliu
as code owners
November 18, 2026 01:02
🦋 Changeset detectedLatest commit: 754cfc4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
Diffuse output: AARJAR |
davidliu
approved these changes
Nov 18, 2026
Open
changt
added a commit
that referenced
this pull request
Nov 19, 2026
PeerConnectionTransport conflicted with the Opus NACK change (#1072), which edited the offer munge inline in createAndSendOffer and added setAnswerWithOpusNack next to it. On this branch the munge lives in createMungedOffer, so the Opus NACK step for audio sections moves there, and both functions are kept. The single peer connection publisher is created in joinImpl on this branch, ahead of the join, so that call now passes singlePeerConnection = true. Without it the publisher's offers would not carry Opus NACK. audioOffersAdvertiseOpusNack covers this through the engine.
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.
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 negotiates plain NACK on 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.
Ports the single-PC behavior from livekit/client-sdk-js#2270 and aligns dual-PC answers with the existing JS and Swift behavior. Publisher offers remain unchanged in dual-PC mode, including after fallback from single-PC mode. Subscriber answers match offered sections by MID and resolve their own Opus payload types. Both paths preserve wildcard feedback, distinguish plain NACK from NACK PLI, and avoid duplicate feedback.
If a modified answer is rejected, the original answer is applied instead; only the successfully applied answer is returned for signaling. If both attempts fail, the error is propagated. Includes a changeset.
Android currently sends its first client offer after JOIN rather than bundling it with JOIN. The shared offer-generation step covers the first offer and renegotiations.
Validation: