USB connection stability

1,062 views
Skip to first unread message

Junichi Chiba

unread,
Jul 23, 2015, 12:45:50 AM7/23/15
to OpenSTF
Hi,

I'm looking at stability in USB connections when more than 10 devices are connected.
I've set up three different machines, however, the connections are not very good in all of them.

Machine 1: Mac Yosemite, two 10 port hub (Anker USB3.0)
Machine 2: Core i7 2.8GHz, 4GB RAM, Ubuntu 14.04, two powered 10 port hub (Anker USB3.0) connected to PCI USB card
Machine 3: Core2 Quad 2.83GHz, 4GB RAM, Ubuntu 14.04, two powered 10 port hub and two SUGOI HUB connected to PCI USB card

Note that each device I have can work fine alone. They are recognized well and operates well over STF:7100 when only that one (or a few others) is present in the host.

The problem is obvious and reproducible when more than 10 devices are present in the host. (It's a few more or less according to the combination of Android)
By connecting the 11th device, it won't be recognized.
Furthermore, some of the devices in operation may become unavailable then, until all the devices are manually removed and reconnected carefully.

I once doubted power shortage, but soon I noted the HUBs here are SUGOI HUB and 10 port Anker, that supply more than 1000mA for each port.
My coworker found a log about USB driver in dmesg:

(Machine 3)
usbfs: USBDEVFS_CONTROL failed cmd adb rqt 128 rq 6 len 256 ret -71


On Mac the problem is the same. Connecting 11th device will fail.

We decided that something around USB driver is blocking recognition of a new device.


Let me ask a few questions:
1) What is the maximum number of devices successfully recognized in one host?

2) What is the recommended number of devices?

3) What are the machine configuration for successfully hosting such number of devices?
Do we need to prepare anything other than explained in Readme?

4) With such numbers of devices present, how long is a MTBF of the host, as long as focusing on USB driver functionality of course?
The Readme says that once a week some devices may need a care, but there's no note if the host needs periodical care.

5) What kind of logs will it be useful for debugging for the team? I will manage to provide any information.

Many thanks in advance.

Simo Kinnunen

unread,
Jul 23, 2015, 1:21:24 AM7/23/15
to Junichi Chiba, OpenSTF
Hi,

Please post a link to the hub. I'm not aware of any Anker hub that works well with STF. Also, we don't recommend any USB 3.0 hubs at all as we've had countless problems with them. Check the README for hub recommendations.

Sounds like you're running into a problem with Intel processors (or the chipset, possibly). I'm not sure about your 4-core Core 2, but many recent Intel processors are only able to support about 8-12 phones simultaneously, even with USB hubs. This is mentioned in our README: https://github.com/openstf/stf#i-plugged-in-a-new-device-but-its-not-showing-up-in-the-list. Basically you need a PCIe USB extension card with onboard controllers. We give some recommendations in the README. USB hubs (whether SUGOI, Plugable or anything else) have nothing to do with it, they will all have the same problem if you don't get the card.

1) What is the maximum number of devices successfully recognized in one host?

We limit our providers to 28 devices, but this is because we have one PCIe USB card per PC, and each port on that card has a separate USB root bus. If you put one hub per root bus like we do, and you use our recommended 7-port hubs, then you get 28 devices. We don't put any hubs or devices directly into the motherboard ports (except on rare occasions if the total count is less than or equal to 8). We currently run 6 device providers.

In theory each USB root bus should be able to support 127 devices, but I don't think that's wise.

2) What is the recommended number of devices?

One hub per USB root bus, or 28 in our configuration. See above.

3) What are the machine configuration for successfully hosting such number of devices? Do we need to prepare anything other than explained in Readme?

Our latest configuration is in the README. You must have all the components (including the PCIe card) or it won't work.

No, you should not need anything else (except some physical space for everything).

4) With such numbers of devices present, how long is a MTBF of the host, as long as focusing on USB driver functionality of course?
The Readme says that once a week some devices may need a care, but there's no note if the host needs periodical care.

With our Intel configuration (in the README) we haven't had any problems so far. With our budget AMD configuration the host may occasionally (perhaps once a month) lose a root bus or two, requiring a complete power cycle and sometimes other voodoo methods.

We've also had a few USB cables go bad, and once a USB hub broke (well, it was actually making a weird noise from the start - must have been a faulty unit).

5) What kind of logs will it be useful for debugging for the team? I will manage to provide any information.

USB problems are the most difficult issue when running a device lab. Because it takes so much time we can't provide any support in this area. If you follow our recommended hardware guide exactly, you shouldn't have any problems. Otherwise we can't really help and you're on your own.

The usual tools we use for checking issues ourselves are `dmesg`, `lsusb -vt` and `lspci`.

- Simo


--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openstf/5d6aa25e-59ca-4bcc-9727-fa59481c885c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Junichi Chiba

unread,
Jul 23, 2015, 3:54:44 AM7/23/15
to OpenSTF, si...@shoqolate.com, si...@shoqolate.com
Thank you for your reply:)

The hub we had is
http://www.amazon.com/Upgraded-Anker-SuperSpeed-Including-Charging/dp/B005NGQWL2?
(the 10th port allowing connection)

Ah, now I found a similar Anker (the 10th port being charging only) is listed in Readme with a score 2/10, which is not recommended.

It's fantastic to hear
If you follow our recommended hardware guide exactly, you shouldn't have any problems.
OK I decide now that I should stop collecting available parts in the company.
I shouldn't date to investigate into troubles introduced by use of parts not recommended.

we have one PCIe USB card per PC, and each port on that card has a separate USB root bus.
> If you put one hub per root bus like we do, and you use our recommended 7-port hubs, then you get 28 devices.
I see. I will aim the maximum 28 devices, preparing the correct PCIe USB card and USB hub.

Irek Dziwis

unread,
Apr 27, 2017, 8:26:07 AM4/27/17
to OpenSTF


On Thursday, July 23, 2015 at 7:21:24 AM UTC+2, Simo Kinnunen wrote:

Sounds like you're running into a problem with Intel processors (or the chipset, possibly). I'm not sure about your 4-core Core 2, but many recent Intel processors are only able to support about 8-12 phones simultaneously, even with USB hubs. This is mentioned in our README: https://github.com/openstf/stf#i-plugged-in-a-new-device-but-its-not-showing-up-in-the-list.
Basically you need a PCIe USB extension card with onboard controllers. We give some recommendations in the README.
[...] 
 
Simo in README PC Componets section you wrote that recomended USB extension card is PCIe SuperSpeed USB 3.0 Card Adapter. You always emphasize to use USB 2.0 hubs, cables and generally that USB 2.0 is better and more stable than 3.0. Let me ask then why do you recommend 3.0 USB PCIe extension card? Do you somehow change the working mode of this card to 2.0 or it works as 3.0, but in case of extension cards it does not matter? Please elaborate how to understand it.
Thanks

Simo Kinnunen

unread,
Apr 27, 2017, 8:28:14 AM4/27/17
to Irek Dziwis, OpenSTF
They also have USB 2 chipsets. No reason really, just that it's more difficult to find non-USB 3 gear.

--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Irek Dziwis

unread,
Apr 27, 2017, 10:44:33 AM4/27/17
to OpenSTF
Ok, but have you enforced the extension card somehow to operate only using USB2.0 mode or it is being happened automatically? If an extension card discover USB2.0 device (in this case USB2.0 hub) it will use backward compatible (USB2.0) chipset features right?
My extension card LogiLink® PCI Express Card, 2x USB 3.1k  is based on ASM1142 chipset, which according to this specs also supports 3.1 and 2.0 standards, so that I should have similar experience, but I don't. I've got everyday's devices disconnections. Of course there can be lots of reasons devices are being disconnected. Eg. I don't have the same environment configuration. But I'm trying to eliminate most probable reasons causing disconnections:
- I've replaced old cables for AWG24 ones,
- replaced hubs from 3.0 to 2.0 ones (externally charged),
- connected hubs from USB ports controlled by Intel chipset (Motherboard built-in) to those from extension PCIe card mentioned in this post.

What else can I do/change?

Simo Kinnunen

unread,
Apr 27, 2017, 11:32:14 AM4/27/17
to Irek Dziwis, OpenSTF
Well you haven't said which hubs you're using. Could be a huge difference right there.

If your devices are USB 2, they will always operate in USB 2 mode throughout the whole stack. They don't support higher speeds so it's not even possible to have them run in USB 3 mode.

--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.

Chris Hessing

unread,
May 1, 2017, 1:21:52 PM5/1/17
to ope...@googlegroups.com

If I may throw in my $0.02 here.   I've found that in most cases, the random disconnects that we have seen have had less to do with the USB host chipset, and *MUCH* more to do with the device itself.   Worse, I've seen poorly behaved devices completely destabilize the entire USB bus they are connected to.  (Won't name names on that one, but we had one device that we had to put on its own USB bus or else it caused all the other devices to completely disconnect within an hour or two of getting them all up and working.)   At the same time, I currently have a device that refuses to stay connected no matter which chipset I use it with, and no matter if I am using USB 2 or USB 3.   (I may have to dig out an old USB 1 hub and see if it is happy with that!)


My point is, don't automatically assume that if there is a problem it is necessarily the host chipset.   Even if the problem is causing all of the devices connected to act up.  From my experience, a single "glitchy" device can cause havoc on the USB bus!


As far as using USB 2 versus USB 3 controllers, I would actually argue that using USB 3 controllers is the right thing to do, even if you are only connecting USB 2.0 devices.   The reason is pretty simple.  USB 3 cards are more likely to support the higher current requirements of devices, and to recognize the goofy wiring those devices use to signal that they want more current.    As I have also seen devices misbehave when they get less power than they want, making sure they get all that they want is another way to help stabilize the bus.   If you are using a USB 2 card, and run in to the low power problem, you might be able to work around it using one of the USB "y" cables that can allow you to use two power sources to feed a single device.  But, be aware that all of that type of cable that I have ever seen lacks the diodes needed to prevent the two power sources from feeding power in to the other, which could potentially cause problems with poorly designed host buses.   (That said, I would *HOPE* that most USB controllers have some kind of feedback circuit in them.  But, who knows!)


Troubleshooting USB problems can also be a massive pain.   So far, the best method I have found is to look in dmesg and see which device disconnects first.   I then disconnect that device, and see if everything else stabilizes.   (I've also found that disconnecting power from the host device for 10-30 seconds, then powering it back up gives you the "best" chance at really figuring out if things have stabilized or not.)   If everything stabilizes, then the device you unplugged probably is the issue.   If not, try the next device at the top of the list when the disconnects happen.   Then, if everything stabilizes, add back the first device.


For the device that you ultimately find misbehaving, you will probably want to try to hook it to it's own bus.  (Note, in a lot of cases multiple ports on a single device are actually on the same bus, just through a hub.   So, you will need to dig in to figure out which ports on the host device are ACTUALLY on their own host.)   You can use the "lspci" and "lsusb" commands in Linux to help figure out how many USB buses are in the machine, and which bus different devices are on.   Or, put another add-in card in, and only hook the flakey device to that add-in card.


Now, what would be *REALLY* cool is something like a thunderbolt->USB device where each port on the device was its own bus!   Would someone please get on that!?  ;)


Hope this helps someone out there!

Simo Kinnunen

unread,
May 1, 2017, 1:26:23 PM5/1/17
to Chris Hessing, OpenSTF
Such a device does exist, but it's somewhat expensive at around $1500 for 16 ports. We can sell you one if you're interested :)

To unsubscribe from this group and stop receiving emails from it, send an email to openstf+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openstf/00975a66-b28f-40a6-81cc-6b67a83ef61b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "OpenSTF" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openstf+unsubscribe@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages