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: William Stewart <email@hidden>
- Date: Mon, 27 Jul 2009 11:41:30 -0700
On Jul 27, 2009, at 11:27 AM, Jeff Moore wrote:
On Jul 27, 2009, at 12:12 AM, Ross Bencina wrote:
Jeff Moore wrote:
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
Thanks, I seem to be getting somewhere now...
and for the input case is it:
scheduled IoProcTime - [kAudioDevicePropertySafetyOffset] -
[kAudioDevicePropertyBufferFrameSize] == inInputTime->mSampleTime
scheduled IoProcTime - [kAudioDevicePropertySafetyOffset] -
[kAudioDevicePropertyBufferFrameSize] -
[kAudioDevicePropertyLatency]
== analog voltage input at ADC time
(?)
This is correct. Make sure that when you are querying the latency
and safety offset properties that you are doing so on the proper
scope since a device can have different latency and safety offset
for input and output.
Now, with a full duplex HAL AU component I only get one timstamp,
which I assume is the output timestamp. So I guess I can work
backwards from the output time to get scheduled IoProcTime and from
there the ADC time.
True, but I thought the output AU had a means for conveying the
input time stamp too, although I don't know what the API for doing
it is.
its in the callback that you add when you enable input - AUHAL gives
you a callback to tell you that input is available, so you then call
AudioUnitRender to get the input. The time stamp provided in the
callback is the time stamp from the HAL for the input time
Another question: Can I rely on AudioTimeStamp::mSampleTime and
AudioTimeStamp::mHostTime always being valid in a HAL and AU HAL
ioProc?
Yes. I believe it would be a bug if that were not true.
--
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
_______________________________________________
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