Re: [mediacapture-main] Bug in spec: circular dependency for enumerateDevices() (#709)

Re long-term, at the front-end `getUserMedia({audio:true})` at Chromium is useless relevant to initial device selection

![Screenshot_2020-08-12_16-24-41](https://user-images.githubusercontent.com/4174848/90041215-844db600-dcb8-11ea-8d3b-76def3fe084b.png)

The user does not gain any knowledge about the device being captured other than "microphone". 

The order _should be_ `enumerateDevices()` => `getUserMedia(<selected_device(s)>)` for the user to be fully aware of the specific devices selected _before_ the capture actually commences at `getUserMedia()`.

Attempting to massage clarity from `getUserMedia({audio: true})` => `enumerateDevices()` requires calling `getUserMedia()` _at least twice_ when the initial selected device (Default) is not the device intended to be captured. 

As you pointed out, attempting to select a device the implementation refuses to support capture of leads to a `DOMException` not even described in the specification, see https://bugs.chromium.org/p/chromium/issues/detail?id=931749

> We use pulse audio to create an audio sink and configure the monitor of that sink as the default/fallback source of that device.
> E.g. a pa configuration like this:
> ```
> load-module module-null-sink sink_name=main_mix
> set-default-source main_mix.monitor
> ```
> 
> In Chrome we then try to access this source. The default audio input device is listed in the result of `navigator.mediaDevices.enumerateDevices`, but when we try to access it we get the following error:
> `DOMException: could not start audio source`

To avoid such restrictions implementers might decide to arbtririly incorporate into their version of `getUserMedia()` `enumerateDevices()` should precede `getUserMedia()` so that users can evaluate the list of available devices and either select a device the implementation decides to expose, or not use `getUserMedia()` at all for the use case. 

Ideally, there should not be any restrictions at all on which devices can be selected for capture, whether the device identifier is `'speech-dispatcher'`, a monitor device, or virtual device.

The change would break existing web applications, though since this specification is active and users of `getUserMedia()` are well-suited to changing code in response to changes, the users at large should be able to adjust code accordingly rather swiftly.









-- 
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/709#issuecomment-672984874 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 12 August 2020 16:39:29 UTC