amazon-chime-sdk-js icon indicating copy to clipboard operation
amazon-chime-sdk-js copied to clipboard

Simultcast - `remoteVideoSourcesDidChange` called with incorrect number of videoSources

Open kelvin2200 opened this issue 3 years ago • 10 comments

What happened and what did you expect to happen?

3rd attempt to enable simulcast in our app.

remoteVideoSourcesDidChange is called with an incorrect number of videoSources

Have you reviewed our existing documentation?

Reproduction steps

We haven't tested to see if this can be reproduced in a simple setup, so it may apply only to our app.

Using:

  • DefaultSimulcastUplinkPolicy.
  • config.serverSideNetworkAdaption = ServerSideNetworkAdaption.BandwidthProbing

Layout (devices are of no relevance, except for the number of attendees):

  • Device A (local)
  • Device B (remote)
  • Device C (remote)
  • all devices have their cameras ON

When Device C hits refresh :

  • A will see B as having turned off its camera (also its stream disappears), though B has not taken any action.
  • remoteVideoSourcesDidChange is triggered twice; once with the remaining remote video source (B) and the second time with an empty array.
  • weirdly enough, we can't reproduce in less or more than 3 attendees
  • cannot reproduce when not using simulcast

Amazon Chime SDK for JavaScript version

3.6.0

What browsers are you seeing the problem on?

any

Browser version

any

Meeting and Attendee ID Information.

No response

Browser console logs

no logs needed

kelvin2200 avatar Jul 21 '22 15:07 kelvin2200

Hi @kelvin2200 we will try to reproduce. Is this reproducible without config.serverSideNetworkAdaption = ServerSideNetworkAdaption.BandwidthProbing ? Also console logs would be nice if we are not able to reproduce.

hensmi-amazon avatar Jul 21 '22 19:07 hensmi-amazon

I was able to reproduce this issue using JS SDK browser demo.

Steps:

  1. Three attendees (1, 2, 3) join the meeting enabling simulcast, priorityBasedDownlinkPolicy with BandwidthProbing.
  2. All of three enable camera.
  3. Refresh page in the window of attendee 3.
  4. From attendee 1's window, attendee 3's video tile disappears, and attendee 2's video tile disappears shortly and appears.
  5. From attendee 2's window, attendee 3's video tile disappears, and attendee 1's video tile disappears shortly and appears.

step 4 and 5 happens at the same time.

I observed three remoteVideoSourcesDidChange events from either attendee 1 or attendee 2's perspective:

  1. videoSources contains the remaining remote attendee. (expected result)
  2. videoSources is empty.
  3. videoSources contains the remaining remote attendee. (expected result)

xuesichao avatar Jul 21 '22 22:07 xuesichao

Hi @kelvin2200 we will try to reproduce. Is this reproducible without config.serverSideNetworkAdaption = ServerSideNetworkAdaption.BandwidthProbing ? Also console logs would be nice if we are not able to reproduce.

The main reason why we gave simulcast another try IS ServerSideNetworkAdaption.BandwidthProbing because without it, we're left with a whole different batch of Safari issues (tiles being paused randomly etc...). We loved the idea of server-sided metrics, and it seems to work nicely with the exception of the scenario above.

P.S. I don't know if it's related to the same issue, or perhaps I should open another one, but a more reliable scenario to reproduce the same (or at least very similar) issue, is with a random number of attendees, and one of them starts and stops sharing his screen while having the camera ON. At some point, one of the remaining video streams gets turned off for everybody.

kelvin2200 avatar Jul 22 '22 07:07 kelvin2200

Any update on this issue? I see 3.7.0 has been released. Has this been addressed in any way?

kelvin2200 avatar Sep 07 '22 08:09 kelvin2200

@hensmi-amazon @xuesichao ?

kelvin2200 avatar Sep 07 '22 08:09 kelvin2200

Hi @kelvin2200 , sorry for the late reply. 3.7.0 doesn't include a fix for this. Let me debug this further to figure out the root cause and come back to you later. thanks for your patience.

xuesichao avatar Sep 07 '22 20:09 xuesichao

I reproduced the issue without using BandwidthProbing, and observed exact same results as previous test.

I used the same repro steps list below.

Steps:

  1. Three attendees (1, 2, 3) join the meeting enabling simulcast, priorityBasedDownlinkPolicy with BandwidthProbing.
  2. All of three enable camera.
  3. Refresh page in the window of attendee 3.
  4. From attendee 1's window, attendee 3's video tile disappears, and attendee 2's video tile disappears shortly and appears.
  5. From attendee 2's window, attendee 3's video tile disappears, and attendee 1's video tile disappears shortly and appears.

step 4 and 5 happens at the same time.

I observed three remoteVideoSourcesDidChange events from either attendee 1 or attendee 2's perspective:

  1. videoSources contains the remaining remote attendee. (expected result)
  2. videoSources is empty.
  3. videoSources contains the remaining remote attendee. (expected result)

The only difference is step1. Three attendees (1, 2, 3) join the meeting enabling simulcast, priorityBasedDownlinkPolicy with Server Side Network Adaption set to None instead of using BandwidthProbing.

image

Got the same results: image

It seems it's not a BandwidthProbing issue. @hensmi-amazon

xuesichao avatar Sep 15 '22 23:09 xuesichao

Sorry for the delay it seems this slipped out of my radar. I have reproduced the issues with simulcast and have pushed some fixes to both client and backend. The client changes should be in the next release and the backend changes should also hopefully be deployed by then as well.

hensmi-amazon avatar Sep 22 '22 19:09 hensmi-amazon

Thanks a lot for this fix! Is there an ETA on when this will be released?

Fnopster avatar Oct 11 '22 20:10 Fnopster

The fix has been released in the latest 3.9.0 version on Sep 21.

bjason avatar Oct 15 '22 02:10 bjason

The fix has been released in the latest 3.9.0 version on Sep 21.

This version is already in the changelog, but it is not yet available npmjs, do you have any predictions for when it will be available there?

carlossantos74 avatar Oct 17 '22 10:10 carlossantos74

@bjason, any estimate on when version 3.9.0 will be released?

Fnopster avatar Oct 20 '22 18:10 Fnopster

Unfortunately we try to avoid giving specific dates for release but we should have one soon. Also for the backend changes which had the bulk of fixes, those have been deployed so you should be able to see improvement even with previous JS SDK version, the JS SDK change just has a fix for some video freezes but you shouldn't see the incorrect remoteVideoSourcesDidChange callback anymore. Please let us know if you see differently.

hensmi-amazon avatar Oct 24 '22 18:10 hensmi-amazon

3.9 has been released, please reopen or open a new issue if you continue to see issues.

hensmi-amazon avatar Nov 09 '22 16:11 hensmi-amazon