6

My webcam worked like a charm until I ran a simple python code to take photo. I ran it with root permission by sudo python myapp.py. The program crashed. Then I ran sudo killall -9 python.

From that time, I lost my webcam. If I run my program, I get this error: VIDEOIO ERROR: V4L: can't find camera device. Cheese cann't find device as well.

I google my issue and I find some pages saying that I should re-enable uvcvideo module. I've done it by sudo modprobe -r uvcvideo && sudo modprobe uvcvideo but the problem isn't solved.

This is the result of some of my commands:

$ lsmod | grep uvc
uvcvideo               86016  0
videobuf2_vmalloc      16384  1 uvcvideo
videobuf2_v4l2         24576  1 uvcvideo
videobuf2_core         40960  2 videobuf2_v4l2,uvcvideo
videodev              184320  3             
videobuf2_core,videobuf2_v4l2,uvcvideo
media                  40960  2 videodev,uvcvideo

$ sudo v4l2-ctl --list-devices
Failed to open /dev/video0: No such file or directory

I should also notice that if I restart the computer I get nothing from lsmod | grep uvc until I run sudo modprobe uvcvideo again.

How should I solve the issue?

vahidreza
  • 161

2 Answers2

2

For my case, I found there is a file called uvcvideo-blacklist.conf in /etc/modprobe.d. It will prevent uvcvideo module to be loaded automatically when booting. Commented out the only line "blacklist uvcvideo" in this file will get uvcvideo been automatically loaded at start up.

L3w1s
  • 131
1

Make sure you're not running a virtual machine with the USB device attached. In that case you'll see the /dev/bus/usb device but no /dev/video device.