(In reply to C.M.Chang[:chunmin] from comment #6) > (In reply to C.M.Chang[:chunmin] from comment #5) > > Commenting this [piece of code](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3877-3899) doesn't solve the issue, since the [`output_dev_desc.mChannelsPerFrame`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3918) (and [`output_hw_desc.mChannelsPerFrame`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3802)), on my [Cubilux Surround Sound Card (CA7)](https://www.cubilux.com/products/7-1-5-1surround-sound-crad), reports `2` while the [`device_layout`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3919) reports that the hardware layout is set to `[BackLeft, BackRight, FrontCenter, LowFrequency, FrontLeft, FrontRight]` (via Audio MIDI Setup) ([`get_channel_count`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#1618) reports `6` in this case). These two pieces of hardware information contradict each other. Commenting [this piece of code setting `kAudioUnitProperty_AudioChannelLayout`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3877-3899) and [reverting](https://searchfox.org/mozilla-central/diff/e71ae3a83ff36994daeb23abee4670b3ee88bbb4/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3822) the [`kAudioUnitScope_Input`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3787) back to `kAudioUnitScope_Output` resolves the issue with my Cubilux Surround Sound Card (CA7). These changes (`kAudioUnitScope_Input` and `kAudioUnitProperty_AudioChannelLayout`) were introduced in [PR #220](https://github.com/mozilla/cubeb-coreaudio-rs/pull/220/commits/6fea3b532a91937194d982feba6b5948f76bda7f#) and [PR #222](https://github.com/mozilla/cubeb-coreaudio-rs/pull/222/) resepctively. However, there were no comments or explanations detailing the issues they were meant to address. Without this context, I am unsure if reverting these changes is the right approach or if it might lead to other regressions. Paul, do you remember what those settings do?
Bug 1904734 Comment 7 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to C.M.Chang[:chunmin] from comment #6) > (In reply to C.M.Chang[:chunmin] from comment #5) > .... > > More investigation is required to know why the assertion is reached when mutating the channel from `2` to `6`. This means the [buffer size](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#953) given by the output callback is only for 2-channel instead of for 6-channel since the channel of audio stream is set to `output_dev_desc.mChannelsPerFrame`, which is `2`. The channel of the `output_dev_desc` is defined by `output_hw_desc.mChannelsPerFrame`, which is expected to reflect the hardware information. However, it reports `2` in this case as well. Setting [`kAudioUnitScope_Input`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3787) to `kAudioUnitScope_Output` makes `output_hw_desc.mChannelsPerFrame` report `6`, meeting the expectation. > Commenting this [piece of code](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3877-3899) doesn't solve the issue, since the [`output_dev_desc.mChannelsPerFrame`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3918) (and [`output_hw_desc.mChannelsPerFrame`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3802)), on my [Cubilux Surround Sound Card (CA7)](https://www.cubilux.com/products/7-1-5-1surround-sound-crad), reports `2` while the [`device_layout`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3919) reports that the hardware layout is set to `[BackLeft, BackRight, FrontCenter, LowFrequency, FrontLeft, FrontRight]` (via Audio MIDI Setup) ([`get_channel_count`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#1618) reports `6` in this case). These two pieces of hardware information contradict each other. Commenting [this piece of code setting `kAudioUnitProperty_AudioChannelLayout`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3877-3899) and [reverting](https://searchfox.org/mozilla-central/diff/e71ae3a83ff36994daeb23abee4670b3ee88bbb4/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3822) the [`kAudioUnitScope_Input`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3787) back to `kAudioUnitScope_Output` resolves the issue with my Cubilux Surround Sound Card (CA7). These changes (`kAudioUnitScope_Input` and `kAudioUnitProperty_AudioChannelLayout`) were introduced in [PR #220](https://github.com/mozilla/cubeb-coreaudio-rs/pull/220/commits/6fea3b532a91937194d982feba6b5948f76bda7f#) and [PR #222](https://github.com/mozilla/cubeb-coreaudio-rs/pull/222/) resepctively. However, there were no comments or explanations detailing the issues they were meant to address. Without this context, I am unsure if reverting these changes is the right approach or if it might lead to other regressions. Paul, do you remember what those settings do?
(In reply to C.M.Chang[:chunmin] from comment #6) > (In reply to C.M.Chang[:chunmin] from comment #5) > .... > > More investigation is required to know why the assertion is reached when mutating the channel from `2` to `6`. This means the [buffer size](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#953) given by the output callback is only for 2-channel instead of for 6-channel since the channel of audio stream is set to `output_dev_desc.mChannelsPerFrame`, which is `2`. The channel of the `output_dev_desc` is defined by `output_hw_desc.mChannelsPerFrame`, which is expected to reflect the hardware information. However, it reports `2` in this case as well. Setting [`kAudioUnitScope_Input`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3787) to `kAudioUnitScope_Output` makes `output_hw_desc.mChannelsPerFrame` report `6`, meeting the expectation. > Commenting this [piece of code](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3877-3899) doesn't solve the issue, since the [`output_dev_desc.mChannelsPerFrame`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3918) (and [`output_hw_desc.mChannelsPerFrame`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3802)), on my [Cubilux Surround Sound Card (CA7)](https://www.cubilux.com/products/7-1-5-1surround-sound-crad), reports `2` while the [`device_layout`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3919) reports that the hardware layout is set to `[BackLeft, BackRight, FrontCenter, LowFrequency, FrontLeft, FrontRight]` (via Audio MIDI Setup) ([`get_channel_count`](https://searchfox.org/mozilla-central/rev/b60bff00c0fe136f35e4d6f3316911c090a39f23/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#1618) reports `6` in this case). These two pieces of hardware information contradict each other. Commenting [this piece of code setting `kAudioUnitProperty_AudioChannelLayout`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3877-3899) and [reverting](https://searchfox.org/mozilla-central/diff/e71ae3a83ff36994daeb23abee4670b3ee88bbb4/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3822) the [`kAudioUnitScope_Input`](https://searchfox.org/mozilla-central/rev/b6671f4c3afdb2b36e63c9d176f98a5959907259/third_party/rust/cubeb-coreaudio/src/backend/mod.rs#3787) back to `kAudioUnitScope_Output` resolves the issue with my Cubilux Surround Sound Card (CA7). These changes (`kAudioUnitScope_Input` and `kAudioUnitProperty_AudioChannelLayout`) were introduced in [PR #220](https://github.com/mozilla/cubeb-coreaudio-rs/pull/220/commits/6fea3b532a91937194d982feba6b5948f76bda7f#) and [PR #222](https://github.com/mozilla/cubeb-coreaudio-rs/pull/222/) resepctively. However, there were no comments or explanations detailing the issues they were meant to address. Without this context, I am unsure if reverting these changes is the right approach or if it might lead to other regressions. This issue is mirrored to git repo: https://github.com/mozilla/cubeb-coreaudio-rs/issues/232 Paul, do you remember what those settings do?