Discussion:
[linux-uvc-devel] webcam (uvc) random usb disconnect
ss infod
2016-12-09 18:07:56 UTC
Permalink
I made a small video recorder with a RPI3 and a USB webcam.
(ELP-USB100W03M-L170).

The video recorder is using OpenCV 3.1 to record video events. (about 10-15
seconds of video when GPIO is asserted. Recording at 10 FPS 320x240).

The webcam is using the uvcvideo driver.

I made a few units and almost all of them are working very reliably.

However, I have one videorecorder that sometimes goes bad and the camera
disconnect from /dev/video0 and goes to /dev/video1.

Then, I got the following message if I kill my program and try to restart
it again.

VIDEOIO ERROR: V4L: index 0 is not correct!

I'm using "cap = cv::VideoCapture(CV_CAP_ANY)"; to create/open the device.

*However, a system reboot (sudo reboot -n) will fix the problem and the
webcam will go back to /dev/video0.*

Here is the log of "dmesg" when the disconnection occurs (See log below at
16779.907007):

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.21-v7+ (***@dc4-XPS13-9333) (gcc
version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #911 SMP Thu
Sep 15 14:22:38 BST 2016
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7),
cr=10c5383d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT
aliasing instruction cache
[ 0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[ 0.000000] cma: Reserved 8 MiB at 0x3a800000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 241664
[ 0.000000] free_area_init_node: node 0, pgdat 808c2f40,
node_mem_map b9fa6000
[ 0.000000] Normal zone: 2124 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 241664 pages, LIFO batch:31
[ 0.000000] [bcm2709_smp_init_cpus] enter (9520->f3003010)
[ 0.000000] [bcm2709_smp_init_cpus] ncores=4
[ 0.000000] PERCPU: Embedded 13 pages/cpu @b9f61000 s22592 r8192
d22464 u53248
[ 0.000000] pcpu-alloc: s22592 r8192 d22464 u53248 alloc=13*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping
on. Total pages: 239540
[ 0.000000] Kernel command line: 8250.nr_uarts=1
dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416
bcm2709.boardrev=0xa22082 bcm2709.serial=0x99238166
smsc95xx.macaddr=B8:27:EB:23:81:66 bcm2708_fb.fbswap=1
bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000
vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=tty1
root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes
rootwait fastboot noswap ro
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7,
524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6,
262144 bytes)
[ 0.000000] Memory: 939068K/966656K available (6348K kernel
code, 432K rwdata, 1716K rodata, 476K init, 764K bss, 19396K reserved,
8192K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xbb800000 - 0xff800000 (1088 MB)
lowmem : 0x80000000 - 0xbb000000 ( 944 MB)
modules : 0x7f000000 - 0x80000000 ( 16 MB)
.text : 0x80008000 - 0x807e854c (8066 kB)
.init : 0x807e9000 - 0x80860000 ( 476 kB)
.data : 0x80860000 - 0x808cc250 ( 433 kB)
.bss : 0x808cf000 - 0x8098e1ec ( 765 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4,
Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 19.20MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask:
0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000009] sched_clock: 56 bits at 19MHz, resolution 52ns,
wraps every 4398046511078ns
[ 0.000026] Switching to timer-based delay loop, resolution 52ns
...
[16779.907007] usb 1-1.4: USB disconnect, device number 5
[16780.149776] usb 1-1.4: new high-speed USB device number 6 using
dwc_otg
[16780.649742] usb 1-1.4: new high-speed USB device number 7 using
dwc_otg
[16780.803420] usb 1-1.4: New USB device found, idVendor=05a3,
idProduct=9310
[16780.803437] usb 1-1.4: New USB device strings: Mfr=2, Product=1,
SerialNumber=0
[16780.803450] usb 1-1.4: Product: USB 2.0 Camera
[16780.803463] usb 1-1.4: Manufacturer: HD Camera Manufacturer
[16780.806521] uvcvideo: Found UVC 1.00 device USB 2.0 Camera
(05a3:9310)
[16780.819931] input: USB 2.0 Camera as /devices/platform/soc/
3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input1
[16780.830889] usb 1-1.4: 3:1: cannot get freq at ep 0x84
[16781.239778] ------------[ cut here ]------------
[16781.239816] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.239827] sysfs group 808a93dc not found for kobject 'event0'
[16781.239835] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.239966] CPU: 2 PID: 1695 Comm: vidcap Not tainted 4.4.21-v7+
#911
[16781.239975] Hardware name: BCM2709
[16781.240008] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.240031] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.240055] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.240078] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.240098] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.240121] [<801cdbe4>] (sysfs_remove_group) from [<803afe70>]
(dpm_sysfs_remove+0x5c/0x60)
[16781.240145] [<803afe70>] (dpm_sysfs_remove) from [<803a5460>]
(device_del+0x48/0x220)
[16781.240173] [<803a5460>] (device_del) from [<7f2fe1cc>]
(evdev_disconnect+0x28/0x50 [evdev])
[16781.240214] [<7f2fe1cc>] (evdev_disconnect [evdev]) from
[<80450afc>] (__input_unregister_device+0xc4/0x164)
[16781.240234] [<80450afc>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.240266] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.240307] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.240344] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.240393] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.240434] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.240455] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.240476] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.240495] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.240530] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.240571] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.240591] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.240611] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.240634] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.240656] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.240675] ---[ end trace 961dba5b0b7d4ff1 ]---
[16781.269848] ------------[ cut here ]------------
[16781.269883] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.269894] sysfs group 808a93dc not found for kobject 'input0'
[16781.269902] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.270033] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.270043] Hardware name: BCM2709
[16781.270075] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.270098] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.270122] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.270144] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.270165] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.270188] [<801cdbe4>] (sysfs_remove_group) from [<803afe70>]
(dpm_sysfs_remove+0x5c/0x60)
[16781.270212] [<803afe70>] (dpm_sysfs_remove) from [<803a5460>]
(device_del+0x48/0x220)
[16781.270234] [<803a5460>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.270254] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.270289] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.270329] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.270366] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.270416] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.270455] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.270476] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.270496] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.270515] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.270552] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.270592] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.270612] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.270632] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.270656] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.270677] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.270689] ---[ end trace 961dba5b0b7d4ff2 ]---
[16781.270724] ------------[ cut here ]------------
[16781.270757] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.270767] sysfs group 808b42e0 not found for kobject 'input0'
[16781.270774] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.270890] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.270899] Hardware name: BCM2709
[16781.270921] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.270941] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.270962] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.270984] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.271004] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.271021] [<801cdbe4>] (sysfs_remove_group) from [<801cdc1c>]
(sysfs_remove_groups+0x34/0x44)
[16781.271040] [<801cdc1c>] (sysfs_remove_groups) from [<803a4a7c>]
(device_remove_attrs+0x60/0x7c)
[16781.271059] [<803a4a7c>] (device_remove_attrs) from [<803a552c>]
(device_del+0x114/0x220)
[16781.271078] [<803a552c>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.271096] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.271126] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.271165] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.271201] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.271246] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.271284] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.271304] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.271323] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.271342] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.271377] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.271415] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.271434] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.271452] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.271474] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.271494] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.271511] ---[ end trace 961dba5b0b7d4ff3 ]---
[16781.271542] ------------[ cut here ]------------
[16781.271558] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.271567] sysfs group 808b4214 not found for kobject 'input0'
[16781.271575] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.271688] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.271697] Hardware name: BCM2709
[16781.271718] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.271738] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.271759] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.271781] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.271801] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.271818] [<801cdbe4>] (sysfs_remove_group) from [<801cdc1c>]
(sysfs_remove_groups+0x34/0x44)
[16781.271837] [<801cdc1c>] (sysfs_remove_groups) from [<803a4a7c>]
(device_remove_attrs+0x60/0x7c)
[16781.271856] [<803a4a7c>] (device_remove_attrs) from [<803a552c>]
(device_del+0x114/0x220)
[16781.271875] [<803a552c>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.271893] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.271922] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.271961] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.271997] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.272042] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.272080] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.272100] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.272119] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.272138] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.272174] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.272212] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.272231] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.272249] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.272271] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.272291] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.272308] ---[ end trace 961dba5b0b7d4ff4 ]---
[16781.272482] ------------[ cut here ]------------
[16781.272500] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.272510] sysfs group 808a93dc not found for kobject 'media0'
[16781.272517] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.272634] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.272643] Hardware name: BCM2709
[16781.272666] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.272686] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.272706] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.272728] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.272748] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.272769] [<801cdbe4>] (sysfs_remove_group) from [<803afe70>]
(dpm_sysfs_remove+0x5c/0x60)
[16781.272790] [<803afe70>] (dpm_sysfs_remove) from [<803a5460>]
(device_del+0x48/0x220)
[16781.272809] [<803a5460>] (device_del) from [<803a5654>]
(device_unregister+0x1c/0x30)
[16781.272834] [<803a5654>] (device_unregister) from [<7f1bee3c>]
(media_devnode_unregister+0x50/0x54 [media])
[16781.272869] [<7f1bee3c>] (media_devnode_unregister [media]) from
[<7f1be3c0>] (media_device_unregister+0x58/0x5c [media])
[16781.272901] [<7f1be3c0>] (media_device_unregister [media]) from
[<7f2e5430>] (uvc_delete+0x130/0x138 [uvcvideo])
[16781.272938] [<7f2e5430>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.272984] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.273021] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.273041] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.273061] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.273079] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.273115] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.273154] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.273172] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.273191] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.273213] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.273233] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.273252] ---[ end trace 961dba5b0b7d4ff5 ]---


Any idea what could cause the problem and why do I have to restart the OS
to fix the webcam disconnection ?

Any possible workaround ? (Could I unload / reload the driver or perform
any USB software restart)

thanks
ss infod
2016-12-12 18:20:05 UTC
Permalink
I found something else.
I can also remove the uvcvideo module and reload it to fix the problem.
(instead of doing a full system reboot)

sudo modprobe -r uvcvideo
sudo modprobe uvcvideo


Any idea why the kernel is still keeping a hold on /dev/video0 ?

Would it be possible to catch the USB disconnect event with a "udev rules" ?
Would it be a bad idea to remove and reload the uvcvideo module when I got
a USB disconnect event (kernel trace) ?

Thanks,
ssinfod
Post by ss infod
I made a small video recorder with a RPI3 and a USB webcam.
(ELP-USB100W03M-L170).
The video recorder is using OpenCV 3.1 to record video events. (about
10-15 seconds of video when GPIO is asserted. Recording at 10 FPS 320x240).
The webcam is using the uvcvideo driver.
I made a few units and almost all of them are working very reliably.
However, I have one videorecorder that sometimes goes bad and the camera
disconnect from /dev/video0 and goes to /dev/video1.
Then, I got the following message if I kill my program and try to restart
it again.
VIDEOIO ERROR: V4L: index 0 is not correct!
I'm using "cap = cv::VideoCapture(CV_CAP_ANY)"; to create/open the device.
*However, a system reboot (sudo reboot -n) will fix the problem and the
webcam will go back to /dev/video0.*
Here is the log of "dmesg" when the disconnection occurs (See log below at
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #911 SMP
Thu Sep 15 14:22:38 BST 2016
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7),
cr=10c5383d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT
aliasing instruction cache
[ 0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[ 0.000000] cma: Reserved 8 MiB at 0x3a800000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 241664
[ 0.000000] free_area_init_node: node 0, pgdat 808c2f40,
node_mem_map b9fa6000
[ 0.000000] Normal zone: 2124 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 241664 pages, LIFO batch:31
[ 0.000000] [bcm2709_smp_init_cpus] enter (9520->f3003010)
[ 0.000000] [bcm2709_smp_init_cpus] ncores=4
r8192 d22464 u53248
[ 0.000000] pcpu-alloc: s22592 r8192 d22464 u53248 alloc=13*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping
on. Total pages: 239540
[ 0.000000] Kernel command line: 8250.nr_uarts=1
dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416
bcm2709.boardrev=0xa22082 bcm2709.serial=0x99238166
smsc95xx.macaddr=B8:27:EB:23:81:66 bcm2708_fb.fbswap=1
bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000
vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=tty1
root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes
rootwait fastboot noswap ro
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7,
524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6,
262144 bytes)
[ 0.000000] Memory: 939068K/966656K available (6348K kernel
code, 432K rwdata, 1716K rodata, 476K init, 764K bss, 19396K reserved,
8192K cma-reserved)
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xbb800000 - 0xff800000 (1088 MB)
lowmem : 0x80000000 - 0xbb000000 ( 944 MB)
modules : 0x7f000000 - 0x80000000 ( 16 MB)
.text : 0x80008000 - 0x807e854c (8066 kB)
.init : 0x807e9000 - 0x80860000 ( 476 kB)
.data : 0x80860000 - 0x808cc250 ( 433 kB)
.bss : 0x808cf000 - 0x8098e1ec ( 765 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4,
Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 19.20MHz (phys).
0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000009] sched_clock: 56 bits at 19MHz, resolution 52ns,
wraps every 4398046511078ns
[ 0.000026] Switching to timer-based delay loop, resolution 52ns
...
[16779.907007] usb 1-1.4: USB disconnect, device number 5
[16780.149776] usb 1-1.4: new high-speed USB device number 6 using
dwc_otg
[16780.649742] usb 1-1.4: new high-speed USB device number 7 using
dwc_otg
[16780.803420] usb 1-1.4: New USB device found, idVendor=05a3,
idProduct=9310
[16780.803437] usb 1-1.4: New USB device strings: Mfr=2,
Product=1, SerialNumber=0
[16780.803450] usb 1-1.4: Product: USB 2.0 Camera
[16780.803463] usb 1-1.4: Manufacturer: HD Camera Manufacturer
[16780.806521] uvcvideo: Found UVC 1.00 device USB 2.0 Camera
(05a3:9310)
[16780.819931] input: USB 2.0 Camera as
/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input1
[16780.830889] usb 1-1.4: 3:1: cannot get freq at ep 0x84
[16781.239778] ------------[ cut here ]------------
[16781.239816] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.239827] sysfs group 808a93dc not found for kobject 'event0'
[16781.239835] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.239966] CPU: 2 PID: 1695 Comm: vidcap Not tainted
4.4.21-v7+ #911
[16781.239975] Hardware name: BCM2709
[16781.240008] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.240031] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.240055] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.240078] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.240098] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.240121] [<801cdbe4>] (sysfs_remove_group) from [<803afe70>]
(dpm_sysfs_remove+0x5c/0x60)
[16781.240145] [<803afe70>] (dpm_sysfs_remove) from [<803a5460>]
(device_del+0x48/0x220)
[16781.240173] [<803a5460>] (device_del) from [<7f2fe1cc>]
(evdev_disconnect+0x28/0x50 [evdev])
[16781.240214] [<7f2fe1cc>] (evdev_disconnect [evdev]) from
[<80450afc>] (__input_unregister_device+0xc4/0x164)
[16781.240234] [<80450afc>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.240266] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.240307] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.240344] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.240393] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.240434] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.240455] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.240476] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.240495] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.240530] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.240571] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.240591] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.240611] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.240634] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.240656] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.240675] ---[ end trace 961dba5b0b7d4ff1 ]---
[16781.269848] ------------[ cut here ]------------
[16781.269883] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.269894] sysfs group 808a93dc not found for kobject 'input0'
[16781.269902] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.270033] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.270043] Hardware name: BCM2709
[16781.270075] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.270098] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.270122] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.270144] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.270165] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.270188] [<801cdbe4>] (sysfs_remove_group) from [<803afe70>]
(dpm_sysfs_remove+0x5c/0x60)
[16781.270212] [<803afe70>] (dpm_sysfs_remove) from [<803a5460>]
(device_del+0x48/0x220)
[16781.270234] [<803a5460>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.270254] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.270289] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.270329] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.270366] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.270416] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.270455] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.270476] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.270496] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.270515] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.270552] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.270592] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.270612] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.270632] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.270656] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.270677] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.270689] ---[ end trace 961dba5b0b7d4ff2 ]---
[16781.270724] ------------[ cut here ]------------
[16781.270757] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.270767] sysfs group 808b42e0 not found for kobject 'input0'
[16781.270774] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.270890] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.270899] Hardware name: BCM2709
[16781.270921] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.270941] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.270962] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.270984] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.271004] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.271021] [<801cdbe4>] (sysfs_remove_group) from [<801cdc1c>]
(sysfs_remove_groups+0x34/0x44)
[16781.271040] [<801cdc1c>] (sysfs_remove_groups) from
[<803a4a7c>] (device_remove_attrs+0x60/0x7c)
[16781.271059] [<803a4a7c>] (device_remove_attrs) from
[<803a552c>] (device_del+0x114/0x220)
[16781.271078] [<803a552c>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.271096] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.271126] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.271165] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.271201] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.271246] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.271284] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.271304] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.271323] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.271342] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.271377] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.271415] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.271434] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.271452] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.271474] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.271494] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.271511] ---[ end trace 961dba5b0b7d4ff3 ]---
[16781.271542] ------------[ cut here ]------------
[16781.271558] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.271567] sysfs group 808b4214 not found for kobject 'input0'
[16781.271575] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.271688] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.271697] Hardware name: BCM2709
[16781.271718] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.271738] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.271759] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.271781] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.271801] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.271818] [<801cdbe4>] (sysfs_remove_group) from [<801cdc1c>]
(sysfs_remove_groups+0x34/0x44)
[16781.271837] [<801cdc1c>] (sysfs_remove_groups) from
[<803a4a7c>] (device_remove_attrs+0x60/0x7c)
[16781.271856] [<803a4a7c>] (device_remove_attrs) from
[<803a552c>] (device_del+0x114/0x220)
[16781.271875] [<803a552c>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.271893] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.271922] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.271961] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo]) from
[<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.271997] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.272042] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.272080] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.272100] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.272119] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.272138] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.272174] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.272212] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.272231] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.272249] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.272271] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.272291] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.272308] ---[ end trace 961dba5b0b7d4ff4 ]---
[16781.272482] ------------[ cut here ]------------
[16781.272500] WARNING: CPU: 2 PID: 1695 at fs/sysfs/group.c:237
sysfs_remove_group+0xa0/0xa4()
[16781.272510] sysfs group 808a93dc not found for kobject 'media0'
[16781.272517] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.272634] CPU: 2 PID: 1695 Comm: vidcap Tainted: G W
4.4.21-v7+ #911
[16781.272643] Hardware name: BCM2709
[16781.272666] [<80018784>] (unwind_backtrace) from [<80014058>]
(show_stack+0x20/0x24)
[16781.272686] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.272706] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.272728] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.272748] [<800253d0>] (warn_slowpath_fmt) from [<801cdbe4>]
(sysfs_remove_group+0xa0/0xa4)
[16781.272769] [<801cdbe4>] (sysfs_remove_group) from [<803afe70>]
(dpm_sysfs_remove+0x5c/0x60)
[16781.272790] [<803afe70>] (dpm_sysfs_remove) from [<803a5460>]
(device_del+0x48/0x220)
[16781.272809] [<803a5460>] (device_del) from [<803a5654>]
(device_unregister+0x1c/0x30)
[16781.272834] [<803a5654>] (device_unregister) from [<7f1bee3c>]
(media_devnode_unregister+0x50/0x54 [media])
[16781.272869] [<7f1bee3c>] (media_devnode_unregister [media])
from [<7f1be3c0>] (media_device_unregister+0x58/0x5c [media])
[16781.272901] [<7f1be3c0>] (media_device_unregister [media]) from
[<7f2e5430>] (uvc_delete+0x130/0x138 [uvcvideo])
[16781.272938] [<7f2e5430>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.272984] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.273021] [<7f1e8800>] (v4l2_device_release [videodev]) from
[<803a4b54>] (device_release+0x3c/0xa0)
[16781.273041] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.273061] [<80323140>] (kobject_release) from [<803231c8>]
(kobject_put+0x54/0x80)
[16781.273079] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.273115] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.273154] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.273172] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.273191] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.273213] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.273233] [<80013914>] (do_work_pending) from [<8000fb68>]
(slow_work_pending+0xc/0x20)
[16781.273252] ---[ end trace 961dba5b0b7d4ff5 ]---
Any idea what could cause the problem and why do I have to restart the OS
to fix the webcam disconnection ?
Any possible workaround ? (Could I unload / reload the driver or perform
any USB software restart)
thanks
Robert Merrill
2016-12-21 13:44:23 UTC
Permalink
I would seek out help from raspberry pi forums, irc channels et cetera.
They run a custom kernel, it's likely there is some bug here they'd be
interested in fixing.
I use a power module (15 Watts) which is protecting and regulating the RPI.
I have two others video recorders with the exact same power that don't
have this problem.
I don't understand why the camera does not come back to /dev/video0
(instead of /dev/video1)
Is there a way to know who is keeping (holding) the /dev/video0 ressource ?
What is the best way to handle the USB disconnection and force back my
camera to /dev/video0 ?
I'm thinking to create a udev rule and remove and install the uvcvideo
sudo modprobe -r uvcvideo
sudo modprobe uvcvideo
Is this a bad idea ? Is there any other work around ?
That being said, I will also check the power / cable / replace camera,
etc..
thanks
How are you powering your Raspberry Pi? Typical USB chargers give very
dirty power and I don't think the raspberry pi does any cleaning up of the
5V USB.
You might want to put a scope on the 5V and see if it's noisy or dipping
too low.
I also logged the output from udevadm monitor during another USB
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[19192.989541] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.0/video4linux/video0 (video4linux)
KERNEL[19192.989655] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0
(usb)
KERNEL[19192.991898] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1
(usb)
KERNEL[19192.992401] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/pcmC1D0c (sound)
KERNEL[19192.992643] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/controlC1 (sound)
KERNEL[19192.996064] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1 (sound)
UDEV [19192.996415] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.0/video4linux/video0 (video4linux)
KERNEL[19192.996558] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2
(usb)
UDEV [19192.996656] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/pcmC1D0c (sound)
KERNEL[19192.996755] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3
(usb)
UDEV [19192.996876] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1
(usb)
UDEV [19192.996978] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0
(usb)
KERNEL[19192.997358] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
(usb)
UDEV [19192.997675] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3
(usb)
UDEV [19192.998943] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/controlC1 (sound)
UDEV [19192.999605] remove /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1 (sound)
UDEV [19193.000518] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2
(usb)
UDEV [19193.001371] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
(usb)
KERNEL[19193.384372] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
(usb)
KERNEL[19193.386698] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0
(usb)
KERNEL[19193.387053] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/media1 (media)
KERNEL[19193.399962] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/video4linux/video1 (video4linux)
KERNEL[19193.400317] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input1 (input)
KERNEL[19193.400539] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input1/event1 (input)
KERNEL[19193.402612] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1
(usb)
KERNEL[19193.403885] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2
(usb)
KERNEL[19193.428412] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1 (sound)
KERNEL[19193.428618] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/controlC1 (sound)
KERNEL[19193.428837] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/pcmC1D0c (sound)
KERNEL[19193.429124] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3
(usb)
UDEV [19193.430764] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
(usb)
UDEV [19193.433548] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1
(usb)
UDEV [19193.433660] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0
(usb)
UDEV [19193.436031] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.2
(usb)
UDEV [19193.436123] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/media1 (media)
UDEV [19193.436471] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1 (sound)
UDEV [19193.438671] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.3
(usb)
UDEV [19193.438765] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/pcmC1D0c (sound)
KERNEL[19193.440085] change /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1 (sound)
UDEV [19193.445199] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/video4linux/video1 (video4linux)
UDEV [19193.451638] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input1 (input)
UDEV [19193.463962] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input1/event1 (input)
UDEV [19193.464152] add /devices/platform/soc/3f98000
0.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1/controlC1 (sound)
UDEV [19193.467533] change /devices/platform/soc/3f980000
.usb/usb1/1-1/1-1.4/1-1.4:1.2/sound/card1 (sound)
KERNEL[19194.321249] remove /1-1.4:1.0/input/input0/event0 (input)
UDEV [19194.323320] remove /1-1.4:1.0/input/input0/event0 (input)
KERNEL[19194.362750] remove /1-1.4:1.0/input/input0 (input)
KERNEL[19194.363659] remove /1-1.4:1.0/media0 (media)
UDEV [19194.364337] remove /1-1.4:1.0/media0 (media)
UDEV [19194.366840] remove /1-1.4:1.0/input/input0 (input)
KERNEL[86391.511302] add /devices/virtual/vc/vcs63 (vc)
KERNEL[86391.512387] add /devices/virtual/vc/vcsa63 (vc)
UDEV [86391.515590] add /devices/virtual/vc/vcs63 (vc)
UDEV [86391.515634] add /devices/virtual/vc/vcsa63 (vc)
I'm not really sure how to interpret the dmesg output and the udev
events / log.
Any idea what could cause the USB disconnection ?
What is the recommended way to handle this kind of USB disconnection ?
Thanks,
Post by ss infod
I found something else.
I can also remove the uvcvideo module and reload it to fix the problem.
(instead of doing a full system reboot)
sudo modprobe -r uvcvideo
sudo modprobe uvcvideo
Any idea why the kernel is still keeping a hold on /dev/video0 ?
Would it be possible to catch the USB disconnect event with a "udev rules" ?
Would it be a bad idea to remove and reload the uvcvideo module when I
got a USB disconnect event (kernel trace) ?
Thanks,
ssinfod
Post by ss infod
I made a small video recorder with a RPI3 and a USB webcam.
(ELP-USB100W03M-L170).
The video recorder is using OpenCV 3.1 to record video events. (about
10-15 seconds of video when GPIO is asserted. Recording at 10 FPS 320x240).
The webcam is using the uvcvideo driver.
I made a few units and almost all of them are working very reliably.
However, I have one videorecorder that sometimes goes bad and the
camera disconnect from /dev/video0 and goes to /dev/video1.
Then, I got the following message if I kill my program and try to
restart it again.
VIDEOIO ERROR: V4L: index 0 is not correct!
I'm using "cap = cv::VideoCapture(CV_CAP_ANY)"; to create/open the device.
*However, a system reboot (sudo reboot -n) will fix the problem and
the webcam will go back to /dev/video0.*
Here is the log of "dmesg" when the disconnection occurs (See log
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
(gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) )
#911 SMP Thu Sep 15 14:22:38 BST 2016
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4
(ARMv7), cr=10c5383d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT
aliasing instruction cache
[ 0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[ 0.000000] cma: Reserved 8 MiB at 0x3a800000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 241664
[ 0.000000] free_area_init_node: node 0, pgdat 808c2f40,
node_mem_map b9fa6000
[ 0.000000] Normal zone: 2124 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 241664 pages, LIFO batch:31
[ 0.000000] [bcm2709_smp_init_cpus] enter (9520->f3003010)
[ 0.000000] [bcm2709_smp_init_cpus] ncores=4
r8192 d22464 u53248
[ 0.000000] pcpu-alloc: s22592 r8192 d22464 u53248 alloc=13*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Built 1 zonelists in Zone order, mobility
grouping on. Total pages: 239540
[ 0.000000] Kernel command line: 8250.nr_uarts=1
dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416
bcm2709.boardrev=0xa22082 bcm2709.serial=0x99238166
smsc95xx.macaddr=B8:27:EB:23:81:66 bcm2708_fb.fbswap=1
bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000
vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=tty1
root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes
rootwait fastboot noswap ro
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
7, 524288 bytes)
6, 262144 bytes)
[ 0.000000] Memory: 939068K/966656K available (6348K kernel
code, 432K rwdata, 1716K rodata, 476K init, 764K bss, 19396K reserved,
8192K cma-reserved)
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xbb800000 - 0xff800000 (1088 MB)
lowmem : 0x80000000 - 0xbb000000 ( 944 MB)
modules : 0x7f000000 - 0x80000000 ( 16 MB)
.text : 0x80008000 - 0x807e854c (8066 kB)
.init : 0x807e9000 - 0x80860000 ( 476 kB)
.data : 0x80860000 - 0x808cc250 ( 433 kB)
.bss : 0x808cf000 - 0x8098e1ec ( 765 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0,
CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] Architected cp15 timer(s) running at 19.20MHz (phys).
0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000009] sched_clock: 56 bits at 19MHz, resolution 52ns,
wraps every 4398046511078ns
[ 0.000026] Switching to timer-based delay loop, resolution 52ns
...
[16779.907007] usb 1-1.4: USB disconnect, device number 5
[16780.149776] usb 1-1.4: new high-speed USB device number 6
using dwc_otg
[16780.649742] usb 1-1.4: new high-speed USB device number 7
using dwc_otg
[16780.803420] usb 1-1.4: New USB device found, idVendor=05a3,
idProduct=9310
[16780.803437] usb 1-1.4: New USB device strings: Mfr=2,
Product=1, SerialNumber=0
[16780.803450] usb 1-1.4: Product: USB 2.0 Camera
[16780.803463] usb 1-1.4: Manufacturer: HD Camera Manufacturer
[16780.806521] uvcvideo: Found UVC 1.00 device USB 2.0 Camera
(05a3:9310)
[16780.819931] input: USB 2.0 Camera as
/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/
input/input1
[16780.830889] usb 1-1.4: 3:1: cannot get freq at ep 0x84
[16781.239778] ------------[ cut here ]------------
[16781.239816] WARNING: CPU: 2 PID: 1695 at
fs/sysfs/group.c:237 sysfs_remove_group+0xa0/0xa4()
[16781.239827] sysfs group 808a93dc not found for kobject 'event0'
[16781.239835] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.239966] CPU: 2 PID: 1695 Comm: vidcap Not tainted
4.4.21-v7+ #911
[16781.239975] Hardware name: BCM2709
[16781.240008] [<80018784>] (unwind_backtrace) from
[<80014058>] (show_stack+0x20/0x24)
[16781.240031] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.240055] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.240078] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.240098] [<800253d0>] (warn_slowpath_fmt) from
[<801cdbe4>] (sysfs_remove_group+0xa0/0xa4)
[16781.240121] [<801cdbe4>] (sysfs_remove_group) from
[<803afe70>] (dpm_sysfs_remove+0x5c/0x60)
[16781.240145] [<803afe70>] (dpm_sysfs_remove) from
[<803a5460>] (device_del+0x48/0x220)
[16781.240173] [<803a5460>] (device_del) from [<7f2fe1cc>]
(evdev_disconnect+0x28/0x50 [evdev])
[16781.240214] [<7f2fe1cc>] (evdev_disconnect [evdev]) from
[<80450afc>] (__input_unregister_device+0xc4/0x164)
[16781.240234] [<80450afc>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.240266] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.240307] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo])
from [<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.240344] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.240393] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.240434] [<7f1e8800>] (v4l2_device_release [videodev])
from [<803a4b54>] (device_release+0x3c/0xa0)
[16781.240455] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.240476] [<80323140>] (kobject_release) from
[<803231c8>] (kobject_put+0x54/0x80)
[16781.240495] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.240530] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.240571] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.240591] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.240611] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.240634] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.240656] [<80013914>] (do_work_pending) from
[<8000fb68>] (slow_work_pending+0xc/0x20)
[16781.240675] ---[ end trace 961dba5b0b7d4ff1 ]---
[16781.269848] ------------[ cut here ]------------
[16781.269883] WARNING: CPU: 2 PID: 1695 at
fs/sysfs/group.c:237 sysfs_remove_group+0xa0/0xa4()
[16781.269894] sysfs group 808a93dc not found for kobject 'input0'
[16781.269902] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.270033] CPU: 2 PID: 1695 Comm: vidcap Tainted: G
W 4.4.21-v7+ #911
[16781.270043] Hardware name: BCM2709
[16781.270075] [<80018784>] (unwind_backtrace) from
[<80014058>] (show_stack+0x20/0x24)
[16781.270098] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.270122] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.270144] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.270165] [<800253d0>] (warn_slowpath_fmt) from
[<801cdbe4>] (sysfs_remove_group+0xa0/0xa4)
[16781.270188] [<801cdbe4>] (sysfs_remove_group) from
[<803afe70>] (dpm_sysfs_remove+0x5c/0x60)
[16781.270212] [<803afe70>] (dpm_sysfs_remove) from
[<803a5460>] (device_del+0x48/0x220)
[16781.270234] [<803a5460>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.270254] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.270289] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.270329] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo])
from [<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.270366] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.270416] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.270455] [<7f1e8800>] (v4l2_device_release [videodev])
from [<803a4b54>] (device_release+0x3c/0xa0)
[16781.270476] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.270496] [<80323140>] (kobject_release) from
[<803231c8>] (kobject_put+0x54/0x80)
[16781.270515] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.270552] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.270592] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.270612] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.270632] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.270656] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.270677] [<80013914>] (do_work_pending) from
[<8000fb68>] (slow_work_pending+0xc/0x20)
[16781.270689] ---[ end trace 961dba5b0b7d4ff2 ]---
[16781.270724] ------------[ cut here ]------------
[16781.270757] WARNING: CPU: 2 PID: 1695 at
fs/sysfs/group.c:237 sysfs_remove_group+0xa0/0xa4()
[16781.270767] sysfs group 808b42e0 not found for kobject 'input0'
[16781.270774] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.270890] CPU: 2 PID: 1695 Comm: vidcap Tainted: G
W 4.4.21-v7+ #911
[16781.270899] Hardware name: BCM2709
[16781.270921] [<80018784>] (unwind_backtrace) from
[<80014058>] (show_stack+0x20/0x24)
[16781.270941] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.270962] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.270984] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.271004] [<800253d0>] (warn_slowpath_fmt) from
[<801cdbe4>] (sysfs_remove_group+0xa0/0xa4)
[16781.271021] [<801cdbe4>] (sysfs_remove_group) from
[<801cdc1c>] (sysfs_remove_groups+0x34/0x44)
[16781.271040] [<801cdc1c>] (sysfs_remove_groups) from
[<803a4a7c>] (device_remove_attrs+0x60/0x7c)
[16781.271059] [<803a4a7c>] (device_remove_attrs) from
[<803a552c>] (device_del+0x114/0x220)
[16781.271078] [<803a552c>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.271096] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.271126] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.271165] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo])
from [<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.271201] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.271246] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.271284] [<7f1e8800>] (v4l2_device_release [videodev])
from [<803a4b54>] (device_release+0x3c/0xa0)
[16781.271304] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.271323] [<80323140>] (kobject_release) from
[<803231c8>] (kobject_put+0x54/0x80)
[16781.271342] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.271377] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.271415] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.271434] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.271452] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.271474] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.271494] [<80013914>] (do_work_pending) from
[<8000fb68>] (slow_work_pending+0xc/0x20)
[16781.271511] ---[ end trace 961dba5b0b7d4ff3 ]---
[16781.271542] ------------[ cut here ]------------
[16781.271558] WARNING: CPU: 2 PID: 1695 at
fs/sysfs/group.c:237 sysfs_remove_group+0xa0/0xa4()
[16781.271567] sysfs group 808b4214 not found for kobject 'input0'
[16781.271575] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.271688] CPU: 2 PID: 1695 Comm: vidcap Tainted: G
W 4.4.21-v7+ #911
[16781.271697] Hardware name: BCM2709
[16781.271718] [<80018784>] (unwind_backtrace) from
[<80014058>] (show_stack+0x20/0x24)
[16781.271738] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.271759] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.271781] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.271801] [<800253d0>] (warn_slowpath_fmt) from
[<801cdbe4>] (sysfs_remove_group+0xa0/0xa4)
[16781.271818] [<801cdbe4>] (sysfs_remove_group) from
[<801cdc1c>] (sysfs_remove_groups+0x34/0x44)
[16781.271837] [<801cdc1c>] (sysfs_remove_groups) from
[<803a4a7c>] (device_remove_attrs+0x60/0x7c)
[16781.271856] [<803a4a7c>] (device_remove_attrs) from
[<803a552c>] (device_del+0x114/0x220)
[16781.271875] [<803a552c>] (device_del) from [<80450b80>]
(__input_unregister_device+0x148/0x164)
[16781.271893] [<80450b80>] (__input_unregister_device) from
[<80451424>] (input_unregister_device+0x58/0x80)
[16781.271922] [<80451424>] (input_unregister_device) from
[<7f2ef52c>] (uvc_status_cleanup+0x40/0x44 [uvcvideo])
[16781.271961] [<7f2ef52c>] (uvc_status_cleanup [uvcvideo])
from [<7f2e531c>] (uvc_delete+0x1c/0x138 [uvcvideo])
[16781.271997] [<7f2e531c>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.272042] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.272080] [<7f1e8800>] (v4l2_device_release [videodev])
from [<803a4b54>] (device_release+0x3c/0xa0)
[16781.272100] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.272119] [<80323140>] (kobject_release) from
[<803231c8>] (kobject_put+0x54/0x80)
[16781.272138] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.272174] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.272212] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.272231] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.272249] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.272271] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.272291] [<80013914>] (do_work_pending) from
[<8000fb68>] (slow_work_pending+0xc/0x20)
[16781.272308] ---[ end trace 961dba5b0b7d4ff4 ]---
[16781.272482] ------------[ cut here ]------------
[16781.272500] WARNING: CPU: 2 PID: 1695 at
fs/sysfs/group.c:237 sysfs_remove_group+0xa0/0xa4()
[16781.272510] sysfs group 808a93dc not found for kobject 'media0'
[16781.272517] Modules linked in: i2c_dev sg evdev uvcvideo
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 brcmfmac videobuf2_core
v4l2_common snd_usb_audio videodev snd_hwdep rtc_ds1307 snd_usbmidi_lib
brcmutil media snd_rawmidi snd_seq_device cfg80211 rfkill snd_bcm2835
snd_pcm snd_timer snd bcm2835_wdt i2c_bcm2708 bcm2835_gpiomem
uio_pdrv_genirq uio
[16781.272634] CPU: 2 PID: 1695 Comm: vidcap Tainted: G
W 4.4.21-v7+ #911
[16781.272643] Hardware name: BCM2709
[16781.272666] [<80018784>] (unwind_backtrace) from
[<80014058>] (show_stack+0x20/0x24)
[16781.272686] [<80014058>] (show_stack) from [<80320f04>]
(dump_stack+0xd4/0x118)
[16781.272706] [<80320f04>] (dump_stack) from [<80025360>]
(warn_slowpath_common+0x98/0xc8)
[16781.272728] [<80025360>] (warn_slowpath_common) from
[<800253d0>] (warn_slowpath_fmt+0x40/0x48)
[16781.272748] [<800253d0>] (warn_slowpath_fmt) from
[<801cdbe4>] (sysfs_remove_group+0xa0/0xa4)
[16781.272769] [<801cdbe4>] (sysfs_remove_group) from
[<803afe70>] (dpm_sysfs_remove+0x5c/0x60)
[16781.272790] [<803afe70>] (dpm_sysfs_remove) from
[<803a5460>] (device_del+0x48/0x220)
[16781.272809] [<803a5460>] (device_del) from [<803a5654>]
(device_unregister+0x1c/0x30)
[16781.272834] [<803a5654>] (device_unregister) from
[<7f1bee3c>] (media_devnode_unregister+0x50/0x54 [media])
[16781.272869] [<7f1bee3c>] (media_devnode_unregister [media])
from [<7f1be3c0>] (media_device_unregister+0x58/0x5c [media])
[16781.272901] [<7f1be3c0>] (media_device_unregister [media])
from [<7f2e5430>] (uvc_delete+0x130/0x138 [uvcvideo])
[16781.272938] [<7f2e5430>] (uvc_delete [uvcvideo]) from
[<7f2e5570>] (uvc_release+0x4c/0x50 [uvcvideo])
[16781.272984] [<7f2e5570>] (uvc_release [uvcvideo]) from
[<7f1e8800>] (v4l2_device_release+0xcc/0xf0 [videodev])
[16781.273021] [<7f1e8800>] (v4l2_device_release [videodev])
from [<803a4b54>] (device_release+0x3c/0xa0)
[16781.273041] [<803a4b54>] (device_release) from [<80323140>]
(kobject_release+0x50/0x84)
[16781.273061] [<80323140>] (kobject_release) from
[<803231c8>] (kobject_put+0x54/0x80)
[16781.273079] [<803231c8>] (kobject_put) from [<803a4efc>]
(put_device+0x24/0x28)
[16781.273115] [<803a4efc>] (put_device) from [<7f1e8518>]
(v4l2_release+0x60/0x84 [videodev])
[16781.273154] [<7f1e8518>] (v4l2_release [videodev]) from
[<80158f88>] (__fput+0x94/0x1e4)
[16781.273172] [<80158f88>] (__fput) from [<80159148>]
(____fput+0x18/0x1c)
[16781.273191] [<80159148>] (____fput) from [<80040a58>]
(task_work_run+0xa0/0xd4)
[16781.273213] [<80040a58>] (task_work_run) from [<80013914>]
(do_work_pending+0xcc/0xd0)
[16781.273233] [<80013914>] (do_work_pending) from
[<8000fb68>] (slow_work_pending+0xc/0x20)
[16781.273252] ---[ end trace 961dba5b0b7d4ff5 ]---
Any idea what could cause the problem and why do I have to restart the
OS to fix the webcam disconnection ?
Any possible workaround ? (Could I unload / reload the driver or
perform any USB software restart)
thanks
------------------------------------------------------------
------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Linux-uvc-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
--
[image: photo]
*Robert "Finny" Merrill*
Software Engineer
Matterport, Inc.
Facebook <https://www.facebook.com/Matterport> | Twitter
<https://twitter.com/matterport> | LinkedIn
<https://www.linkedin.com/company/matterport> | matterport.com
--
[image: photo]
*Robert "Finny" Merrill*
Software Engineer
Matterport, Inc.
Facebook <https://www.facebook.com/Matterport> | Twitter
<https://twitter.com/matterport> | LinkedIn
<https://www.linkedin.com/company/matterport> | matterport.com
Loading...