I suspect [`ApplySettings`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#434) should be executed before [here](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#422) so the [`AudioInputProcessing::SetRequestedInputChannelCount`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#254) can run before [`AudioInputProcessing::Start`](https://searchfox.org/mozilla-central/source/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#386). Otherwise [`mRequestedInputChannelCount`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#480) could be [`0`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#361) if cubeb creates a [0-channel device](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#53) (#comment 2).
Bug 1749281 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
I suspect [`ApplySettings`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#434) should be executed before [here](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#422) so the [`AudioInputProcessing::SetRequestedInputChannelCount`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#254) can run before [`AudioInputProcessing::Start`](https://searchfox.org/mozilla-central/source/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#386). Otherwise [`mRequestedInputChannelCount`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#480) could be [`0`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#361) if cubeb creates a [0-channel device](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#53) (comment 2).
I suspect [`ApplySettings`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#434) should be executed before [here](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#422) so the [`AudioInputProcessing::SetRequestedInputChannelCount`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#254) can run before [`AudioInputProcessing::Start`](https://searchfox.org/mozilla-central/source/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#386). Otherwise [`mRequestedInputChannelCount`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#480) could be [`0`](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#361) if cubeb creates a [0-channel device](https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/dom/media/webrtc/MediaEngineWebRTCAudio.cpp#53) (comment 2). I am going to write a patch for it.