Why are all my threads being momentarily paused?

PlatypusPotato 1 Reputation point
2020-08-04T16:30:08.917+00:00

Hi, I've been struggling with this for weeks. I have several audio threads in my application (they all have high priorities in the 20's from the multimedia class scheduler service). They are often held up for long periods of time (100ms, 300ms, even longer). Naturally this causes audio dropouts. Here is a shot of one from Windows Performance Analyzer:
15460-share.png

Thread 25216 is a thread where I sleep for 10ms and write a tone output to a WASAPI device, and that's all. Where I've circled, it has been suspended for about 170ms. It is not being pre-empted by higher priority threads (notice chrome.exe and the Idle thread are still running). In fact, my whole process seems to be suspended for most of this time, and other processes on the machine are fine.

Does anyone have any ideas? Thanks!

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,420 questions
{count} votes