Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Incorrect video feed for UVC devices in Chrome on Linux and ChromeOS #14

Open
maks opened this issue Sep 19, 2018 · 6 comments
Open

Incorrect video feed for UVC devices in Chrome on Linux and ChromeOS #14

maks opened this issue Sep 19, 2018 · 6 comments

Comments

@maks
Copy link

maks commented Sep 19, 2018

Hi it seems that UVC attached devices such as usb webcams or in my case hdmi->usb
dongles are not even working properly in Chrome, both on a couple of Chromebooks I have here (pixelbook on beta channel v68) and on a ubuntu 16.04 laptop running Chrome 69, though the devices are accessible just fine via native linux apps (eg. OBS) in ubuntu on same laptop. I can't try OBS on the Pixelbook as the linux container functionality there does not yet supported access to usb devies within the containers.

Interesting thing is that in Chrome on Ubuntu and on the Pixelbook, using the live demo for WBS the UVC device does show up in the list of available audio/video sources, but if selected, the video feed that is displayed is actually just for the builtin webcam not from the UVC source.

I suspect this is a bug in Chrome, but wanted to raise this here in case this is due to a bug in WBS, before I went ahead and filed bugs reports in the Chromium bugtracker.

@t-mullen
Copy link
Owner

t-mullen commented Sep 19, 2018

Can you verify that the problem device isn't present in the array printed by this code:

window.navigator.mediaDevices.enumerateDevices().then(devices => console.log(devices))

@t-mullen
Copy link
Owner

Sorry, is the issue that you can see the device in the sources list, but the feed is from the default camera?

@maks
Copy link
Author

maks commented Sep 19, 2018

Yes, sorry I didn't make that more clear. That's exactly it, I have 2 UVC devices, they both show up in the sources list but selecting them just displays the built-in webcams actual video content.

@t-mullen
Copy link
Owner

t-mullen commented Sep 19, 2018

Alright, let's make sure WBS isn't just grabbing the wrong stream. Get the device ID of the UVC device with the above snippet, and plug it into here (with dev console):

DEVICE = '78da83489276ec70f0068cba07fa4b6d797afd8b131017f72f11cb4308980ef8';  //<-- deviceId

window.navigator.getUserMedia({audio:{exact:DEVICE}, video:{exact:DEVICE}}, (stream) => {
  var vid = document.createElement('video');
  vid.srcObject = stream
  vid.controls = true
  document.body.appendChild(vid)
}, (err) => console.error(err))

If the created video element shows your UVC stream, we know it's just a logic bug. Otherwise, we have a nice way to reproduce with Chrome.

@maks
Copy link
Author

maks commented Sep 20, 2018

Thanks. I don't have access to the devices at the moment so I'll try this once I have them again tomorrow.

@maks
Copy link
Author

maks commented Oct 21, 2018

Sorry to take so long to reply, I didn't have access to my gear for a little while.
In the meantime I got a simpel uvc webcam (Logitech c270) which demonstrates exactly the same issue I was seeing wit my other devices.

I've done some tests with the snippets above and it shows the same (first video src) each time, despite using a different videoinputs deviceId.

However I have been able to hack up a version of the webrtc sample demo which does allow me to ahve both video inputs displaying in separate

I'll keep investigating more the next time a have a chance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants