Re: weird USB test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 15, 2009 at 8:45 PM, Alan Stern<stern@xxxxxxxxxxxxxxxxxxx> wrote:
> Let's say your application submits A write requests and B read requests
> during a frame.  Then your library will want to send 33*A + 3*B bytes
> in that frame.  These will get merged into USB packets, and your
> firmware will accept no more than 512 bytes per frame.  Hence if 33*A +
> 3*B > 512, you will build up a backlog.  Also, since your firmware
> won't send more than 1024 bytes per frame, if 3*A + 33*B > 1024 then
> you will lose data.
>
> Depending on the balance between A and B, you can figure out the
> maximum transfers rate in Mb/s.  For example, if B is 0 then the
> limiting value for A is floor(512 / 33) = 15.  If A = B then the
> limiting value is floor(512 / (33 + 3)) = 14.
>
These discussions are very useful, thank your very much. We will
try to increase the size of firmware buffers to see if we can increase the
bandwidth.

> If A = 15 and B = 0 then the total amount of data transferred per frame
> is 15 * (33 + 3) = 540 bytes.  Thus the upper limit to the throughput
> is 540 * 8 * 1000 = 4.32 Mb/s for each device.
>
> If A = B = 14 then the total amount of data transferred per frame is
> 2 * 14 * (33 + 3) = 1008 bytes.  This yields an upper limit to the
> throughput of 8.064 Mb/s for each device.
>
Well, yes you're right, but since our protocol uses 2ms quanta (1st ms
write, 2nd read urb), we have to divide those bandwidth calculations by two.

>>        Is your external hub full speed (USB 1.1) or high speed (USB
>>        2.0)?
>>
>> It's a Digitus 7 port High speed hub(both 1.1 and 2.0 compatible).
>
> This explains why you are able to achieve throughputs higher than 20
> Mb/s when using multiple devices.  Most likely each port on that hub
> has its own Transaction Translator, and consequently each port is able
> to sustain 12 Mb/s independent of the other ports.
>
> Similarly, if you have two separate root hubs on your PC, then each can
> sustain 12 Mb/s independent of the other.
>
> Alan Stern
>
>

I checked if my assumptions about the internals of PC are really
true, used an application called USBView, and the screenshot
at http://www.cs.bilkent.edu.tr/~mcihan/other/usbview1.jpg
clearly shows that the two port pairs are drived by the last two
UHCI HCs, and the external hub is USB2.0. So I expect each pair
sustains 12Mbps as you have mentioned.
The only problem remaining is we still cannot figure out why
connecting two devices to the port pair drived by same HC
lets us use 4.32Mbps per device(which is the expected case), but
using only one of the devices for communication reduces the bandwidth
to 1.72Mpbs, as I explained the calculations in my previous messages.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux