Audio glitches: why do they occur?

User avatar
Posts: 1301
Joined: Fri Mar 10, 2017 1:47 pm

Audio glitches: why do they occur?

Postby w-u-2-o » Tue Nov 27, 2018 2:04 am

Audio glitches seem to be a fact of life with our radios. They can and do occur with both transmit and receive audio, although the receive glitches seem to be much more apparent. There are three sources of audio glitches:

1) Dropped UDP packets from the hardware to the PC. These will be counted by the OOOPS counter in the VAC1 setup tab. You will almost certainly see a non-zero count on the OOOPS counter because UDP is not a lossless protocol like IP (and why the designers of the firmware did not use IP I could not tell you). However, if you are seeing a lot of OOOPS counts then there is a networking problem of some sort. Check all of the obvious things, certainly, i.e. cables, connectors, etc. However, people have seen network issues because of obscure problems such as malfunctioning circuit breakers, so leave no stone un-turned.

2) Blocked process threads in the PowerSDR. The most likely culprit according to Warren, NR0V, is the “JanusAudio thread”. Per Warren,

"The JanusAudio thread retrieves ALL data streams from the network interface, runs them ALL through quite a variety of operations, and then takes ALL the DSP output back to the network interface. As PowerSDR has gotten more complex, I see more and more times that the Windows scheduling issues you mention impact this thread. In my opinion, it is overloaded. However, we do not propose to fix this in PowerSDR. In Thetis, we have separate threads FOR EACH DATA STREAM to perform most of these functions. No matter which thread is problematic, the result can be the same, if something doesn’t get scheduled for execution in a timely fashion, data is dropped on the floor."

Windows is not a real time operating system. There is only so much buffering can do to smooth things out. If a thread is blocked for longer than how much data a buffer can hold then you get a drop out or a glitch. You can get an idea if this is a problem by using two tools, LatencyMon and DPC Latency Checker. Sometimes these tools help you fix problems, sometimes they say there are no problems to fix, but it's always worth trying them to at least see if they report problems.

3) VAC buffer under and overruns caused by audio sample rate mismatch between the radio hardware and the PC. The resampler function, if enabled with proper VAC buffer adjustments, can correct this almost perfectly, and you can watch the under and overrun counters basically stop counting.

Even with everything in a relatively optimum state with respect to 1, 2 and 3 above, it is still not unusual to see a couple of glitches per minute. I'm convinced that these mostly come from category (2) because there are good metrics on (1) and (3) and if they are not indicating problems then there are none in those categories.
User avatar
Posts: 167
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin

Re: Audio glitches: why do they occur?

Postby Tony EI7BMB » Tue Nov 27, 2018 10:02 am

Good info Scott thanks

Return to “PowerSDR mRX”