ios - Why can't I change the number of elements / buses in the input scope of AU multi channel mixer? -
update: i'm changing code illustrate issue in more streamlined way. had little bug which, while not deterring problem, did add confusion.
i'm instantiating multi channel mixer au in ios (kaudiounitsubtype_multichannelmixer) , 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); // can try initializing unit before or after attempt set input bus count. // doesn't matter; won't work either way. audiounitinitialize(mixer); // number of inputs uint32 bussize = sizeof(uint32); uint32 buscount = 0; status = audiounitgetproperty(mixer, kaudiounitproperty_elementcount, kaudiounitscope_input, 0, &buscount, &bussize); nslog(@"au 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); // number of inputs buscount = 0; status = audiounitgetproperty(mixer, kaudiounitproperty_elementcount, kaudiounitscope_input, 0, &buscount, &bussize); nslog(@"au 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); // number of inputs buscount = 0; status = audiounitgetproperty(mixer, kaudiounitproperty_elementcount, kaudiounitscope_input, 0, &buscount, &bussize); nslog(@"au input bus count | status: %li | count: %lu", status, buscount);
and 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 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 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 input bus count | status: 0 | count: 10
i'd expect bus count not 8 default (since audio unit documentation doesn't there default value on instantiation) , i'd expect able change number of input elements both less , more 8 matter (since docs can have "any" number of inputs). however, output, attempting set input count less 8 nothing; can set more 8.
i talked apple engineer part of coreaudio team , showed him code , agreed bug. tried out himself , got same results me: unit seems instantiated 8 inputs default , can set number more 8 not less (yes, code showed 2 inputs cause messing , dividing 8/4 -- thanks).
he told me file radar did. # 15214291.
Comments
Post a Comment