Pitel
Posts: 25
Joined: Fri Jun 22, 2012 1:37 pm
Location: Brno, CZE
Contact: Website Facebook Google+ Skype Twitter YouTube

Can't record from V4L2 webcam again

Tue Nov 07, 2017 11:41 am

This works the first time:

Code: Select all

ffmpeg -f v4l2 -video_size 720x480 -i /dev/video0 -q:v 16 -r:v 5 -y test.mjpg
But after pressing Q and trying to start it again, I get either

Code: Select all

/dev/video0: Device or resource busy
or

Code: Select all

/dev/video0: No such file or directory
The only workaround now is to unplug and plug the camera again. But's it's unacceptable.

This happens with ffmpeg, motion, vlc and probably others.

Code: Select all

[ 3852.432421] usb 1-1.5.1: new high-speed USB device number 31 using dwc_otg
[ 3852.563818] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563833] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563842] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563851] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563860] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563869] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563878] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563887] usb 1-1.5.1: config 1 has an invalid interface number: 4 but max is 3
[ 3852.563896] usb 1-1.5.1: config 1 has no interface number 2
[ 3852.564547] usb 1-1.5.1: New USB device found, idVendor=07ca, idProduct=1510
[ 3852.564558] usb 1-1.5.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3852.564567] usb 1-1.5.1: Product: Live Gamer Portable 2
[ 3852.564575] usb 1-1.5.1: Manufacturer: AVerMedia Technologies, Inc.
[ 3852.564583] usb 1-1.5.1: SerialNumber: 5201372200340
[ 3852.568387] uvcvideo: Found UVC 1.00 device Live Gamer Portable 2 (07ca:1510)
[ 3852.631823] uvcvideo 1-1.5.1:1.0: Entity type for entity Extension 3 was not initialized!
[ 3852.631833] uvcvideo 1-1.5.1:1.0: Entity type for entity Processing 2 was not initialized!
[ 3852.631839] uvcvideo 1-1.5.1:1.0: Entity type for entity Camera 1 was not initialized!
[ 3852.632509] input: Live Gamer Portable 2 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5.1/1-1.5.1:1.0/input/input7
[ 3978.751766] usb 1-1.5.1: USB disconnect, device number 31
[ 3978.961395] usb 1-1.5.1: new full-speed USB device number 32 using dwc_otg
[ 3979.061388] usb 1-1.5.1: device descriptor read/64, error -32
[ 3979.281411] usb 1-1.5.1: device descriptor read/64, error -32
[ 3979.501411] usb 1-1.5.1: new full-speed USB device number 33 using dwc_otg
[ 3979.601421] usb 1-1.5.1: device descriptor read/64, error -32
[ 3979.821416] usb 1-1.5.1: device descriptor read/64, error -32
[ 3980.041407] usb 1-1.5.1: new full-speed USB device number 34 using dwc_otg
[ 3980.481409] usb 1-1.5.1: device not accepting address 34, error -32
[ 3980.581483] usb 1-1.5.1: new full-speed USB device number 35 using dwc_otg
[ 3981.021375] usb 1-1.5.1: device not accepting address 35, error -32
[ 3981.021455] usb 1-1.5-port1: unable to enumerate USB device
I'm using Rasbian Stretch Lite. It works fine on Ubuntu PC.

I'm using powered USB hub, so it shouldn't be an issue, I event ried with everything disconnected and results are the same.

luminary
Posts: 2
Joined: Sat Dec 30, 2017 12:13 pm

Re: Can't record from V4L2 webcam again

Sat Dec 30, 2017 12:17 pm

Same problem.
Camera: Logitech C270
Raspberry Pi 2 Model B
OS: Raspbian GNU/Linux 9 (stretch) (last stable build at this time)

luminary
Posts: 2
Joined: Sat Dec 30, 2017 12:13 pm

Re: Can't record from V4L2 webcam again

Sat Dec 30, 2017 1:12 pm

Solve Problem!

Add this lines to /boot/cmdline.txt

Code: Select all

dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3
Than reboot, and all work fine.

May be help one of this parameters, i dont check.
I simple add all of them and propblem gone.

Need contact with team who write dwc_otg usb driver but i dont have so many time for this... :?

palto
Posts: 4
Joined: Fri Jul 12, 2013 3:45 pm

Re: Can't record from V4L2 webcam again

Tue Mar 13, 2018 6:53 pm

@luminary Thanks for your help!
I can confirm that the addition to /boot/cmdline.txt worked for me as well :)

Note that the extra commands have to be added/appended to the existing line and not as a new line.

I tried which of the three extra commands are really required and found that only

Code: Select all

dwc_otg.fiq_fsm_mask=0x3
needs to eb added.

My full cmdline.txt is now

Code: Select all

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait dwc_otg.fiq_fsm_mask=0x3

bls
Posts: 286
Joined: Mon Oct 22, 2018 11:25 pm
Location: Seattle, WA

Re: Can't record from V4L2 webcam again

Wed May 29, 2019 11:24 pm

Thank you! :D I was bashing my head over this one. Adding

Code: Select all

dwc_otg.fiq_fsm_mask=0x3 
to /boot/config.txt fixes my Logitech QuickCam Pro 9000 on Stretch.

Return to “Troubleshooting”