From: Martin V. <mva...@ca...> - 2004-06-14 19:15:14
|
Hi, Effectively, it handles any size transfer, but it is not efficient :( So the kernel is really part of the problem. I have built the linux 2.4.18 -rmk6, but I don't see anything about the size limitation of 4KB of the file system. Question#1: Do you know what to change exactly into the kernel? Do you think that I should jump with a kernel that handle usb2.0. (My platform is usb1.1 presently). Question#2: (if the #1 is not possible ...) You also tell me to use the URBs instead of the bulk call? I'm not pretty certain to understand exactly. (English limitation and/or usb expertise limitation). I do not see any URBs function? I was assuming the the usb_bulk_read or usb_bulk_write commands were handling this? Here what I'm doing exactly to write data, maybe that you will be able to tell me what to change :) Step1- I'm building the CBW Bloc Command of 31Bytes. (Command Op 2Ah to write data) Step2-I'm using usb_bulk_write() to send the CBW. Step3-I'm using the usb_bulk_write() to send also my data( 512Bytes, upto 1MB). It's here that the limitation of 4KB slow down my test. (I'm testing Flash device) Step4-I'm reading the CSW with usb_bulk_read(); NB:To readback the data write on my UnitUnderTest, I'm using the command op 28h). Those commands are working, but it should be much faster!(I run comparison transfer rate test under window2000 and windows XP). I'm waiting respond from you to know if it will be possible for me to fix this issue soon or if I will have to wait a few weeks (months) Thank you very much! Martin -----Original Message----- From: lib...@li... [mailto:lib...@li...] On Behalf Of Johannes Erdfelt Sent: Monday, June 14, 2004 2:09 PM To: lib...@li... Subject: Re: [Libusb-devel] MAX_READ_WRITE On Sat, Jun 12, 2004, Peter Stuge <stu...@cd...> wrote: > On Thu, Jun 10, 2004 at 04:25:37PM -0400, Martin Vaillancourt wrote: > > #define MAX_READ_WRITE 4096 > > > > QUESTION : This seems to slow down a lot the transfer rate . Is > > there already a fixed or a solution to speed up this? > > I believe you should just use larger buffers in your application > and libusb and/or the kernel will handle it all well. > > My guess is that 4KB is just the size libusb uses to communicate > with the kernel, but if libusb knows you want to transfer more, > it will do so efficiently. Please correct me if I'm wrong. :) It will handle any size transfer, but it won't be efficient. Some people have had problems with 4KB transfer sizes and getting the maximum amount of bandwidth out of USB 2.0 devices. One thing we can do in libusb is submit using URBs instead of using the bulk call. That is the difference between 16k buffers and 4k buffers, so we should be able to get a 4x improvement in performance that way. But ultimately, we'll need to make some modifications to the Linux kernel to handle bigger buffers. I'll implement the libusb change ASAP. JE ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ Libusb-devel mailing list Lib...@li... https://lists.sourceforge.net/lists/listinfo/libusb-devel |