linux USB摄像头不停掉线问题
1.T507板子上面接了一个usb接口的RGB摄像头,发现RGB摄像头有时候一开机就掉线了,或者跑一会掉线,dmesg看到的现象如下
sunxi-ehci 5101000.ehci0-controller: ehci_irq: highspeed device disconnectsunxi-ehci 5101000.ehci0-controller: ehci irq: highspeed device connectusb 1-1: USB disconnect, device number 2uvcvideo: Failed to resubmit video URB (-19).uvcvideo: Failed to resubmit video URB (-19).uvcvideo: Failed to resubmit video URB (-19).uvcvideo: Failed to resubmit video URB (-19).uvcvideo: Failed to resubmit video URB (-19).sunxi-ehci 5101000.ehci0-controller: ehci_irq: highspeed device connectusb 1-1: new high-speed USB device number 3 using sunxi-ehciusb 1-1: device descriptor read/64, error -71usb 1-1: device descriptor read/64, error -71usb 1-1: new high-speed USB device number 4 using sunxi-ehciusb 1-1: device descriptor read/64, error -71uvcvideo: Found UVC 1.00 device DECXIN CAMERA (1bcf:2cd1)uvcvideo 1-1:1.0: Entity type for entity Extension 4 was not initialized!uvcvideo 1-1:1.0: Entity type for entity Extension 3 was not initialized!uvcvideo 1-1:1.0: Entity type for entity Processing 2 was not initialized!uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!input: DECXIN CAMERA as /devices/platform/soc/5101000.ehci0-controller/usb1/1-1/1-1:1.0/input/input62.后面观察到,usb会不停的掉线,上线

3.应用层是通过固定的设备节点/dev/video4去读取RGB图像的,RGB一掉线,出图节点就变成了/dev/video5,导致应用层读取不到RGB图像了。
4.解决办法,查询了AI,禁用 USB 电源管理(排除 autosuspend)就没出现这个问题了。
# 一次性禁用所有 USB 设备的 suspend
for f in /sys/bus/usb/devices/*/power/control; doecho 'on' > "$f"
done