opentok / opentok-network-test

Sample app to test network connectivity and statistics (bps, packet-lost)
MIT License
112 stars 56 forks source link

Low bandwidth check is wrong for web #30

Open ulifigueroa opened 7 years ago

ulifigueroa commented 7 years ago

I discovered that the bandwidth check for audio is wrongly implemented, because the amount of bits transferred depends on the volume level of the system.

We noticed that many of our clients were having bandwidth errors even when they had a good internet connection, and after testing we discovered that it was caused because they had a low volume level or the audio input was low during the test.

You should consider this on your test example.

davemun commented 7 years ago

@ulifigueroa I need a little bit of help with this one because I can't seem to reproduce the issue. From my testing across different setups, silence should still be 40kbps.

Could you get back to me with the browser version you are reproducibly seeing this on, and if possible, the hardware model of the microphone you are using?

ulifigueroa commented 7 years ago

Sure thing, I'm using Chrome 59 on a Mac Book Pro Mid 2015 and I'm using the computer default microphone, but we've seen this issue happening as well on FF.

davemun commented 7 years ago

That's interesting, I'm pretty sure I have the exact same setup. Let me get back to you in a bit.

ulifigueroa commented 7 years ago

The problem isn't that the silence doesn't produce any data, it is that the amount of data transmitted for the audio stream varies depending on the microphone audio input, which makes the tets not be accurate.

davemun commented 7 years ago

I was actually also referring to the network data transmitted. I did some more poking around and figured out what I think the disconnect is:

I can actually noticeably see the audio bitrate rampup to a new threshold at a steady 40kbps, when there is video ramping up to HD. This is probably why I couldn't see this in testing - I only tested silence on audio+video.

If it's an audio-only stream, silence can come in at around 25kbps, while loud sound (I pressed my phone's speaker playing audio to the MBP mic) can come in at 35-40kbps. 25kbps is barely at the minimum threshold outlined for audio-only.

I'll have to do some more digging around regarding the rampups and bitrate budget between silence and sound.