USB webcam not usable despite being detected

Hi!

I have been learning how to use NixOS for a couple weeks now, however, I ran into an issue I can’t quite figure out. I have an LSK Meeting Eye webcam. It worked flawlessly under OpenSUSE Tumbleweed. On NixOS, it shows up in lsusb, and even /dev/media0 gets created, but no video device is available. Interestingly, if I plug in a different usb webcam, that one seems to function as intended. I can’t seem to find any documentation or previous discussions related to this.

My current configuration: nixos-config/flake.nix at e8622536627c2577d0251766056ea42cba8c29c4 - lilymeow/nixos-config - git.gay

Here are some outputs that might be useful:

v4l2-ctl --list-devices:

LSK Meeting Eye for Business &  (usb-0000:00:14.0-1):
	/dev/media0

Cannot open device /dev/video0, exiting.

dmesg:

[ 1777.168712] uvcvideo 1-1:1.0: Found multiple Units with ID 4
[ 1777.168736] usb 1-1: Found UVC 1.00 device LSK Meeting Eye for Business & Home (1d6b:0105)
[ 1777.180144] usb 1-1: No streaming interface found for terminal 65535.
[ 1777.180558] usbcore: registered new interface driver uvcvideo

lsusb -v: https://cryptpad.fr/pad/#/2/pad/view/smHYbrf3mzEX36eg5KZf1NdxDqF6PGMI40VhB5726zI/ (couldn’t fit into the text body)

I’d first try sudo v4l2-ctl --list-devices to rule out permission issues. Assuming that also fails, I’d compare kernel versions between Tumbleweed and your current NixOS system, and see if upgrading/downgrading it works.

Unfortunately that’s not it. I tried both linux 6.16 and latest, but it’s the same result in both cases - even with sudo.

Update: I’ve tried to build a custom kernel by getting the diff between the NixOS and OpenSUSE kernel configs and applying them to the NixOS one, I did succeed in building one with only all the usb and video related options copied, but I keep running into issues when trying to copy all options, and I don’t really want to dig through over 1000 lines to see which ones are causing it (each execution takes 1-2 minutes to see if it will fail). I don’t think it would really make that much of a difference anyway. Even with the first custom built kernel, I still get the same output.

New clue: the webcam works when booting from the installation media. I was quick to assume that it’s because of the hardware.enableAllHardware = true setting, but I tried setting that in my own one and still nothing.

Maybe try hardware.enableAllFirmware = true? I don’t think there’s anything relevant there but just in case it’s worth a try

I figured it out. The issue is a regression in the kernel created by this commit, so I had to create a patch to revert that change.

Here’s the patch if anyone is having the same problem: nixos-config/jupiter/kernel/webcam-fix.patch at 11bb710ec9c6fe666c58112e2b27e946453326ca - lilymeow/nixos-config - git.gay

I’ll try to report this to the linux project, though I’ve never done that before.

2 Likes

Building with your patch just fixed my issue! (I have some off brand webcams that used to work but stopped.) Was just about to give up on it. Thank you!

2 Likes

I’m glad it was useful! When I reported the issue to the kernel maintainers they actually sent me a patch which solves the issue differently, but this should be fine until that gets merged if you don’t want to recompile again.

1 Like

ah right - I see it in your repo - i’ll probably try it soon but great to have one I know works

1 Like