When interfacing with hardware audio devices, Core Audio allows you to add an additional level of abstraction, creating aggregate devices which combine the inputs and outputs of multiple devices to appear as a single device. For example, if you need to accommodate five channels of audio output, you can assign two channels of output to one device and the other three to another device. Core Audio automatically routes the data flow to both devices, while your application can interact with the output as if it were a single device. Core Audio also works on your behalf to ensure proper audio synchronization and to minimize latency, allowing you to focus on details specific to your application or plug-in.
Users can create aggregate devices in the Audio MIDI Setup application by selecting the Audio > Open Aggregate Device Editor menu item. After selecting the subdevices to combine as an aggregate device, the user can configure the device’s input and output channels like any other hardware device. The user also needs to indicate which subdevice’s clock should act as the master for synchronization purposes.
Any aggregate devices the user creates are global to the system. You can create aggregate devices that are local to the application process programmatically using HAL Services function calls. An aggregate device appears as an AudioAggregateDevice object (a subclass of AudioDevice) in the HAL.
Note: Aggregate devices can be used to hide implementation details. For example, USB audio devices normally require separate drivers for input and output, which appear as separate AudioDevice objects. However, by creating a global aggregate device, the HAL can represent the drivers as a single AudioDevice object.
An aggregate device retains knowledge of its subdevices. If the user removes a subdevice (or configures it in an incompatible manner), those channels disappear from the aggregate, but those channels will reappear when the subdevice is reattached or reconfigured.
Aggregate devices have some limitations:
All the subdevices that make up the aggregate device must be running at the same sampling rate, and their data streams must be mixable.
They don’t provide any configurable controls, such as volume, mute, or input source selection.
You cannot specify an aggregate device to be a default input or output device unless all of its subdevices can be a default device. Otherwise, applications must explicitly select an aggregate device in order to use it.
Currently only devices represented by an IOAudio family (that is, kernel-level) driver can be added to an aggregate device.
Last updated: 2007-01-08