UPDATE: I'm changing my code to illustrate the issue in a more streamlined way. Also I had a little bug which, while not deterring from the problem, did add some confusion.
I'm instantiating a Multi Channel Mixer AU in iOS (kAudioUnitSubType_MultiChannelMixer) and I do the following:
OSStatus status = noErr;
// Set component type:
AudioComponentDescription cd = {0};
cd.componentType = kAudioUnitType_Mixer;
cd.componentSubType = kAudioUnitSubType_MultiChannelMixer;
cd.componentManufacturer = kAudioUnitManufacturer_Apple;
// Alloc unit:
AudioComponent defaultOutput = AudioComponentFindNext(NULL, &cd);
AudioUnit mixer;
status = AudioComponentInstanceNew(defaultOutput, &mixer);
NSLog(@"AU init status: %li", status);
// You can try initializing the unit before or after the attempt to set its input bus count.
// It doesn't matter; it won't work either way.
AudioUnitInitialize(mixer);
// Get number of inputs
UInt32 busSize = sizeof(UInt32);
UInt32 busCount = 0;
status = AudioUnitGetProperty(mixer,
kAudioUnitProperty_ElementCount,
kAudioUnitScope_Input,
0,
&busCount,
&busSize);
NSLog(@"AU get input bus count | status: %li | count: %lu", status, busCount);
// Try setting number of inputs
busCount = 3;
status = AudioUnitSetProperty(mixer,
kAudioUnitProperty_ElementCount,
kAudioUnitScope_Input,
0,
&busCount,
busSize);
NSLog(@"AU set input status: %li", status);
// Get number of inputs
busCount = 0;
status = AudioUnitGetProperty(mixer,
kAudioUnitProperty_ElementCount,
kAudioUnitScope_Input,
0,
&busCount,
&busSize);
NSLog(@"AU get input bus count | status: %li | count: %lu", status, busCount);
// Try setting number of inputs
busCount = 10;
status = AudioUnitSetProperty(mixer,
kAudioUnitProperty_ElementCount,
kAudioUnitScope_Input,
0,
&busCount,
busSize);
NSLog(@"AU set input status: %li", status);
// Get number of inputs
busCount = 0;
status = AudioUnitGetProperty(mixer,
kAudioUnitProperty_ElementCount,
kAudioUnitScope_Input,
0,
&busCount,
&busSize);
NSLog(@"AU get input bus count | status: %li | count: %lu", status, busCount);
And I get the following output:
2013-10-11 19:54:32.248 AUMultiChannelRadar[3996:a0b] AU init status: 0
2013-10-11 19:54:32.249 AUMultiChannelRadar[3996:a0b] AU get input bus count | status: 0 | count: 8
2013-10-11 19:54:32.250 AUMultiChannelRadar[3996:a0b] AU set input status: 0
2013-10-11 19:54:32.250 AUMultiChannelRadar[3996:a0b] AU get input bus count | status: 0 | count: 8
2013-10-11 19:54:32.250 AUMultiChannelRadar[3996:a0b] AU set input status: 0
2013-10-11 19:54:32.251 AUMultiChannelRadar[3996:a0b] AU get input bus count | status: 0 | count: 10
I'd expect the bus count to not be 8 by default (since the Audio Unit documentation doesn't say there is a default value on instantiation) and I'd expect to be able to change the number of input elements to both less and more than 8 for that matter (since the docs say it can have "Any" number of inputs). However, from the output, attempting to set the input count to less than 8 does nothing; I can only set it to more than 8.