usb2 bulk read optimization ?

Thierry Herbelot thierry.herbelot at free.fr
Fri Nov 28 15:31:34 PST 2008


Le Friday 28 November 2008, Hans Petter Selasky a écrit :
> On Friday 28 November 2008, Thierry Herbelot wrote:
> > Hello,
> >
> > another day, another question :
> >
> > I'm done converting an old "userland driver" to usb2 and libusb20 - and
> > it works ! (using the libusb API, for the time being).
> >
> > The application is a data capture from a bulk endpoint, and I can't get
> > more than around 8 Mbps. The data are formatted as URBs of 40 kbytes.
> >
> > This may be expected, as the machine is an oldish Pentium-III, with an
> > additional Acer-based USB-2 extension card.
> >
> > (still, I have recompiled the -current kernel without the INVARIANTS and
> > WITNESS options)
> >
> > I have had a quick look at the code of libusb20 and tried an increase of
> > bufsize in usb_get_transfer_by_ep_no, but with no discernable
> > improvements.
> >
> > 	Any idea ?
>
> Hi Thierry,
>
> You have found the correct place to tune the buffer size. Are you sure that
> your application is also doing similiarly large bulk transfers?

I'm doing "usb_bulk_read(handle, ep, data, size, 500);" with size around 
40kbytes.
>
> Are you sure that the transfer speed limitation is not a limitation of your
> USB device?

this USB device is known, with a different, open-source, OS, to handle around 
240Mbps (30Mbyte/s, but probably not on this oldish machine). the device is 
high-speed compliant, but can only do bulk transfers (maybe isochronous could 
have been better, but that's technically not possible)
>
> Keep in mind: The EHCI has an interrupt clamp of 4000-8000 interrupts /
> second.

OK : I would *very much* like to see a transfer rate of 4k*40kbyte/sec
>
> --HPS

	Thanks for the answers

	TfH


More information about the freebsd-usb mailing list