Re: how to access HAL buffer timestamps when using AUHAL?
Re: how to access HAL buffer timestamps when using AUHAL?
- Subject: Re: how to access HAL buffer timestamps when using AUHAL?
- From: Jeff Moore <email@hidden>
- Date: Wed, 22 Jul 2009 11:16:20 -0700
On Jul 21, 2009, at 9:23 PM, Ross Bencina wrote:
Thanks Jeff...
Is there any way to query CoreAudio for the hardware latency?
e.g. the time
difference from when a sample enters the audio hardware at
inOutputTime->mHostTime to when it appears as a voltage or optical
impulse
on the physical output?
The HAL provides the properties kAudioDevicePropertyLatency and
kAudioStreamPropertyLatency. The latency for any particular channel
on an audio device is the sum of the device latency and the
latency of the stream the channel is in.
Sorry, just to check that I understand, for audio output, are these
invariants correct?
inNow->mHostTime - scheduling jitter == scheduledIoProcTime
This is correct, more or less. There is some overhead between when the
thread starts running and the HAL actually makes the reading of the
time. But the scheduling latency is the dominant effect to be sure
though.
scheduled IoProcTime + [kAudioStreamPropertyLatency] == inOutputTime-
>mHostTime
scheduled IoProcTime + [kAudioStreamPropertyLatency] +
[kAudioDevicePropertyLatency] == analog voltage output from DAC time
These, however, are not correct.
The output time would be (using your terminology, but counting in
samples, since that's what most of the relevant values are measured in):
scheduled IoProcTime + [kAudioDevicePropertySafetyOffset] +
[kAudioDevicePropertyBufferFrameSize] == inOutputTime->mSampleTime
scheduled IoProcTime + [kAudioDevicePropertySafetyOffset] +
[kAudioDevicePropertyBufferFrameSize] + [kAudioDevicePropertyLatency]
== analog voltage output from DAC time
--
Jeff Moore
Core Audio
Apple
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden