Open Bug 1739163 Opened 3 years ago Updated 2 months ago

MediaStreamTrack muted is always false even when microphone is muted on the system

Categories

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

Firefox 94
defect

Tracking

()

Webcompat Priority P2

People

(Reporter: sam.gabriel, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36

Steps to reproduce:

When calling window.getUserMedia with {audio:true, video:false} the mediastream returned with a MediaStreamTrack has muted to false even when the system microphone is muted.

To mute the system microphone usually there is a hardware button but can be done with the following steps
On Windows 10 Open the Settings go to
Sound Settings:
Under Input Devices section click on Device Properties under the device name
Click on Additional Device Properties
This will open a dialog click on the Levels tab then click speaker icon to mute/unmute.

Actual results:

When calling window.getUserMedia with {audio:true, video:false} the mediastream returned with a MediaStreamTrack has muted to false even when the system microphone is muted.
navigator.mediaDevices.getUserMedia(constraints).then(function (stream)
{

        var track = window.testTrack = stream.getTracks()[0];
        
        log("Got track mutedState=", track.muted);
        // track.muted is false here expected to be true
      
    }).catch(function (err)
    {
        console.log(err);
    });

Also changing the mute and unmute state of the system does not fire the mute and unmute state events

Expected results:

Expected that muted field is true and when changing the system mute state the mute and unmute events should fire.

This is how Chrome is behaving currently and provides developers with a way to warn users that their microphone is muted.

The specs also confirm that the useragent should set this value to the current os setting.

see https://output.jsbin.com/cebatas

The Bugbug bot thinks this bug should belong to the 'Core::WebRTC: Audio/Video' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core

I can verify the unexpected behavior in 93 and 94, and in 96 after the webrtc.org update. I can also verify that it works properly in Edge.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

This appears to be affecting Google Meet's UI, as reported on webcompat.com

Webcompat Priority: --- → ?
Webcompat Priority: ? → P2

This issue persists and affects Firefox specifically. I'm on a very different system than the original reporter, but I still experience the same bug.

On Arch Linux (kernel 6.6.6-zen1) with Firefox (120.0.1), adjusting the muted state of the system's default microphone (by toggling "mute" on the PulseAudio source) does not affect the result of mediaStream.getAudioTracks()[0].muted, which is always false. In Chromium (120.0.6099.109) on the same system, the same muted attribute changes according to the state of the microphone state.

I've made a small demo page at https://detect-mute.glitch.com.

Hi folks, this issue is still an issue on 121.0. Any status on this? Thanks!

Flags: needinfo?(dschubert)

If there was an update, it would be shared here in this very bug.

Flags: needinfo?(dschubert)
Blocks: 1886696
You need to log in before you can comment on or make changes to this bug.