Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reducing USB bulk transfer speed #9

Open
jeromeDms opened this issue Nov 29, 2021 · 2 comments
Open

Reducing USB bulk transfer speed #9

jeromeDms opened this issue Nov 29, 2021 · 2 comments

Comments

@jeromeDms
Copy link

Hi
My app is a USB MIDI app, transfers are compliant to the USB MIDI specification, which defines BULK transfers.
Each packet is 64 bytes, so each millisecond the device can receive up to 64 bytes (48 useful bytes).

Those bytes are forwarded to MIDI Out which is only 31.25 kb/sec, (as defined in MIDI specification).

When receiving large packets numbers from USB (1200 bytes of Exclusive systems for instance), incoming data must be buffered, so we have time to forward them to MIDI out at lower speed rate.
Unfortunately the buffer size is limited to 1024 bytes in my app, this results in truncated data when receiving large number of USB packets.

Is there a way to reduce the USB data rate for bulk transfers (it seems the bInterval in USB descriptors can only be changed for Interrupt or Isochronous transfers).
Also, it seems Nuvoton USB phy does not support USB Low speed, but only USB full speed.

Any tip to solve my issue ?
thanks.

@kchuang1
Copy link
Contributor

Hi
Per your description, your USB device use a BULK out to send data from PC to USB device, right?
The BULK transfer data number is dependent on the description which you return to PC.
Please check your sample rate in your USB descriptor.

By the way, USB low speed doesn't support BULK transfer. It is not your solution.

@jeromeDms
Copy link
Author

You are right, I found after writing this post that USB Low speed does not support BULK.
Yes BULK transfers are used in both direction, what I'm trying to do is to limit the speed from Host computer to the device.
The bInterval in the device descriptor is ignored for BULK transfer, and I did not find any other solution for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants