Re: SampleTime
Re: SampleTime
- Subject: Re: SampleTime
- From: Jeff Moore <email@hidden>
- Date: Wed, 12 Dec 2001 11:59:32 -0800
on 12/12/01 10:15 AM, email@hidden <email@hidden> wrote:
>
If I stop and start the same device very rapidly the inNow time in the IOProc
>
and the AudioDeviceGetCurrentTime seem to continue from the last IO?
That is the expected behavior.
Stopping an IOProc is not the same as stopping the hardware. Further,
starting and stopping IOProcs are asynchronous operations (mostly). In your
case (assuming that no other process is also using that device), by
starting, stopping and starting again quickly, the hardware is coalesces
these commands and doesn't actually stop. The HAL will also coalesce these
events under certain situations as well.
I've said this before and I'll say it again: Do _not_ depend on the absolute
values in time stamps. You are sharing the device with the rest of the
system. You have no idea what other processes are doing. They could be
playing sound in which case your stopping/starting of your IOProc is only a
local event and will have no effect on stopping/starting the hardware.
Therefore, you should use the time stream you get from the device to perform
only relative operations.
I posted a more detailed response here about this sort of issue a month or
two ago. It would probably make for good reading =)
--
Jeff Moore
Core Audio
Apple