Skip to main content

Camera Disconnects on Linux Because of USB Autosuspend

When to use this article

The camera repeatedly disconnects and reconnects after it is detected by the Linux host.

You may see messages like these in the kernel log:

[86452.959044] usb 2-1.2: new SuperSpeed USB device number 5 using xhci-hcd
[86452.983505] usb 2-1.2: LPM exit latency is zeroed, disabling LPM.
[86453.022662] usb 2-1.2: Found UVC 1.10 device VCI-AR0144-C (3407:0144)
[86453.139540] input: VCI-AR0144-C as /devices/platform/soc@0/32f10108.usb/38200000.usb/xhci-hcd.1.auto/usb2/2-1/2-1.2/2-1.2:1.0/input/input8
[86467.470212] usb 2-1.2: USB disconnect, device number 5
[86468.959511] usb 2-1.2: new SuperSpeed USB device number 6 using xhci-hcd
[86468.983960] usb 2-1.2: LPM exit latency is zeroed, disabling LPM.
[86469.022673] usb 2-1.2: Found UVC 1.10 device VCI-AR0144-C (3407:0144)
[86469.139501] input: VCI-AR0144-C as /devices/platform/soc@0/32f10108.usb/38200000.usb/xhci-hcd.1.auto/usb2/2-1/2-1.2/2-1.2:1.0/input/input9
[86472.078213] usb 2-1.2: USB disconnect, device number 6

Why this happens

The Linux USB autosuspend function may suspend the camera because the camera's standby power consumption is low. This can make the system disconnect the camera even though the device and cable are functional.

Turn off USB autosuspend

  1. Check the current autosuspend setting.
$ cat /sys/module/usbcore/parameters/autosuspend
2
  1. Disable USB autosuspend.
$ echo -1 > /sys/module/usbcore/parameters/autosuspend
  1. Reconnect the camera.

Check the result

After reconnecting the camera, confirm that the device remains present and can stream.

$ v4l2-ctl --list-devices
$ v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=100

If the camera still disconnects

  • The command above changes the runtime setting. If the setting returns after reboot, configure the host system to apply the same autosuspend setting at startup.
  • If disconnects continue after disabling autosuspend, test a different cable, port, and direct USB connection before collecting logs for support.