mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Max USB devices - revisited

Thu Feb 02, 2017 1:46 pm

Following on from previous discussion, and some old threads:
viewtopic.php?f=63&t=13917
(which refer to limits of 8 and 14 devices)

I thought I'd check what the current status is ....

Armed with a 7 port hub and 9 USB wifi dongles, here goes:
Image Image

Code: Select all

Bus 001 Device 006: ID 1915:0144 Nordic Semiconductor ASA
Bus 001 Device 014: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 013: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 012: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 011: ID 058f:9254 Alcor Micro Corp. Hub
Bus 001 Device 010: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 009: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 008: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 007: ID 058f:9254 Alcor Micro Corp. Hub
Bus 001 Device 005: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ifconfig shows wlan0..wlan9 (pi3 intenal is wlan0)

Code: Select all

ifconfig
eth0      Link encap:Ethernet  HWaddr b8:27:eb:c7:99:44
          inet6 addr: fe80::9223:e262:6411:6f59/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:16896 (16.5 KiB)  TX bytes:16896 (16.5 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:92:cc:11
          inet addr:192.168.0.56  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::cdaa:53df:a99f:4605/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5953 errors:0 dropped:345 overruns:0 frame:0
          TX packets:188 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:350356 (342.1 KiB)  TX bytes:25983 (25.3 KiB)

wlan1     Link encap:Ethernet  HWaddr 00:0f:13:29:11:60
          inet addr:192.168.0.38  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::9d60:c95f:d0b0:5b63/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5730 errors:0 dropped:168 overruns:0 frame:0
          TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:357011 (348.6 KiB)  TX bytes:15639 (15.2 KiB)

wlan2     Link encap:Ethernet  HWaddr 00:0f:54:12:c5:93
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan3     Link encap:Ethernet  HWaddr ac:a2:13:22:7b:19
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan4     Link encap:Ethernet  HWaddr ac:a2:13:22:7f:4f
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan5     Link encap:Ethernet  HWaddr ac:a2:13:22:7c:d1
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan6     Link encap:Ethernet  HWaddr ac:a2:13:22:7e:a0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan9     Link encap:Ethernet  HWaddr ac:a2:13:22:7f:fc
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
Last one occasionally drops out - its probably power related with 9x wifi dongles - maybe try with usb flash drives
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ejolson
Posts: 3260
Joined: Tue Mar 18, 2014 11:47 am

Re: Max USB devices - revisited

Thu Feb 02, 2017 4:08 pm

mikerr wrote:Last one occasionally drops out - its probably power related with 9x wifi dongles - maybe try with usb flash drives
The internal WiFi does not communicate over USB so maybe not count it in the total. Have you tried the hub with 9 WiFi dongles in a standard PC? This somewhat recent post seems to confirm the 8 device limit.

W. H. Heydt
Posts: 10625
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Max USB devices - revisited

Thu Feb 02, 2017 5:00 pm

Is it possible that the "8 device limit" is a fanout restriction where the hub itself is counted as a device? I seem to recall seeing 14 port hubs from time to time, which would argue that 8 is not an actual, direct limit.

mikerr
Posts: 2770
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Max USB devices - revisited

Thu Feb 02, 2017 5:46 pm

12 USB drives, + 1 keyboard dongle,
7 port hub, 4 port hub

They're these super slim USB readers with SD cards inside:
https://www.amazon.co.uk/Kingston-Gener ... B0028R3NCU

Image

Code: Select all

lsusb
Bus 001 Device 019: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 018: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 017: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 016: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 015: ID 058f:9254 Alcor Micro Corp. Hub
Bus 001 Device 014: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 013: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 012: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 011: ID 058f:9254 Alcor Micro Corp. Hub
Bus 001 Device 010: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 009: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 008: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 007: ID 05e3:0736 Genesys Logic, Inc. microSD Reader/Writer
Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 1915:0144 Nordic Semiconductor ASA
Bus 001 Device 004: ID 054c:02a5 Sony Corp. MicroVault Flash Drive
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I think the limit is more ACTIVE devices, so "dd" all the flashdrives at once ?
Last edited by mikerr on Thu Feb 02, 2017 6:03 pm, edited 2 times in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

ejolson
Posts: 3260
Joined: Tue Mar 18, 2014 11:47 am

Re: Max USB devices - revisited

Thu Feb 02, 2017 5:54 pm

W. H. Heydt wrote:Is it possible that the "8 device limit" is a fanout restriction where the hub itself is counted as a device? I seem to recall seeing 14 port hubs from time to time, which would argue that 8 is not an actual, direct limit.
As far as I know, the eight device limit is specific to the Pi hardware and applies only to USB2 devices. From what I understand, as the expected use of the SOC was device (gadget) mode, it took heroic efforts to get host mode working well with multiple devices. Thus, a limit of eight is really quite good all things considered.
mikerr wrote:12 USB drives, + 1 keyboard dongle,
7 port hub, 4 port hub
That's impressive! I wonder if some of the thumb drives automatically connected in USB1 mode to overcome the eight USB2 limit. Can you mount the drives and check whether some are running in USB1 mode?

W. H. Heydt
Posts: 10625
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Max USB devices - revisited

Thu Feb 02, 2017 6:04 pm

ejolson wrote:As far as I know, the eight device limit is specific to the Pi hardware and applies only to USB2 devices. From what I understand, as the expected use of the SOC was device (gadget) mode, it took heroic efforts to get host mode working well with multiple devices. Thus, a limit of eight is really quite good all things considered.
I recall the early "teething" problems, though I never ran into them, myself. On the other hand, I don't think I've ever connected more than 4 USB devices to a Pi, so I don't get anywhere near the limit.

uhclem
Posts: 2
Joined: Mon Sep 18, 2017 7:54 am
Location: NH, USA

Re: Max USB devices - revisited

Sun Oct 22, 2017 10:32 am

I'm new to the RPi, but an old-timer at Unix [v4, '73]. Just got a Pi3b, and thought I'd see how hard I could push its storage sub-system. I think the results shed light on this discussion.

Connected two unpowered 4-port USB2 hubs, each with 4 [flash drive,sd reader]s plus a direct-connect flash drive and a direct-connect USB2 HDD enclosure.

Code: Select all

~/dev [ 694 ] # lsblk | grep "^sd.*sk $"
sda           8:0    1  7.5G  0 disk
sdb           8:16   1  1.9G  0 disk
sdd           8:48   1  7.5G  0 disk
sde           8:64   1 14.4G  0 disk
sdg           8:96   1  3.8G  0 disk
sdh           8:112  1  7.5G  0 disk
sdi           8:128  1 29.7G  0 disk
sdj           8:144  1  1.9G  0 disk
sdk           8:160  0  1.8T  0 disk
sdl           8:176  1  3.9G  0 disk
[ sdc & sdf are "missing" because two of the readers have two slots, only one of which was occupied. ]

Code: Select all

~/dev [ 695] # lsusb
Bus 001 Device 106: ID 1976:1307 Chipsbrand Microelectronics (HK) Co., Ltd.
Bus 001 Device 105: ID 04fc:0c25 Sunplus Technology Co., Ltd SATALink SPIF225A
Bus 001 Device 104: ID 1e3d:4082 Chipsbank Microelectronics Co., Ltd CBM4082 SD Card Reader
Bus 001 Device 093: ID 13fe:3100 Kingston Technology Company Inc. 2/4 GB stick
Bus 001 Device 092: ID 13fe:3d00 Kingston Technology Company Inc.
Bus 001 Device 091: ID 090c:6300 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.)
Bus 001 Device 090: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 089: ID 1b8f:0311 MA LABS, Inc.
Bus 001 Device 088: ID 0bda:0306 Realtek Semiconductor Corp.
Bus 001 Device 087: ID 0781:a3a4 SanDisk Corp.
Bus 001 Device 086: ID 13fe:3100 Kingston Technology Company Inc. 2/4 GB stick
Bus 001 Device 085: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Code: Select all

~/dev [ 696 ] # lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 85, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 88, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 1: Dev 86, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 4: Dev 89, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 87, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 3: Dev 90, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 91, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 4: Dev 104, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 2: Dev 92, If 0, Class=Mass Storage, Driver=usb-storage, 480M
            |__ Port 3: Dev 93, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 4: Dev 105, If 0, Class=Mass Storage, Driver=usb-storage, 480M
        |__ Port 5: Dev 106, If 0, Class=Mass Storage, Driver=usb-storage, 480M
OK, let's start this debacle ... rolling ... a joint script: [cf: R.H.]

Code: Select all

~/dev [ 697 ] # xdskt -t -b256 -d10 a b d e -s g h i j -s k l
sda = 3.23 MiB/sec
sdb = 3.69 MiB/sec
sdd = 3.14 MiB/sec
sde = 4.11 MiB/sec
=====>>   14.17 MiB/sec
sdg = 4.62 MiB/sec
sdh = 4.92 MiB/sec
sdi = 5.24 MiB/sec
sdj = 4.37 MiB/sec
=====>>   19.15 MiB/sec
sdk = 4.89 MiB/sec
sdl = 4.87 MiB/sec
================
Total =   43.08 MiB/sec
For each drive letter, concurrently, for a duration of 10 seconds, do 256KB reads (sequential & unbuffered [O_DIRECT]). (xdskt is a homebrew.) (Note the speeds are in programmer units--i.e., the total of 43.08 is equal to 45.17 MB/sec (marketing units).)

Yes, there appear to be 10 active USB2/high-speed devices, but that does not contradict the statement
There is a soft limit to the number of devices active at once.
Due to the way the Raspberry Pi hardware works, there is a maximum of 8 simultaneously active USB transactions.
in jdb's sticky viewtopic.php?f=28&t=53832.

A USB transaction is very low-level; each has a max payload of 1024 bytes. The USB controller takes each I/O request from the Linux driver, and breaks it down into transactions, dynamically allocating (in the Pi's case) the 8 simultaneous "slots" so as to keep everybody happy.

Down the road I'll see how Ethernet activity affects this "tipping point", and will follow up.

I did confirm that concurrent activity on the (native) microSD card does not affect the USB bandwidth (same 43 MiB/s on USB and 35 MiB/s on uSD).

Also, cascading the two hubs (and direct connecting the freed flash drive) did not materially affect the results.

Return to “General discussion”