Re: Detecting dropouts?
Re: Detecting dropouts?
- Subject: Re: Detecting dropouts?
- From: Jeff Moore <email@hidden>
- Date: Mon, 28 Jan 2002 16:40:46 -0800
on 1/28/02 4:03 PM, Jim Dolan <email@hidden> wrote:
>
One more thing about this - if I hit the kAudioDeviceProcessorOverload
>
notification, the AudioHardware.h documentation mentions that the IO cycle is
>
restarted and resynched. What exactly is resynched? Will TimeStamps in
>
subsequent IOProcs be adjusted to the new time?
Basically, this causes the HAL's internal clock to establish a new anchor
point and to zero it's sample counter. Basically, it's as if the IO thread
is just starting up again.
One other thing is that this notification also means that the HAL is going
to take a full sleep period before calling your IOProc again. This is to
prevent naughty processes from hogging the CPU in the time constraint thread
by constantly maxing out the CPU.
>
1. How do I determine how many samples were skipped?
Since the sample numbers are derived from the time stamp the driver
provides, the sample numbers will be in the same general ball park. So, the
new time minus the old time will be in the neighborhood, but probably not
very accurate. Because of the forced sleep period, it will be at least one
buffer's worth of data, though.
>
2. Is the anchor offset that I took when I stared the device is still valid?
You probably ought to take a new one. The HAL does.
--
Jeff Moore
Core Audio
Apple