2

Suddenly, my webcam stopped working in my browsers even though it works if I run the cheese application in the terminal. I am testing it with this website (and many others) on Google Chrome (incognito mode and Firefox) and I get this error message:

NotFoundError: Requested device not found; Object

lsusb gives:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0bda:57f2 Realtek Semiconductor Corp. HD WebCam
Bus 001 Device 003: ID 04ca:3015 Lite-On Technology Corp. Qualcomm Atheros QCA9377 Bluetooth
Bus 001 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

If I use an external webcam this still does not get detected. I tried to re-install Chrome, change user and reboot my machine but still does not work. Microphone, instead, is correctly detected.

My system information:

Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:        21.10
Codename:       impish
Kernel:         5.13.0-23-generic

ls -l /dev/video* prints

crw-rw----+ 1 root video 81, 0 gen  6 18:06 /dev/video0
crw-rw----+ 1 root video 81, 1 gen  6 18:06 /dev/video1

groups $USER prints

alex : alex adm cdrom sudo dip video plugdev lpadmin lxd sambashare

bash ./pathlld /dev/video* prints

drwxr-xr-x 21 root root 4096 gen  6 12:46 /
/dev/sdb2 on / type ext4 (rw,relatime,errors=remount-ro)
drwxr-xr-x 22 root root 4960 gen  6 19:14 /dev
udev on /dev type devtmpfs (rw,nosuid,relatime,size=6036388k,nr_inodes=1509097,mode=755,inode64)
crw-rw----+ 1 root video 81, 0 gen  6 19:12 /dev/video0
drwxr-xr-x 21 root root 4096 gen  6 12:46 /
/dev/sdb2 on / type ext4 (rw,relatime,errors=remount-ro)
drwxr-xr-x 22 root root 4960 gen  6 19:14 /dev
udev on /dev type devtmpfs (rw,nosuid,relatime,size=6036388k,nr_inodes=1509097,mode=755,inode64)
crw-rw----+ 1 root video 81, 1 gen  6 19:12 /dev/video1

getfacl /dev/video* prints

getfacl: Removing leading '/' from absolute path names
# file: dev/video0
# owner: root
# group: video
user::rw-
user:alex:rw-
group::rw-
mask::rw-
other::---

file: dev/video1

owner: root

group: video

user::rw- user:alex:rw- group::rw- mask::rw- other::---

tail
  • 121

1 Answers1

0

Many device access problems can be resolved through group membership changes.

You can find the device name by watching sudo journalctl --follow as you connect your device. OR ls -1 /dev >dev.before, connect the device, wait 10 seconds, ls -1 /dev >dev.after;diff dev.{before,after}. Your camera is probably /dev/video.

Specifically, if ls -l shows that the group permissions (the second "rwx" triplet) is "rw" (e.g."-rw-rw----"), then, adding oneself to the group that owns the device will grant rw access.

Here's how:

device="/dev/whatever"
sudo adduser $USER $(stat -c "%G" $device)

This allows you membership in the group that can rw the device, but there is one more step.

To make all your processes members of the new group, logout and login. Group memberships are set up at login time.

To create a single process in the new group (for testing, prior to logout/login):

newgrp $(stat -c "%G" $device)  

or, just type the group name. See man newgrp.

waltinator
  • 37,856