While capturing frames with your program or any other software (capturing via the v4l2 kernel module), you recieve select timeout errors and the process is terminated?
Do not despair:
I read about first pointers in this thread (identifying v4l2 uvcvideo kernel module as a steppingstone to the solution)
The proposed steps
modprobe uvcvideo nodrop=1 timeout=5000
improved the situation but did not prevent the select timeout errors.
I looked at the uvcvideo faq and read about the quirks for problem devices. The timeout problems seems related to the bandwidth. So now I use the additional uvcvideo option quirks=0x80 (bandwidth quirk). Further there is the program guvcview available with apt-get install, a desktop tool to set the capture options of your webcam. I turned off all automatic image processing options, i want to process the feed myself anyway.
No more timeout select errors and 15 FPS at 55% CPU (prior 3-5 FPS)! Significant less CPU usage at the reduced FPS I am aiming for (20% CPU at 5 FPS).
That way I am able to use my Logitech C120 webcam with the raspberry pi and opencv. I am really impressed what can be achieved with this 25$ device using 100 times less power and 20 times less money. I was haunted by the select timeout errors also on my 4 Mhz quad core box, but finally got rid of this using this phenomenal energy saving computational device!
No more timeout select crash with this shell script (and guvcview for the settings):
- Code: Select all
modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80