Simulcast during CPU overload

Hi,

Not sure if this is a browser related bug or something to do with Janus.

Scenario:
Two or more publisher joins the video rooms with simulcast enabled (3 layers). When the system (laptop) they are on experiences excess load. QualityLimitationReason switches from None to CPU and the browser soon stops sending the lowest substream S0. This causes an issue if the subscriber is already on S0 as janus will not switch to a higher substream automatically if the current one is stopped/disabled.

Shouldn’t the higher substreams (S2, S1) be stopped for these situations instead of S0?

This is happening on our server with 0.x branch (latest release). But i’m also able to replicate this reliably on the Janus demo by following the below steps. This has been tested on Chrome 114 on a Mac.

  1. Join the demo Janus WebRTC Server (multistream): Video Room Demo on two tabs/machines
  2. Switch substream to SL 0 for the subscribers on both machines
  3. Set Bandwidth to “no limit” on both machines
  4. Do something that will cause your systems CPU to spike (Open lots of tabs/applications). It helps if you have a crappy machine :sweat_smile:
  5. You can notice in webrtc internals that the peer has changed its QualityLimitationReason to CPU. After ~30 seconds, the message will show up in the console that janus has stopped receiving our video. You can see that the video freezes and the video muted event is triggered.
  6. Sometimes the video gets back automatically, otherwise you can manually click on SL1, SL2 to switch to the higher substream and the video starts playing again.

Thanks.

It’s the browsers that decide which substreams to send, not Janus, so you should check what’s wrong on that side. Janus assumes S0 is always available and that’s why it considers it a safe fallback.

You can try reversing the simulcast envelope order and then pass a lmh property to Janus to make it aware the expected order is reversed (context here).

Thanks for the suggestions.

Tried with both S2->S1->S0 and S0->S1->S0 and by passing the rid order to janus. The browser only drops S0 in both cases when there is QualityLimitationReason changes to CPU.

Since its the browser thats dropping the substream and not janus, will post in discuss-webrtc instead.

Thanks for your help.