How do I get FEC audio data to be sent from Chrome when using Opus codec?

141 views
Skip to first unread message

Tim Robbins

unread,
Dec 14, 2021, 11:56:10 AM12/14/21
to discuss-webrtc
Hi,
We are using web-rtc audio with Asterisk as the server between the users. Opus is our codec, and I am testing to see how FEC is working in both directions.  I can easily see that Asterisk will send FEC data to Chrome, based on the fecPacketsReceived stat.  However, I am not able to confirm that the other direction works, namely that Chrome is sending FEC packets to Asterisk.  I have useinbandfec=1 set and have simulated packet loss, but I have not audibly detected any audio improvement which would indicate FEC packets are being sent and utilized. Furthermore, the fecPacketsReceived stat is not implemented in remote-inbound-rtp nor is fecPacketsSent implemented in outbound-rtp, so I do not have a good way to easily confirm the packets are being sent like I do in the other direction.

I did try to enable Wireshark for an alternate way to detect the packets, but I had installation issues, so I could not actually test this method.

Can anyone tell me how to get FEC data to be sent and also have to confirm it's being sent?

Lorenzo Miniero

unread,
Dec 18, 2021, 1:47:02 PM12/18/21
to discuss-webrtc
To my knowledge, libwebrtc will only send FEC if it's aware of packet loss via RTCP. Onc that happens, this will in turn make it configure the expected loss property in libopus, without which no FEC data is ever sent even if FEC is enabled. Not sure what the thresholds in libwebrtc are, though.

Tim Robbins

unread,
Jan 4, 2022, 1:08:21 PMJan 4
to discuss-webrtc
Hi,
I found the Chromium code which contains the logic of when to send FEC data.  Apparently there are a few factors, such as loss needing to be above 5% and the bitrate must be high enough. See here:  https://source.chromium.org/chromium/chromium/src/+/main:third_party/opus/src/src/opus_encoder.c;l=729;bpv=0;bpt=1 in decide_fec()

Anyways, I have tested with many combinations of config, using various levels of the sender bitrate and I have simulated packet loss at various levels as well.  Yet, audio quality never improves and there is of course no other way to confirm the code is functioning.  I think I would need to add logging into this chromium code and make a custom chrome build at this point

Philipp Hancke

unread,
Jan 4, 2022, 1:35:49 PMJan 4
to discuss...@googlegroups.com
Am Di., 4. Jan. 2022 um 19:08 Uhr schrieb Tim Robbins <timothyro...@gmail.com>:
Hi,
I found the Chromium code which contains the logic of when to send FEC data.  Apparently there are a few factors, such as loss needing to be above 5% and the bitrate must be high enough. See here:  https://source.chromium.org/chromium/chromium/src/+/main:third_party/opus/src/src/opus_encoder.c;l=729;bpv=0;bpt=1 in decide_fec()

Yeah. See also https://slack.engineering/calls-is-it-you-or-is-it-me/ -- a bit dated but still accurate.
 
Anyways, I have tested with many combinations of config, using various levels of the sender bitrate and I have simulated packet loss at various levels as well.  Yet, audio quality never improves and there is of course no other way to confirm the code is functioning.  I think I would need to add logging into this chromium code and make a custom chrome build at this point

On Saturday, December 18, 2021 at 1:47:02 PM UTC-5 Lorenzo Miniero wrote:
To my knowledge, libwebrtc will only send FEC if it's aware of packet loss via RTCP. Onc that happens, this will in turn make it configure the expected loss property in libopus, without which no FEC data is ever sent even if FEC is enabled. Not sure what the thresholds in libwebrtc are, though.

Il giorno martedì 14 dicembre 2021 alle 17:56:10 UTC+1 Tim Robbins ha scritto:
Hi,
We are using web-rtc audio with Asterisk as the server between the users. Opus is our codec, and I am testing to see how FEC is working in both directions.  I can easily see that Asterisk will send FEC data to Chrome, based on the fecPacketsReceived stat.  However, I am not able to confirm that the other direction works, namely that Chrome is sending FEC packets to Asterisk.  I have useinbandfec=1 set and have simulated packet loss, but I have not audibly detected any audio improvement which would indicate FEC packets are being sent and utilized. Furthermore, the fecPacketsReceived stat is not implemented in remote-inbound-rtp nor is fecPacketsSent implemented in outbound-rtp, so I do not have a good way to easily confirm the packets are being sent like I do in the other direction.

I did try to enable Wireshark for an alternate way to detect the packets, but I had installation issues, so I could not actually test this method.

Can anyone tell me how to get FEC data to be sent and also have to confirm it's being sent?

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ada15759-7afd-417f-81e9-ac08b59da07en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages