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

Limit max Redundant Audio Encoding packet size to 1000 bytes. #2763

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

dinmin-amzn
Copy link
Contributor

Issue #:

Description of changes:
In Chromium-based browsers, writing audio frames larger than 1000 bytes will cause an error to be thrown, so we limit the max Redundant Audio Encoding packet size to 1000 bytes. See https://crbug.com/1248479.

Testing:
Previously, starting a call with WebAudio, Redundant Audio Encoding, and fullband music stereo quality all enabled and introducing high uplink packet loss (>20%) would cause the Redundant Audio Encoding payloads to exceed the Chromium-imposed limit and audio sending would stop working for the rest of the meeting. This issue is fixed by this PR.

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

  1. Have two attendees join a meeting using Chrome with WebAudio, Redundant Audio Encoding, and fullband music stereo quality all enabled
  2. Enable audio sending and receiving for both clients
  3. Introduce >20% uplink packet loss
  4. Both attendees should still be able to receive and hear audio from the other attendee

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.

@dinmin-amzn dinmin-amzn requested a review from a team as a code owner September 26, 2023 01:32
@dinmin-amzn dinmin-amzn force-pushed the limit-red-size branch 3 times, most recently from 4ea3b51 to 4409c02 Compare September 26, 2023 02:05
@@ -236,12 +237,12 @@ export default class RedundantAudioEncoder {
frame: RTCEncodedAudioFrame,
controller: TransformStreamDefaultController
): void {
// const frameMetadata = frame.getMetadata();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a miss from previous PR? Does not seem related with the issue this PR tries to fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this was missed from the previous CR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dinmin-amzn Curious why a unit test did not catch this. Maybe we can add one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let me add a unit test for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the existing unit tests to better capture this case.

pracheth
pracheth previously approved these changes Sep 26, 2023
mklingb
mklingb previously approved these changes Sep 26, 2023
In Chromium-based browsers, writing audio frames larger than 1000 bytes will cause an error to be thrown, so we limit the max Redundant Audio Encoding packet size to 1000 bytes. See https://crbug.com/1248479.
});

it('forwards frames when the primary payload cannot be determined', () => {
const header = createRedHeader(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and made this test case more effective as well since it is similar in nature to the previous test case.

@dinmin-amzn dinmin-amzn merged commit a19b0b3 into main Sep 26, 2023
10 checks passed
@dinmin-amzn dinmin-amzn deleted the limit-red-size branch September 26, 2023 19:01
dinmin-amzn added a commit that referenced this pull request Sep 26, 2023
In Chromium-based browsers, writing audio frames larger than 1000 bytes will cause an error to be thrown, so we limit the max Redundant Audio Encoding packet size to 1000 bytes. See https://crbug.com/1248479.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants