Re: Very high data rate isochronous USB device ?
Thierry Herbelot <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
Le Monday 29 January 2007 19:50, Thierry Herbelot a écrit : > Hello, > > I'm writing a USB device driver for a high-data rate device, for which I > would like to use isochronous transfers (I already have working bulk > transfers), but I can't get the expected (very high) data bandwidth. > > The situation today is following : > - the device uses a High-speed USB 2.0 connection > - the device advertises one isochronous Endpoint, with up to 3 packets of > 1024 bytes per micro-frame, which corresponds to the designated target rate > of around 200 Mbps (the endpoint descriptor has been checked and rechecked, > and lsusb seems to acknowledge these parameters) > - the PC I use as host has three EHCI USB bridges : one is on the > motherboard, and comes from Intel (it is a recent ICH6), and two > additionnal PCI boards use chipsets from VIA and Ali > - I am using a quite recent linux kernel (2.6.18, coming with with OpenSuse > 10.2) > - I have copied the urb and iscochronous packet initialization and the > completion routines from existing device drivers (one example I followed is > drivers/media/dvb/b2c2/flexcop-usb.c) > - like in flexcop-usb.c, I have initialized the URBs with many packets > (urb->number_of_packets is now a parameter of my device driver, and current > values are 8 or 16) > - like in flexcop-usb.c, I have a big buffer cut in 8 or 16 chunks of > 1kbyte, with offsets of 1 kbyte, one chunk for each packet of the URB > - like in flexcop-usb.c, the URBs are scheduled as fast as possible > (urb->interval = 1;) > - I can read some data in isochronous mode, but with a lower data rate than > the target : I only get one IN token for each micro-frame, instead of the 3 > expected > - I get the same behavior with all thre EHCI controllers (Intel, VIA and > Ali) - I have had a quick look at drivers/usb/host/ehci-sched.c, where the > scheduling occurs, but I could not determine from iso_stream_init(), for > example, which parameters I should set to have a higher data rate > > Thus the question is : is there any driver in the linux source tree which > can read more than one 1kbyte packet par micro-frame ? (or, which parameter > set in flexcop_usb_transfer_init() should I change to attain a higher data > rate ?) (for the archive ?) after some more homework, I have found one strange but working answer in the gspcav1-20070110 driver : urb->iso_frame_desc[j].length for each "packet" should in fact be set to (number of packets expected per micro-frame)*(size of each packet), that is a hard-coded 3*1024 for my case. the example computes in gspca_core.c::gspca_init_transfert() : psize = le16_to_cpu(ep->desc.wMaxPacketSize); psize = (psize & 0x07ff) * (1 + ((psize >> 11) & 3)); then : urb->iso_frame_desc[fx].length = psize; TfH -- ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel