-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to handle NACK that uses distinct SSRC #1675
Comments
Yea this is an issue :/ when I am at my desk I will type up some ideas we can do to fix! Thanks for reporting @slavazhil |
Currently Pion doesn't support RTX with a distinct SSRC. When we interact with a remote
ImplementationAllow
|
In my understanding, the whole point of having a separate RTX track is to distinguish between original and resent packets. If there is no need to make the distinction, then there is no need for the overhead of a separate RTX track — resent packets can be sent over the main media track. In the words of RFC 4588 Section 3:
Note that retransmitting the packets in the main RTP stream is well supported by current browsers. Note further that it is not too difficult to compensate for the retransmissions and get accurate RTP statistics, although I don't think that browsers do that correctly (Galène does). |
The same mechanism is used for RED. Unilke RTX, which is nice to have but not difficult to work around, RED is what allows you to do FEC with audio, which is the secret sauce behind Zoom's audio quality over lossy WiFi. So while it might not be that critical to implement ancillary tracks for RTX, the work will be reused when somebody implements RED. |
Let me explain some more why a separate track is essential for FEC but not strictly required for retransmissions. Suppose you are doing retransmissions on the same track. You receive
You NACK P3, so you later receive
In order to maintain proper statistics, you need to determine that P3 is a reemission, which is not too difficult: P3 was NACKed and it arrived out of order, that's a pretty good indication that it was a retransmission. Having a separate RTX track makes this simpler and more reliable, but it's not essential. Suppose now you're doing FEC on a single track. The sender sends
and you receive
I don't see a way for the receiver to determine whether the missed packet was FEC or data. If the receiver is an SFU, for example, if the missed packet was FEC it must renumber P3 before sending it out, while it must not do so if the missed packet was data. In conclusion, support for ancillary tracks is required:
Sean, I'm therefore enthusiastic about you willing to do the work, just keep in mind that any work you do for RTX must be easy to extend to RED. |
@jech Do you find any advantage on using FEC with RED? On my statics gathered, when network gets congested packets gets dropped in big batches (5+ packets), also the complexity of RED since not all browser supports it makes the SFU to terminate it for some users. I think that for audio inband-fec offers good performance and you can set a fixed packet loss rate to control the % of FEC. |
I haven't done any experiments yet.
That happens if your bottleneck router does tail drop. Modern routers use AQM and should not drop packets in bursts. (Or at least a bunch of people much smarter than me are working very hard on getting modern AQMs widely deployed.) However, the main problem I'm trying to solve is people lecturing behind a poor quality WiFi connection. This happens a lot in my world, since a lot of lecturers have small children, and they need to move to an isolated room in order to give their lectures.
Exactly. Opus FEC is great for end-to-end FEC, while ulpfec is the right thing if you want to terminate FEC at the server. There's no point to negotiate out-of-band FEC if you're not going to reconstruct it at the server, Opus FEC is fine in that case. Terminating FEC at the server has a number of advantages. Since the signal is reconstructed at the server, it reduces the amount of loss in the case where loss occurs on both legs of the flow. It allows you to use different amounts of FEC for different clients, which reduces both overhead and latency. And, finally, it allows you to use higher FEC rates than what the browsers do, which means that audio can survive on extremely lossy links. (Opus FEC is limited to 100% FEC. Given that an Opus flow is on the order of 30kbps, it is quite reasonable to use 200% FEC, i.e. to multiply the amount of traffic by 3. With suitable interleaving, this should allow acceptable audio quality on even the worst links.) |
wait, I need to clarify
|
I believe that's correct. |
Hi all, I also don't understand why video/ulpfec declared in |
If the MediaEngine contains support for them a SSRC will be generated appropriately Co-authored-by: aggresss <[email protected]> Co-authored-by: Kevin Wang <[email protected]> Resolves #1989 Resolves #1675
If the MediaEngine contains support for them a SSRC will be generated appropriately Co-authored-by: aggresss <[email protected]> Co-authored-by: Kevin Wang <[email protected]> Resolves #1989 Resolves #1675
Your environment.
What did you do?
A PeerConnection created with
NewPeerConnection
(not api) logs an errorpc ERROR: 2021/02/13 07:35:09 Incoming unhandled RTP ssrc(3537335204), OnTrack will not be fired. mid RTP Extensions required for Simulcast
after the browser sends first retransmitted packet. Looks like pion/webrtc confuses the retransmitted packet for another stream/track.After recreating the code from
NewPeerConnection
manually, but registering only some codecs showed that adding the codec below triggers the error.The rest of the code:
What did you expect?
Expected to receive retransmitted packets from the browser
What happened?
Adding the codec above triggers the error and prevents any retransmitted packet from being received.
The text was updated successfully, but these errors were encountered: