Processed microphone capture repeatedly replaces AudioCallbackDriver when the voice-stream preference is disabled
Categories
(Core :: Audio/Video: MediaStreamGraph, defect)
Tracking
()
People
(Reporter: hola, Assigned: hola)
References
Details
Attachments
(1 external file)
Steps to reproduce
- Set
media.getusermedia.microphone.prefer_voice_stream_with_processing.enabledtofalse. - On macOS, also set
media.getusermedia.audio.processing.platform.enabledtofalseso that Firefox uses its software audio-processing path. - Start a processed microphone track, for example:
await navigator.mediaDevices.getUserMedia({
audio: {
echoCancellation: true,
noiseSuppression: true,
autoGainControl: true,
},
});
Actual result
The processed track can produce digital silence. MediaTrackGraph logging shows the graph repeatedly replacing AudioCallbackDriver.
Expected result
The graph should keep a stable regular-input driver and deliver microphone samples through Firefox's software audio-processing pipeline.
Cause
AudioCallbackDriver respects media.getusermedia.microphone.prefer_voice_stream_with_processing.enabled. When the preference is false, it opens a regular input and records CUBEB_DEVICE_PREF_ALL.
MediaTrackGraphImpl::AudioInputDevicePreference() does not consult the same preference. For any track with a processed input consumer, it continues to return AudioInputType::Voice.
MediaTrackGraphImpl::CheckDriver() therefore compares a requested Voice input with the driver's effective regular input, replaces the driver, and encounters the same mismatch again on the next iteration.
Proposed fix
Make MediaTrackGraphImpl::AudioInputDevicePreference() return Voice only when both conditions are true:
- the device input track has a voice-processing consumer; and
prefer_voice_stream_with_processing.enabledis enabled.
This keeps MediaTrackGraph's requested preference consistent with the preference applied by AudioCallbackDriver.
Regression test
Add TestAudioTrackGraph.ProcessedInputWithoutVoicePreference. It creates a processed microphone input with software AGC while the preference is disabled, then verifies that the graph requests AudioInputType::Unknown.
The test fails with the old implementation (Voice) and passes with the fix (Unknown).
Local results on Firefox 153:
- targeted test: 1/1 passed
- complete
TestAudioTrackGraph.*suite: 30/30 passed - the targeted gtest rebuild completed with zero compiler warnings
- Mozilla formatting completed with 0 problems
The patch also applies cleanly to mozilla-central at 0f16fef034090c1c63f6e80e048eea32faad2ea3 (2026-07-24).
Background
This was found while investigating macOS VoiceProcessingIO capture problems. Mozilla has previously recommended disabling prefer_voice_stream_with_processing as a diagnostic/workaround, but doing so currently exposes this graph/driver mismatch.
Related: bug 1960048, bug 1890426, bug 1404972.
AudioCallbackDriver uses a regular cubeb input when prefer_voice_stream_with_processing.enabled is false, but MediaTrackGraphImpl::AudioInputDevicePreference() continued to request Voice for processed microphone consumers. CheckDriver() then replaced the driver on every graph iteration.
Gate the graph Voice preference on the same static preference used by the driver. Add a regression test covering a software-processed microphone input with the preference disabled.
Updated•3 months ago
|
Comment 2•3 months ago
|
||
The severity field is not set for this bug.
:karlt, could you have a look please?
For more information, please visit BugBot documentation.
Updated•3 months ago
|
Comment 3•3 months ago
|
||
https://phabricator.services.mozilla.com/D276412, https://phabricator.services.mozilla.com/D197659, and https://phabricator.services.mozilla.com/D202405 combined to produce this behavior.
Description
•