-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Missing marker bit when switching from generated ringback to actual media #2361
Comments
All of this is 100% just a matter of a missing marker bit when A's ringback stream is switched for the actual media stream from B - it's super apparent when adding The call starts bridging, and generated ringback immediately starts being sent to A with a timestamp starting from 0. In summary, a marker bit must be inserted when switching streams. Otherwise the receiver has no idea what just happened. |
Further investigations indicate that Chrome (version 120) does not flush the jitter buffer and reset the stream upon receiving a marker bit, and thus a change of SSRC seems to be necessary. The associated comment to In the same condition as mentioned above, there's also a check for the flag Anyhow, I made the necessary changes to run some tests and it all worked exactly as I had hoped it would - changing the SSRC fixes the issue caused by the apparent jump backwards in timestamps. I will get a PR up for this shortly. For posterity; the gap in packets mentioned at the start of this issue becomes a non-issue by changing the SSRC. |
…allow SSRC change when using SRTP Fixes signalwire#2361, where a jump backwards in RTP timestamps caused silence at the start of calls when switching from generated ringback to remote media.
Can you apply the below patch to the latest master and show me
|
@jakubkarolczyk Sorry for the delay, but here we go! I got one such log, at the moment when ringback starts being generated for the caller: |
Thanks @olofssonanton . Interesting, in my tests I always hit it second time when the actual audio starts after the ringback (so first packet after the gap you described). So I don't see the marker bit problem, what you reported. |
Interesting indeed! Can you share some lines of debug log context around your second hit @jakubkarolczyk? |
Do you have |
@jakubkarolczyk |
The biggest issue I see with this is that the timestamp is going to a lower value (inherited from the other leg) but the SSRC doesn't change. RFC 3550 says that the timestamp MUST be monotonically increasing. Genesys PBXs drop those because they think the packets are too long ago to be relevant, although most applications don't seem so strict. We can't rely on the marker bit here because RTP is sent over UDP and we can't guarantee that a single packet will reach the end. Change the SSRC, which even feels correct because the source of the media has indeed changed. |
Describe the bug
When using
ringback
andignore_early_media
, there is a brief gap in packets sent to the A-part after receiving200 OK
from B. In order to prevent this gap from causing an unnecessary slow-down in playback for A (due to jitter buffer), there should be a marker bit inserted when the media sent to A switches from generated ringback to actual media from B.See below image for a screenshot with comments from that exact moment in a pcap.
To Reproduce
Steps to reproduce the behavior:
ringback=%(1000,4000,425.0)
andignore_early_media=true
packetsReceived/s
in chrome://webrtc-internals under "Stats graphs for inbound-rtp".Expected behavior
Either no gap in packets being sent, or a market bit in the first packet which is sent after the gap.
Package version or git hash
Trace logs
pcap file of the related media streams has been sent to Brian West.
The text was updated successfully, but these errors were encountered: