VAC & ASIO Under/Overflows

USB headsets to digital audio workstation software...
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

VAC & ASIO Under/Overflows

Postby W9IP » Wed Feb 08, 2023 11:13 pm

Dear friends,
After reading the "Thetis 2.8.11-21+++ VAC advanced controls: results and discussion" thread a couple of times, I purchased a Presonus 192 Mobile USB audio interface in the hope that it would be more stable than my previous Behringer UMC204HD. I hooked up a Leo Bodnar GPSDO @ 48kHz to drive the word clock of the Presonus. I have been disappointed to find that the rate-locked Presonus is no more stable than the unlocked Behringer. I am wondering whether my expectations were too high or if I'm missing something.
My setup: Anan Angelia SDR, remotely mounted, with 10MHz GPSDO feeding it as well as the L.O. of the associated 2m transverter. The radio is connected to the shack via 100m of fiber-optic cable. Three Ethernet switches along the way. On the main computer, Thetis is linked through VM Potato with ASIO.
I expected that the audio stream would synchronize almost immediately because both ends are GPS-locked. Instead, satrt-up is marked by an avalanche of under/overflows. I have to restart Voicemeeter and sometimes Thetis, occasionally rebooting the whole computer before things settle down. Only if the main VAC buffer is 1024 (matched with Presonus') do the under/overflows eventually stabilize at 100-200/hour.
So... my question is whether my simple Ethernetwork might be adding latency that overcomes GPS synchronization. of something elas?
W9IP
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Wed Feb 08, 2023 11:37 pm

I posted too soon... After a couple of hours, the Over/Underflows converged to zero. A restart (with Audio/Advanced/Old VAR checked) resulted in only a few glitches at first, followed by settling to zero within 5 minutes. Maybe my initial instability was due to an obsolete VAR from pre-Presonus?
User avatar
w-u-2-o
Posts: 5539
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC & ASIO Under/Overflows

Postby w-u-2-o » Wed Feb 08, 2023 11:46 pm

You do need to keep the buffers the same size for best performance.
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Thu Feb 09, 2023 6:59 pm

Scott, sorry, my wording was poor. I know to always keep the main buffer in Thetis the same as in the ASIO driver. I meant that the main buffer had to be big in order for the VAC loop to be reasonably stable.
After a number of warm and cold starts, stability is elusive. Sometimes VAC settles down in a minute or two; other times, it can continue to under/overflow 5-10 times an hour forever.
I'm thinking that my LAN might be at fault. There are three Ethernet switches (Netger Prosafe), in the path between the radio and Thetis... could they have an inconsistent effect on timing?
W9IP
User avatar
kc2rgw
Posts: 165
Joined: Mon Jun 22, 2020 5:44 pm

Re: VAC & ASIO Under/Overflows

Postby kc2rgw » Fri Feb 10, 2023 12:10 am

Can you show the settings screen from Voicemeeter and a snapshot of the full mixer panel too?
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Fri Feb 10, 2023 1:45 am

Here are the images...
Attachments
ASIO_VM_config.JPG
ASIO_VM_config.JPG (119.53 KiB) Viewed 6833 times
ASIO_VM_mixer.JPG
ASIO_VM_mixer.JPG (218.99 KiB) Viewed 6833 times
User avatar
w-u-2-o
Posts: 5539
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC & ASIO Under/Overflows

Postby w-u-2-o » Fri Feb 10, 2023 1:56 am

With my 8000 locked to a BG7TBL GPSDO, and my Presonus Studio 192 locked to a separate Bodnar GPSDO, I use the Force option in VAC with the Forced VAR ratio set to 1.0. I've not looked at overflows or underflows in some time. This evening I restarted Thetis and zeroed the counters. I will report out in the morning what I see.

My connection is PC direct to the 8000 on a dedicated NIC. It's conceivable having some switches in between might be an issue. Remember that the openHPSDR Ethernet comm's protocol is UDP. All it would take is one lost UDP packet (which contains I forget how many IF samples, but a lot more than just 1) to potentially screw things up.

One thing to try would be to temporarily move the Angelia to be near the PC, go to a direct connection and see what happens.

Another thing to try would be to install iPerf on the Thetis PC and a separate PC (one with good network performance), place the separate PC at the Angelia location, and then test what your UDP dropped packet rate is across the three switches.

Please also post a screenshot of your Thetis VAC setup page.

BREAK

Totally separate topic, but your Voicemeeter setup looks wonky. Why are you not routing the Thetis virtual channel to both the WSJT-X and Map65 channels? You only have A1 and A2 sends turned on. And all levels ought to be at 0 dB. But start a separate thread for that ;)
User avatar
kc2rgw
Posts: 165
Joined: Mon Jun 22, 2020 5:44 pm

Re: VAC & ASIO Under/Overflows

Postby kc2rgw » Fri Feb 10, 2023 2:23 am

In the Thetis Audio tab VAC set to 48k and 512.

Also I’d drop all the buffers down to 128 and set each of the busses to 4096. Will drop your latency a fair bit.
User avatar
kc2rgw
Posts: 165
Joined: Mon Jun 22, 2020 5:44 pm

Re: VAC & ASIO Under/Overflows

Postby kc2rgw » Fri Feb 10, 2023 2:24 am

Also double check Control Panel and set all the busses to 48k 24 bit if you haven’t.
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Fri Feb 10, 2023 2:35 am

Here are my Thetis settings. This instance has been running for an hour or so and has settlled down nicely after the first five minute of thrashing.
I will examine my VM setup in the morning; thank you for your observations and comments.
Attachments
ASIO_Thetis_Advanced.JPG
ASIO_Thetis_Advanced.JPG (87.23 KiB) Viewed 6825 times
ASIO_Thetis_VAC1.JPG
ASIO_Thetis_VAC1.JPG (93.01 KiB) Viewed 6825 times
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Fri Feb 10, 2023 2:39 am

Scott - regarding your question, "Why are you not routing the Thetis virtual channel to both the WSJT-X and Map65 channels?" Map65 gets its I/Q feed from a UADC4 via Linrad and the network.
Last edited by W9IP on Fri Feb 10, 2023 3:00 am, edited 1 time in total.
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Fri Feb 10, 2023 2:42 am

KC2RGW... could you elaborate a bit on "Also double check Control Panel and set all the busses to 48k 24 bit if you haven’t." I'm not especially fluent with Voicemeeter.
Michael
User avatar
w-u-2-o
Posts: 5539
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC & ASIO Under/Overflows

Postby w-u-2-o » Fri Feb 10, 2023 3:05 am

I don't see any problem with your buffer or rate settings in VAC or Voicemeeter. I'd turn on stereo in VAC, but that's just a minor issue, not related to your problem. As soon as I get my data collected in the morning I will post my VAC Advanced settings which are somewhat different than yours. And you are also not using Force like I am.

As for the "Control Panel" reference I believe he is referring to the legacy Windows Sound Control Panel, and he is correct, you do need to go there, find every single Voicemeeter related device both for playback and recording, and ensure that they are set to 48KHz, stereo if possible. 16 or 24 bit doesn't matter so much, but I also use 24 bit.

Here's an example:

Capture.JPG
Capture.JPG (232.86 KiB) Viewed 6819 times
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Fri Feb 10, 2023 11:57 am

Scott - Thanks for explaining. I wasn't sure which control panel was intended. I had set everything to 16-bit/48000 long ago as per your tutorial.
W9IP
User avatar
kc2rgw
Posts: 165
Joined: Mon Jun 22, 2020 5:44 pm

Re: VAC & ASIO Under/Overflows

Postby kc2rgw » Fri Feb 10, 2023 12:37 pm

Everything looks ok from the sound settings, the 512 buffers are large so they should be very forgiving.

I'm out of guesses at the moment.
User avatar
kc2rgw
Posts: 165
Joined: Mon Jun 22, 2020 5:44 pm

Re: VAC & ASIO Under/Overflows

Postby kc2rgw » Fri Feb 10, 2023 12:41 pm

In the Thetis audio tab, you have your buffers on manual and 0. I just let mine do the automatic thing, my system would never work at 0ms forced.

I'll screen shot mine when I get to my desk again.
User avatar
kc2rgw
Posts: 165
Joined: Mon Jun 22, 2020 5:44 pm

Re: VAC & ASIO Under/Overflows

Postby kc2rgw » Fri Feb 10, 2023 1:13 pm

I'm not forcing the buffers into manual and the Advanced tab in Thetis is set to defaults. This has been very stable for me with Voicemeeter for a good run now.

1shot.png
1shot.png (758.32 KiB) Viewed 6699 times
User avatar
w-u-2-o
Posts: 5539
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC & ASIO Under/Overflows

Postby w-u-2-o » Fri Feb 10, 2023 1:20 pm

As promised, here is an example of the performance I am getting. The key differences between my setup are:

1. I am using the forced checkbox. This should make any changes on the advanced tab immaterial, but I have included my advanced settings that I developed during experimentation, as documented in that other long topic about these settings, just for completeness.
2. I am using a direct connection, PC to ANAN, on a dedicated NIC, no switches. This should improve UDP packet loss rates.
3. Over many days of testing I have found that I need a slight increase in the input Ringbuffer over 0 to be stable.

Things to consider:

a) Try the force checkbox option. This should work if everything is locked to a GPSDO.
b) Try increasing Ringbuffer sizes (PortAudio can remain at zero since you are using ASIO).
c) Do the experiments I previously recommended to measure UDP packet loss rates (move the PC next to the Angelia, or do an iPerf test).

After approx. 10 hours of soak time in a receive-only state, here is what I've got:

Capture.JPG
Capture.JPG (129.95 KiB) Viewed 6699 times


Capture2.JPG
Capture2.JPG (124.26 KiB) Viewed 6699 times
K1LSB
Posts: 639
Joined: Wed Feb 05, 2020 5:25 pm

Re: VAC & ASIO Under/Overflows

Postby K1LSB » Sat Feb 11, 2023 4:45 pm

Just for reference, here's my setup. I'm running an old i7-6700K and don't have any GPSDO. I forget how I arrived at the specific settings I'm currently running, but they've been working fine for me for the last several months. I often go several hours with no underflows/overflows.

Personally I've never understood the concern over an occasional isolated underflow/overflow, given that when one does occur it's completely unnoticeable in the audio.

Mark

Edit: I arrived at the settings shown in my pursuit of minimum latency.

Screenshot 2023-02-11 101652.jpg
Screenshot 2023-02-11 101652.jpg (154.29 KiB) Viewed 6585 times


Screenshot 2023-02-11 101727.jpg
Screenshot 2023-02-11 101727.jpg (153.99 KiB) Viewed 6585 times
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Sat Feb 11, 2023 5:07 pm

Surprising result...
My hypothesis said that the three network switches inline from Angelia to Thetis were introducing instability that caused over/underflows in the audio stream. This despite GPS-disciplined synchronization for the time domains at each end.
To test the hypothesis, I set up the following:
Latency test.jpg
Latency test.jpg (20.58 KiB) Viewed 6582 times

No switches, just a simple fiber connection from Angelia to Thetis.
NOTE: As I was setting up the media converters, I had to turn off my McAfee firewall to do ping testing with another computer. I left it off for the time being.
When I launched Thetis, the audio stream was steady from the very beginning, Only one overflow during the next 20 minutes. Hooray, hypothesis confirmed! The switches were the culprits, right?
No, it was the firewall. I noticed that it was off and switched it back on. Almost immediately, overflows started accumulating, reaching over 800 in the first 15 minutes. I repeated the off/on test several times and the effect was clearly repeatable. Firewall off, solid synchronization; firewall on, instability.
How about that.
W9IP
User avatar
w-u-2-o
Posts: 5539
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC & ASIO Under/Overflows

Postby w-u-2-o » Sat Feb 11, 2023 6:00 pm

McAffee is not a good choice and has not been for a long time. Windows Defender is pretty much all you need these days, and definitely all you need for a PC firewall. If you want a little extra anti-virus protection Avast is a good choice, but disable their firewall and stick with Windows Defender.

Anyhow, glad you found the problem!
K1LSB
Posts: 639
Joined: Wed Feb 05, 2020 5:25 pm

Re: VAC & ASIO Under/Overflows

Postby K1LSB » Sat Feb 11, 2023 6:37 pm

I'm a big fan of BitDefender Free. I was having problems with another firewall (possibly Windows Defender but I can't remember) cooperating with Thetis so I tried BitDefender and I was hooked. It's very low overhead and so unobtrusive I basically forget it's even there.

Oh, and it's free. :)

Mark
W9IP
Posts: 43
Joined: Mon Apr 10, 2017 11:57 am

Re: VAC & ASIO Under/Overflows

Postby W9IP » Sat Feb 11, 2023 7:32 pm

To close out the saga, I hooked everything up in its original configuration including all three Ethernet switches. Without firewall it is rock-solid, with the firewall, it's unstable as before.
Thanks to everyone,
W9IP

Return to “Digital ("Virtual") Audio”