From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 23 07:47:26 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FF0216A400 for ; Thu, 23 Mar 2006 07:47:26 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from mail46.e.nsc.no (mail46.e.nsc.no [193.213.115.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id A772043D46 for ; Thu, 23 Mar 2006 07:47:25 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from acer-43b73db2a3.lan (ti131310a080-4379.bb.online.no [85.165.209.27]) by mail46.nsc.no (8.13.5/8.13.5) with ESMTP id k2N7lLAN008547; Thu, 23 Mar 2006 08:47:22 +0100 (CET) From: Hans Petter Selasky To: Peter B Date: Thu, 23 Mar 2006 08:47:40 +0100 User-Agent: KMail/1.7 References: <200603230055.k2N0twwd024499@brother.ludd.ltu.se> In-Reply-To: <200603230055.k2N0twwd024499@brother.ludd.ltu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603230847.41120.hselasky@c2i.net> Cc: freebsd-hackers@freebsd.org Subject: Re: usb2 iscochronous transfer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Mar 2006 07:47:26 -0000 On Thursday 23 March 2006 01:55, Peter B wrote: > >> >Maybe you want to try out the new USB API when designing the driver. > >> > Don't forget that high-speed isoc have 8 frames per millisecond! > > http://en.wikipedia.org/wiki/USB > "In addition to this some operating systems take a conservative approach > to scheduling transactions and limit the number of transfers per frame. > Reducing the maximum transfers from say the theoretical 13 per frame > to 10 or 9." > > Does this apply? The limit is 128 transactions per transfer. For full-speed USB that means 128 frames. For high-speed USB that means 128*8 frames. I recommend that you use two transfers of 50 frames for full speed and 50*8 for high speed. > >> >PS: My USB driver in SVN is now also compiling and working on NetBSD > >> > 3.X. > > Where can I find instructions for this? There are not so many instructions available, so here is a quick one: 1) Compile a NetBSD kernel without USB 2) svn --username anonsvn --password anonsvn checkout svn://svn.turbocat.net/i4b 3) Uncomment "WITH_USB=" in "i4b/trunk/i4b/module/Makefile" 4) Read "i4b/trunk/i4b/Makefile" and follow the instructions for how to install on NetBSD. > > >if that works better during the transition phase. But the patches are not > >ready yet. Really it is just to follow the Makefile. > > Anything in particular that makes them "not ready" in you opinion? Lack of time to make the patches. > > >> How is uaudio and umass working with this driver? > > > >uaudio and umass works fine, but they need to be rewritten, hence they are > >still under the compatibility layer of my driver, and can sleep when they > >should not sleep. > > I tested the new usb driver with: > FreeBSD 6.0-RELEASE #0: Tue Mar 21 15:17:11 UTC 2006 > CPU: Pentium Pro (199.74-MHz 686-class CPU) (yes a slave machine for i/o > :) real memory = 83881984 (79 MB) > > http://www.pcidatabase.com/vendor_details.php?id=648 > ehci0@pci0:6:2: class=0x0c0320 card=0x31041106 chip=0x31041106 > rev=0x63 hdr=0x00 > 4xUsb 2xFw > uaudio0: Creative Technology SB Live! 24-bit External, rev 1.10/1.00, > addr 2 > > uaudio plays without any audioable distortion over the toslink interface. > However syslog is full of: > usbd_transfer_done: short transfer actlen(3528) < len (3600) > > What's the cause .. ? > /usr/src/sys/dev/usb2/_usb_transfer.c > usbd_transfer_done() > error==FALSE (why set?) > xfer->actlen < xfer->length > xfer->flags & USBD_SHORT_XFER_OK == FALSE The cause is probably in "uaudio.c", that it feeds too much data to the uaudio device. Really the error should be ignored for read transfers, so it maybe lacks a USBD_SHORT_XFER_OK. Someone at "multimedia@freebsd.org" might be able to answer. Could you try plugging the device into a high speed USB HUB connected to a high speed USB port? See if the messages change. --HPS