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: Fri, 10 Jul 2009 10:40:39 -0700
In either setting (zeroing time stamps or not) It does provide the
host time that was associated with the buffer you are producing data
for (output time stamp in the HAL's ioProc). You can also translate
this to the sample counter of the device by using the AudioDevice
translate time services (or do as Jeff suggested)
If you are doing input with AUHAL, the callback that is fired to you
(to tell you that input is available) is passed the inInputTime time
stamp (the sample count is never reset on this time stamp in this
context).
There's no direct access to the now time stamp using AUHAL that I can
see
Bill
On Jul 10, 2009, at 10:15 AM, Jeff Moore wrote:
On Jul 9, 2009, at 9:40 PM, Ross Bencina wrote:
We're using AUHAL in PortAudio and we need to report current time
and timestamps for when the first sample of each buffer is received
from/enters the hardware. My research suggests that when using HAL
directly we could use the mHostTime fields of the inNow,
inInputTime and inOutputTime parameters of AudioDeviceIOProc:
typedef OSStatus (*AudioDeviceIOProc)(
AudioDeviceID inDevice,
const AudioTimeStamp*inNow,
const AudioBufferList*inInputData,
const AudioTimeStamp*inInputTime,
AudioBufferList*outOutputData,
const AudioTimeStamp*inOutputTime,
void*inClientData);
However, the AUHAL render proc looks like this:
OSStatus AudioIOProc( void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData );
I can't find documentation for what inTimeStamp means in this
context. Could someone please clarify the meaning of it for me?
AUHAL has it's own management of it's timeline so that it can do
things like account for dropped samples due to overloads or other
changes in state, not to mention any rate conversion that it might
be doing. To get it to pass along the HAL's timestamps, you can set
the property, kAudioOutputUnitProperty_StartTimestampsAtZero, to
false.
More importantly, we need access to all three HAL timestamps (now,
inputTime, outputTime). So my question is: how can I recover these
three HAL timestamps from within my AUHAL render proc?
I don't believe that AUHAL provides any access to the now time stamp.
--
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