VAC under/overflows due to changes in how Windows handles Timer resolution

USB headsets to digital audio workstation software...
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Mon May 03, 2021 4:43 pm

Thetis developers please read it carefully!


1) Introduction:
Windows changed the way it handles Interrupt Timer Resolution in Windows 10 v.2004 and newer.

Using Windows 10 v.1903 I can achieve a rock solid VAC performance with 3/4 ms IN/OUT ringbuffers settings, that's absolutely impossible after updating to W10 v.2004 or v.20H2. I must go over 20/20ms to have a pleasent Thetis experience or let it run in automatic mode.

After investing several weeks trying to debug what was going wrong I found the culcript!, recent versions of windows 10 changed the function to call Timer Resolution changes!

2) Test method:

Run powercfg -energy duration 5 in powershell (admin mode) and take a look at the report located in /Windows/system32/energy-report.html

On W10 v.1903:
If I run it at IDLE the report shows a current Timer Resolution of 15.6 ms (Windows default and OK to save energy)
If I run it when Thetis is running, it shows a current Timer Resolution of 1 ms because Thetis requested a higher Timer Resolution and the OS agreed.

On W10 v.2004 and v.20H2:
Here things have changed... Interrupt Timer Resolution never goes lower than 15.6 ms.
If I run it when Thetis is running, it shows a request from Thetis to change to a higher Timer Resolution of 1 ms but windows sticks at his default resolution of 15.6 ms. and that's the origin of VAC under/Overflows.


3) Things that don't work:

Messing around with High Precision Event Timer, BcDedit UsePlatformClock, UsePlatformTick, etc didn't work.
Using sotware to force Timer resolution (TimerTool V3, ISLC, etc ) didn't work.
I was not able to found a tweak to make Interrupt Timer Resolution to work properly on Windows 10 20H2.

4) Possible solutions?:


Looks like the only possible solution is to change in Thetis the function that calls Timer Resolution changes. I'm not a coder, so please, Thetis developers, take a carefully look at this link, including all comments. Seems that the solution will be there!

https://randomascii.wordpress.com/2020/10/04/windows-timer-resolution-the-great-rule-change/
https://docs.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod

73
EA3AQR


MY SOLUTION TO THIS PROBLEM:

https://apache-labs.com/community/viewtopic.php?f=13&t=3780
Last edited by ea3aqr on Wed May 05, 2021 9:05 pm, edited 1 time in total.
New call sign EA3CL
User avatar
w-u-2-o
Posts: 5540
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby w-u-2-o » Mon May 03, 2021 5:59 pm

This may not be a universal problem.

I have been running Windows 10 Pro 20H2 since March. I've loaded every optional update except for the latest one. I've not experienced any problems at all. Using TimerTool (https://vvvv.org/contribution/windows-system-timer-tool) this is what I see at all times, with and without my audio software (Voicemeeter and Reaper) running, with and without Thetis running:

Capture.JPG
Capture.JPG (21.71 KiB) Viewed 10090 times


The current timer is less than the min/max range allows. Not sure that is a problem, but again my system is running fine, no audio glitches at all.
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Mon May 03, 2021 6:26 pm

w-u-2-o wrote:This may not be a universal problem.

I have been running Windows 10 Pro 20H2 since March. I've loaded every optional update except for the latest one. I've not experienced any problems at all. Using TimerTool (https://vvvv.org/contribution/windows-system-timer-tool) this is what I see at all times, with and without my audio software (Voicemeeter and Reaper) running, with and without Thetis running:

Capture.JPG

The current timer is less than the min/max range allows. Not sure that is a problem, but again my system is running fine, no audio glitches at all.


If I run Timer Tool I also see a current resolution of 0.5 or 1ms when hitting "set timer" in the app, but looks like it is not right..

Could you please check the OS real Timer resolution running powercfg -energy duration 5 and checking what says your windows energy report?

I have the same problem with my "everyday windows drive" and also with a fresh W10 v.20H2 installation.

Have you read the first link in the bottom of my post?

Thanks

EDIT:
Could it be a platform specific issue, what processor and W10 are you running?
Me a Ryzen 7 3700X and W10 Pro
New call sign EA3CL
User avatar
w-u-2-o
Posts: 5540
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby w-u-2-o » Mon May 03, 2021 8:05 pm

I'm running an i7 7700k, and again the latest Win 10 Pro 20H2.

I ran the powercfg report. It reports that the current timer is set to 15.6ms, however it also reports all my audio software, and Thetis, requesting timers of less than the minimum allowed 0.5ms.

Both TimerTool and SysInternals "clockres" report that the current timer is set to 0.496ms.

I'm inclined to believe that the powercfg report only reports on the max. allowable timer interval and not the current timer interval.

Again, I'm experiencing zero problems hear with anything that is using real time audio processing. This includes the Presonus driver, Reaper DAW, Voicemeeter DAW and Thetis.
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Mon May 03, 2021 8:55 pm

w-u-2-o wrote:I'm running an i7 7700k, and again the latest Win 10 Pro 20H2.

I ran the powercfg report. It reports that the current timer is set to 15.6ms, however it also reports all my audio software, and Thetis, requesting timers of less than the minimum allowed 0.5ms.

Both TimerTool and SysInternals "clockres" report that the current timer is set to 0.496ms.

I'm inclined to believe that the powercfg report only reports on the max. allowable timer interval and not the current timer interval.

Again, I'm experiencing zero problems hear with anything that is using real time audio processing. This includes the Presonus driver, Reaper DAW, Voicemeeter DAW and Thetis.



I'm sorry but I must dissagree.

If I run Powercfg in w10 v.1903 it reports current timer interval of 1ms when Thetis is running and 15.6 when the system is IDLE.
On W10 v.2004 or 20H2 Powercfg reports a 1 ms request from Thetis, but unfortunately it is not set and the current timer interval stays fixed at 15.6ms as per report data.

https://ibb.co/YdZLnpM
Attachments
timer.jpg
timer.jpg (91.5 KiB) Viewed 10049 times
New call sign EA3CL
User avatar
w-u-2-o
Posts: 5540
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby w-u-2-o » Mon May 03, 2021 9:57 pm

I also add that, using ASIO, my VAC PortAudio settings are both 0, and the RingBuffers are set to 5 and 8 respectively. No problems at all, unless I see a CPU spike from another application or service.

Whether you agree with my assessments or not, my audio has remained stable under 20H2.
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 8:23 am

I did the windows upgrade last night and I am also now seeing issues with overflows/underflows where previously this was rock solid. Using Ryzen 1700 CPU
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 9:42 am

Here''s what I am seeing in energy report and Timer tool

Platform Timer Resolution:Outstanding Timer Request
A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 936
Requesting Process Path \Device\HarddiskVolume4\Program Files\OpenHPSDR\Thetis\Thetis.exe
Platform Timer Resolution:Outstanding Timer Request

A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 11060
Requesting Process Path \Device\HarddiskVolume4\Windows\System32\audiodg.exe
Platform Timer Resolution:Outstanding Timer Request

A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 11176
Requesting Process Path \Device\HarddiskVolume4\Program Files (x86)\VB\Voicemeeter\voicemeeter8x64.exe


Image
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 10:07 am

Tony EI7BMB wrote:Here''s what I am seeing in energy report and Timer tool

Platform Timer Resolution:Outstanding Timer Request
A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 936
Requesting Process Path \Device\HarddiskVolume4\Program Files\OpenHPSDR\Thetis\Thetis.exe
Platform Timer Resolution:Outstanding Timer Request

A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 11060
Requesting Process Path \Device\HarddiskVolume4\Windows\System32\audiodg.exe
Platform Timer Resolution:Outstanding Timer Request

A program or service has requested a timer resolution smaller than the platform maximum timer resolution.
Requested Period 10000
Requesting Process ID 11176
Requesting Process Path \Device\HarddiskVolume4\Program Files (x86)\VB\Voicemeeter\voicemeeter8x64.exe


Image



Yes, I also see the program requesting a smaller timer resolution but the problem is that this request is not being applied.

Look further on the yellow or white section and you will see the "current resolution" stuck at 15.6ms

I've read somewhere that timer resolution setting tools no longer work properly on W10 v.2004 and newer...
New call sign EA3CL
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 10:20 am

Yeah I've had to disable manual buffer latency to stop overflows . Thanks for the work on this Jordi , I am glad I saw your post before i did the windows upgrade.
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 10:26 am

Look at that!

Timer2.jpg
Timer2.jpg (256.23 KiB) Viewed 10018 times


Tony, you are also running a Ryzen CPU... could it be a specific problem with AMD?

Will be nice if some more people could test it...
New call sign EA3CL
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 10:35 am

Yes if we could ask guys with both AMD and Intel CPU's to test this it may show if its specific to AMD
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 10:40 am

FireShot Capture 142 -  - .png
FireShot Capture 142 - - .png (36 KiB) Viewed 10011 times
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 10:42 am

Tony EI7BMB wrote:Yes if we could ask guys with both AMD and Intel CPU's to test this it may show if its specific to AMD


Tony, are you using "AMD Ryzen high performance" power plan?

I tested Windows's high performance power plan and had the same issue, could you test it please?
New call sign EA3CL
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 10:42 am

Tony EI7BMB wrote:FireShot Capture 142 - - .png


Yea!

Exactly the same issue as me!
New call sign EA3CL
User avatar
w-u-2-o
Posts: 5540
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby w-u-2-o » Tue May 04, 2021 10:58 am

So far we have a count of two Ryzens (not ok) and one Intel (ok).
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 11:00 am

ea3aqr wrote:
Tony EI7BMB wrote:Yes if we could ask guys with both AMD and Intel CPU's to test this it may show if its specific to AMD


Tony, are you using "AMD Ryzen high performance" power plan?

I tested Windows's high performance power plan and had the same issue, could you test it please?


I'm actually using Ultimate performance plan
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 11:39 am

Even with very conservative settings I am seeing "blow outs" on FT8 now . What a pain
User avatar
rbduck
Posts: 327
Joined: Tue Dec 03, 2019 1:49 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby rbduck » Tue May 04, 2021 3:23 pm

Here is data from my system. I was able to run rock solid 8ms in and out before the upgrade. Now I can go no less than 50ms before I get endless underflows and overflows. I'm running an Intel I7 9700 cpu
I don't have any "before" data, just the current energy report
Attachments
Timer.PNG
Timer.PNG (12.48 KiB) Viewed 9976 times
Energy.PNG
Energy.PNG (20.64 KiB) Viewed 9976 times
73
Ruben
NB4R
Apache-Labs Anan 7000DLE MKII Black -- Thetis 2.10.3.6 dev_2 -- Windows 11
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 3:58 pm

I'm no expert but looks like voicemeeter has been affected also.
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 4:16 pm

rbduck wrote:Here is data from my system. I was able to run rock solid 8ms in and out before the upgrade. Now I can go no less than 50ms before I get endless underflows and overflows. I'm running an Intel I7 9700 cpu
I don't have any "before" data, just the current energy report


First of all, thanks for the report, but unfortunately there is no info about your current Timer resolution on you Powercfg screenshot, I just can see your 1ms request. Check also in the "white part of the report to see if it is there. (sometimes it appears in the yellow part, and sometimes in the white one).

Please check further in the report to find the current resolution and please post it!
Last edited by ea3aqr on Tue May 04, 2021 4:25 pm, edited 2 times in total.
New call sign EA3CL
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 4:18 pm

Tony EI7BMB wrote:I'm no expert but looks like voicemeeter has been affected also.


Not just voicemeter... look like most, if not all, resolution requests are ignored by the OS. :shock:
New call sign EA3CL
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Tue May 04, 2021 7:31 pm

I have tried going back to previous version of windows and although the process seemed to go ok the problem remains.
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Tue May 04, 2021 9:00 pm

Tony EI7BMB wrote:I have tried going back to previous version of windows and although the process seemed to go ok the problem remains.


Windows 10 v. 1903?
New call sign EA3CL
User avatar
rbduck
Posts: 327
Joined: Tue Dec 03, 2019 1:49 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby rbduck » Tue May 04, 2021 9:10 pm

ea3aqr wrote:
rbduck wrote:Here is data from my system. I was able to run rock solid 8ms in and out before the upgrade. Now I can go no less than 50ms before I get endless underflows and overflows. I'm running an Intel I7 9700 cpu
I don't have any "before" data, just the current energy report


First of all, thanks for the report, but unfortunately there is no info about your current Timer resolution on you Powercfg screenshot, I just can see your 1ms request. Check also in the "white part of the report to see if it is there. (sometimes it appears in the yellow part, and sometimes in the white one).

Please check further in the report to find the current resolution and please post it!



Here it is with all the info. I've tried all power modes and same results with them all.

Image
Image
Image
73
Ruben
NB4R
Apache-Labs Anan 7000DLE MKII Black -- Thetis 2.10.3.6 dev_2 -- Windows 11
User avatar
w-u-2-o
Posts: 5540
Joined: Fri Mar 10, 2017 1:47 pm

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby w-u-2-o » Tue May 04, 2021 10:49 pm

Many times a Windows update will damage audio drivers. I've lost count of the number of times I've had to reinstall Voicemeeter. If you are rolling back without any improvement you might consider an uninstall/reboot/reinstall/reboot cycle for any relevant audio drivers.
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Wed May 05, 2021 7:08 am

ea3aqr wrote:
Tony EI7BMB wrote:I have tried going back to previous version of windows and although the process seemed to go ok the problem remains.


Windows 10 v. 1903?


Windows 10.0.18363 Build 18363
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Wed May 05, 2021 7:28 am

Yeah I've done that in the past with success . Re installing voicemeeter and its components did not help but I found a recent MOTU driver which I've installed so will see if that makes any difference.

Scott am I right in thinking that you are not seeing the warnings in /Windows/system32/energy-report.html ?

w-u-2-o wrote:Many times a Windows update will damage audio drivers. I've lost count of the number of times I've had to reinstall Voicemeeter. If you are rolling back without any improvement you might consider an uninstall/reboot/reinstall/reboot cycle for any relevant audio drivers.
User avatar
Tony EI7BMB
Posts: 651
Joined: Sun Apr 09, 2017 2:31 pm
Location: Dublin
Contact:

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby Tony EI7BMB » Wed May 05, 2021 7:57 am

Driver update made no difference . I've enabled HPET as a test but right now I have to run a buffer size of 2048 and buffer latency of 60ms to stop overflows/underflows
ea3aqr
Posts: 270
Joined: Mon Mar 04, 2019 10:50 pm
Location: BCN

Re: VAC under/overflows due to changes in how Windows handles Timer resolution

Postby ea3aqr » Wed May 05, 2021 9:23 am

Linked in the first post, it is a must read document! (including all comments).

This is the explanation of all the problems after W10 v.1903

https://randomascii.wordpress.com/2020/10/04/windows-timer-resolution-the-great-rule-change/
New call sign EA3CL

Return to “Digital ("Virtual") Audio”