-
Notifications
You must be signed in to change notification settings - Fork 5
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
Figure out why the grey frame after joining the call is shown for so long #131
Comments
@SimonBrandner, @robintown do you by chance know which state the grey frame corresponds to? (in EC) AFAIK, we never display grey frames in the full-mesh mode, I would like to know when we do this in the SFU mode. Is it when the track negotiation has finished, but no RTPs arrived yet? According to webrtcforthecurious, the But according to the MDN, it's a bit different. My current hypothesis is that the EC does get the RTPs, that's why the callback is called and we display the tile, but since the first packet is not necessarily a keyframe (see #100), nothing is said until the key frame arrives. In this case, this bug seems to be an extension (or maybe even a duplicate) of #100, but I would need a bit more input to get a broader perspective and to understand if it's worth addressing #100 first. |
UPD. After running it with OpenTelemetry and also trying to match it with the logs, there are several interesting findings I've done. Essentially, the grey frame is shown when there are no RTP packets received on a track. If we don't receive any RTP packets at the beginning of the call (i.e. us joining the call and trying to display other participants' videos or a new participant joining the call), then that's where we see a grey frame. If the frames were received on a certain simulcast layer but stopped being sent by the client after a certain time, it will be observed as a frozen frame. Essentially it happens because although we do get informed about new tracks/transceivers, we don't know upfront when and how often the peer's browser will send RTP packets on a certain simulcast layer. The browser adjusts this behavior based on many factors and we can't assume that we always get it. The solution is to track the state of each publisher and automatically switch between layers by the SFU. This would solve the issues caused by long grey frames for the participants and frozen participants' videos. It's important to note that short-term grey frames (1-2 seconds) that happen right after joining the call happen for a different reason. I've noticed that each time we join, there are a couple of logs that we always get on the SFU side:
Basically, each time the subscription gets added, we add a track to the peer connection, this causes a renegotiation process to start. Until the renegotiation completes, the grey frame is seen in the Element Call. We could probably work around it by not displaying a grey frame, but instead displaying a more useful status. As for preventing the renegotiation, the only thing we could do is to allocate a set of transceivers upfront that would allow us to skip the renegotiation stage. |
Interesting note, not sure that it's related, but it happened every time where the browser on the sender's side did not send RTPs on a certain layer, we've observed the following errors printed by Pion in the stdout/stderr:
|
So that we can detect when the publisher is stalled. Relates to #131.
So that when the layer on a published track stalled, we can change subscriptions to expect receiving packets from a different track layer (different simulcast layer) within the same published track. Solves #131.
It takes on average 2 seconds to disappear, but sometimes it takes a bit more. We have to check if it's some sort of a bug in the SFU or something different.
The text was updated successfully, but these errors were encountered: