Open Bug 2091322 Opened 9 days ago Updated 15 hours ago

macOS: microphone is silent for the first ~10 s of a WebRTC call (built-in mic, voice-processing input), and disabling voice processing causes a continuous aggregate-device restart loop with no audio at all

Categories

(Core :: Audio/Video: cubeb, defect, P3)

Firefox 159
defect

Tracking

()

UNCONFIRMED

People

(Reporter: slava.v.ivannikov, Unassigned, NeedInfo)

References

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:159.0) Gecko/20100101 Firefox/159.0

Steps to reproduce

On a MacBook Pro (Mac17,8, macOS 26.7) with the built-in microphone as the default input, open https://meet.google.com in Firefox 159.0.1.
Click "New meeting" → "Start an instant meeting" and speak continuously from the start.
Watch the Meet mic level indicator. Leave and rejoin; the result is the same.

Actual results

No microphone audio for about 8–10 seconds after joining. After that, audio works normally for the rest of the call. The OS does not show the device as disconnected. Chrome on the same machine, mic and meeting has no delay.

Expected results

Microphone audio is available immediately, as in Chrome.

Attached file debug info —

Thanks for the macOS audio log and the about:support data.

Analysis

The macOS log shows that the voice-processing unit runs in bypass mode in each microphone session. With bypass on, Apple's echo cancellation and noise suppression do not run. The built-in microphone then gives a very quiet signal, about -60 dBFS in this log. Firefox then applies its own processing in software. Its automatic gain control starts at 15 dB of gain and adds at most 6 dB each second during speech (audio_processing.h). This slow gain increase is the probable cause of the silent first seconds.

Chrome does not use the macOS voice processing (bug 1896938 comment 66), so this agrees with the difference between the two browsers. Bug 1896938 comment 58 reports the same slow start on Google Meet with other MacBooks.

Why Firefox requests the bypass is not known yet. DeviceInputTrack.cpp combines the requests of all microphone tracks on the device. So one track with no processing turns off echo cancellation for all tracks. Also, cubeb refuses echo cancellation without noise suppression (mod.rs). After such an error, Firefox requests no platform processing (MediaEngineWebRTCAudio.cpp).

The restart loop with voice processing turned off matches bug 2057748. With media.getusermedia.microphone.prefer_voice_stream_with_processing.enabled set to false, the driver opens a normal input, but the graph still requests a voice input. So CheckDriver in MediaTrackGraph.cpp replaces the AudioCallbackDriver again and again. Each new driver creates one CubebAggregateDevice. This agrees with the 262 aggregate devices in the log, about one each 0.25 s.

Next steps

Viacheslav, could you please record a capture while you join a Google Meet instant meeting and speak from the start? Keep media.getusermedia.microphone.prefer_voice_stream_with_processing.enabled at its default value, true. In step 2, choose the WebRTC preset in place of Media playback.

Please capture a profile:

  1. Open about:logging.
  2. Under Log module selection, choose "Media playback" in the Logging preset: drop-down.
  3. Under Logging output, select "Logging to the Firefox Profiler".
  4. Click Start Logging.
  5. Reload the page. Then do the steps that show the problem.
  6. Click Stop Logging. The profile opens in the Firefox Profiler.
  7. Click Upload Local Profile. This is the share button.
  8. Copy the share URL. Add it to this bug.

The instruction video shows these steps.

The capture shows the processing that each microphone track requests and any cubeb error. This tells which of the two paths above turns on the bypass.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.

Severity: -- → S3
Flags: needinfo?(slava.v.ivannikov)
Priority: -- → P3
See Also: → 2057748, 1896938
Flags: needinfo?(slava.v.ivannikov)

Thanks for the profile in comment 3.

Analysis

The triage tools cannot read this profile yet. The profile uses a newer file format than the profile reader of the triage tools supports. This is a gap in our tools, not a problem with the capture. The capture follows the request of comment 2, so the reporter does not need to capture again.

The two open questions of comment 2 are still open. The first question is which microphone track or cubeb error turns on the voice-processing bypass. The second question is whether the slow start of the automatic gain control causes the silent first seconds. The restart loop with voice processing turned off is in bug 2057748, and Andres K works on that bug.

Next steps

Paul, could you please look at the profile in comment 3? The log markers of the WebRTC preset can show the processing that each microphone track requests. They can also show any cubeb error when the voice-processing input opens.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.

Flags: needinfo?(padenot)

I will run this triage again and make a fix to profile-cli. Now whenever they update the version, old version would not be able to read the format generated by the new version, which is bad.

Flags: needinfo?(padenot)

Thanks for the profile in comment 3. The triage tools can now read it.

Analysis

For the whole call, the macOS voice-processing unit of the MacBook Pro Microphone runs with bypass on and its AGC off. cubeb reports no error. Input data arrives with no gaps from the start of the stream. cubeb sets bypass on when the request from Firefox has no echo cancellation (mod.rs). So Firefox requested no platform processing for this call.

The request of the device is the intersection of the requests of all its microphone tracks (DeviceInputTrack.cpp). One track gives an empty request in three cases (MediaEngineWebRTCAudio.cpp). Platform processing is off for the track, an earlier attempt to set the params failed, or the track has no processing. The default macOS prefs turn on platform processing (all.js), and the about:support data shows no change to them.

The probable cause of the silent first seconds is still the slow gain increase of the software AGC. The input is very quiet, as comment 2 says. The parent process shows no change at the time when the audio starts to work. So the change probably happens later in the chain, in the content process.

A correction to comment 4: the profile has log lines only from the parent process. The Google Meet content process has no log markers, so the profile cannot show the processing that each track requests. Step 2 of the capture steps in comment 2 said "Media playback". That preset does not have the MediaManager and webrtc_trace modules. The profile shows Firefox 160 on macOS 27.2.1, so the problem probably continues in Firefox 160.

Next steps

Viacheslav, could you please record a new capture while you join a Google Meet instant meeting and speak from the start? In step 2, choose the WebRTC preset in place of Media playback. Before the upload, keep the data of all tabs and processes in the upload options.

Please capture a profile:

  1. Open about:logging.
  2. Under Log module selection, choose "Media playback" in the Logging preset: drop-down.
  3. Under Logging output, select "Logging to the Firefox Profiler".
  4. Click Start Logging.
  5. Reload the page. Then do the steps that show the problem.
  6. Click Stop Logging. The profile opens in the Firefox Profiler.
  7. Click Upload Local Profile. This is the share button.
  8. Copy the share URL. Add it to this bug.

The instruction video shows these steps.

Viacheslav, could you please also give the input volume of the MacBook Pro Microphone in System Settings > Sound > Input?


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.

Flags: needinfo?(slava.v.ivannikov)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: