Jetson Orin Nano cannot connect reliably to USB Cameras

Hi all,

I am currently running a Jetson Orin Nano Dev Kit with 2 USB Cameras. Jetpack version 6.2.1.

I tried to connect the cameras to the USB-A ports and I cannot reliably connect to them. When doing ls /dev/video*, I can see that they are periodically connecting and disconnecting.

here is lsusb -t, and this will also periodically appear and disappear.

myuser@ubuntu:~$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 10000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 10000M
    |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 480M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 51, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 3: Dev 51, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 3: Dev 51, If 3, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 3: Dev 51, If 1, Class=Video, Driver=uvcvideo, 480M
    |__ Port 3: Dev 3, If 0, Class=Wireless, Driver=rtk_btusb, 12M
    |__ Port 3: Dev 3, If 1, Class=Wireless, Driver=rtk_btusb, 12M

I know this is not the cameras fault because when I tried to connect to a USB hub via the USB-C port, it worked fine. However, I need to USB-C port for the device IP capabilities since the USB-A ports do not support it.

Here are the dmesg logs as well about the cameras when I run sudo dmesg -w | grep -iE “usb|uvc” :

dmesg_cam_log.txt (33.6 KB)

Is there any potential fix I can do?
Thanks

Will this issue happen when only one camera is in use?

This happens even with 1 camera. I am streaming at 640 x 480 using MJPG. Its way below the 10 GB/s limit for the USB-A ports.

Here is the script I am running:


import cv2
import time

vid_cap = cv2.VideoCapture(0, cv2.CAP_V4L2)

if not vid_cap.isOpened():
print(f"camera no opened")

vid_cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*‘MJPG’))
vid_cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
vid_cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)

vid_cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1)
vid_cap.set(cv2.CAP_PROP_EXPOSURE, 300)

vid_cap.set(cv2.CAP_PROP_FPS, 30)
print(f"cam fps: {vid_cap.get(cv2.CAP_PROP_FPS)}")

while True:
  t1 = time.time()
  ret, frame = vid_cap.read()
  if not ret:
    print(f"cannot get frame")
    continue
  t2 = time.time()
  print(f"fps = {1/(t2-t1)}")
  cv2.imshow(‘camera feed’, frame)

  if cv2.waitKey(1) & 0xFF == ord('q'):
    break

vid_cap.release()
cv2.destroyAllWindows()

Is there any solution for this so far?

What kind of usb camera are you using there? And which jetpack version in use?

Jetpack 6.2.1 as stated in the original post.

The USB camera:

lsusb says this: Xitech USB Camera. From amazon: Amazon.com: waveshare IMX335 5MP USB Camera (B), Compatible with Raspberry Pi 5 and Jetson Orin kit, 2K Video Recording, Better Sensitivity in Low-Light Condition, Wide Dynamic Range : Electronics

here is lsusb -t, and this will also periodically appear and disappear.

Is this problem happened after running the application? or even USB cam idle state?

This happens even at idle state, right after I plug it in.

Hi,
We have AVerMedia CAM513 and Logitech Brio 4K USB cameras. Both can be launched and run well on Orin Nano developer kit. It may be an issue specific to the cameras. Do you have other USB cameras for a try? Would suggest try other brands.

And would suggest use Jetpack 6.2.2 r36.5 which includes PSIRT fixes.

Will try another Jetpack version. These cameras work on an AGX Orin and other desktops like Windows and MacOS just fine. I am not sure the Jetpack version of the AGX Orin but thanks for your help.

I will try to update if I find the solution.

Hi,
For reference, attach dmesg and log of launching the Logitech camera on Orin Nano developer kit/Jetpack 6.2.2 r36.5:

[1301057.081434] usb 2-1.3: new SuperSpeed USB device number 3 using tegra-xusb
[1301057.149824] usb 2-1.3: current rate 16000 is different from the runtime rate 24000
[1301057.168794] usb 2-1.3: current rate 16000 is different from the runtime rate 32000
[1301057.187538] usb 2-1.3: current rate 16000 is different from the runtime rate 48000
[1301057.238097] input: Logitech BRIO Consumer Control as /devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.5/0003:046D:085E.0002/input/input6
[1301057.301174] hid-generic 0003:046D:085E.0002: input,hidraw0: USB HID v1.11 Device [Logitech BRIO] on usb-3610000.usb-1.3/input5
[1301057.425688] usb 2-1.3: Found UVC 1.00 device Logitech BRIO (046d:085e)
[1301057.455372] input: Logitech BRIO as /devices/platform/bus@0/3610000.usb/usb2/2-1/2-1.3/2-1.3:1.0/input/input7
[1301057.455534] usbcore: registered new interface driver uvcvideo
[1301057.631662] usb 2-1.3: current rate 16000 is different from the runtime rate 48000
[1301057.679685] usb 2-1.3: current rate 16000 is different from the runtime rate 48000
[1301057.719543] usb 2-1.3: current rate 16000 is different from the runtime rate 48000
nvidia@tegra-ubuntu:~$ gst-launch-1.0 v4l2src device=/dev/video2 num-buffers=166 ! "image/jpeg,width=1920,height=1080,framerate=30/1" ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,format=I420 ! xvimagesink sync=0
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 277
NvMMLiteBlockCreate : Block : BlockType = 277
Redistribute latency...
Got EOS from element "pipeline0".
Execution ended after 0:00:07.714833051
Setting pipeline to NULL ...
Freeing pipeline ...