Webcams and USB cables on linux
March 2023
And here I thought USB was compatible (mostly) with itself. Apparently, I still have a lot to learn about USB even though I’ve been in the computer field for 40+ years.
Last week I was so looking forward to getting Zoom to work on linux. I had just found out–and I don’t recall how this happened–that Zoom supports linux and given that I do 98% of my work on linux (Fedora, for-ever) with the other 2% being on macOS for all the video calls I’m on, I thought it would be so nice to not have to twist my body to face the macbook on one side of my desk. So I ordered what looked to be a reasonable webcam (Logitech’s Brio 300) and waited for it to arrive. I had to order a USB-C to A adapter as the goal was to plug it into my KVM switch so multiple machines could make use of it.
When both parts arrived I plugged things in, somewhat naively expecting it all to just work. And, of course it didn’t. So I plug it in (with no C to A adapter) to my mac and all seems well, leaving me disappointed with linux and with my researching things prior to ordering.
So I start digging into what might be the problem. I quickly find out that the subsystem in linux for video is v4l2 (Video 4 Linux 2, though I’m guessing that the “2” means major changes from “1”, but I didn’t look enough to verify) and I install v4l2 tools and start trying to get those to work. The computer can see the webcam device itself, but all I see is black for any video app.
Eventually I give up (mostly) and let it sit for a few days. And I think about ordering a known compatible model but after clicking through so many links I’m not liking what I’m seeing (“discontinued model” showed up more than once). I eventually started searching again for possible problems with Brio 300 and linux and I finally hit upon a review written in German (which Google offered to translate) and when I read it (translated well enough, I suppose) there was as a mention of MJPEG and YUYV and native hardware operations not working if a USB 2 cable is used… and, of course that adapter drops it from USB 3 to 2 and so I thought that I should try going directly from the webcam into the motherboard USB 3 connector.
And it worked and I was a bit (or more) surprised as the bandwidth used by a HD webcam at 30fps should *not* overwhelm USB 2. Okay, whatever. So then I start plugging in the cable+adapter (to type A) into USB 3.2, 3.1, and 2 ports and it becomes clear that it works only with 3.0/3.1 (blue/teal ports)–not 3.2 (red) as far as I can tell.
So after ordering and using a 6ft USB 3.1 extension cable and plugging it into the 3.1 (A connector) ports with the adapter it all works.
Thinking that maybe this little webcam is using a large amount of the bandwidth, I found out about usbtop
and so I ran it, and it shows that it’s using only around 24Mbps, or a small portion of the USB 2 bandwidth (480Mbps). Sigh.
Moral of the story is that backwards compatibility isn’t always, and that it’s good to bypass “transformations” of USB data (like those that come with downgrading to USB 2). I suppose related to this is my saga of having a really nice ASUS Republic of Gamers mechanical RGB keyword not work if it’s connected to a USB 2 KVM switch…
Update (a few days after the above was written)… well, it’s not quite so simple as it turns out it is possible to throw USB 2 in the mix and have it work. Either the combination of adapters (and orientation of the C-to-C connection) or the particular USB 3.2 (?) port used on the motherboard is important (or both), as I was able to get the Brio working using a USB 2 female-to-male extension cable as long as the orientation of connections was correct and the USB type A connector was plugged into the right motherboard USB connector. The working combination requires the manufacturer’s logo on the connectors/cables and the generic USB “network” symbol to be on the same side of the connection. Sigh.