Winusb speed problems

Hi

I have a problem with WinUSB - managed to install WinUSB and access it from a simple executable (WinUsb_HowTo.docx from MS used as starting point).
As device I used OSRFX2 devboard.

But the speed is only ~512 byte/msec which is around 4MBit using the bulk endpoints.
Which is too slow - even if i canot put more packages in every microframe it should be at least 8 packages of 512 bytes/msec not only one. For now I used the blocking mode (no overlapped) - now I want to try the overlapped version.

The sending is quite simple - sending one after another 100,200, 1000 x 512 byte packets with Winusb_WritePipe. It works, I can read out what I send down to the device. The board displays highspeed, winusb report back highspeed, cable is highspeed.

What I don’t know is:

  • does this limitation coming from OSRFX2 quad buffer solution
  • from their firmware
  • do I need to change some parameter with WinUsb_ControlTransfer

Winusb should not be a problem - many people from here stated that WinUSB can support high speed so it should be something else.

What I noticed is that if I don’t read in data, the out buffer fulls up too (that is stated on the board’s manual as well so it’s fine) - for read I used a thread with no sleeps or whatever else, just Winusb_readpipe-s one after another.

Does anybody have experience with this board?
It would be important for me to know that this limitations are coming from my code or from the board itself … Tried on 3 PC’s, one Vista, two XP’s - the result is close in every case. Sending 100x512 or 50x1024 does not make a difference so sending bigger amount does not change much.

The 4Mbit say something for anybody? It’s not lowspeed, is not fullspeed - it’s somewhere in the middle, the timeframe looks like an interrupt mode which works with 1 pkt/msec like the HID one. But this is bulk :slight_smile:

thanks,
-Barna Csenteri

Even from kernel mode drivers, sending a URB for a single MaxPacket worth of data at a time is going to kill performance if the device is capable of moving data on every IN or OUT. There is a cost of programming a transfer in the controller (and the cost of passing it up and down the stack). You want to amortize this cost by sending larger transfers (as big as you can). Another technique is to send multiple larger transfers at a time so that when one completes, the next one is already scheduled in the controller. In this case, to optimize WinUsb performance, you should set the RAW_IO pipe policy to TRUE. This will require that your transfers are multiples of MaxPacketSize for the endpoint, but it will allow them to go all the way to the controller.

Now, the highspeed value doesn’t really indicate anything about actual throughput. I could design a highspeed device that gets 1 byte per hour. There is flow control involved so the device and host can move data at whatever rate they choose (up to the max).

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, March 26, 2008 6:24 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Winusb speed problems

Hi

I have a problem with WinUSB - managed to install WinUSB and access it from a simple executable (WinUsb_HowTo.docx from MS used as starting point).
As device I used OSRFX2 devboard.

But the speed is only ~512 byte/msec which is around 4MBit using the bulk endpoints.
Which is too slow - even if i canot put more packages in every microframe it should be at least 8 packages of 512 bytes/msec not only one. For now I used the blocking mode (no overlapped) - now I want to try the overlapped version.

The sending is quite simple - sending one after another 100,200, 1000 x 512 byte packets with Winusb_WritePipe. It works, I can read out what I send down to the device. The board displays highspeed, winusb report back highspeed, cable is highspeed.

What I don’t know is:

  • does this limitation coming from OSRFX2 quad buffer solution
  • from their firmware
  • do I need to change some parameter with WinUsb_ControlTransfer

Winusb should not be a problem - many people from here stated that WinUSB can support high speed so it should be something else.

What I noticed is that if I don’t read in data, the out buffer fulls up too (that is stated on the board’s manual as well so it’s fine) - for read I used a thread with no sleeps or whatever else, just Winusb_readpipe-s one after another.

Does anybody have experience with this board?
It would be important for me to know that this limitations are coming from my code or from the board itself … Tried on 3 PC’s, one Vista, two XP’s - the result is close in every case. Sending 100x512 or 50x1024 does not make a difference so sending bigger amount does not change much.

The 4Mbit say something for anybody? It’s not lowspeed, is not fullspeed - it’s somewhere in the middle, the timeframe looks like an interrupt mode which works with 1 pkt/msec like the HID one. But this is bulk :slight_smile:

thanks,
-Barna Csenteri


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I tried the RAW settings and without any result.
I also tried sending bigger packets but there is no difference in sending 100*512 or 51200 byte (the amount of time taken to transfer for both case is around the same)

I could design a highspeed device that gets 1 byte per hour
That’s what I want to know regarding the OSR FX2 kit - this limitation is coming from the board firmware or it’s my mistake somewhere in the code …

I don’t want to reach high speed from first try but 4 Mbit/s is slow for anything :slight_smile:

I know I need to play than with packet size and other things to get more packets in one microframe but as a first try I just wanted to get 1 pkt/microframe. Which should result in a transfer rate around 8*4mbit after my calculations … Or even less but at least it should be more than 4 …

It can be difficult to diagnose USB throughput issues without the aid of a hardware bus analyzer (e.g. Ellisys, LeCroy) to observe exactly what is happening on the bus.

If you look at a bus trace and the bus is full of NAKs or NYETs from the device then the device is limiting throughput performance. If the device never returns NAKs or NYETs then the host is limiting throughput performance.

I have no direct experience with the OSR FX2 board with standard firmware to be able to comment on what the typical transfer throughput should be under optimal host driver conditions.

WinUSB should not be the performance bottleneck.

-Glen

The OSR FX2 was the bottleneck - we have made a small prototype using an Atmel devboard which just take packages from the USB, nothing else. The speed was 8*4Mbit from first shot which means 8 time faster than OSR FX2 (using the same program via WinUSB)

This means 1 package/1 microframe which was my first target.
Now the finetuning comes with packet size and overlapped ride/write to have more frames in the same microframe.

Thank’s for everything,
-Barni