libusb performance on 8.1

Hans Petter Selasky hselasky at c2i.net
Thu Feb 3 10:56:37 UTC 2011


On Thursday 03 February 2011 11:24:23 Daniel O'Connor wrote:
> On 03/02/2011, at 17:52, Hans Petter Selasky wrote:
> >> I am trying to get it working at the moment, however I'm only finding it
> >> capable of 4 or 8 Mb/sec (512 or 1024 byte EP), although perhaps I don't
> >> understand how to do ISO transfer properly.
> > 
> > Hi,
> > 
> > You need to set the multiplier to 2 or 3. Then you get 3*1024 bytes at
> > maximum.
> 
> OK, so I need..
> usb_xf[i].xf = libusb_alloc_transfer(3);
>  p = malloc(3 * 1024);
> libusb_fill_iso_transfer(usb_xf[i].xf, h, 0x82 p, 3 * 1024, 3, usbcb,
> &usb_xf[i], 2000);
> 

No. Please read the description of wMaxPacketSize in the USB2.0 spec, and the 
multiplier bits.

High-speed USB executes 8 isoc packets per second! Number of packets should 
not be less than 56 for High-speed USB due to underflow risc.

usb_xf[i].xf = libusb_alloc_transfer(56);
 p = malloc(3 * 1024 * 56);
libusb_fill_iso_transfer(usb_xf[i].xf, 0x82, p, 3 * 56 * 1024, 56, usbcb,
 &usb_xf[i], 2000);

libusb_set_iso_packet_lengths(usb_xf[i].xf, 3 * 1024);


You need to allocate 2x "libusb_alloc_transfer(56)" and submit to get double 
buffering!

--HPS


More information about the freebsd-usb mailing list