Discussion:
[linux-uvc-devel] uvcvideo error and webcam stops working
ss infod
2016-02-23 22:49:31 UTC
Permalink
I'm using a RPI2 and a USB webcam (Microsoft HD3000) to record video in a C
program.

Now, I'm doing extensive testing and I see that when I record long video
(ex: 10-12 hours) I almost always got an error in dmesg. The errors are:

With Raspbian (Wheezy):
uvcvideo: Non-zero status (-5) in status completion handler.

With Raspbian (Jessie)
uvcvideo: Failed to resubmit video URB (-1).

After these errors, my camera is not working anymore.
I have to restart my program to fix the error.

My program is using OpenCV 2.4.1 or 2.4.11 (I tried both).
I'm using cvQueryFrame() to get the pictures and
cvCreateVideoWriter()/cvWriteFrame() to record the video to a USB dongle
(32 GB).

I also tried to enable some uvcvideo driver options but I still have the
problem after a few hours.

sudo nano /etc/modprobe.d/uvcvideo.conf
options uvcvideo nodrop=1
options uvcvideo timeout=5000
options uvcvideo quirks=0x80

Any idea what could cause the problem ?
What would be the best way to catch the problem and deal with it ?
Can I get dmesg message in my C program and restart the camera ?
Is it possible to do a power cycle on the USB camera from an API call ?

Thanks for your comments,
ssinfod
Jayakrishnan M
2016-02-25 04:17:18 UTC
Permalink
Hi ssinfod,
Post by ss infod
After these errors, my camera is not working anymore.
I have to restart my program to fix the error.
Are you able to capture video by restarting the capture program alone?
Do you reset the camera?
Post by ss infod
Is it possible to do a power cycle on the USB camera from an API call ?
Why is this needed? There is no API as such in uvcvideo. If the
platform allows, you could power off the USB port and enable it back
which will reset the camera. I am not familiar with raspberry pi, so
not sure whether you could do this.

Jayakrishnan
Post by ss infod
I'm using a RPI2 and a USB webcam (Microsoft HD3000) to record video in a C
program.
Now, I'm doing extensive testing and I see that when I record long video
uvcvideo: Non-zero status (-5) in status completion handler.
With Raspbian (Jessie)
uvcvideo: Failed to resubmit video URB (-1).
After these errors, my camera is not working anymore.
I have to restart my program to fix the error.
My program is using OpenCV 2.4.1 or 2.4.11 (I tried both).
I'm using cvQueryFrame() to get the pictures and
cvCreateVideoWriter()/cvWriteFrame() to record the video to a USB dongle
(32 GB).
I also tried to enable some uvcvideo driver options but I still have the
problem after a few hours.
sudo nano /etc/modprobe.d/uvcvideo.conf
options uvcvideo nodrop=1
options uvcvideo timeout=5000
options uvcvideo quirks=0x80
Any idea what could cause the problem ?
What would be the best way to catch the problem and deal with it ?
Can I get dmesg message in my C program and restart the camera ?
Is it possible to do a power cycle on the USB camera from an API call ?
Thanks for your comments,
ssinfod
Loading...