Re: Setting the AudioChannelLayout for an aggregate output device
Re: Setting the AudioChannelLayout for an aggregate output device
- Subject: Re: Setting the AudioChannelLayout for an aggregate output device
- From: Jeff Moore <email@hidden>
- Date: Wed, 30 Jan 2008 12:52:06 -0800
On Jan 30, 2008, at 12:43 PM, Dave Addey wrote: I’m trying to set the audio channel layout of an aggregate output device via code, and as yet I can’t work out how to do so.
Whenever I create a new aggregate device with a never-before-used name, it reports a preferred channel layout of the correct number of channels, each with a channel label of kAudioChannelLabel_Unknown. I can change this via Audio MIDI Setup, but ideally I want to do this behind the scenes since it is a custom aggregate device being created (and destroyed) for one application’s needs.
I have tried creating an audio unit of subtype kAudioUnitSubType_HALOutput, setting its current device to be the aggregate device, and then trying the kAudioUnitProperty_AudioChannelLayout property, but I get an error whenever I try and get or set this property for the output scope of the audio unit. (I can’t set it for the input scope either).
I can see why normally you wouldn’t want code to mess with a device’s layout, but in the case of an aggregate device it would be very handy. Is this possible to do without resorting to Audio MIDI Setup? If AMS can do it, can we do so too?
The HAL uses the device property, kAudioDevicePropertyPreferredChannelLayout, to store the preferred channel layout for a device. You should be able to use this property with the output scope of your instance of AUHAL.
(One other note: if I create another aggregate device with the same name, it seems to inherit the audio channel layout from the last time an aggregate with that name was created. Is this deliberate?)
I would view this behavior as a bug. Please file it in Radar. Thanks!
--
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