On Mon, Sep 28, 2009 at 7:08 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > On Mon, 28 Sep 2009, Devin Heitmueller wrote: > >> Hello, >> >> I have been doing some testing in an attempt to support two USB video >> capture devices on the same bus. >> >> For a single device running with maxpacket of 3072 per microframe, the >> EHCI driver is indicating 57% utilization of the bus (the sysfs stats >> already takes into account the fact that only 80% of the bus is >> available for isoc traffic). >> >> Is this expected behavior? By my math, an alternate of 3072 should >> take exactly 50% of the available bandwidth. Have I misinterpreted >> the spec? > > Let's go through the arithmetic. EHCI runs at 480 million bits per > second. That's 480000 bits per ms, or 60000 bytes per ms, or 7500 > bytes per uframe. Only 80% of those bytes are available for periodic > transfers, leaving 6000 bytes per uframe. You want to transfer 3072 > bytes per uframe; allowance for bit-stuffing raises that to 3584. > There's some additional protocol overhead as well, but let's ignore > that. 3584/6000 is a little under 60% (closer to 59.7%). So if > anything, the 57% estimate is a little low. Ok, now we're getting somewhere. I did not account for bit-stuffing. I had read somewhere that it only introduces 0.8% overhead for random data (not appreciating that the scheduler would have to account for a worst-case scenario). Also, I looked at the wrong line in my spreadsheet - the driver indicated a utilization of 60% for 3072 (it was 57% for 2892). Taking into account the 1/6 overhead of bit stuffing, that matches up perfectly with what I'm seeing. Thanks to both of you for taking the time to clarify how the math works. Cheers, Devin -- Devin J. Heitmueller - Kernel Labs http://www.kernellabs.com -- 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