-
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
Fix receiveForRtx usage for simulcast #2751
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2751 +/- ##
==========================================
+ Coverage 77.83% 79.91% +2.07%
==========================================
Files 87 76 -11
Lines 8202 7398 -804
==========================================
- Hits 6384 5912 -472
+ Misses 1345 1061 -284
+ Partials 473 425 -48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
That’s not good, thank you @aalekseevx Is it possible to get a failing test? If you can fix the lint would love to merge right now! |
Sure, will think of the failing test and fix the linter |
@aalekseevx If you don't have the time I am happy to fix this tonight! After work I have some time to do Pion stuff :) |
@Sean-Der, thank you! I'll fix it, just need some time |
I couldn't write a simple test to reproduce it because we need to send simulcast RTX, which is not yet supported as far as I understand. :( It seems that the root of the problem is that SSRCs are not parsed correctly for simulcast, and Logged RTPDecodingParameters for simulcast:
Blocked goroutine:
I think the best way to fix it is to make simulcast RTX work via the newly created readRTX. However, it may be worth returning to the old behavior for now to fix what's broken. |
09ce8b3
to
6f718a5
Compare
@Sean-Der, updated! |
@aalekseevx Revert sounds good to me! Want to use this PR for it? I will work with original author on relanding with tests |
Want to use this PR and just do revert commits? |
My commit is literally a revert, but only for simulcast. It fixes the issue for me. Do we need anything else? |
@aalekseevx Could we revert the commit in whole? I would do just a normal |
No problem |
6f718a5
to
8305427
Compare
@Sean-Der, do I need to open a separate PR to v3? |
This reverts commit 88d8eef.
Nope! I think cherry-pick is fine when this lands. I didn’t realize this would break public API! I need to be more careful with this @boks1971 @cnderrauber could I get your help on this? I don’t know the RTX code well enough to fix, so I was going to revert and re-land. I don’t think that’s a good idea because of API breakage. Do you think we could easily test/fix this issue or is it ambiguous? |
I remember there was a developer said they enabled rtx in prod and don't get problem, we enabled it for some users too. I will try to fix it before revert the feature if you have the steps to reproduce this issue. |
The problem reproduces with a simulcast input with rtx. Simulcast SSRCs are not present in SDP, so they do not fill |
@cnderrauber that sounds like a good plan! We need to update those value when we get a RTX with the repair-stream-id is all? |
I think the code to update rsid is already there and it works well in livekit sfu while it is using buffer instead of track.Read to read rtp packet. I'll test the normal read method. |
@cnderrauber any progress on testing? I added d9a59a5, I will add a test for Simulcast tomorrow |
Uses examples/simulcast, I have no problem to send all 3 simulcast layers back to the browser with rtx enabled. @aalekseevx which browser are you using, can you try it with the simulcast example in the repo? |
The original issue was encountered with chromium, I'll work on reproduction based on examples/simulcast |
@cnderrauber, I have reproduced the unwanted behaviour in my branch. It may be not 100% accurate, but I hope it will be helpful. I run it as follows:
|
Fix #2751, updates remote track's rtx ssrc for simulcast track doesn't contain rtx ssrc in sdp since readRTX relies on rtx ssrc to determine if it has a rtx stream.
Your test case is useful, although it needs small change to match the real case. The root cause is TrackRemote relies on HasRTX(rtxssrc!=0) to determine if it needs to read the rtx packet but it dosen't have that in the simulcast case because rtx ssrc is not included in sdp. The result is TrackRemote.Read/ReadRTP method can't get any rtx packet in this case but only get media packet so examples/simucalst can pass the test. |
Fix #2751, updates remote track's rtx ssrc for simulcast track doesn't contain rtx ssrc in sdp since readRTX relies on rtx ssrc to determine if it has a rtx stream.
Fix #2751, updates remote track's rtx ssrc for simulcast track doesn't contain rtx ssrc in sdp since readRTX relies on rtx ssrc to determine if it has a rtx stream.
Fix #2751, updates remote track's rtx ssrc for simulcast track doesn't contain rtx ssrc in sdp since readRTX relies on rtx ssrc to determine if it has a rtx stream.
Fix pion#2751, updates remote track's rtx ssrc for simulcast track doesn't contain rtx ssrc in sdp since readRTX relies on rtx ssrc to determine if it has a rtx stream.
Fix pion#2751, updates remote track's rtx ssrc for simulcast track doesn't contain rtx ssrc in sdp since readRTX relies on rtx ssrc to determine if it has a rtx stream.
Hello! We have encountered some issues with simulcast after latest upgrade. All layers, except for one, were shutting down very quickly after the connection was established. After some investigation, we found that this issue is related to this specific commit. This change does not seem to work correctly when receiveForRtx method is called to receive a new simulcast layer. Therefore, this PR is intended to restore the previous behavior in order to ensure that simulcast continues to function properly.