Open Bug 2057748 Opened 3 months ago Updated 7 days ago

Processed microphone capture repeatedly replaces AudioCallbackDriver when the voice-stream preference is disabled

Categories

(Core :: Audio/Video: MediaStreamGraph, defect)

Firefox 153
defect

Tracking

()

ASSIGNED

People

(Reporter: hola, Assigned: hola)

References

Details

Attachments

(1 external file)

Steps to reproduce

  1. Set media.getusermedia.microphone.prefer_voice_stream_with_processing.enabled to false.
  2. On macOS, also set media.getusermedia.audio.processing.platform.enabled to false so that Firefox uses its software audio-processing path.
  3. 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:

  1. the device input track has a voice-processing consumer; and
  2. prefer_voice_stream_with_processing.enabled is 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.

Assignee: nobody → hola
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

The severity field is not set for this bug.
:karlt, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(karlt)
Severity: -- → S3
Flags: needinfo?(karlt)
Duplicate of this bug: 2090431
See Also: → 2091322
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: