title: Using multiple audio input devices with AVAudioEngine
body: <p>I've got several usb audio input devices connected and I want to select more than 1 of them to connect to the mixer.  The way I understand it, it will not be able to use <code>AVAudioInputNode</code> for this purpose.  </p>
  
  <p>I could accomplish this by using AVFoundation to read samples from each device and then schedule them to a player but it seems to me that this might be easier done with AVAudioUnit.  Unfortunately, I have not been able to make that work.</p>
  
  <pre><code>AudioComponentDescription desc;
  desc.componentType = kAudioUnitType_Output;
  desc.componentSubType = kAudioUnitSubType_HALOutput;
  desc.componentFlags = 0;
  desc.componentFlagsMask = 0;
  desc.componentManufacturer = kAudioUnitManufacturer_Apple;
  
  [AVAudioUnit
      instantiateWithComponentDescription:desc
                                  options:kAudioComponentInstantiation_LoadInProcess
                        completionHandler:^(AVAudioUnit *xx, NSError *error) {
  
                          AudioUnitSetProperty(xx.audioUnit, kAudioOutputUnitProperty_CurrentDevice,
                                               kAudioUnitScope_Global, 0, &amp;inputDeviceID, sizeof(inputDeviceID));
  
                          [_engine attachNode:xx];
                          AVAudioMixerNode *mixer = [_engine mainMixerNode];
                          [_engine connect:xx to:mixer format:[xx outputFormatForBus:0]];
                        }];
  </code></pre>
  
  <blockquote>
    <p>[central] 54:   ERROR:    >avae> AVAudioEngineGraph.mm:1235: AddNode:
    required condition is false: inImpl != nil &amp;&amp; !IsIONode(inAVNode)</p>
  </blockquote>
  
  <p>Any suggestions would be appreciated.</p>