1

In Ubuntu 18.04, the integrated webcam stops working after a while: blank screen in all the applications (gucview, cheese, etc.). I have no idea what causes it or how to solve it.

When I do guvcview -d /dev/video0 The result is:

V4L2_CORE: Could not grab image (select timeout): Resource temporarily unavailable

when I try another driver, and do mplayer -cache 128 -tv driver=v4l2:width=640:height=480 -vo xv tv://

The results is:

Error while decoding frame!
v4l2: select timeout
[mjpeg @ 0x7f01c899a920]No JPEG data found in image

The weird thing is that right after reboot, the video works. After a while, it doesn't, and it's impossible to understand what disables it. fuser /dev/video0 doesn't show any usage.

sudo lsof -n | grep video Shows everything apparently normal:

Output information may be incomplete.
goa-daemo  1375                 username  mem       REG              259,2    623848    3282429 /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0.1405.0
gmain      1375  1382           username  mem       REG              259,2    623848    3282429 /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0.1405.0
gdbus      1375  1384           username  mem       REG              259,2    623848    3282429 /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0.1405.0
dconf\x20  1375  1385           username  mem       REG              259,2    623848    3282429 /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so.0.1405.0

Switching off and on again doesn't solve anything:

sudo modprobe -r uvcvideo
sudo modprobe uvcvideo

Any idea to at least understand what disables the internal webcam?

Zanna
  • 70,465

2 Answers2

1

I've been having the same problem myself in Ubuntu 20.04, and while I'm writing this as an answer to try and help find a solution, I really have nothing more than a poor workaround.

In my case the "webcam" is a USB UVC capture device (I've tried two different types though and neither exhibits this behaviour on Windows).

I have found that the camera works for exactly one capture session then stops working until the device is reset. To reproduce:

  • Boot PC
  • Open cheese (video works)
  • Close cheese
  • Open cheese (video output is black)
  • Close cheese
  • Disconnect and reconnect webcam
  • Open cheese (video works)

This is somewhat problematic for apps like Skype, which apparently stop and start reading from the webcam before starting a call, so the result it's always black.

Things I've tried/checked so far that have not helped:

  • 5.6 kernel
  • permissions on /dev/video (made user a member of the video group, have not tried root)

No relevant errors are logged that I can see.

What has helped is a script to hard-reset the USB device (I found usbreset.cc to be the best method), which achieves the same as unplugging the webcam physically. This at least makes the camera usable for Zoom, as unlike Skype it doesn't go completely mad when the device is reset. I am still looking for a proper solution though.

  • Just tested with an actual webcam, a Logitech C920, and it doesn't exhibit this problem. So it would appear to be hardware/driver specific. – Alex Forbes Jun 20 '20 at 12:02
  • Hi, thanks for the tip. I've tried both the C file, and the Python file. The USB device seems to be reset, but the video is still black. It must be something else. – user2298922 Jun 21 '20 at 15:56
  • Ah, yeah that's different to what I'm seeing. Wouldn't rule out the same root cause, but we could easily be dealing with different issues. – Alex Forbes Jun 22 '20 at 16:07
  • On Ubuntu 20.04, I was having the exact same issue. It was very frustrating when the person on the other side asks you to turn on your camera, and you have to think of a lame excuse.The script is what I have been using now, and seems to work every time, at least until now. :) – zean_7 Mar 11 '21 at 14:29
0

I have a similar problem with the integrated webcam of a Dell XPS 15 L502X, and it's apparently a hardware issue: it gets fixed if, at the moment of start capturing, you shine a light (for instance, the smartphone flashlight) at the webcam. Seems like it needs a high light threshold to activate. Hope this helps you. Best regards.