From owner-freebsd-usb@FreeBSD.ORG Thu Feb 3 10:56:37 2011 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8B091065693 for ; Thu, 3 Feb 2011 10:56:37 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe08.c2i.net [212.247.154.226]) by mx1.freebsd.org (Postfix) with ESMTP id 529EE8FC21 for ; Thu, 3 Feb 2011 10:56:36 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=6QwXiDozn7Gnsf2tGidwH+ndAwLlGixx7JAIKZICKmI= c=1 sm=1 a=-lJg8f7At1MA:10 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=0LsJn07xfMtCSjKXVQkA:9 a=TBzY9b6K8SavzH5TMCkA:7 a=h6m3qC9dId0d5s3AfVLqcHa4ZMgA:4 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 82718668; Thu, 03 Feb 2011 11:56:35 +0100 From: Hans Petter Selasky To: "Daniel O'Connor" Date: Thu, 3 Feb 2011 11:56:37 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <9CF6C32F-E230-446B-94FC-C57F0F02B0E4@gsoft.com.au> <201102030822.49266.hselasky@c2i.net> <4DAFAF80-746B-4272-86CC-BB284E59D4F6@gsoft.com.au> In-Reply-To: <4DAFAF80-746B-4272-86CC-BB284E59D4F6@gsoft.com.au> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102031156.37148.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: libusb performance on 8.1 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2011 10:56:37 -0000 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