AudioHardwarePlugIn, AUHAL, and Timestamps
AudioHardwarePlugIn, AUHAL, and Timestamps
- Subject: AudioHardwarePlugIn, AUHAL, and Timestamps
- From: Chandrasekhar Ramakrishnan <email@hidden>
- Date: Sun, 22 Apr 2007 22:18:50 +0200
Hi Jeff (and the coreaudio list),
I'm working on an AudioHardwarePlugIn. My implementation works in
HALLab and AULab, but I'd like to confirm that the approach is
correct and get some help on a couple of specific problems.
The plugin is a sort of glorified reflector driver -- it takes audio
from the client app, does a bit of processing, and then sends it to
another device. Being lazy, I've implemented it using an AUHAL in the
plugin to get/send audio to/from the wrapped device. There is a
configuration application that sends the processing parameters to the
plugin via a CFMessagePort, but no audio is transmitted -- all the
DSP happens in the memory space of the plugin.
The first question is: is this all kosher or should I redesign?
Assuming the design isn't fundementally flawed, a follow-up question
is how do I generate the timestamps to send to clients of the plugin?
AFAIK, it's not possible to get at the now, input, and output
timestamps the HAL gave the AUHAL. So I'm doing the following:
output time -- timestamp provided by the AUHAL to my
AudioUnitRenderCallback
now -- AudioGetCurrentHostTime() and then use
AudioDeviceTranslateTime to get the corresponding sample time
input time -- output sample time - block size and then use
AudioDeviceTranslateTime to get the corresponding host time
(I've set kAudioOutputUnitProperty_StartTimestampsAtZero to false.)
Does this all sound good?
As mentioned above, the plugin works with many applications, but
there is a problem in programs that only use the input side of the
plugin. E.g., if I use the AUHAL and turn off the output side, the
AUHAL input callback never gets called even though the plugin is
invoking its IOProcs. Any thoughts on why this might be the case?
Thanks!
- sekhar
--
C. Ramakrishnan
Illposed Software http://www.illposed.com
_______________________________________________
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