# Simulcast dropping to spatialLayer 0 after recreating producer

**URL:** <https://mediasoup.discourse.group/t/simulcast-dropping-to-spatiallayer-0-after-recreating-producer/2358>\
**Category:** mediasoup libraries\
**Created:** [January 29, 2021, 5:23pm UTC](https://mediasoup.discourse.group/t/simulcast-dropping-to-spatiallayer-0-after-recreating-producer/2358 "2021-01-29T17:23:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![keianhzo](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/keianhzo/32/797_2.png) [@keianhzo](https://mediasoup.discourse.group/u/keianhzo)\
**Post date:** [January 29, 2021, 5:23pm UTC](https://mediasoup.discourse.group/t/simulcast-dropping-to-spatiallayer-0-after-recreating-producer/2358/1 "2021-01-29T17:23:02Z")

</div>

I’m trying to wrap my heard around this. I’ve seen this behavior both in our app and in the mediasoup demo app but only using FF. The config uses 3 spatial layers for the webcam producer. This are just the default demo settings.

**STRs**  
Open two FF (v84) session in different computers, same network:

1. Share the webcam

> On the consumer side the currently used layers are S[2] T[2]
> 
> In the producer remote stats I see 3 RTP video streams (rIds: 0,1,2) with 3 layers each. All the ll the bitrates for the layers are set.
> 
> In the receiver remote stats I see a video RTP stream for the highest layer with rId 2 and 3 temporal layers.

1. Stop sharing the camera
2. Share the camera again, repeat this process

> After repeating this a couple of times the higher RTP streams for the producer end that with 0 bitrate temporal layers and eventually are not created so the producer eventually just sends one RTP stream for the lowest spatial layer

**Notes:**

- The downlink BWE estimation stays the same throughout the whole test
- I have tried to force **setMaxSendingSpatialLayer** to **2** every time I create the webcam producer but it doesn’t seem to have any effect.
- I have also tried to **setConsumerPreferredLayers** to **2,2** after the consumer is created but also doesn’t seem to have any effect.
- I have checked that every time the producer is created the right encodings are used

Maybe Mediasoup is creating only a spatial layer 0 stream because it thinks the client doesn’t have enough bandwidth or maybe because _“the browser may stop sending spatial layer 1 due to CPU load, etc”_ as I read [here](https://mediasoup.discourse.group/t/simulcast-consumer-is-selecting-invalid-temporal-layer/82/2)?

It’s not happening with Chrome (although it just creates 1 spatial and 2 temporal layers but that is probably Chrome’s implementation limitations) so might be some sort of FF bug but I jut wanted to make sure that this is not me doing some obvious thing wrong or missing some parameter somewhere and I’m not the only one seeing this behavior.

Thanks!

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [January 29, 2021, 5:29pm UTC](https://mediasoup.discourse.group/t/simulcast-dropping-to-spatiallayer-0-after-recreating-producer/2358/2 "2021-01-29T17:29:52Z")

</div>

> [@keianhzo](#):
>
> Maybe Mediasoup is creating only a spatial layer 0 stream because it thinks the client doesn’t have enough bandwidth or maybe because _“the browser may stop sending spatial layer 1 due to CPU load, etc”_ as I read [here](https://mediasoup.discourse.group/t/simulcast-consumer-is-selecting-invalid-temporal-layer/82/2)?

If the browser just send one or two spatial layers (RTP streams when simulcast) then mediasoup can uso magic so it just seems a single stream.

Yes, browser’s decision based on CPU usage, etc. It can also happen in Chrome, sure.
