F4HTB / Universal_HamRadio_Remote_HTML5

Universal HamRadio Remote HTML5 interface
GNU General Public License v3.0
151 stars 36 forks source link

Audio Lag Problem #16

Closed dslotter closed 4 years ago

dslotter commented 4 years ago

Kevin Loughin reports on his YouTube channel https://youtu.be/JC9N0PMu_Kc?t=603 that UHRR web interface works pretty well on a laptop, but with a tablet or smartphone, when you click the transmit button, talk, and release transmit, there'll be a small pause, and perhaps a small buzz, and then the audio will lag behind the radio by that amount of time. This was much more pronounced with the smartphone -- approximately 4-7 seconds behind.

I confirmed this behavior on my Android smartphone -- a Pixel 3a XL running Android version 11

Because of this audio delay, real-time communication is not possible on the smartphone.

From Kevin Loughin's writing:

Universal Ham Radio Remote actually works well.

I spent my windy day here messing around with it. On the Pi Zero it nearly works perfectly except for one issue.

Once you start it up, it works as expected. You can control your radio and it's audio comes through quite clearly with just a fraction of a second delay. If you press TX in the browser, the radio goes into transmit and your voice audio from the computer is modulated as power going out in near perfect real time.

But! Once you unkey, there's a 4-7 second pause before the receive audio starts streaming through the browser again. And it doesn't correct, so the audio is 4-7 seconds behind at that point. If you TX again, the delay may be slightly different, but still in the 4-7 second range.

I observed a CPU level hovering around only 34% on the pi while audio is streaming. It stays there during TX also, varying only for brief jumps, but mostly around 1/3rd of the cpu capacity.

When you unkey back to RX, the CPU spikes at 100% for those 4-7 seconds, dropping back down to around 34% again once the stream finally starts.

F4HTB commented 4 years ago

Hello Dear Dave,

For be sure to correctly understand, this bug only appears on a Pizero or you noticed this on a pi4? This indication will help me reproduce the problem.

Thanks in advance

dslotter commented 4 years ago

I've seen this on a Pi 4. And Kevin Loughin saw this on a Pi Zero. I don't think the choice of Pi matters much except perhaps degree.

The main variable here is using the web interface on a tablet or smartphone.

Does this help explain?

On Sat, Nov 7, 2020, 2:11 PM Olivier SCHMITT notifications@github.com wrote:

Hello Dear Dave,

For be sure to correctly understand, this bug only appears on a Pizero or you noticed this on a pi4? This indication will help me reproduce the problem.

Thanks in advance

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/F4HTB/Universal_HamRadio_Remote_HTML5/issues/16#issuecomment-723483112, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUOGDZRVUFJMR7IOLEN6HLSOWLWPANCNFSM4TNY4JVQ .

F4HTB commented 4 years ago

I will try to reproduce this and see. I'll give you info as soon as possible.

dslotter commented 4 years ago

Please take your time, kind sir. And did you watch the YouTube video link? It is a short video...

On Sat, Nov 7, 2020, 2:26 PM Olivier SCHMITT notifications@github.com wrote:

I will try to reproduce this and see. I'll give you info as soon as possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/F4HTB/Universal_HamRadio_Remote_HTML5/issues/16#issuecomment-723484562, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUOGD2MCAUTBLWBJUEVGXLSOWNNPANCNFSM4TNY4JVQ .

F4HTB commented 4 years ago

Yes! thanks to him. I confess to you that I couldn't think that this little project could have so much interest. :)

dslotter commented 4 years ago

That's what I thought about HamPi. I thought maybe 10 people would download a Ham Radio software image for a Raspberry Pi... Then... 25,000 downloads later...

My GitHub project: https://github.com/dslotter/HamPi

I plan to add this project to HamPi as well... That's how important your software has become!

F4HTB commented 4 years ago

Hi, I have try on multiples devices. Problem sometime appear and sometime not. I continue to search and have a big modification to past audio handler on wome javascript workers. So i close in the interval. :)