Closed Bug 1898067 Opened 5 months ago Closed 5 months ago

`mediaDevices.enumerateDevices()` doesn't display all audio input devices

Categories

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

Firefox 125
defect

Tracking

()

RESOLVED DUPLICATE of bug 1890186

People

(Reporter: spencer, Unassigned)

Details

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

Steps to reproduce:

I'm writing a web-audio application that uses the microphone input. I've noticed that when I'm using Firefox, my preferred audio device doesn't show up in the list of available devices. It does show up in Chrome.

Based on various posts it seems that this is likely due to differences in how Firefox makes audio devices available to javascript. I put together this jsfiddle to reproduce the issue.

The important bit of the code is:

// trigger the permissions popup
await navigator.mediaDevices.getUserMedia({
  audio: true
});

// Enumerate all media devices
const devices = await navigator.mediaDevices.enumerateDevices();

// Filter audio input and output devices
const audioDevices = devices.filter(device =>
    device.kind === 'audioinput' || device.kind === 'audiooutput');

I've confirmed in my Firefox settings that media.setsinkid.enabled is set to true.

Is there something else I can do to convince Firefox to list all my audio devices? I've noticed this issue is also present in other applications like Google Meet.

Actual results:

In chrome I get:

audioinput: Default - UltraLite-mk5 (ID: default)
audioinput: IPEVO VZ-R (1778:d020) (ID: cb499cf28fc88dffdfbb97876c4bd31025757e3fb200ddd16c935939fa52e320)
audioinput: BlackHole 16ch (Virtual) (ID: 60a4878f71831d635ed580df649bb5cab560aec7662bb58f3789a5d4f8f4a766)
audioinput: MacBook Air Microphone (Built-in) (ID: 45ab111539e43af8e3d0465f384339c526950950c26b762bb430b82bbe3e899d)
audioinput: Spencers Pager Microphone (ID: 536d53350967b94368528931963df2e0304c8a83764129656a15fd41836afd1c)
audioinput: Immersed (Virtual) (ID: 7d58cffbb4e1a3c25141b7f8776a9e0fa3802f22c8f7cc0c28cec94ae7259d52)
audioinput: UltraLite-mk5 (ID: 14a272a8d27ad1c7de745140da06dbcb0b76718f447395fab192c6c7a00724ed)
audioinput: ZoomAudioDevice (Virtual) (ID: f040b17d20d334fa2470fe8c60a870d3eb9e971b6b8345448a84685c7b9d05db)
audiooutput: Default - UltraLite-mk5 (ID: default)
audiooutput: DELL U2415 (HDMI) (ID: e663bbb1040ae3fbd664ea099db4388501fb4cdabef36278644631779b96ab8d)
audiooutput: BlackHole 16ch (Virtual) (ID: 60a4878f71831d635ed580df649bb5cab560aec7662bb58f3789a5d4f8f4a766)
audiooutput: MacBook Air Speakers (Built-in) (ID: e3f7bf2c336f269d32455b131fadcb785666daa5f7ec67bf9de7883e0e5e14ce)
audiooutput: Immersed (Virtual) (ID: 7d58cffbb4e1a3c25141b7f8776a9e0fa3802f22c8f7cc0c28cec94ae7259d52)
audiooutput: UltraLite-mk5 (ID: 14a272a8d27ad1c7de745140da06dbcb0b76718f447395fab192c6c7a00724ed)
audiooutput: ZoomAudioDevice (Virtual) (ID: f040b17d20d334fa2470fe8c60a870d3eb9e971b6b8345448a84685c7b9d05db)

And in firefox I get:

audioinput: MacBook Air Microphone (ID: Ro0SgyrAd1dnNtWIzT9+eH9prYBmltQgN4bq7GnwluI=)
audioinput: ZoomAudioDevice (ID: 9OunH2y2wvzRAnyxSG/K0+ltIWqys2oA3kYD2dOUUOU=)
audioinput: Immersed (ID: Ne3xlB+fgDvm1oW1IJihlqbqlNwUUzLIV8zf/b/4t+4=)
audioinput: BlackHole 16ch (ID: e4721JeIBljfLxN/Yaodzvb7xVYfbR3RONYyPwBDJaY=)
audioinput: IPEVO VZ-R (ID: dxV5+E+omRxRIA9vx6kDzgPireXFcrtRc0RFku8QA14=)

Notice that Firefox displays a subset of the inputs and none of the outputs.

One more note - this example page shows outputs as well as inputs (though the same subset of inputs as above). In particular it has a "Default audio output device" output. There doesn't appear to be a corresponding input device corresponding to my OS default. It just selects "MacBook Air Microphone".

I have my USB multichannel audio device (UltraLite-mk5) set to default input and output in my OS settings. This behavior means that I can use my OS-configured speakers, but not microphone.

I'm not sure if this (the fact that enumerateDevices provides a "Default audio output device" but not the corresponding input device) is a separate issue or part of this one.

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

Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Duplicate of bug: 1890186
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.