Closed kinetiknz closed 4 years ago
I do, but my macbook is also a 2018.
It's not clear to me the correct way to handle this situation. Whether it's correct or not, I noticed that other code querying
kAudioUnitProperty_AudioChannelLayout
often treatsAudioChannelLayout.mNumberChannelDescriptions
<= 2 as special and forces mono/stereo examining the AudioChannelDescriptions only for the > 2 case.
Actually, that's what we currently do. We force the 1-channel and 2-channel layout to be mono and stereo: https://github.com/ChunMinChang/cubeb-coreaudio-rs/blob/e8b8a052d8ce716c6a6f846d3a6fd4deea2d5ed8/src/backend/mixer.rs#L199-L206
I think we can simply remove the hardcode predefined values in the test.
On a mid-2018 MacBook Pro (MacBookPro15,1 running 10.14) using the default speakers,
test_get_current_channel_layout_output
andtest_get_preferred_channel_layout_output
fail with:For whatever reason, the AudioChannelLayout queried via
AudioUnitGetProperty(kAudioUnitProperty_AudioChannelLayout)
appears to be valid/correctly initialized (52 bytes) but is mostly filled with zero values:...which results in
audiounit_convert_channel_layout
returning aVec
of[mixer::Channel::Silence, mixer::Channel::Silence]
, causing the tests expecting[mixer::Channel::FrontLeft, mixer::Channel::FrontRight]
to fail.It's not clear to me the correct way to handle this situation. Whether it's correct or not, I noticed that other code querying
kAudioUnitProperty_AudioChannelLayout
often treatsAudioChannelLayout.mNumberChannelDescriptions
<= 2 as special and forces mono/stereo examining the AudioChannelDescriptions only for the > 2 case.FWIW,
kAudioUnitProperty_SupportedChannelLayoutTags
in the same context returnskAudioUnitErr_InvalidProperty
.Chun-Min mentioned that @padenot has seen the same issue on a 2019 MBP.