Date: Thu, 3 Feb 2011 11:56:37 +0100 From: Hans Petter Selasky <hselasky@c2i.net> To: "Daniel O'Connor" <doconnor@gsoft.com.au> Cc: freebsd-usb@freebsd.org Subject: Re: libusb performance on 8.1 Message-ID: <201102031156.37148.hselasky@c2i.net> In-Reply-To: <4DAFAF80-746B-4272-86CC-BB284E59D4F6@gsoft.com.au> References: <9CF6C32F-E230-446B-94FC-C57F0F02B0E4@gsoft.com.au> <201102030822.49266.hselasky@c2i.net> <4DAFAF80-746B-4272-86CC-BB284E59D4F6@gsoft.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102031156.37148.hselasky>