Solution to Audio glitches/How to Ensure General Real-time Performance


  1. Posts : 4
    Win10, Win7, XP emulated
       #1

    Solution to Audio glitches/How to Ensure General Real-time Performance


    Dear Ten Forums,

    If you've been struggling with audio glitches on a Windows 10 system with an adequately powerful laptop (8Gb of ram, processor N5000 is fast enough), I may have the solution. I take it you've tried the pretty useless audiotroubleshooter - deleting and re-installing drivers, turning off enhancements, going to the manufacturer's website to download the correct drivers to no avail. I suggest doing a deep virus scan first with say Windows Defender and something like Malwarebytes (google it),

    1. First identify the problem

    (You can skip this and go ahead to the solution, if you want.)

    If you tried all that, google "LatencyMon" and install it. This brilliant tool will let you see what drivers and interrupts are causing sound problems on your system. Mostly likely you'll find ACPI.sys (to do with battery monitoring) or the mysterious "wdf01000.sys". I've seen ACPI.sys take up to 0.2 seconds supposedly doing an interrupt routine (more an "imposition" routine).

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp2.jpg

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp3.jpg

    Microsoft or the manufacturers don't look like they'll get around to fixing these problems, hell, they'll fix it one Windows update and then in two weeks "unfix" it, as happened to me when I did an update for Windows 10 early 2021.

    If you observe this, I suggest trying the simple fixes below.

    2. This solution may be applicable to Windows 10 and Windows 7, even other versions.

    Some software is broken so my solution is to isolate it onto a particular core.

    ACPI.sys and wdf01000.sys seem to either run on all cores or default to core 0 or core 0/1 - as do the other processes.
    You can try typing tasklist /SVC into a cmd prompt and scroll through the list to find the svchost.exe processes, which are a kind of container for all the sys files running. You'll see the process ID number and then a list of the sys files running in that process. Some of the names maybe slightly different, i.e. ACPI.sys might just be called "Power".

    You can either set the affinity (more on that later) for the services audiosrv and audioendpointbuilder to specific cores or set the affinity for ACPI.sys and wdf01000.sys, I prefer the former.

    Start up taskmanager (taskmgr.exe) and you'll probably need to be Administrator and go to the services tab:

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp1.jpg

    There look for Windows Audio and Windows Audio Endpoint Builder. Right click on one, then the other to "Go to detail". Under Windows 7 that may be called "Go to process".

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp4.jpg

    You'll be taken to the running process tabs

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp5.jpg

    Where you right click on the process that has been highlighted and chose "Set affinity". There choose the other cores as invariably microsoft puts interrupts on core 0 or 1 (or all cores, we'll come back to this point shortly), thus giving the audio services a fair crack of the whip when it comes to running on time.

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp6.jpg


    Now as mentioned you can do the converse and limit ACPI.sys and other errant drivers (or maybe I should say, not well coded drivers) to a particular core but you will need to use tasklist /SVC and sift through the data it provides:

    Solution to Audio glitches/How to Ensure General Real-time Performance-tmp7.jpg

    There you can see that I have probably located the instance of ACPI.sys running and then I can take note of the process ID and do the same thing in task manager, set the affinity and limit it to a particular core.

    This may all be fine and dandy but you say, each time I reboot, I have to go through this rigmarole. Well it's not that difficult to do, I tend to leave my computer booted for weeks and just sleep it or hibernate it. If you want a permanent fix, there are alternatives to task manager which can remember your settings for processes, just google it.

    By this method of just setting the affinity of the audio services to their own cores, I have seen a drastic improvement in sound quality. I could make it even better by limiting the other services to core 0 (they seem to be default to run on all cores) but that is a more complicated variation of what is above - you have to identify the likely process containing the sys file running from the screenload that tasklist /SVC gives you.

    Hope that helps.

    - - - Updated - - -

    Method has general applicability to errant (badly coded) drivers -

    Isolate them onto one core so that they don't affect the real time performance of the rest of your system with random glitches. If they can potentially run on any core, they might clash with your process, should it be scheduled for the same core. By deterministically setting which core it runs on and putting your other code on to the other cores, there is little chance that a poorly written interrupt routine can de-schedule your code.
    Last edited by RemC; 29 Apr 2021 at 19:27. Reason: General applicability of the solution to ensure real-time performance
      My Computer


  2. Posts : 4
    Win10, Win7, XP emulated
    Thread Starter
       #2

    wdf01000.sys Windows Driver Foundation and audio


    Adding to what I wrote a few months ago, the process that loads the driver wdf01000.sys "Windows Driver Foundation" is WUDFHost.exe, usually found here C:\Windows\System32\WUDGHost.exe

    Just do the usual thing in task manager (and if you have System Explorer, a suped-up task manager you can search for, it will remember your settings) and set the affinity on this process to processors where you audio stuff isn't running. For instance I put Power ACPI and WUDGHost.exe on cores 1 and 2 and my audio stuff on cores 3 and 4 (I could probably get by with just one dedicated core for audio).

    What to look for in task manager Solution to Audio glitches/How to Ensure General Real-time Performance-wdf.png
    What to look for in System Explorer (you'll need to download this program) Solution to Audio glitches/How to Ensure General Real-time Performance-systemexplorer.jpg
      My Computer


  3. Posts : 1
    Windows 11
       #3

    Thank you! So far it seems to be working on my Lenovo laptop running windows 11. I was really quite unhappy, having finally saved for a new laptop for audio production, only to not know about how rotten the latency is on some otherwise great laptops.
    Please update with anything more you learn over time.
      My Computer


  4. Posts : 1
    Win 11 Mac
       #4

    Is there a way to have the affinity set and survive a reboot?
      My Computer


  5. Posts : 1
    Windows 10
       #5

    THANK YOU! This is the ONLY thing worked for me and I have tried so many things to eliminate issues with the audio when I'm playing VST instruments on any of my windows computers. I never really understood until now that you can buy a top of the line Windows PC and endlessly suffer from audio dropout. It really is just poorly written drivers. Forcing audio processes to run on different cores than the cores that the poorly written drivers run on is incredibly simple compared to trying to fix every instance of high DPC latency. In my experience, even if you are somehow able to address all of your DPC latency issues, anything can happen after a single Windows update to bring those issues back. Using this trick, I'm now getting low latency, pristine audio on a $100 refurbished desktop that is 10 years old!

    I don't think it is possible to preserve Affinity setting across a reboot, but I plan on writing a batch script to do it for me when I start my PC. And I think I will probably just experiment with asking ChatGPT to write that batch script for me, LOL.

    Thank you RemC !!!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:26.
Find Us




Windows 10 Forums