Glimesh / janus-ftl-plugin

A plugin for the Janus WebRTC gateway to enable relaying of audio/video streams utilizing Mixer's FTL (Faster-Than-Light) protocol.
https://hayden.fyi/posts/2020-08-03-Faster-Than-Light-protocol-engineering-notes.html
GNU Affero General Public License v3.0
44 stars 11 forks source link

🔊 Ask receiver to play stereo audio #118

Closed danstiner closed 3 years ago

danstiner commented 3 years ago

Per https://tools.ietf.org/html/rfc7587#section-6.1 if the sender does not specify sprop-stereo=1 the receiver may default to downmixing stereo sources to mono.

Firefox does this: https://bugzilla.mozilla.org/show_bug.cgi?id=1524145

danstiner commented 3 years ago

Firefox just throws CORS errors for me locally so I can't easily test this fixes things, but I can say this doesn't break anything.

luludotdev commented 3 years ago

Does not fix on Chrome 89.0.4389.114

luludotdev commented 3 years ago

From all my research and testing getting https://github.com/Glimesh/janus-ftl-player/pull/13 going, it seems that Opus is always negotiated as stereo, hence the 2 channels in OPUS/48000/2. But it is up to the receiver to figure out what it wants to decode as, and Chromium seems to default to mono. Munging the SDP on the client end seems to be a requirement right now.

danstiner commented 3 years ago

Ah thanks, I tested locally now and can also confirm this doesn't help. Per spec it is the correct attribute to set but Chrome just happily ignores it right now. It seems like stereo support has a very broken history in WebRTC.

If munging the SDP on the client fixes it let's munge away :)

I'll leave this open as it doesn't hurt to add in case browsers start supporting the standard signalling attributes someday.

luludotdev commented 3 years ago

I'll leave this open as it doesn't hurt to add in case browsers start supporting the standard signalling attributes someday.

Agreed. Hopefully this bug will be fixed in Chromium eventually :smile: