Multiple audio input devices

Hi,

I’m working on an app that uses multiple audio input devices at the same time and I’m running into a couple of issues, at the moment I’m developing on mac, but I’m planning to port it to windows too.

The first input device works fine, but when I try to open another input something goes wrong and the app either crash or gets stuck.

I tried to replicate the issue with the InputAnalyzer sample using the mouseDown to open a new input device and create the monitor spectral node, both objects are store in vectors. The app consistently crash, sometimes I can create a couple of nodes, sometimes it crash immediately.
I’m not completely sure, but it seems asio doesn’t like when I pipe the input device into the spectral monitor.

Is it possible to open, close and use multiple input devices at the same time?

EDIT:
I think I found at least the call that’s hanging. When I connect the input to the monitor, InputDeviceNodeAudioUnit::initialize() calls findAndCreateAudioComponent() in CinderCoreAudio.cpp

The app freeze on this call (CinderCoreAudio.cpp #227):
OSStatus status = ::AudioComponentInstanceNew( component, componentInstance );

thanks.

AFAIK Apple Core Audio only supports one input device and one output device at a time to have the property kAudioOutputUnitProperty_CurrentDevice. There might be a way to have more than one but I don’t know how. I’d recommend creating an aggregate device that makes your multiple inputs (or outputs) appear as one, then use that in your cinder app.

On Windows, multiple input devices has been tested and works. Multiple outputs are still on the Todo list and have been discussed a bit on these forums and github issues.

1 Like