Skip to content
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

RTX support for v3 #2666

Merged
merged 6 commits into from Feb 5, 2024
Merged

RTX support for v3 #2666

merged 6 commits into from Feb 5, 2024

Conversation

cnderrauber
Copy link
Member

Description

Reference issue

Fixes #...

adriancable and others added 6 commits February 2, 2024 17:32
Fix data race of RTX packet
Always handle header extensions from packet read
from interceptor, let interceptor has consistent
chance to process headers

Fix rtx is not negotiated when there is multiple
codecs has same mime but different profile (H264)

Fix rtx stream info missed when SSRC group attr
shows after base track's ssrc attr.
Copy link
Contributor

@boks1971 boks1971 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@cnderrauber cnderrauber merged commit e2454d1 into v3 Feb 5, 2024
9 of 11 checks passed
@cnderrauber cnderrauber deleted the v3_rtx branch February 5, 2024 15:06
@adriancable
Copy link
Contributor

adriancable commented Feb 5, 2024

This looks great (and of course I am a fan of RTX support, having done the original implementation in v4 😃). But I am wondering, in general what is our approach regarding backporting stuff to v3 vs. focussing on v4?

My own view (not strongly held) is that we should get v4 out of beta so it becomes the 'de facto' base for new users, and basically freeze v3 except maybe for important bug fixes. I think this is what happened when we went from v2 to v3. But we should probably (as maintainers) decide the approach collectively because there is a time/effort cost in backporting things to v3.

@alexpokotilo
Copy link

@adriancable I need RTX support for Sender to add probing to improve for pion/interceptor#71 support. Am I right that RTX for sender is supported in Pion and your are adding RTX for receiving ?

@adriancable
Copy link
Contributor

@alexpokotilo - RTX receiving over a distinct SSRC is supported in v4 and, with this PR, is backported to v3. RTX sending over a distinct SSRC is currently not supported as far as I know. RTX sending/receiving over the same track/SSRC as the main media i.e. via the NACK mechanism has been supported for a while by Pion's NACK generator/sender interceptor.

@alexpokotilo
Copy link

alexpokotilo commented Feb 5, 2024

@adriancable NACK over the main works fine, you are right! The problem with not supporting RTX in Pion is that we cannot implement Bandwidth Estimation as we need to add bandwidth probing. Bandwidth probing from another hand cannot be added using main SSRC since sending the same RTP packet (with the same payload) would lead browsers(Chrome and Firefox) think we are doing Replay Attack. I tried to send some RTP packets twice changing TWCC header, but browsers reject my duplicates since payload is the same as SSRC and Sequence Number of RTP packet is the same.Thanks to @lminiero I was able to find why browsers reject these RTPs. So we need to send probing packets over distinct SSRC.
We will not be able to implement BWE for Pion without RTX sending over a distinct SSRC support as padding must be added before we can increase stream bitrate and there is no way to measure network other than send some probing packets over time.
But now we cannot do that.
What should I theoretically do to add RTX support for distinct SSRC ?
I really appreciate your help !

@adriancable
Copy link
Contributor

adriancable commented Feb 5, 2024

@alexpokotilo - for video streams with same-track RTX via NACK feedback, BWE probes are implemented as empty-payload (i.e. padding only) RTP packets. You do not need distinct-SSRC RTX for this.

Distinct-SSRC RTX has an advantage for BWE in that empty-payload probes are generally not needed because you can use repeat RTP packets as probes instead. But you do not need distinct-SSRC for BWE probes.

See: https://chromium.googlesource.com/external/webrtc/+/master/pc/g3doc/rtp.md

@alexpokotilo
Copy link

@adriancable thanks a million ! I will try. But as you said RTX is preferred as RTX packets act as redundancy.
I'll try padding in my case but would be cool we eventually have RTX for sending as well!

@cnderrauber
Copy link
Member Author

@adriancable Agree to focus on release v4 instead of backporting features to v3. We also have a plan to upgrade to v4 in our product. I add the RTX to v3 because it is important to us now, after evaluating the effort and risk between upgrading to v4 and supporting it in v3, I chose the latter. It also contains bug fixes merged to master first and cherry-pick to v3 so it is focusing on v4 too. Will re-evaluate v4 later and discuss with other developers about the plan to release v4.

@adriancable
Copy link
Contributor

@cnderrauber - that sounds very reasonable. We are running v4 in a volume commercial product (which uses RTX) with no issues so far, which is an encouraging indicator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants