w3c / mediacapture-main

Media Capture and Streams specification (aka getUserMedia)
https://w3c.github.io/mediacapture-main/
Other
121 stars 61 forks source link

Redefine groupId to be more narrow and useful #899

Open jan-ivar opened 2 years ago

jan-ivar commented 2 years ago

The undisputed use case for groupId is to find devices a user might want to use together in a video call. E.g. headset switching.

But the current definition: "Two devices have the same group identifier if they belong to the same physical device", is too broad.

Because on linux, Firefox exposes virtual microphones from monitored output devices, with matching groupId (behind a pref). But using these together (in a video call or anywhere else) would always be a mistake as it short-circuits.

I propose we redefine it to: "Two devices have the same group identifier if they belong to the same physical device, and are useful together in a video conferencing call."

Happy to bikeshed.

youennf commented 2 years ago

I am not a big fan of using 'video conferencing call'. Maybe something like they belong to the same physical device and are useful when used together?

alvestrand commented 2 years ago

What's the use case for listening to output devices? Seems to be useful for picking up input to an echo cancellation algorithm, but I don't quite understand the point otherwise (and the PR for selecting the reference signal for the browser's echo cancellation is languishing).

karlt commented 2 years ago

Use cases are similar to screen capture, and so there is overlap with getDisplayMedia().

alvestrand commented 1 year ago

@karlt that comment was a little too terse for me to understand it.

alvestrand commented 1 year ago

A possible extension would be to classify the type of a group. But at the moment, it seems clear that the output / monitor devices are not useful to group.

bradisbell commented 1 year ago

For my use cases, the groupId can be useful, for input and output.

If I have a list of input devices and a list of output devices, I'd like to know what I/O pairs together. Common devices where this is useful include USB headsets, USB microphones with integrated headphone jacks, and DJ mixers/decks.

Other cases include virtual devices. For instance, many multichannel audio interfaces include drivers to split many channels into stereo pairs to be shown to software as virtual audio devices.

I don't know what all is possible on the OS side of things, but group ID should definitely consider output/monitor devices when relevant.

karlt commented 1 year ago

Use cases are similar to screen capture, and so there is overlap with getDisplayMedia().

@karlt that comment was a little too terse for me to understand it.

I just meant that someone may wish to record or share the output of a particular speaker device in the same way that they might that of a tab or application. It wasn't a comment for or against monitors being in the same group as their output device.

If I have a list of input devices and a list of output devices, I'd like to know what I/O pairs together. Common devices where this is useful include USB headsets, USB microphones with integrated headphone jacks, and DJ mixers/decks.

I assume everyone's agreeing that microphones and speakers on the same headset should be in the same group.

The DJ mixer/deck and stereo-to-stereo effects unit, for example, are interesting cases because their inputs and outputs are useful when used together, though not really in the sense usually considered for a video call.

If the input and output of an effects unit should be in the same group, then its hard to argue that those of a pass-through effects unit, like an output and its monitor, should not be in the same group.