aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
699 stars 471 forks source link

Do no enqueue any audio payloads larger than 1000 bytes #2791

Closed dinmin-amzn closed 8 months ago

dinmin-amzn commented 8 months ago

Issue #: n/a

Description of changes: In Chromium-based browsers, writing audio payloads larger than 1000 bytes using the WebRTC Insertable Streams API (which is used to enable dynamic audio redundancy) will cause an error to be thrown and cause audio flow to permanently stop. See https://crbug.com/1248479.

Testing:

Can these tested using a demo application? Please provide reproducible step-by-step instructions.

  1. Have attendee A join with the Set fullband music (stereo) quality selected (this will cause the audio frames to be especially large due to the higher quality)
  2. Have attendee B join normally
  3. Start content share from attendee A, select a tab that actually has audio, and enable the Also share tab audio option
  4. Use Network Link Conditioner to simulate >20% downlink packet loss (this will cause the downlink packets to contain up to 2 extra RED packets and have up to 3x the audio payload size)
  5. Attendee B should NOT see the Uncaught (in promise) DOMException: Failed to execute 'write' on 'UnderlyingSinkBase': Frame too large error and Attendee B should receive audio normally

Checklist:

  1. Have you successfully run npm run build:release locally? y

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved? n

  3. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved? n

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.