[Note that programming questions like this are generally better suited for linux-usb-devel than for linux-usb-users.]
On Mon, 6 Sep 2004, Patrick Boettcher wrote: > Hi, > > I'm writing a driver for a dvb-t device. It is a 1.1 device. When > receiving a channel the transfer bandwidth can reach a bindwidth up to 6 > MBit/s. So almost reaches to practical limit of USB1.1 . > > Until now I have a 8KB buffer in one URB which is submitted when the > transfer begins. When the complete-method is called I copy the buffer to > another and resubmit the URB. It is working fine as I was able to record a > channel 8 hours in a row. > > Now someone told me, that copying buffers in the complete method is not > the best way and can lead into data losses. He recommends some kind of > ringbuffer which is then be used as URB-buffer and a tasklet is doing the > actual copying. Is this the way to go? Is there a better way? While it's true that copying in a tasklet is slightly better than copying in an interrupt handler, the difference isn't all that great. (However you shouldn't use a ring buffer; you should use separate buffers. That's because in non-cache-coherent architectures it's necessary to avoiding reading or writing data in a memory buffer while it's being used for I/O.) What _will_ make a big difference is if you submit two URBs instead of just one (each with its own buffer of course). Then whenever one of them completes the other one will be active, avoiding a possible data loss. After copying the data you resubmit the URB. That way there are never any gaps, periods during which no URB is active. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel