Author Topic: USB 3.0 bulk EP bursts  (Read 15032 times)

Dinesh

  • Member
  • ***
  • Posts: 13
USB 3.0 bulk EP bursts
« on: July 31, 2013, 04:08:52 am »
Hi,
I am trying to use transfer around 200MB (peak throughput) from device to host. I use USB 3.0 bulk transfers with burst size=16. Though the 200MB is half of what USB 3.0 can transfer I face problems in reaching 200MB peak throughput. I have used USB 3.0 protocol analyzer and observerd that the 16 bursts Epoint ready is not accepted by the host. The host splits the transfer into e.g: 8K, 4K, 2K, 1K and 1K (this is an example). This is in accordance to USB 3.0 specification as host can decide how many bursts it can accept per transaction basis.
I also observe many Not Ready (NRDY) packets and after few microseconds Endpoint ready (ERDY) is sent. Does it mean that USB 3.0 device is not able to send the data at peak throughput 200MB?
Another approach is when the bulkread request from Host was submitted for 50 times 16K (50X16K bytes) instead of 16KB I could see improvement in performance but again not 200MB peak through put.
Intention of my application is to stream video.
Can someone help me to understand this problem?

Thank you in advance!

« Last Edit: July 31, 2013, 04:10:56 am by Dinesh »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB 3.0 bulk EP bursts
« Reply #1 on: July 31, 2013, 10:06:00 am »
Yes, on an IN endpoint, NRDY means that the device has no data to send, similar to NAK in USB 2.0. Minimizing NRDYs is one way to increase throughput.

Dinesh

  • Member
  • ***
  • Posts: 13
Re: USB 3.0 bulk EP bursts
« Reply #2 on: July 31, 2013, 11:44:15 am »
Thanks for your reply Jan!

From the USB 3.0 device that is streaming image from camera hits buffer under run i.e. host is not able to read the data from the device at rate camera is generating.
This behavior is observed only when high resolution images are streamed.

Even for small resolution like VGA (640X480) the peak through put is approximately 200MB but when high resolution images are streamed the peak  throughput (approx 200MB) has to be retained for longer duration compared to low resolution image.

On contrary I observe NRDY meaning device is without data.

Please help me if I miss some details in my calculation?
« Last Edit: July 31, 2013, 11:47:02 am by Dinesh »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB 3.0 bulk EP bursts
« Reply #3 on: July 31, 2013, 12:36:13 pm »
NRDY means that the host is asking for data, and the device is delaying in providing it.

Dinesh

  • Member
  • ***
  • Posts: 13
Re: USB 3.0 bulk EP bursts
« Reply #4 on: July 31, 2013, 12:59:30 pm »
Thank you. Let me try to analyze the device more.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: USB 3.0 bulk EP bursts
« Reply #5 on: July 31, 2013, 03:52:56 pm »
I've been away from USB 3 for a couple of months and I've forgotten most of what I knew already.

What's the host in this system?

To achieve throughput like this, all layers in the system driver stack have to be tuned for performance. If there's any layer which isn't expecting to transfer at this rate, it may well not manage it. I mentioned that the system I worked on achevied 460MB/s, but that was with careful attention to detail getting all layers to higher performance. That was also using multiple streams, if you only have one stream things may be more difficult.

So what host are you using? How good is its driver? The XHCI driver has to set several different fields in the endpoint context to make large bursts happen. The device driver also has to request large enough transfers, and its probably helpful to make sure you have several outstanding at any time. You don't want to give any other part fo the system an excuse to not be fast.

Also if I'm remembering right (and I'm not sure), can't either end of the bus issue a NRDY? If that's true, which end of the bus are the NRDYs coming from.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB 3.0 bulk EP bursts
« Reply #6 on: July 31, 2013, 05:22:13 pm »
8.5.2 says the NRDY only comes from endpoints.