XavierNX usb3.2 Bandwidth problem

The two Usb ports of the xavierNX DevKit are connected to two usb3vision cameras respectively, the cameras are 5M, 74frame/second. The xavierNX CPU can only receive images up to 80 frames /second, which means that the bandwidth of usb3 cannot exceed 5Gbit/s. What could possibly be the cause of this?

Hi,
Please confirm the devices are USB3 devices. And check dmesg to make sure both devices are enumerated as superspeed. If the devices are USB2 devices, total bandwidth is 480Mbps.

The four type A ports on developer kit is from an embedded hub, which is connected to a USB3 roothub. So the 4 ports share one USB3 bandwidth.

When examining USB, one way to look at bandwidth is to view it in a tree layout via “lsusb -t”. The end of the line will be “480M” (480 Mb/s) for USB2, or “5000M” (5000 Mb/s) for USB 3.1 gen. 1, or other speeds depending on the standard being used. The root HUB is the fastest it can go. Those are based on clock speeds, and there is overhead, so actual throughput is significantly less.

nvidia@ubuntu:~$ lsusb
Bus 002 Device 003: ID 2bdf:0001
Bus 002 Device 005: ID 2bdf:0001
Bus 002 Device 002: ID 0bda:0489 Realtek Semiconductor Corp. 4-Port USB 3.0 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 13d3:3549 IMC Networks Bluetooth Radio
Bus 001 Device 006: ID 413c:2113 Dell Computer Corp.
Bus 001 Device 005: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 001 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 002: ID 0bda:5489 Realtek Semiconductor Corp. 4-Port USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
nvidia@ubuntu:~$
nvidia@ubuntu:~$
nvidia@ubuntu:~$
nvidia@ubuntu:~$ 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
|__ Port 1: Dev 5, If 2, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 1: Dev 5, If 0, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 1: Dev 5, If 1, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 0, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 1, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 2, Class=Miscellaneous Device, Driver=, 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 2: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 4: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 1: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 3: Dev 3, If 0, Class=Wireless, Driver=rtk_btusb, 12M
|__ Port 3: Dev 3, If 1, Class=Wireless, Driver=rtk_btusb, 12M
nvidia@ubuntu:~$

dmesg information:

[ 306.999153] usb 2-3.1: new SuperSpeed Gen 1 USB device number 5 using tegra-xusb
[ 307.019776] usb 2-3.1: LPM exit latency is zeroed, disabling LPM.
[ 307.020511] usb 2-3.1: New USB device found, idVendor=2bdf, idProduct=0001, bcdDevice= 1.00
[ 307.020523] usb 2-3.1: New USB device strings: Mfr=5, Product=3, SerialNumber=6
[ 307.020531] usb 2-3.1: Product: LBAS-U350-74M
[ 307.020538] usb 2-3.1: Manufacturer: U3V
[ 307.020546] usb 2-3.1: SerialNumber: 00K75647843

usb3 vision camera is
Bus 002 Device 003: ID 2bdf:0001
Bus 002 Device 005: ID 2bdf:0001

The connection status is correct

This subset of the tree view is of interest:

/: 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
|__ Port 1: Dev 5, If 2, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 1: Dev 5, If 0, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 1: Dev 5, If 1, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 0, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 1, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 2, Class=Miscellaneous Device, Driver=, 5000M

Note that you can use the “pencil” icon in the lower right of your existing posts to edit, then mouse highlight that block of log with the mouse. Once highlighted, you should click on the “code” icon (looks like “</>” in the top icon bar while editing). This would preserve whitespace. It is hard to see if the devices are a child to the external HUB, versus to the internal root HUB. I just happen to know that these are children of the external HUB.

The root HUB is USB 3.2. It’s total bandwidth capacity (raw bits, overhead reduces this) is 10 Gb/s. One of the USB devices is a HUB, which is also running at 10 Gb/s. This is good. Assuming that all of those remaining devices are plugged into the external HUB, it means that running each device at its limits requires the HUB to be capable of 6*5 Gb/s = 30 Gb/s. Even if the external HUB could run at 30 Gb/s, the root HUB cannot. This exceeds the capability of both HUBs by 3-to-1.

For devices at a 5000M data rate, only two such devices can run through that root HUB (or the external HUB). If one cable supports stereo vision, then it is possible that one cable consumes 2*5 Gb/s (depends on camera setup), so it is possible that a single cable consumes the entire bandwidth of the USB 3.2. There is no possibility of this HUB going faster.

The best you could do is to have a PCIe USB 3.2 add-on card. If and only if that card produces multiple USB ports via independent root HUBs would that help. Some add-on USB cards have a single root HUB with multiple ports. The slightly more expensive ones will have independent root HUBs for each port. In this latter case it has to use enough PCIe lanes to support that many root HUBs.

There may be other bottlenecks if you have a proper PCIe set of root HUBs, e.g., if it goes through a single CPU core, then that core might not have the power to handle all of that data (which is when DMA is nice).

|__ Port 1: Dev 5, If 2, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 1: Dev 5, If 0, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 1: Dev 5, If 1, Class=Miscellaneous Device, Driver=, 5000M

The above IFs belong to the same camera, the total bandwidth is 5000M, one of the three IFs is the data channel, and the rest is the configuration channel.

|__ Port 4: Dev 3, If 0, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 1, Class=Miscellaneous Device, Driver=, 5000M
|__ Port 4: Dev 3, If 2, Class=Miscellaneous Device, Driver=, 5000M

The above IFs belong to another camera, the total bandwidth is 5000M.

The bandwidth requirement for each camera is 5MByte x 70frame/s. The total bandwidth requirements of the two cameras do not exceed the bandwidth of the usb3.2 root HUB.

The problem I have now is that the total bandwidth of the two cameras has always been 5MByte x 80 Frame/s and will not exceed 4000M.

      xavierNX devKit
                |
               usb
                |
         camera 74 frame/s
  (device Maximum frame rate is 74frame/s)


       x a v i e rNX--devkit
         |                |
        usb              usb
         |                |
      camera-1         camera-2
     40frame/s         40frame/s

Note that if one camera provides more than one device, and if those devices exceed (in total combination) the particular USB standard (e.g., 10000M is USB3.1 gen. 2 or USB3.2), that not all devices can operate at their full bandwidth simultaneously. The control would rarely use even a tiny fraction of that bandwidth, but for something like a stereo camera, the two sensors of that one stereo camera would run simultaneously and use all of the bandwidth. There would be no more bandwidth for anything else. Each device has its PHY running at 5000M speeds; the only question is if they are active simultaneously. Even if the control channel does not actually use the full bandwidth the fact that you have a pair of these pretty much guarantees you don’t have even remotely close to enough bandwidth for actual USB3 simultaneous transfer of all devices. The only possibility of this working is if data alternates between the USB3 data pipes without running simultaneously. This is what the USB pipe says; what actual data transmits might make it within reason, but the camera itself is not something the USB actually knows about (the driver running the camera knows this, the USB pipe has its own separate driver which does not know this).

So a single USB cable with one of these cameras (3 USB devices) is obviously designed to function correctly, but how would two separate cameras know how to cooperate to not run simultaneously? Even if a stereo camera does not exceed 10000M, and if that stereo camera in reality does not use that bandwidth, how would you guarantee that two independent stereo cameras cooperate? Now if the camera itself buffers data and can handle delays, then it might work, but it isn’t truly sending from all 5000M data sources, it is time sharing/multiplexing. A lot of USB3 devices do not have enough memory to buffer that much.

Incidentally, there is overhead on the USB data. 4000M is probably the limit of what you’ll be able to achieve from the camera, but the actual USB is sending a higher rate…you just don’t see the overhead, e.g., encoding.

Since this is not a fully verbose “sudo lsusb -vvv” we also don’t know what transfer modes are being used. If it is isochronous (which cameras and video and audio devices might use), then it is pretty much a guarantee that there is no chance both of these example stereo cameras could work; you might not even get a keyboard or mouse to work in addition to such a stereo camera. If the cameras are able to buffer and delay, and if they use a bulk/batch transfer mode, then they could work with added latency.

I just don’t believe that you can get all of these to work simultaneously on a 10000M connection. I strongly believe you need another root HUB. Maybe your devices have enough buffer though, and use bulk transfer along with enough internal buffer. Something like an additional PCIe root HUB is more likely to behave well.

Xavier NX only has one USB 3 port: USBSS0. Orin Nano and NX have three USB 3: USBSS0, USBSS1, and USBSS2. USBSS0 and USBSS1 share a root hub, and USBSS2 has its own root hub. The Orin Nano devkit (there is no Orin NX devkit) also uses an USB hub like Xavier NX devkit, so you should look for another carrier board in order to use both root hubs.

We decided against USB3 cameras where possible and use PCIe cameras. PCIe has a MUCH higher bandwidth (Orin NX has PCIe x4 Gen 4, 8 GBytes/s bandwidth) and MUCH lower latency and almost no CPU load (the camaras write their frames directly into main memory).

I’ve got it,
thank you!

Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.