-
Notifications
You must be signed in to change notification settings - Fork 146
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
Allow adjustment to buffer / audio delay in web client #293
Comments
I'm sorry, but there's nothing to adjust here. The application already tries to keep the audio buffer down to a minimum, and only buffers if the audio data is not arriving in time. By unplugging the network cable you have created an artificial network latency that filled up the buffer to its maximum, so that is not really a usable measurement. Other applications do not need to deal with the sample rates that an SDR delivers and are therefor able to achieve better latencies. A lack of CPU power on the receiver end increases the chance of audio data arriving late, thus increasing the necessary buffer size. If you do have any reasonable input about other technologies and how they would improve the latency, please feel free to comment on the existing issues: See #274 and #220. |
Bear in mind that I'm trying to infer how the OpenWebRX architecture works. I don't know if the buffering we are discussing is something you specify, or something completely hidden/controlled by the tcp stack/browser.
OK, so I did some experiments. Laptops on wifi seem to have a longer buffer. Cabled connections have a shorter (eg 1 sec) buffer, but after I have unplugged them it expands to almost 5 secs. The buffer size appears to expand and not shrink down again. i.e. it was 1 sec before I unplugged the cable. Now several minutes later it is 4 secs. Again in the wifi or mobile situation, a brief weak spot or cell transition will cause unacceptable delay afterwards, even though the network is now stable and doesn't need the excess buffer. If I am having a conversation, some amount of dropout is less of a problem than latency (HF ssb is already full of lightning, fades etc). The buffer size appears to expand and not shrink down again. i.e. it was 1 sec before I unplugged the cable. Now several minutes later it is 4 secs. Again in the wifi or mobile situation, a brief weak spot or cell transition will cause unacceptable delay afterwards, even though the network is now stable and doesn't need the excess buffer. It also plays for 2 seconds after I press the mute button. So it might also be desirable to do a buffer dump on audio affecting UI changes so that changes are effective immediately and the UI seems responsive. |
Stackoverflow suggests that WebRTC may be the correct solution for the audio transport. |
Thinking more about the TCP vs UDP: So perhaps what is happening is this: When the network is broken TCP waits for it's maximum delay and increases it's buffer. Lets call that max 4 secs. I'm not seeing why the 4 sec block gets established - perhaps it requests 4 secs of retransmissions when the connection restores. Perhaps the player needs to do a dump after breaks? |
It is very unpleasant/difficult to use remote rx with a local transmitter due to the 2 second audio delay. Having used a direct analog remote the usability is hugely improved with zero lag.
Long buffering might be useful for people who are only listening, but it needs to be reduced as much as possible when you are also transmitting, and moreso when you are using both a local rx and the remote rx at the same time.
Making it adjustable would let people set a tolerable level of stuttering - HF SSB is not exactly high quality anyway.
Doing simple tests: Unplugging the network or clicking the mute button, seems to show that there is ~2secs audio delay between the web client and speaker.
Some other web clients e.g. skype don't have this huge buffer delay, whilst some e.g. mp3 players seem to.
Perhaps rather than buffering being set, there are different sound api's for buffered music type sound vs real-time type telephony. In that case it would be good to have a switch that can select realtime sound
Target audience
Hams - transmitting locally, rx from remote and local.
The text was updated successfully, but these errors were encountered: