MediaDevices.enumerateDevices() returns MediaDeviceInfo array with multiple cameras and the same deviceID
Categories
(Core :: WebRTC: Audio/Video, defect, P3)
Tracking
()
People
(Reporter: bugzilla.mj, Unassigned)
References
(Depends on 1 open bug)
Details
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
Operating system: Ubuntu 20.04.3 LTS
Existing video hardware:
Laptop camera: "Chicony USB2.0 Camera: Chicony".
Additional camera on the monitor (Philips Brilliance 346P): "USB2.0 FHD UVC WebCam: USB2.0 F" and "USB2.0 FHD UVC WebCam: IR Camer"
It is a camera with Windows 10 Hello feature.
dmesg:
uvcvideo: Found UVC 1.00 device Chicony USB2.0 Camera (04f2:b685)
input: Chicony USB2.0 Camera: Chicony as /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/input/input26
...
uvcvideo: Found UVC 1.50 device USB2.0 FHD UVC WebCam (04f2:b612)
input: USB2.0 FHD UVC WebCam: USB2.0 F as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.4/1-3.4:1.0/input/input43
uvcvideo: Found UVC 1.50 device USB2.0 FHD UVC WebCam (04f2:b612)
input: USB2.0 FHD UVC WebCam: IR Camer as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.4/1-3.4:1.2/input/input44
Javascript:
navigator.mediaDevices.enumerateDevices().then(console.log.bind(console));
Actual results:
Firefox finds all cameras on Linux, but the two cameras from the monitor have the same deviceID.
E.G.:
{
"deviceId": "gOaZRUnAk8kC2EqEHFg7dDb+eQ0kAWlsLBN+PNLxbjA=",
"kind": "videoinput",
"label": "Chicony USB2.0 Camera: Chicony ",
"groupId": "KRRUDzY1G4y5buXrJDvcgGxbDNwBJSiejYC+vO+5n78="
},
{
"deviceId": "Qbx9xcsUHv72RmeLRrN6UyAE6TGUqVvXROFG9ltfHNk=",
"kind": "videoinput",
"label": "USB2.0 FHD UVC WebCam: USB2.0 F",
"groupId": "RYwko438Rnc0qp4XLbWOBBtsg4h8FzYPTio2rjXgDoE="
},
{
"deviceId": "Qbx9xcsUHv72RmeLRrN6UyAE6TGUqVvXROFG9ltfHNk=",
"kind": "videoinput",
"label": "USB2.0 FHD UVC WebCam: IR Camer",
"groupId": "/YIhp58B6XHPSPAuo9eYQklsKIxTD3X/2RcxHYUOu4I="
},
{
"deviceId": "LxaWFgEXyw9Y3Laok+/Qd1M70tfsVTvChKPLliB4IRQ=",
"kind": "audioinput",
"label": "",
"groupId": "lzf0Xny1v9QykjF8BMuTs+0C7GMSTnpiVitJL9x/0U0="
},
{
"deviceId": "AFOrUPvU+gTUAmBniasgSp6ngiBKnJ3JKFumFmZklQo=",
"kind": "audioinput",
"label": "",
"groupId": "1xMlMpurX1r3tCcPFvIRYNRy1cLNb4NRyDg846CuQPM="
},
{
"deviceId": "NwHWT2bHfPrhyu+syglpvByD/dp6vE0PWoJxoygYi1w=",
"kind": "audioinput",
"label": "",
"groupId": "1xMlMpurX1r3tCcPFvIRYNRy1cLNb4NRyDg846CuQPM="
}
In previous version (checked with version 93.0 and ESR 91.3) and the current Nightly (96.0a1 (2021-11-11)) it behaves exactly the same.
Expected results:
Firefox (version 94.0) on Windows also finds all three cameras. But here all cameras have different deviceID.
Chrome/Chromium/Edge does not show the second camera from the monitor.
Comment 1•4 years ago
|
||
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.
Comment 2•4 years ago
|
||
I'm curious (and to help prioritize), does the deviceId pick the regular camera or the IR camera? https://jsfiddle.net/jib1/qk8och13/
| Reporter | ||
Comment 3•4 years ago
|
||
DeviceID selects the regular camera and I get a picture.
Only in a webmeeting application (3CX) it was checked if there are cameras with the same DeviceID, so I noticed the error.
With my camera there are several video streams, see the dmesg excerpt.
uvcvideo: Found UVC 1.50 device USB2.0 FHD UVC WebCam (04f2:b612)
input: USB2.0 FHD UVC WebCam: USB2.0 F as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.4/1-3.4:1.0/input/input43 <- regular camera
uvcvideo: Found UVC 1.50 device USB2.0 FHD UVC WebCam (04f2:b612)
input: USB2.0 FHD UVC WebCam: IR Camer as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.4/1-3.4:1.2/input/input44 <- IR Camera
Comment 4•4 years ago
|
||
The severity field is not set for this bug.
:jib, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 5•4 years ago
•
|
||
Marking low severity since it picks the regular camera over the IR camera.
Could you do me a favor and test it in nightly (96)? We've merged in a newer libwebrtc, and the relevant code has changed slightly here (but probably not enough).
| Reporter | ||
Comment 6•4 years ago
|
||
I tested this with the Nightly 96 from 2021-12-05.
Both cameras still have the same DeviceID.
Updated•4 years ago
|
Description
•