USB camera gets disconnected

Hi,

I have connected 3 usb camera sources to the jetson nano board. The camera is working fine. After sometime the camera gets disconnected. I got the below demsg

dmesg | grep 2-1.2
[ 2.795805] usb 2-1.2: new SuperSpeed USB device number 4 using tegra-xusb
[ 2.816306] usb 2-1.2: LPM exit latency is zeroed, disabling LPM.
[ 2.816637] usb 2-1.2: Int endpoint with wBytesPerInterval of 1024 in config 1 interface 0 altsetting 0 ep 129: setting to 16
[ 2.831109] usb 2-1.2: New USB device found, idVendor=04b4, idProduct=00f8
[ 2.831115] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.831119] usb 2-1.2: Product: USB3.0 Capture Video
[ 2.831122] usb 2-1.2: Manufacturer: Cypress Semiconductor
[ 5.754807] uvcvideo 2-1.2:1.0: Entity type for entity Extension 3 was not initialized!
[ 5.767518] uvcvideo 2-1.2:1.0: Entity type for entity Processing 2 was not initialized!
[ 5.767523] uvcvideo 2-1.2:1.0: Entity type for entity Camera 1 was not initialized!
[ 5.767904] input: USB3.0 Capture Video as /devices/70090000.xusb/usb2/2-1/2-1.2/2-1.2:1.0/input/input5
[ 5.778200] input: HD Camera as /devices/70090000.xusb/usb2/2-1/2-1.3/2-1.3:1.0/input/input6
[ 5.789766] input: USB3.0 Capture Video as /devices/70090000.xusb/usb2/2-1/2-1.1/2-1.1.2/2-1.1.2:1.0/input/input7
[ 8.999535] usb 2-1.2: usb_suspend_both: status 0
[ 28.967508] usb 2-1.2: usb_suspend_both: status 0
[ 48.007525] usb 2-1.2: usb_suspend_both: status 0
[ 158.095278] usb 2-1.2: usb_suspend_both: status 0
[ 163.559616] usb 2-1.2: reset SuperSpeed USB device number 4 using tegra-xusb
[ 163.579827] usb 2-1.2: LPM exit latency is zeroed, disabling LPM.
[ 178.178710] usb 2-1.2: usb_suspend_both: status 0
[ 200.002218] usb 2-1.2: usb_suspend_both: status 0
[ 203.134227] usb 2-1.2: usb_suspend_both: status 0
[ 211.070119] usb 2-1.2: usb_suspend_both: status 0
[ 238.973710] usb 2-1.2: usb_suspend_both: status 0
[ 258.941486] usb 2-1.2: usb_suspend_both: status 0
[ 276.093330] usb 2-1.2: usb_suspend_both: status 0
[ 279.165326] usb 2-1.2: usb_suspend_both: status 0
[ 676.172807] usb 2-1.2: usb_suspend_both: status 0
[ 680.948714] usb 2-1.2: usb_suspend_both: status 0
[ 695.140476] usb 2-1.2: usb_suspend_both: status 0
[ 881.988152] usb 2-1.2: usb_suspend_both: status 0
[ 906.114492] usb 2-1.2: usb_suspend_both: status 0
[ 909.189367] usb 2-1.2: usb_suspend_both: status 0
[ 925.061924] usb 2-1.2: usb_suspend_both: status 0
[ 929.194061] usb 2-1.2: usb_suspend_both: status 0
[ 934.022346] usb 2-1.2: usb_suspend_both: status 0
[ 947.994683] usb 2-1.2: usb_suspend_both: status 0
[ 994.083901] usb 2-1.2: usb_suspend_both: status 0
[ 997.004092] usb 2-1.2: usb_suspend_both: status 0
[ 1002.024114] usb 2-1.2: usb_suspend_both: status 0
[ 1013.128328] usb 2-1.2: usb_suspend_both: status 0
[ 1064.073266] usb 2-1.2: usb_suspend_both: status 0
[ 1071.209366] usb 2-1.2: usb_suspend_both: status 0
[ 1100.169856] usb 2-1.2: usb_suspend_both: status 0
[ 1119.170071] usb 2-1.2: usb_suspend_both: status 0
[ 1135.158251] usb 2-1.2: usb_suspend_both: status 0
[ 1139.082348] usb 2-1.2: usb_suspend_both: status 0
[ 1155.210470] usb 2-1.2: usb_suspend_both: status 0
[ 1182.090791] usb 2-1.2: usb_suspend_both: status 0
[ 1186.186836] usb 2-1.2: usb_suspend_both: status 0
[ 1189.994879] usb 2-1.2: usb_suspend_both: status 0
[ 1216.171072] usb 2-1.2: usb_suspend_both: status 0
[ 1227.146913] usb 2-1.2: usb_suspend_both: status 0
[ 1232.010667] usb 2-1.2: usb_suspend_both: status 0
[ 1246.090065] usb 2-1.2: usb_suspend_both: status 0
[ 1263.241284] usb 2-1.2: usb_suspend_both: status 0
[ 1275.016784] usb 2-1.2: usb_suspend_both: status 0
[ 1294.216076] usb 2-1.2: usb_suspend_both: status 0
[ 1369.989635] usb 2-1.2: usb_suspend_both: status 0
[ 1376.997428] usb 2-1.2: usb_suspend_both: status 0
[ 1396.172947] usb 2-1.2: usb_suspend_both: status 0
[ 1469.059361] usb 2-1.2: usb_suspend_both: status 0
[ 1472.131321] usb 2-1.2: usb_suspend_both: status 0
[ 1489.027005] usb 2-1.2: usb_suspend_both: status 0
[ 1499.010829] usb 2-1.2: usb_suspend_both: status 0
[ 1530.102341] usb 2-1.2: usb_suspend_both: status 0
[ 1682.089589] usb 2-1.2: usb_suspend_both: status 0
[ 1686.144663] usb 2-1.2: usb_suspend_both: status 0
[ 1732.068290] usb 2-1.2: usb_suspend_both: status 0
[ 1735.172312] usb 2-1.2: usb_suspend_both: status 0
[ 1751.168170] usb 2-1.2: usb_suspend_both: status 0
[ 1835.135745] usb 2-1.2: usb_suspend_both: status 0
[ 1842.047734] usb 2-1.2: usb_suspend_both: status 0
[ 1845.119757] usb 2-1.2: usb_suspend_both: status 0
[ 1871.155587] usb 2-1.2: usb_suspend_both: status 0
[ 2098.047118] usb 2-1.2: usb_suspend_both: status 0
[ 2108.663545] usb 2-1.2: reset SuperSpeed USB device number 4 using tegra-xusb
[ 2113.899277] usb 2-1.2: device descriptor read/8, error -110
[ 2114.010969] usb 2-1.2: reset SuperSpeed USB device number 4 using tegra-xusb
[ 2119.275302] usb 2-1.2: device descriptor read/8, error -110
[ 2119.727484] usb 2-1.2: Device not responding to setup address.
[ 2119.957124] usb 2-1.2: Device not responding to setup address.
[ 2120.179092] usb 2-1.2: device not accepting address 4, error -71
[ 2120.739564] usb 2-1.2: Device not responding to setup address.
[ 2120.963621] usb 2-1.2: Device not responding to setup address.
[ 2121.179028] usb 2-1.2: device not accepting address 4, error -71
[ 2121.535412] usb 2-1.2: Device not responding to setup address.
[ 2121.767498] usb 2-1.2: Device not responding to setup address.
[ 2121.979353] usb 2-1.2: device not accepting address 4, error -71
[ 2121.989233] usb 2-1.2: USB disconnect, device number 4
[ 2122.395263] usb 2-1.2: Device not responding to setup address.
[ 2122.619235] usb 2-1.2: Device not responding to setup address.
[ 2122.831003] usb 2-1.2: device not accepting address 9, error -71
[ 2123.179354] usb 2-1.2: Device not responding to setup address.
[ 2123.407263] usb 2-1.2: Device not responding to setup address.
[ 2123.618952] usb 2-1.2: device not accepting address 10, error -71
[ 2124.035299] usb 2-1.2: Device not responding to setup address.
[ 2124.259322] usb 2-1.2: Device not responding to setup address.
[ 2124.470957] usb 2-1.2: device not accepting address 11, error -71
[ 2124.819284] usb 2-1.2: Device not responding to setup address.
[ 2125.043260] usb 2-1.2: Device not responding to setup address.
[ 2125.254986] usb 2-1.2: device not accepting address 12, error -71

And when v4l2-ctl --list-devices is entered below is the reply

Failed to open /dev/video0: No such file or directory

Sometimes the camera will fully dissapear and is not recognized even after restarting the jetson. It only works after power on after a shutdown

Is there a method to rescan the usb devices connected or What can be the issue for this?

Thanks in advanced

If it is a signal issue, then this won’t help, but if this is an issue of autosuspend, this might help (and is easy to test, and auto suspend might be the problem):

  • Go to the “/boot/extlinux/extlinux.conf” file.
  • Look for the “APPEND” key/value entry.
  • At the end of that entry add a space and then “usbcore.autosuspend=-1”.
  • Reboot, verify the “usbcore.autosuspend=-1” shows up in “cat /proc/cmdline”.
  • Test.

If this does not work, then simply remove the “usbcore.autosuspend=-1” from “extlinux.conf”. Problem would be something else, e.g., signal quality. You’d then want to describe the cameras (including frame rate and resolution).

1 Like

Will try this method and update

Hi @linuxdev ,

I tired the method you mentioned now the device is not getting disconnected, but the device stops sending data.

When I run a gstreamer pipeline I get the below error.

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Device ‘/dev/presentation’ has no supported format
Additional debug info:
gstv4l2object.c(3760): gst_v4l2_object_set_format_full (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Call to S_FMT failed for YUYV @ 1920x1080: Invalid argument
EOS on shutdown enabled – waiting for EOS after Error
Waiting for EOS…
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

Seems like the nano is detaching the usb device.

Is there a method to reset the usb device after disconnecting?
Can it be a power issue of the usb device? Since I have connected 3 USB videos sources 2 Hdmi to USB source and single USB camera source.

USB3.0 Capture Video (usb-70090000.xusb-1.1.2):
/dev/video1

USB3.0 Capture Video (usb-70090000.xusb-1.1.4):
** /dev/video2**

Above devices is not sending data

HD Camera (usb-70090000.xusb-1.2):
/dev/video0

I couldn’t answer for sure. There is a possibility of power being an issue, or it could be insufficient bandwidth, or it could be signal quality. Keep in mind that it is unlikely a single USB3 port could handle the traffic of more than one USB3 camera (and unless the cameras are self-powered it is reasonable to assume the Jetson’s USB3 port cannot provide enough power to simultaneously run 2 or 3 cameras).

You would have to provide the camera’s resolution and frame rate and color depth if you want to estimate required bandwidth. Then, prior to an error, you would want to provide the output of “lsusb -t” to see how the cameras are connected to the root HUB (which is the HUB internal to the Jetson). This could be used to estimate if bandwidth requirements are too high (which is a very strong possibility if each camera does not have its own root HUB).

The cameras are connected as below

1 HDMI to USB YUYU Conneted to External powered USB HUB(Connected to Jetson)
1 HDMI to USB YUYU Connected directly to Jetson
1 Camera MJPG Connected directly to Jetson

All cameras are 1080p @ 30FPS

When these cameras are connected, what do you see from “lsusb -t”?

Below is the reply from lsusb -t

/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 3: Dev 4, If 0, Class=Hub, Driver=hub/4p, 5000M
|__ Port 2: Dev 8, If 3, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 2: Dev 8, If 1, Class=Video, Driver=uvcvideo, 5000M
|__ Port 2: Dev 8, If 4, Class=Human Interface Device, Driver=usbhid, 5000M
|__ Port 2: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 2: Dev 8, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 1, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 2, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 4: Dev 7, If 3, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 4: Dev 7, If 4, Class=Human Interface Device, Driver=usbhid, 5000M
|__ Port 4: Dev 7, If 5, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 4: Dev 7, If 6, Class=Audio, Driver=snd-usb-audio, 5000M
|__ Port 4: Dev 5, If 0, Class=Mass Storage, Driver=uas, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/5p, 480M
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 8, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 8, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 1: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 5, If 4, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 5, If 2, Class=Human Interface Device, Driver=, 480M
|__ Port 2: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 5, If 3, Class=Audio, Driver=snd-usb-audio, 480M
|__ Port 2: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
|__ Port 3: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 3: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M

Can you also show “lsusb” without the “tree” option (the “-t”)? Most USB devices (especially cameras) will have multiple devices on a single cable, e.g., the control of the camera would show separately and not use the uvcvideo driver because it is basically serial data. It is looking like on the first tree (the “Bus 02.Port 1: Dev 1” root_hub) there are several actual cameras…at least 3, although one could be stereo (which would still count as two cameras):

|__ Port 2: Dev 8, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 1, Class=Video, Driver=uvcvideo, 5000M

Actual throughput (due to overhead) of a USB3 port (the 5000M) is actually less than 5000 Mb/s, and the requirement of one camera (assuming 1920x1080@30fps and 32-bit) would be around 2 Gb/s before including overhead. Two cameras would have a hard time with bandwidth even if they were the only devices, but would probably work right at the edge of bandwidth. Regardless of whether the devices are integrated or separate, there are also audio devices on that port, which would pretty much guarantee two cameras exceed that first port’s bandwidth. Not sure, perhaps someone else could comment on whether the cameras are exceeding the port’s capability.

output from lsusb command

there are two devices with the same name. one of these two gets disconnected.

Bus 002 Device 004: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge
Bus 002 Device 007: ID 04b4:00f8 Cypress Semiconductor Corp.
Bus 002 Device 006: ID 04b4:00f8 Cypress Semiconductor Corp.
Bus 002 Device 003: ID 2109:0817 VIA Labs, Inc.
Bus 002 Device 005: ID 2109:0817 VIA Labs, Inc.
Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 004: ID 2109:2817 VIA Labs, Inc.
Bus 001 Device 008: ID 2e7e:0877
Bus 001 Device 007: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
Bus 001 Device 006: ID 09da:c10a A4Tech Co., Ltd.
Bus 001 Device 005: ID 2109:2817 VIA Labs, Inc.
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

USB3.0 Capture Video (usb-70090000.xusb-1.3.2):
/dev/video0

USB3.0 Capture Video (usb-70090000.xusb-1.3.4):
/dev/video1

HD Camera (usb-70090000.xusb-2.2):
/dev/video2

Is it correct that we can limit the failure description to the two devices of the same type? If the HD Camera is not at issue it might simplify things.

The latter three devices seem to be using the same cable (perhaps they are in the same physical device sharing a cable or HUB?). In summary I see the following video devices:

/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 5000M
|__ Port 2: Dev 8, If 1, Class=Video, Driver=uvcvideo, 5000M
|__ Port 2: Dev 8, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 0, Class=Video, Driver=uvcvideo, 5000M
|__ Port 4: Dev 7, If 1, Class=Video, Driver=uvcvideo, 5000M

/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/5p, 480M
|__ Port 2: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 2: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M

In the “non-tree” listing of “lsusb” I’m not sure which devices are the cameras. I suspect it is:

Bus 002 Device 007: ID 04b4:00f8 Cypress Semiconductor Corp.
Bus 002 Device 006: ID 04b4:00f8 Cypress Semiconductor Corp.

(I did not find device ID 0x00f8 in the USB registry so I cannot confirm)

If it turns out that the “Cypress Semiconductor Corp.” is the USB3 camera, what do you see for the verbose output of:
sudo lsusb -d 04b4:00f8
(ignore this if that device is not the camera)

I doubt there is enough bandwidth to run all of this at the same time. Perhaps the audio devices are part of the camera, but as an aid, can you remove all devices on USB other than keyboard/mouse if they are not integrated with the cameras?

Thank You @linuxdev

The devices got detached mainly in the below scenario.

We used these sources in chromium browser to get the source preview using a webrtc socket. After previewe and exit the device is detached.

So we used a different method using gstreamer pipline to capture images and then preview them. Still no detaching issues were encountered, we are currently testing it. Will update if it solved the issue.

There may be an bandwidth issue. We tried to test a recording pipeline for 12h but the pipeline always stops around 7h-8h.