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

Audio garbled when buffer size is reduced in Chrome #184

Open
IanPhilips opened this issue Dec 2, 2020 · 6 comments
Open

Audio garbled when buffer size is reduced in Chrome #184

IanPhilips opened this issue Dec 2, 2020 · 6 comments

Comments

@IanPhilips
Copy link

Hey there,

I tested this out in firefox to get a higher audio quality and it was working fine but having just tried this in Chrome I noticed that the audio is very garbled at any buffer size smaller than 2048. Any ideas on why this might be?

Tested on videomail-client 2.14.5 and 2.14.2 and Chrome v87.0.4280.88

If you visit www.virtualbycfb.com and hit get my assessment, agree & begin, and "company" you'll see the video prompt to try it out. That's at a buffer size of 512 and you can hear the difference in audio quality between Chrome and Firefox.

cheers!

@binarykitchen
Copy link
Owner

Hey thanks for the great feedback. So are you saying, audio is good on FF but worse on Chrome?

And what buffer size works best on Chrome?

(If you haven't noticed yet, I am Deaf myself and unable to test on your site. Isn't that crazy eh? A Deaf person coding that far with audio stuff, grins. In the past I've asked few hearing friends of mine to test for me but can't always rely on them ...)

@IanPhilips
Copy link
Author

Hahaha wow! I thought that might be the case but honestly that is really amazing you coded that up without being able to hear it!! If you need my help in gauging audio quality, don't hesitate to ask.

Yes, in FF smaller buffer sizes (512, 1024) work but in Chrome only a buffer size of 2048 works.

@binarykitchen
Copy link
Owner

thx mate, yeah crazy eh?

good, i've just npm published v2.15 with that fix. now the bufferSize option also supports auto which will include browser detection. have a look here 3ff27c1#diff-5d0ae54b5f2645490f8b4c4c8ac28571478316c8f4f1775d313549987bea6cffR24268

can you test and confirm it's better now? can do some fine tuning and include other browsers if you are keen?

@IanPhilips
Copy link
Author

Hey, sorry for the very delayed follow up, the holidays have been very busy for me.

This works great on Firefox, fair on Safari (a few audio artifacts), and rather poorly on Chrome (lots of audio artifacts) - worse than the audio on 2.14.5 sounds on Chrome actually. Want me to try it on any other browsers?

@binarykitchen
Copy link
Owner

@IanPhilips thanks for testing.

This is weird, actually no change was made for Chrome but you say it got worse?

If you look at the commit here
3ff27c1#diff-5d0ae54b5f2645490f8b4c4c8ac28571478316c8f4f1775d313549987bea6cffR24266

you will see that the audio buffer size for Chrome hasn't changed. Whether it's auto or the default on 2.14.5, it's the same number for both: 2048.

    if (bufferSize === 'auto') {
      if (browser.isFirefox()) {
        bufferSize = 512;
      } else {
        bufferSize = 2048;
      }
    }

It's difficult for me to test and fine tune when I cannot hear. If you still experience differences for Chrome from both versions then this might be something else, e.g. bandwidth issues, a newer Chrome version or anything else random I don't know. We need solid facts here to investigate and fix this properly.

One thing you could help me here is to find the perfect bufferSize for Chrome. Grab the latest version, change the number until it's good. Then try again with a different bandwidth (in Chrome Dev Tool you can switch to 3G speed for example). Then test again if that number still produces the same audio quality or not.

Thanks. Very curious here what you can tell.

@IanPhilips
Copy link
Author

OK using source from: https://cdn.rawgit.com/binarykitchen/videomail-client/2.15.0/prototype/js/videomail-client.min.js

Results on Chrome v88.0.4324.96:
Poor Audio quality on any buffer size except 2048 regardless of network throttling - (tried 256, 512,1024, 2048 at online, 4G, and 3G)

Results on Firefox v85.0:
Best audio quality at buffer size 512 with online, 4G, and 3G.
The audio quality decreases on Firefox as the buffer size is increased or is set to 256. It looks like 512 is the best spot for Firefox.

Results on Safari Version 14.0 (15610.1.28.1.9, 15610):
No buffer size works on Safari, the audio is always missing.

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

No branches or pull requests

2 participants