Re: IOProc and AudioStreams
Re: IOProc and AudioStreams
- Subject: Re: IOProc and AudioStreams
- From: Jeff Moore <email@hidden>
- Date: Mon, 06 Oct 2008 10:49:40 -0700
On Oct 4, 2008, at 6:28 AM, Russell Edwards wrote:
Firstly thanks to those that replied to my previous thread. Having
got that little bit of code going i've now started to write code to
get audio data form my audio card; and have successfully tied myself
in knots.
As I said in my previous thread I'm using the old audio on os x
guide form 2001 as this is the only documentation that I have
managed to find that mentions the HAL in any detail other than "the
HAL exists but we want you to use audio units (AUHAL)". If i have
missed some really obvious documentation I apologize, but can you
please point me to it.
There's a reason for this that basically boils down to us not
recommending that developers use the HAL directly.
So, I guess my first question is why _aren't_ you following this
advice? Using AUHAL is a much better solution for 999/1000
applications out there.
I think I understand the encapsulation behind Audio Streams my
problem comes in creating them, and then getting data from them?
From what I understand all audio data is presented to an IOProc for
processing.
Clearly, you do not understand AudioStreams because applications do
not create them. The exist independently of your application which
merely accesses them through the HAL's API.
As an example lets say my application needs a mono input on channel
1 and a stereo input on channels 3,4. And a stereo output on
channels 1,2 and two mono outputs on channels 3, 4.
I know how to find the hardware and register an IOProc (if that is
required) with my chosen audio device. But how do I go about
creating the two input streams and 3 output streams and then telling
them to send their data to the IOProc? If of cause that is how you
do it? Or would you just create a 3 channel input stream and a 4
channel output? Or something completely different again?
Basically, applications do none of that. The HAL is there to provide
access to the audio device on the device's terms. It is entirely up to
you and your application to make sense of that.
This is one of the areas where using AUHAL can really help you out,
especially if you combine it with one of our mixer AUs to handle the
routing you want to do.
Another problem comes in the IOProc so far I have only found the
ability to add an IOProc to a device and not a stream. If this is
the case I take it that the data too and from each device from all
the streams is presented in the AudioBufferLists passed too and from
the IOProc as separate buffers?
This is the first true statement you've made so far. Sadly, it
probably means you've been spinning your wheels on problems that AUHAL
solves for you.
But how do I know which buffer corresponds to which stream?
The AudioBuffers in the ABL are presented in the order the streams are
in and streams are ordered by kAudioStreamPropertyStartingChannel.
--
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