Not enough host controller resources for new device state

Dear NVIDIA, hello, I connect 5 USB2.0 depth cameras in the Jetson AGX Xavier, each camera itself comes with a USB hub, there are three ports, and an external 4G module, 4 USB ports are required, but the USB port of the camera cannot be stably recognized, and at the same time can only stably identify up to three cameras, at this time DMESG prompt: USB 2-3: Not enough host Controller Resources for New Device State, if the 4G module can be removed to recognize five cameras normally, I would like to ask the Jetson platform up to how many USB Host Controller Resources is supported? Can this maximum number of supported devices be modified or defined by myself? Is the device management supported by Host Controller Resources hardware-driven or software-driven? Thank you

I just found a post, there is the following calculation formula, how is the number of each USB device allocated in this formula, can I modify it myself? It can be modified there.https://forums.developer.nvidia.com/t/usb3-xhci-driver-device-count-limitation/77769/2

There is a hardware limitation: EP(end point) <= 70, i.e., SS+HS+FS+LS EPs <= 70.

Hi,
There are two type-C ports on Xavier developer kit. Please connect some devices to the ports so that you don’t hit the constraint.

@DaneLLL ,hello,our platform is based on Jetson AGX Xavier’s own design, and our USB Hub is also based on root_hub connection,The following is the display of LSUSB-T in the five depth cameras that are normally recognized and the error of DMESG when it is abnormal.

   |__ Port 3: Dev 69, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 70, If 1, Class=Video, Driver=uvcvideo, 480M
            |__ Port 3: Dev 70, If 0, Class=Video, Driver=uvcvideo, 480M
            |__ Port 1: Dev 71, If 0, Class=Vendor Specific Class, Driver=, 480M

SS+HS+FS+LS EPs <= 70.Can the number of device resources in this formula be modified? How do I determine the scope and size of the host controller resources it allocates and can I modify them through the kernel driver? Again, it is randomly assigned by hardware?Can I specify the size and range of Host Controller Resources for USB 2.0? If you can, modify it there, thanks.

I think it isn’t the device count which is insufficient. There is only so much bandwidth, and if one device were to come close to that, then another which is low in resource requirement would still cause this to be exceeded. Make sure you’re not looking at a bandwidth resource limit, which is quite different than the number of devices. I think the Jetson can handle far more devices, it is the bandwidth which is likely an issue. That means a new root HUB, not a software change. For example, a PCIe based USB card.

1 Like

Hello, I am the colleague of @DreamLan. We would like to know the limit rules for the number of EP at different speed. For example: FS EP limit, HS EP limit.

Hi,
If you have multiple USB2 devices, we would suggest use more USB2 roothubs in Xavier. Please check product design guide:
https://developer.nvidia.com/embedded/dlc/jetson-agx-xavier-series-oem-product-design-guide

There are usb2-0, usb2-1, usb2-2, usb2-3. If only single roothub is used, EP number is limited and also bandwidth:
connected more than two usb cameras problem on deepstream-app (Jetson Nano Dev Kit) - #12 by DaneLLL

One last comment: USB driver errors related to resources tend to have poorly worded messages. The literal message “Not enough host controller resources for new device state” should not be interpreted as saying “too many devices”. I want to reiterate that you might get the same message with absolutely no bearing on number of devices. It is a misleading error in some cases.

Thank you very much for your answer, but when the Jetson AGX is connected to more USB sensors, the later USB devices cannot boot normally

Are each of the sensors self-powered? Or do they consume power from the host?

Note that devices failing can (and usually is) from wanting a resource the host does not have. The messages produced during errors are usually misleading. Have you calculated the bandwidth used? Are they all the same model? If so, then when you have a single one of these plugged in, the command “lsusb” will give an ID that looks like “0955:7019” (0955 happens to be manufacturer the hexadecimal ID for NVIDIA, and 7019 is the hex value of AGX Xavier). You can tell lsusb to look at only that ID, and then perform a verbose query (you’d use the actual ID of the sensor instead of this example):
sudo lsusb -d '0955:7019' -vvv

Note: To get fully verbose information sudo is required.

This same thing, creating a log for post on the forum:
sudo lsusb -d '0955:7019' -vvv 2>&1 | tee log_lsusb.txt

If you post that we can examine some of the bandwidth requirements from a different angle, such as whether or not the sensor is capable of falling back to a lower speed, and what USB transfer modes it can operate in.

This file is my command to get the return of the camera, using sudo lsusb -d ‘2bc5:0561’ -vvv 2>&1 | tee log_lsusb.txt
log_lsusb.txt (27.5 KB)

@linuxdev @DaneLLL ,Hi,Regarding the depth camera Not enough host controller resources for new device state, my current handling method is to temporarily block the camera’s RGB USB hub, because a depth camera has three USB2.0 hubs, including two RGB hub channels, and a deep USB hub, I am unbinding the two USB hubs of the RGB channel at the application layer to reduce the resource occupation of the USB, the specific operation is as follows, before disable, the camera recognition is as follows:

  |__ Port 3: Dev 69, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 70, If 1, Class=Video, Driver=uvcvideo, 480M
            |__ Port 3: Dev 70, If 0, Class=Video, Driver=uvcvideo, 480M
            |__ Port 1: Dev 71, If 0, Class=Vendor Specific Class, Driver=, 480M

To unbind USB by command, perform the following:

sudo su
echo '1-4.3.3' > /sys/bus/usb/drivers/usb/unbind

Unbind the RGB USB Hub and use only the deepin USB port, as follows:

  |__ Port 3: Dev 69, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 71, If 0, Class=Vendor Specific Class, Driver=, 480M

Although this operation can make the program run normally, I am not sure whether it will cause the system to be abnormal, because recently my board often runs for a period of time, the system automatically restarts, I am not sure if it is caused by this。

Hi,
The constraint is a hard requirement so it may not be possible to have a valid software solution. We would suggest use all usb2 and usb3 rothubs in the hardware board design if you have multiple USB devices in your use-case.

I will add something which sticks out from the verbose lsusb log:

Transfer Type            Isochronous

Isochronous mode is a continuous mode which is not unlike a clock: It always runs, and it reserves 100% of any bandwidth it might need. This is typically used on something needing realtime behavior. Audio and video are common examples. It is possible to transfer audio and video in a block mode whereby chunks of data are sent, there is a pause, and then more chunks of data are sent; at the other end the chunks of data are reassembled, which is much like common ethernet. Isochronous mode is rather continuous, and does not suffer from needing the larger buffering (nor the latency of buffering).

However, isochronous mode also means this device does not share the bus the same way as other devices do. Other modes tend to grab the bus only when there is a certain amount of data to send, or when activity is detected. There is no such relaxation of bus use with isochronous; it will reserve and use the bus at a certain rate without exception (this is determined at the moment the bus detects the device and sets it up). If those timing requirements cannot be met, then the device is rejected. One such device works well when mixed with other non-isochronous devices, e.g., a disk drive or a keyboard can easily pause for a short moment and take lower precedence. When two isochronous devices meet, then things change, and if there is a fight for time on the bus, then one of the devices is rejected rather than allow that fight for traffic.

I am going to suggest that the total bandwidth the USB bus supports will differ and be less when isochronous time requirements exist, versus the total bandwidth which is available among less timing-critical devices. It is about timing in the former case, and not just bandwidth like the latter case.

@DaneLLL ,Hi,That is to say, when more USB devices are connected, there is no way to modify the bandwidth allocated by the USB device and set the number of USB controller resources to achieve this function through the driver, and can only modify the connection method through hardware design, is this the meaning?

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