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

[BUG] issues with simulcast layers #30

Closed
pnts-se opened this issue Sep 5, 2023 · 4 comments
Closed

[BUG] issues with simulcast layers #30

pnts-se opened this issue Sep 5, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@pnts-se
Copy link
Contributor

pnts-se commented Sep 5, 2023

Describe the bug
When developing locally, if I join on mobile (ios), and then join with another peer and start webcam, the serverside consumer emits layerschange event with layers set to null.

From Mediasoup documentation: "When there is no available bitrate for this consumer (even for the lowest layers) so the event fires with null as argument" https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-layerschange

Perhaps that's the case, but I'm, on high speed wifi so obviously eventually there will be bandwidth. No new layerschange event is emitted.

If I join with a third peer and start the webcam, a new layerschange event is emitted in the consumer and it start. The new consumer for the third peer also works without problems.

To Reproduce
Steps to reproduce the behavior:

  1. Join with mobile (ios)
  2. Join with another peer and start webcam
  3. Watch media-node logs for layerschange event
  4. See client-side VideoView doesn't work, it has a spinner.

Expected behavior
If there is no bandwidth, I would expect a new layerschange event to be emitted once there is.

@pnts-se pnts-se added the bug Something isn't working label Sep 5, 2023
@pnts-se
Copy link
Contributor Author

pnts-se commented Sep 5, 2023

I can trigger it to work from mobile (ios) client side by putting peer in fullscreen and holding the phone horizontally. That will trigger a new setConsumerPreferredLayers from room-server to media-node and it will start to work.

This is not only relevant for mobile. I can reproduce the issue on desktop if I have a small enough window when remote peer starts its webcam. See edumeet/edumeet-client#116

image

@pnts-se
Copy link
Contributor Author

pnts-se commented Sep 5, 2023

If I disable simulcast I can't reproduce the issue.

Mediasoup logs when the issue occur:

mediasoup:WARN:Channel [pid:114193] webrtc::ProbeController::Process() | kWaitingForProbingResult: timeout +891ms
  mediasoup:Channel [pid:114193] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:585945142, seq:21838] +25ms
  mediasoup:Channel [pid:114193] RTC::Producer::ReceiveRtpPacket() | key frame received [ssrc:3924621829, seq:18106] +0ms
  mediasoup:WARN:Channel [pid:114193] RTC::RtpStreamRecv::OnTimer() | RTP inactivity detected, resetting score to 0 [ssrc:2027180633] +491ms
  mediasoup:Channel [pid:114193] RTC::SimulcastConsumer::UpdateTargetLayers() | target layers changed [spatial:-1, temporal:-1, consumerId:2167bf04-37e6-4be7-b6b6-e4086e16ab22] +1s

Target layers being set to null can happen for a number of reasons.

@pnts-se
Copy link
Contributor Author

pnts-se commented Sep 6, 2023

Seems like a lot of changes related to preferred consumer layers seems to be the culprit.
It's very difficult to troubleshoot.
As of now I can only reproduce it on local development environment.

@pnts-se pnts-se changed the title [BUG] issues with layers for mobile consumer [BUG] issues with simulcast layers Sep 6, 2023
@pnts-se
Copy link
Contributor Author

pnts-se commented Sep 8, 2023

I'm absolutely not saying this is a bug in mediasoup, but we can learn from this issue:
versatica/mediasoup#990

@havfo havfo closed this as completed Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants