Re: Multiple RemoteIO
Re: Multiple RemoteIO
- Subject: Re: Multiple RemoteIO
- From: Lucas Goossen <email@hidden>
- Date: Mon, 18 Apr 2016 07:02:00 -0500
Jonatan, you and Micheal are an inspiration. I am constantly in aw of the amount and quality of your work!
I did figure out what my mistake was. Turns out the MatrixMixer doesn’t like the result of a render call on a RIO that is not started being fed into one of its inputs. Makes sense! So the right way to do it is disable the input on the matrix mixer then make the connection and register for notification on IAA connection. Upon connection start the RIO then enable the MatrixMixer input.
> On Apr 16, 2016, at 7:03 AM, Jonatan Liljedahl <email@hidden> wrote:
>
> Hi Lucas,
>
> That's right. One AUGraph can only have a single RIO unit.
>
> However, you can have multiple AUGraphs if you wish, but I'm not sure
> that would be the simplest approach in your case.
>
> Personally I don't use AUGraph, but just the plain render callback to
> provide audio for the RIO unit, and then calling AudioUnitRender()
> within that render callback to pull audio input from hardware or IAA
> host, or to render other AU's (hosted IAA nodes or AU extensions,
> Apple's built-in AU's, etc)
>
> You might also want to check out the new TAAE2 audio engine:
> https://github.com/TheAmazingAudioEngine/TAAE2
>
> Cheers
> /Jonatan
>
> On Sat, Apr 16, 2016 at 3:30 AM, Lucas Goossen <email@hidden> wrote:
>> Thank you Jonatan,
>>
>> You gave me confidence that it was doable so then I tested without AUGraph
>> which I was using.
>>
>> So… I feel like I don’t understand something about how AUGraph works. I want
>> to just say what I have tried.
>>
>> AUGraph flat out refuses to add a second RIO so I create the second RIO
>> independent of the graph.
>>
>> Setup 1:
>>
>> AUGraph Containing:
>>
>> RIO -> MatrixMixer -> RIO
>>
>>
>> Completely independent of AUGraph
>>
>> RIO2 ->RIO2
>> RIO2 registered for IAA via a ABFilterPort
>>
>>
>> Result I get is that both streams flow as expected.
>>
>>
>> Setup 2:
>> AUGraph Containing:
>>
>> RIO -> MatrixMixer(Bus0) -> RIO
>> RIO2 -> MatrixMixer(Bus1) -> RIO2
>> RIO2 registered for IAA via a ABFilterPort
>>
>> RIO2 setup independent from the graph then render callbacks to connect to to
>> MatrixMixer
>>
>>
>> Result is no audio flow on the first stream when starting the graph but as
>> soon as an IAA connection is made to RIO2 audio starts flowing for both
>> streams.
>>
>> There is actually quite a bit more complexity in the audio engine so I am
>> going to work on creating a stripped down test app to be able to post and
>> double check that I can reproduce in a simpler setup.
>>
>> I just wanted to ask if anyone was aware that using the graph this way is
>> not allowed?
>>
>>
>>
>> On Apr 15, 2016, at 4:25 AM, Jonatan Liljedahl <email@hidden> wrote:
>>
>> Date: Thu, 14 Apr 2016 09:35:04 -0500
>> From: Lucas Goossen <email@hidden>
>> To: CoreAudio API <email@hidden>
>> Subject: Multiple RemoteIO
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset=us-ascii
>>
>> I would like to be able to have access to hardware while simletaiously
>> registering a remoteIO with IAA. I know this is possible becasue Audiobus
>> does this when you create a ABFilterPort with processBlock. The filter port
>> created has its own remoteIO that it uses for IAA under the hood, but I can
>> still use my own remoteIO for hardware. When I try to replicate this myself
>> by the whole AudioComponentFindNext - AudioComponentInstanceNew sequence the
>> second remoteIO seems to kill the first. What am i missing?
>>
>>
>> Yes, this is totally possible, and it's what I do in my app AUM - Audio
>> Mixer:
>>
>> I have a main RIO unit for hardware I/O, that I never publish as an
>> IAA connectable node.
>>
>> AudioComponentDescription cd = {kAudioUnitType_Output,
>> kAudioUnitSubType_RemoteIO, kAudioUnitManufacturer_Apple, 0, 0};
>> AudioComponent comp = AudioComponentFindNext(NULL, &cd);
>> OSStatus status = AudioComponentInstanceNew(comp, &unit);
>> etc...
>> And don't forget to AudioUnitInitialize() your unit.
>>
>> I set the client-side streamFormat to non-interleaved float, with the
>> same number of input/output channels as the currently connected
>> hardware route.
>>
>> Also I add a property listener on kAudioUnitProperty_StreamFormat to
>> be able to observe sample rate and channel-count changes and sync the
>> client-side stream format to avoid automatic sample-rate conversion by
>> the system. Also the usual enable IO for both input and output using
>> kAudioOutputUnitProperty_EnableIO, set
>> kAudioUnitProperty_MaximumFramesPerSlice to 4096, and set my main
>> render callback with kAudioUnitProperty_SetRenderCallback.
>>
>> Then, I create 8 additional RIO units for my IAA output ports:
>>
>> Same thing to create RIO units for these, except I disable input since
>> they are output ports and not filter ports. The render callback for
>> these units provide the audio to the host. I set the stream format to
>> stereo float using the current sample rate (and in the main RIO unit
>> StreamFormat listener callback I update the format on these IAA units
>> as well!)
>>
>> Then I publish the IAA units, if using Audiobus this is taken care of
>> by creating an ABSenderPort for each unit and adding it to the
>> audiobusController.
>>
>> I have some various developer notes regarding iOS audio and IAA here:
>> http://lijon.github.io
>>
>> Important stuff regarding multiple IAA ports:
>> http://lijon.github.io/iaa_quirks.html
>>
>> And how sample rates and stream formats work in IAA (there's actually
>> a chain of 3 different streamFormats, with 2 potential places for
>> sample rate conversion, in each direction of the host<->node audio
>> signal flow): http://lijon.github.io/iaa_sample_rates.html
>>
>> --
>> /Jonatan
>> http://kymatica.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
>>
>>
>
>
>
> --
> /Jonatan
> http://kymatica.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