Conversation
TrackWriter.Codec declared the encoder's channel count, so the default mono writer offered opus/48000/1. RFC 7587 signals Opus as opus/48000/2 whatever the stream carries, and that is what the SFU and browsers negotiate, so pion could not bind the track: SetRemoteDescription returned ErrUnsupportedCodec, the SDK logged "a track does not support the negotiated codec", ICE never connected, and nothing was published. examples/audio (which uses the default writer) and examples/publish (which hard-coded one channel) both failed this way against a live call. The capability now always says two channels; mono audio is a valid stream of that codec. A new loopback test publishes the default writer to a peer that negotiates Opus with pion's default codecs and checks that the track binds and its audio arrives; it fails without this change.
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.
Publishing with the default
TrackWriter(mono) never worked:Codec()declaredopus/48000/1, but RFC 7587 signals Opus asopus/48000/2regardless of the channels carried, and that is what the SFU and browsers negotiate. Pion couldn't bind the track (SetRemoteDescription→ErrUnsupportedCodec, logged as "a track does not support the negotiated codec"), ICE never connected, and no audio reached the call.examples/audioandexamples/publishboth hit it against a live call.TrackWriter.Codec()always declares two channels (mono audio is a valid stream of that codec);examples/publishlikewise.TestTrackWriterBindsToNegotiatedOpus: publishes the default writer over a loopback peer that negotiates Pion's default codecs and checks the track binds and audio arrives. It fails onmainwithErrUnsupportedCodec.TestTrackWriterCodecnow expects two channels for mono.Verified live:
examples/audio(unmodified) publishes into a call and a subscriber receives and decodes the audio; before the change it logged the codec error and never connected.make cipasses.