Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

USB headsets to digital audio workstation software...
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Thu Sep 30, 2021 4:34 pm

This is with 21k6
I'm using FLDigi's FMT mode to track my GPS to see the practical effect of these settings.
#1 One problem is the Buffer Size and Buffer Latency checkboxes are not being saved so have to change them on every restart of Thetis.
#2 Takes about 3 minutes to get close to where it should be...seems this could be faster so maybe the slew rate can be increased. I'll experiment
#3 I'm seeing a couple of transients which you can seen in the FLDigi data -- they coincide with a jump in the plot in Thetis. I'll have to capture one of those.
#4 Since I turned of Window buffer cache flushing I've had virtually no dropouts and been able to drop buffer size to 64.
Attachments
Screenshot 2021-09-30 112232.png
Screenshot 2021-09-30 112232.png (31.11 KiB) Viewed 1064 times
Screenshot 2021-09-30 112151.png
Screenshot 2021-09-30 112151.png (55.57 KiB) Viewed 1064 times
Screenshot 2021-09-30 111942.png
Screenshot 2021-09-30 111942.png (22.39 KiB) Viewed 1064 times
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Thu Sep 30, 2021 4:45 pm

Caught one of the transients
Looks kind of like a bit flip from negative to positive
This was about 3 minutes after startup.
Attachments
Screenshot 2021-09-30 114418.png
Screenshot 2021-09-30 114418.png (10.89 KiB) Viewed 1060 times
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Thu Sep 30, 2021 9:15 pm

Bumping up the FF Alpha to 0.02 got rid of the big transients. But long-term stability is not too good. Switching back for Force for now and will show how stable it is there.
Attachments
Screenshot 2021-09-30 161150.png
Screenshot 2021-09-30 161150.png (39.13 KiB) Viewed 1040 times
Screenshot 2021-09-30 122018.png
Screenshot 2021-09-30 122018.png (22.27 KiB) Viewed 1040 times
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Thu Sep 30, 2021 9:45 pm

30 minutes with Force checked shows how stable things can be. Just one small burp of around 50mHz accuracy for some reason.
So the drift in the resampler needs to be looked at. Could this just be accumulated error? With 15 significant digits is there some scale difference in the resampler that may be hitting the 15-digit precision?
Attachments
Screenshot 2021-09-30 164022.png
Screenshot 2021-09-30 164022.png (39.41 KiB) Viewed 1039 times
User avatar
ramdor
Posts: 760
Joined: Wed Jul 03, 2019 3:07 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby ramdor » Thu Sep 30, 2021 10:43 pm

w9mdb wrote:This is with 21k6
#1 One problem is the Buffer Size and Buffer Latency checkboxes are not being saved so have to change them on every restart of Thetis.


are you saving the tx profile? Yellow items saved per tx profile.

txProfile.jpg
txProfile.jpg (89.66 KiB) Viewed 1032 times
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Thu Sep 30, 2021 11:06 pm

I've got "Auto Save TX Profile on change" checked....shouldn't that do it? But manually saving it worked...so thanks for that.
I also notice there's a new Restore VAC1 -- what values is that working with?
User avatar
ramdor
Posts: 760
Joined: Wed Jul 03, 2019 3:07 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby ramdor » Thu Sep 30, 2021 11:11 pm

w9mdb wrote:I've got "Auto Save TX Profile on change" checked....shouldn't that do it? But manually saving it worked...so thanks for that.
I also notice there's a new Restore VAC1 -- what values is that working with?


Input output driver names are saved per tx profile. That option when checked will attempt to recover them and reassign them. Useful if you have digi tx profile setup using virtual audio cables vs regular sound device for headset/speakers.

I will check if that auto save is working, but from memory it calls the same code as hitting the save button. So if one works, the other should, ideally.

EDIT: that option will only save the changes if you move to another tx profile

R.
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Fri Oct 01, 2021 12:03 am

Mike -- are you using a signal generator as the input signal for these tests?
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Fri Oct 01, 2021 3:22 am

Bodnar GPSDO

Mike
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Fri Oct 01, 2021 3:23 am

w9mdb wrote:Bodnar GPSDO -- I've got 3 of them for testing different things. One is the 10MHz source for the 7000DLE MKII and using a 2nd for a secondary signal to measure.

Mike
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Fri Oct 01, 2021 1:36 pm

@ w9dmb -- Very good, Mike, I can do the same here. No time to play radio today, though :(

However, I have done this experiment before using WWV and achieved better than 0.2Hz accuracy with the resampler, audio interface on internal reference, and radio on GPSDO. I think the resampler, and buffer sizes, when properly adjusted can provide the very high performance. Especially because I suspect most of that 0.2Hz came from ionospheric effects. But I will recheck with a local GPS derived 10MHz.

Also, slight thread drift, but given that DDC tuning in the radio is accomplished using a numerically controlled oscillator (aka DDS), there is a quantization of tuning, and frequency steps are 0.026Hz (rounded to the nearest millihertz).

The equation for tuning is: frequency_in_hz = phase_word_in_decimal / (2^32 * 122800000).

The nearest phase word (decimal) to 10MHz is 349753037, which give 9999999.996 Hz (rounded to the nearest millihertz).

BREAK

@ K1LSB -- Mark -- I tried your "astonishing" :) settings.

First I tried them with my normal "all buffers equal zero" settings, which went very poorly. I actually cut that test short, it was racking up 10's of counts per hour.

Then I tried them with the Ringbuffers set to 4, as you have them. This netted me 4.9 counts per hour, which is respectable but not as good as what I had tested previously.

So it would still seem that "your mileage may vary". We need more data from more people to help zero in on what will hopefully be just a couple or three changes to the defaults.
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Fri Oct 01, 2021 2:43 pm

Scott...have you tried turning off the windows buffer cache flushing? Did miracles here. As long as you're on on UPS you're protected. Blue screen of death horks the buffer flush anyways so doesn't matter.

As for phase word I don't think that's involved here at all, is it? That would be in the Frequency Calibration. we have a frequency correction in FLDigi that CAN get us to within 1mHz -- I didn't use that on the run above. Would be nice to add that fine resolution correction to Thetis too. And that's a good example of how to avoid precision problems.
Tempting to do this:
freq *= 1.000000000000001
But that pushes precision and you can see the difference doing it a different way
main()
{
double f = 10000000;
double f2;
f2 = f * 1.000000000000001;
printf("f=%.17f\n",f2);
f2 = f + f*0.000000000000001;
printf("f=%.17f\n",f2);
}
f=10000000.00000001117587090

f=10000000.00000000931322575


You can see from the FLDigi plot I showed earlier that the drift is about 30mHz so not much and I can see how you could get 0.2Hz with WWV -- I've done WWV to < 10mHz on a good day. I worked with Dave W1HKJ on the FMT mode in FLDigi to where I can measure a frequency to < 2mHz now. I was running my own FMT with a group of users while we were developing this and you'll see many of the FMT operators using FLDigi now.

Some value is askew in the resampler...perhaps hitting accumulated error due to too much precision being used....especially with the fact that you get 15-17 digits of precision from a double so anything over 15 will be lost or rounded.

If I had access to the source I could take a look at this.

Here's a measurement of a local AM station -- which is extremely stable but not terribly accurate -- I have to put fairly good size frequency correction to zero out FLDigi. The real frequency of the station is off about 0.4Hz. This is a good way to measure another frequency to check the resampler if one doesn't have a decent reference.
This measurement has a standard deviation of 5mHz
Attachments
Screenshot 2021-10-01 094335.png
Screenshot 2021-10-01 094335.png (66.27 KiB) Viewed 897 times
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Fri Oct 01, 2021 3:27 pm

Mike,

This frequency accuracy stuff is fun and interesting. I suggest we start a separate topic to focus on that.

Super quick results this morning:

- Updated to fldigi 4.1.20
- Learned to use FMT mode: it would seem VERY important to select 1/4 actual audio sample rate in the FMT modem config. I could not get good results otherwise.
- Looked at WWV, with resampler or with force checked, seeing approx. -0.0 to +0.2 Hz variation from 10MHz.

Off to do other things, will check back into the board tomorrow.

73,

Scott
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Fri Oct 01, 2021 4:12 pm

The frequency measurement is relative to the resampler....you can see here where I turned on the resampler at about the 51 minute mark and it dropped 40mhz slowly rising than hits some limit and goes nuts for a while.
Attachments
Screenshot 2021-10-01 110951.png
Screenshot 2021-10-01 110951.png (33.38 KiB) Viewed 881 times
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Sat Oct 02, 2021 10:38 pm

I spent most of today looking at frequency accuracy. I used a hybrid splitter to split my BG7TBL GPSDO output so I could continue to feed it to my 8000 reference input, and after putting on a big attenuator, feed it to the Ant 1 input at -63dBm.

I had the Bodnar available to the Presonus audio interface.

I used the fldigi FMT feature as my measurement device.

My take-aways so far:

- The resampler works well when everything is properly adjusted and one is not getting under/over-run counts. Typically ±0.001Hz slow variations with the GPS reference on the Presonus, twice that with the Presonus internal reference.

- Slightly mis-adjusting things so that I was getting a steady but slow diet of under/over-runs, say 60 per hour, the resampler was kind of a mess, wandering around strangely. But, still, not seeing anything worse than ±0.005 or so.

- Even force=on with the Presonus internal reference was good, but under/over-runs were much higher in this condition, and audible glitches were heard.

- Obviously a GPS reference on the Presonus with force=on was stellar. Unmeasurable variation. Rock solid.

- Under all conditions I had a strange frequency offset that I had to put into fldigi, -0.023Hz, even with the Bodnar selected in the Presonus and force=on. I could not tie that to Thetis tuning quantization. I have no idea where it's coming from. This is something I'd like to figure out.

Bottom line: any of these conditions would have been more than enough to easily achieve high honors (≤1Hz) in any FMT event, and are far more than adequate to run something like FT8. If things look stable in the VAC monitoring section then all should be well. We may be worrying about nothing here, although from an academic standpoint it is fun to look at.
w9mdb
Posts: 246
Joined: Sun Apr 09, 2017 5:53 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w9mdb » Sat Oct 02, 2021 10:45 pm

Have you tried doing a multi-hour run yet? That's where I see drifting and craziness once in a while long runs. That's the main concern I see left. The sampler should be stable and not drift and definitely not lose it's mind every 30-60 minutes.
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Sun Oct 03, 2021 12:20 pm

w9mdb wrote:Have you tried doing a multi-hour run yet? That's where I see drifting and craziness once in a while long runs. That's the main concern I see left. The sampler should be stable and not drift and definitely not lose it's mind every 30-60 minutes.

I have done a 60 minute fldigi FMT run. The resampler never "lost its mind". It definitely seems to wander around somewhat aimlessly. Even using the lower performing internal reference in the Presonus, I never saw it wander more than ±0.005. But even if I'm not monitoring long enough and it chose to perform ten times worse, that would still not be enough to disturb FMT competition performance in any meaningful way, and it certainly would not be audible.

The only time things get crazy for me are when settings are not properly adjusted. When this occurs the under and overrun counters will accumulate many hundreds or thousands of counts, i.e. using fldigi FMT mode is not necessary for me to know when these conditions occur. The situation can range from inaudible (but would mess up FT8, for example) to very badly audible. However, now that I've lowered feedback gain and FF alpha settings, as multiple posts above have described I am seeing a lot less than 10 counts per hour under any conditions, and I can't remember the last time I started Thetis and the resampler went unstable. Of course with the feedback gain and FF alpha settings I've chosen I now need to be very patient for 5 or 10 minutes for things to settle, but it doesn't seem to go unstable.

Edited to add: also, for me I saw no difference with the buffer cache flush setting disabled. I run dual Samsung EVO 960 SSDs.

Second edit: after additional testing this morning I take that back! Turning this off does seem to help. Under/overrun counts are so very low I can't measure any in over an hour using my lowest performing configuration. I'm going to have to do all my testing over again, darn it! :D
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Sun Oct 03, 2021 5:38 pm

First of all, very important, many thanks to you, Mike, @w9mdb, for pointing out that disabling windows write-cache buffer flushing seems to make huge improvements in resampler performance. This may very well turn out to be as important as disabling network throttling.

How to disable write-cache buffer flushing:

- Right-click Computer in the Start menu, then select Properties
- Select Device Manager
- Select Disk drives
- Right-click your SSD and select Properties
- Under the Polices tab, check the Turn off Windows write-cache buffer flushing on the device box
- Close the Device Manager.
- Reboot

It would be good to get a larger population of folks to try this to confirm it's not just Mike and I.

BREAK

I got serious today and took a few hours of data. As before, my setup used a Mini Circuits hybrid splitter to split my BG7TBL GPSDO output so it could continue to feed the 8000 reference input and, after putting on a big attenuator, also feed the Ant 1 input at -63dBm. The Bodnar GPS reference was available to the Presonus audio interface, and the fldigi FMT feature was again the measurement device.

Thetis setup is as shown below (that's a composite image, not some special dual settings display :) ). Nothing crazy in the VAC advanced settings, just slowing down the feedback gain and FF alpha settings a bit from the default to gain better stability. Some step attenuation was added to lower IMD from the GPSDO 10MHz, and the passband was restricted to lower noise.

The computer was used for light web browsing while these experiments were taking place. No special measures were taken to restrict operating system activity.

If you right click any of these images and select "Open image in new tab" you will get them full size for easier viewing.

Thetis Settings.JPG
Thetis Settings.JPG (1.04 MiB) Viewed 734 times


First up was a 6o minute test with the Presonus on its internal reference and the resampler active. Results were quite good. Very stable. There was clear evidence of a fast and slow loop in the repetitive pattern. You can judge for yourself what you think the periods are. The fldigi FMT configuration is as shown. A frequency offset in fldigi was necessary to get it close to zero. As before, I have no idea what is causing the offset. On the waterfall the input audio level was at -8dB, and there was at least 70dB of audio SNR, which is more than adequate.

Presonus Int Ref & Resampler.JPG
Presonus Int Ref & Resampler.JPG (407.1 KiB) Viewed 734 times


Next I investigated what happens when you change feedback gain and FF alpha. Please ignore the startup transient. In the first approx. 20 minute period the feedback gain and FF alpha settings twice that of the results above. I had expected to see a change in periodicity but instead there is only a change of approx. a factor of two in the amplitude of the frequency variations. In the second 12 or 13 minutes or so the feedback gain and FF alpha were changed to 1/10 what it was in the first test. Again, this had a dramatic effect on the amplitude but not periodicity of the frequency variations.

Presonus Int Ref Resampler Changes.JPG
Presonus Int Ref Resampler Changes.JPG (340.41 KiB) Viewed 734 times


After that the Presonus was switched from the internal frequency reference to the Bodnar GPS external reference. VAC advanced settings were set back to the starting condition as shown above. It took a good 20 minutes for things to settle down (not pictured). After they settled down, the results with the resampler are seen in the first 35 minutes of the data. You'll note the change required in the fldigi frequency correction. For the last 25 minutes Force was activated. Perfectly perfect, except for that annoying .023Hz frequency correction!

Presonus GPS Ref.JPG
Presonus GPS Ref.JPG (391.08 KiB) Viewed 734 times


After all this my conclusions remain the same: any of these configurations would happily meet any requirements, from meat and potatoes phone and SSB, to FT8, to the most obscure FMT event. Under and overruns remained at zero throughout these tests after an appropriate period of stabilization had elapsed. No need to invest in a GPS reference for your audio interface, but the operator does need to do their part in smartly choosing VAC settings that work with their specific configuration. A GPSDO on the RF hardware can be quite worthwhile. IMHO, the default feedback gain and FF alpha settings need to be smaller than the current defaults. We can argue about how much smaller ;) The write-cache buffer flushing issue needs to be further investigated by more people and confirmed as a source of improved stability.

It's also worth noting that clicking "Apply" did not work to update resampler operation. I had to cycle one of the "manual" checkboxes when changing settings or test conditions.
K1LSB
Posts: 241
Joined: Wed Feb 05, 2020 5:25 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby K1LSB » Sun Oct 03, 2021 9:38 pm

w-u-2-o wrote:First of all, very important, many thanks to you, Mike, @w9mdb, for pointing out that disabling windows write-cache buffer flushing seems to make huge improvements in resampler performance. This may very well turn out to be as important as disabling network throttling.

Scott,

Can you be more specific regarding the "huge improvements in resampler performance" you're seeing? I'm reading in lots of places on the web that disabling windows write-cache buffer flushing is potentially a very bad thing, in that a BSOD can conceivably result in corrupted system files.

Thanks,
Mark
Joe-W4WT
Posts: 125
Joined: Sun Apr 09, 2017 5:27 pm
Location: Cumming, GA

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby Joe-W4WT » Mon Oct 04, 2021 1:38 am

Unless you are running an "Online" type UPS (sometimes called "double conversion") which is constantly supplying power from the battery through an inverter to your gear you are asking for trouble disabling the buffer flush. These units are nice but they are typically noisy and expensive.

Standby UPS's, which I use as do most people, are not 100% effective in keeping power up during a failure or power glitch. My standby UPS is a pretty good APC unit and 99.x% of the time it works perfectly but it does fail to switch fast enough during very rare power glitches. I don't know what causes these type glitches but i get maybe one a year and it "fools" the UPS and everything crashes. It happed last week for the first time this year. All computers and radios went down in an instant. No problems occurred but certainly could have if buffer flush was not enabled.

I personally feel the level of stability I and others are now seeing, as I think Scott said above, is more than "good enough" without turning off buffer flush and possibly sacrificing data integrity just to get that last little bit of VAC stability.

Joe W4WT
User avatar
w-u-2-o
Posts: 3315
Joined: Fri Mar 10, 2017 1:47 pm

Re: Thetis 2.8.11-21+++ VAC advanced controls: results and discussion

Postby w-u-2-o » Mon Oct 04, 2021 12:23 pm

K1LSB wrote:
w-u-2-o wrote:First of all, very important, many thanks to you, Mike, @w9mdb, for pointing out that disabling windows write-cache buffer flushing seems to make huge improvements in resampler performance. This may very well turn out to be as important as disabling network throttling.

Scott,

Can you be more specific regarding the "huge improvements in resampler performance" you're seeing? I'm reading in lots of places on the web that disabling windows write-cache buffer flushing is potentially a very bad thing, in that a BSOD can conceivably result in corrupted system files.

Thanks,
Mark

Mark,

With flush enabled I was seeing approx. 2 counts per hour on under/overrun counters. with flush disabled now I'm down to approx. 0.6.

Maybe it's not such a huge improvement on an absolute scale, but it is definitely better than a 3x improvement from a rate perspective.

Is it worth the risk? That's a personal decision. People disable this setting in the interests of speed, whereas here it's disabled for the purposes of smoother audio operation. Are a few clicks and pop's worth the risk? Maybe not for most people.

Joe-W4WT wrote:Unless you are running an "Online" type UPS (sometimes called "double conversion") which is constantly supplying power from the battery through an inverter to your gear you are asking for trouble disabling the buffer flush. These units are nice but they are typically noisy and expensive.

FWIW, I run APC Back-UPS 1000 and 1500VA units on my PC's and other IT hardware. I get outages every day, practically like clockwork. None have ever caused any of my equipment to go down. However, this may also be a function of the quality of the equipment and their power supplies plugged into these UPS units. Indeed this morning's event came in at 0748EDT, per the nice little email my UPS sends me every time it goes on or off battery. I'm guessing that my power company makes some sort of switching decision every morning. Living out in the sticks definitely requires robust power protection!

One other factor in my thinking is that all my PC's automatically back up to my NAS every night without fail. I can recover from the unlikely event of drive corruption in under 20 minutes. This is also proven, as I'm now on my third SSD in this machine. Further off topic, but remember that SSDs fail without warning, and they have limited lifetimes. Back up, back up, back up!

Return to “Digital ("Virtual") Audio”