Audio "hickups" when events occur


#1

I have a little application running (Win XP) that streams audio via the audioDeviceIOCallback function. However, I get “hickups” (sounds like the same buffer of the audioDeviceIOCallback function gets played several times) when for instance I get a Skype message, minimize/restore windows etc. And this in release code with a minimal CPU usage of the application (<1%). A guess is that the audioDeviceIOCallback is not called in time so that the sound output buffer gets played again because of data starving. Any idea as to what might cause this?

Thanks
/R


#2

Forgot, it is DirectSound that I’m using…


#3

DSound uses a thread to render, so if it gets blocked for too long, that’d cause a hiccup. In tracktion I boost the priority of the app with Process::setPriority() to avoid other tasks from getting in its way.


#4

I tried boosting up to “Real time” priority (using Sysinternals ProcessExplorer). The problem still remains. As soon as a window (any window) is minimized to task bar, or restored, the audio “hiccups”. iTunes for example can not be stressed to hiccup. DSound is used in both cases.

/R


#5

Maybe itunes is using a larger buffer size?

Not much else you can do, other than setting the thread and process priorities to high. Are you sure it’s the playback stage that’s glitching, and not some other thread that’s generating the audio to be played?


#6

[quote=“jules”]Maybe itunes is using a larger buffer size?

Not much else you can do, other than setting the thread and process priorities to high. Are you sure it’s the playback stage that’s glitching, and not some other thread that’s generating the audio to be played?[/quote]

By replacing my code with your tone generator, I could see that it was my code that was the problem. Quite some digging later, a triggerAsyncUpdate() in the audio thread caused the problems. By moving all timed updates into a Thread, the problem was resolved. Phew! Jules, I have to tell 'ya, you’ve done some great job on JUCE here…

/R


#7