Adding more than two USBHub3+ hubs
Some customers who have been using multiple Acroname USBHub3+ hubs have shared with us that they cannot add more than two USBHub3+ hubs to their system or that they need more USB resources. As it happens, this is not a limitation of USBHub3+ itself, but rather a limitation of the host USB controller and the host machine's implementation of the USB controller.
Let's take a deep dive to understand where this limitation comes from:
The USB specification defines two different connectivity types in the USB tree topology: number of layers or tiers and number of endpoints or functions. Note that endpoints are not the same thing as devices.
USB Tiers
USB tiers result from the use of hubs, where each hub is, in fact, its own USB device as well as the start of a new layer of USB devices. The USB 2.0 specification (section 4.1.1, figure 4-1) includes the following diagram to illustrate USB topology.
The host and root hub reside on the first tier, and a connection to a hub adds another tier. The tier number for any USB device is the number of non-root hubs in the connection chain plus 2. The USB specification is limited to a maximum of 7 tiers. Therefore, for there is a hard limit of 5 daisy-chained hubs (not counting the root hub).
Most host systems have just one USB controller that is integrated in the host system chipset.
Here, you can see a diagram of a typical PC architecture. We have expanded the diagram to expand on the USB section, showing the USB Type A connectors:
What is not commonly known is that many host machines use hub chips internally to expand the number of available USB connectors. So, it is possible that the USB connector on your host machine is already one or even two tiers deep in the overall USB tree:
Thus, the ability to daisy-chain external hubs is reduced on a host machine that uses internal hubs. Keep in mind that many low-cost USB expansion cards just add an internal hub.
Defining USB Endpoints
Each USB device can define up to 32 endpoints (16 inputs and 16 outputs though one must be a control endpoint), but most devices only define 2 or 3 endpoints (e.g. data in, data out, and a control endpoint). Hubs themselves also define at least a control endpoint. Every USB controller implementation may have its own layer or endpoint limitations. Most modern USB 3.0 hosts use eXtensible Host Controller Interface (XHCI) USB controllers.
The XHCI specification allows for a massive 7,906 enpoints! However, common implementations of the XHCI controllers impose their own limit on the total number of endpoints to 96. The most notorious of these Intel's series 8 architectures. This means that the maximum number of common devices which use 3 endpoints able to be attached to an Intel series 8 XHCI host controller is actually 96 endpoints / 3 endpoints per device = 32 devices. This is a known limitation of Intel-based XHCI controllers:
- communities.intel.com/thread/52417 - unfortunately Intel removed this thread
- https://community.intel.com/t5/Embedded-Intel-Core-Processors/Hardware-limitations-on-USB-endpoints-XHCI/td-p/264556 - mentions a 64 endpoint limit
To make matters worse, USB 3.0 buses live in a strange dual existence with USB 2.0 devices. That is, they live in the similar yet separate tree architecture in parallel with USB 2.0 devices, but they share the same endpoints on XHCI controllers. USB 3.0 devices may implement endpoints on both the USB 3.0 and 2.0 buses. This will even furhter reduce the number of devices which can be attached to a single XHCI host controller.
USB Limits and the Acroname USBHub3+
Architecturally, 8-port USB hubs implement their 8-port configuration by internally cascading 2-port and 4-port USB hub chips. Each individual hub chip contains both a USB 2.0 device as well as a USB 3.0 device. USBHub3+ is no different and we can see this architecture clearly in the USBHub3+ datasheet:
You can now see that each USBHub3+ unit is actually comprised of three hub chips in two internal hub layers: Hub A on one layer and Hub1/Hub2 on a second layer. Remember that each hub chip itself contains a USB 2.0 and a USB 3.0 device which will be added to the system USB tree. Given these 3 internal hub chips, each USBHub3+ adds 2 tiers to the USB tree. Each hub chip defines one control endpoint, and the BrainStem controller itself adds 3 more endpoint, for a total of 9 endpoints per USBHub3+.
Going back to the previous example of the commonly available Intel XHCI-based host system, the integrated controller supports a maximum of 96 endpoints. We need to tally up the total number of active endpoints (assuming 3 endpoints for each downstream device - input, output, control) to determine how many USBHub3+ hub ports can be used:
1 Acroname USBHub3+ (9 endpoints) + 8 Downstream Devices (8 x 3 = 24 endpoints) = 33 endpoints
If 3 fully populated USBHub3+ hubs are connected, 99 endpoints would be used with 24 typical USB devices. By removing one device (23 total), we would drop down to 96 endpoints. However, many host machines use USB internally for built-in peripherals, including webcams, touchscreens, and touchpads. Therefore, the number of external devices that can be connected is different for every system.
What also begins to become clear is that because the USBHub3+ adds 2 layers to the USB tree, you will exceed the maximum USB layer count in your system by daisy-chaining 3 USBHub3+ units. This number can be further impacted by a host machine where the USB connectors are already expanded by internal hubs. We've created a follow-up blog post with a suggested topology to reach maximum daisy-chaining potential. Read it here.
5 Simple Solutions for Your System
Those are the limitations… so what are the solutions?
1. Force your system to use EHCI instead of XHCI (Linux)
Thanks to Marc Merlins for pointing out the magic to force your system to use EHCI instead of XHCI. Unfortunately, this will limit all devices to USB 2.0 speeds.
More information on the limitations of Intel's XHCI
More information on Linux driver
2. Force your system to use EHCI instead of XHCI (Windows)
Similar to the method above for Linux, Alexx999 made a tool to set BIOS flags to use the EHCI controller on Windows systems: Intel USB Controller Switcher
3. Use a USB 2.0 cable from your host to USBHub3+
If you need to add more than 18 total devices to your XHCI system and you do not need USB 3.0 performance, the simplest solution is to use a USB 2.0 host cable to connect your host to USBHub3+. Since the USBHub3+ is now connected only with USB 2.0, there will not be any enumeration of USB 3.0 devices, including the USB 3.0 hub chips internal to USBHub3+. This will effectively reduce the USBHub3+ footprint in your USB tree from 6 devices to 3 devices.
4. Add a discrete USB controller to your host
If you need to add substantially more USB devices to your host, the main limitation is likely the integrated Intel XHCI USB host controller. Discrete USB host controllers do not typically have this limitation. Adding a discrete USB host controller in a PCIe expansion slot is a great way to expand the total tree and number of devices available.
5. Remove unneeded internal devices
Find where and what devices are attached to your host controller:
https://www.intel.com/content/www/us/en/support/articles/000005622/software/chipset-software.html
Then disable ones you aren't using such as Bluetooth, audio devices, finger print readers, cameras, etc.
Comments
What a great presentation!
Thank you for this complete but clear explanation. So theoric limits of 127 and 255 devices for USB 2.0 and 3.0 USB host controllers respectively are a kind of dream that can never be achieved in any implementation. Unless you could attach all devices in the first tier! Cheers from France.
Sort of possible...
It is technically possible to hit 127 devices, but it is very very unlikely. Besides the tier limit, you also have the end point limit to contend with. Even worse, macOS has some other limitations which come into play when making a hackintosh.
So adding a pci usb hub will
So adding a pci usb hub will add end points ?
Adding a PCIe USB expansion card
Adding a PCIe expansion card may allow for more end points. At the least, an expansion card will not have all the built-in devices and hubbing that many computers come with. The firmware expansion card and drivers in the OS determine the number of end points available.
VMWare or Unix allows you to use more
I think I found a way around some of these limits. VMWare and FreeBSD and other Unix OS's allow you to use a lot more devices VS linux/windows based systems. These OS's are somehow handling this differently. Check out my post over at Proxmox for details on what I'm doing:
https://forum.proxmox.com/threads/usb-3-and-max-number-of-devices-this-x...
Excellent, very clear explanation of USB topology
I've read countless articles about USB related problems with consumer level PCs. This is the best explanation of USB topology I've found to date, and clearly illustrates one of the reasons why the common attempt to daisy chain multiple hubs is usually doomed to fail.
Thanks - very good!
Add new comment