AGX support 2 USB cameras only?

Hi, I found out I couldn’t run 4 USB cameras at the same time.

When I run 4 simple opencv code in four terminal, only 2 can run.

Note: individual code works fine. Only 1280 x 720 30 fps each 480M. And I connect each USB camera in separate 4 plug in AGX.

Is there any settinng I can change it? Thx

import cv2# current camera
cap = cv2.VideoCapture(0)
while (cap.isOpened()):
   ret, frame = cap.read()
   cv2.imshow('frame', frame)   
   key = cv2.waitKey(1)
   # ESC
   if key == 27:
      breakcap.release()
cv2.destroyAllWindows()
import cv2# current camera
cap = cv2.VideoCapture(2)
while (cap.isOpened()):
   ret, frame = cap.read()
   cv2.imshow('frame', frame)   
   key = cv2.waitKey(1)
   # ESC
   if key == 27:
      breakcap.release()
cv2.destroyAllWindows()
```


import cv2# current camera
cap = cv2.VideoCapture(4)
while (cap.isOpened()):
   ret, frame = cap.read()
   cv2.imshow('frame', frame)   
   key = cv2.waitKey(1)
   # ESC
   if key == 27:
      breakcap.release()
cv2.destroyAllWindows()


import cv2# current camera
cap = cv2.VideoCapture(6)
while (cap.isOpened()):
   ret, frame = cap.read()
   cv2.imshow('frame', frame)   
   key = cv2.waitKey(1)
   # ESC
   if key == 27:
      breakcap.release()
cv2.destroyAllWindows()

lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 10000M
    |__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/4p, 10000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 480M
    |__ Port 3: Dev 2, If 0, Class=Wireless, Driver=rtk_btusb, 12M
    |__ Port 3: Dev 2, If 1, Class=Wireless, Driver=rtk_btusb, 12M
    |__ Port 4: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 3: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 2: Dev 7, If 0, Class=Hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 25, If 0, Class=Video, Driver=uvcvideo, 480M
                |__ Port 1: Dev 25, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 1: Dev 24, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 1: Dev 24, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 20, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 20, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 22, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
                |__ Port 1: Dev 26, If 0, Class=Video, Driver=uvcvideo, 480M
                |__ Port 1: Dev 26, If 1, Class=Video, Driver=uvcvideo, 480M
            |__ Port 4: Dev 21, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 4: Dev 21, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'MJPG' (Motion-JPEG, compressed)
		Size: Discrete 640x480
			Interval: Discrete 0.040s (25.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.040s (25.000 fps)
	[1]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.100s (10.000 fps)

I found this, I am surprised that two 10Gps USB can not support 4 USB cameras… Is it true?

And I saw this, but it said it can brick the Jetson…. I am scared to try unless it is working. And the file name does not match… Thx

Hi,
If you use AGX Xavier developer kit, would suggest connect two cameras to the type-A port and two cameras to the type-C port through USB hub. And please use USB3 cameras and USB3 hub. If either device is a USB2 device, total bandwidth is 480Mbps instead of 5Gbps.

Hi, is there any way the AGX can support 4 USB cameras? I guess mine is USB2 only. Can I force to reduce the resolution or fps? thx

I have tried to release the cap.capture and do it for another camera, it kind of work but the speed is really slow.

I have tried to set the resolution to 320x240 in my opencv python code but the third camera still fail to get frame. Is there any way I can do it in system level? thx

Hi,
There is a hacking solution from community:
Failed to allocate memory for four usb cameras - #4 by fabian.solano

It is not recommended but you may try.

Dear DaneLLL,

It is a broken link…. ERROR: The request could not be satisfied.

Anyway, it seems there is no way AGX can support more that 2 x USB2.0 cameras.

Plan B: I may use a Jetson nano to feed two USB cameras and output the rtsp streams. In this way, the openCV shall be able to get 2 rtsp streams and 2 USB cameras. Thx