Re: synchronizing iMic I/O
Re: synchronizing iMic I/O
- Subject: Re: synchronizing iMic I/O
- From: Jeff Moore <email@hidden>
- Date: Wed, 16 Jul 2003 11:51:05 -0700
The current time here refers to the time returned by
AudioDeviceGetCurrentTime() for the device you want to call
AudioDeviceRead() on. The safety offset is provided by
kAudioDevicePropertySafetyOffset.
If you are basing your anchor time on the times returned by
AudioDeviceGetCurrentTime() for the device you want to call
AudioDeviceRead() on (as opposed to any of the time stamps from the
IOProc of the output device), following that recipe will work. In fact,
that is what the HAL does internally for timing the IO thread.
I can't emphasize enough that the current sample time for one device is
_not_ the current sample time for another device, even if they are the
same physical device (ie. USB). Each device operates in it's own time
space. To move between them you have to use the host times and
AudioDeviceTranslateTime() in order to get the proper sample time.
On Wednesday, July 16, 2003, at 11:10 AM, email@hidden wrote:
Is the anchor when initializing so that when you call
AudioDeviceRead(), the
inStartTime will be a valid time? (the buffer requested will
actually be in
the devices buffers) Isn't there a possiblity the time you
requested won't
be there? The description of a valid range for AudioDeviceRead() in
AudioHardware.h does not make sense (to me anyways).
current time - max buf size - safety offset to current time - safety
offset
What is "the safety offset to the current time" ?
// The valid range of time that can be read is from the current
time
minus
// the maximum buffer size minus the safety offset to the current
time
mins
// the safety offset.
thanks
Jeff
In a message dated 07/14/03 10:10:38 PM,
email@hidden writes:
The mechanism I use (suggested by Jeff Moore) is to establish an
'anchor
time' using one of the Device 'GetTime' routines (sorry I don't recall
the full prototype) during initialization.
I then increment that time by 'n' frames (buffer size) in each IOProc
(for the output device) and call AudioDeviceRead() with the updated
time.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.