I'm developing a USB MIDI device with a Teensy microcontroller - let's limit it to a USB 1.X / "Full-Speed" device for now if that helps. The USB MIDI (1.0) class definition uses Bulk transfer endpoints for communication so that's the type of transfer used.
I understand that unlike interrupt/isochronous transfers bulk transfers are not strictly limited to the frame/microframe timing - they can "fill-up" remaining bandwidth after these transfers are allowed for. Up to 19x 64-byte bulk transactions can be sent per frame (USB Full-Speed) for example according to the spec.
My questions are therefore:
- How often / what frequently are bulk transfers serviced by the host? (i.e. How often are BULK IN/OUT packets sent by the host)?
- Is this entirely defined by the host? Or can I request or ensure fastest possible servicing of transfers somehow?
Some more detail on Q1 if it helps:
I know all USB transactions are host-driven. I know the host must send an IN/OUT packet before any data is transferred. So I'm trying to confirm if the host sends BULK IN/OUT token messages every ~52ms (1000ms / 19)? Or actually at a much faster rate limited by its capabilities and the device is just expected to respond whatever this unknown rate will be.
Provided:
Then the host will poll the device without any pause and you can indeed achieve up to 20 packets within a 1ms second frame (best case).
The scheduling is entirely under the control of the host, but also specified in the USB standard. So the host has limited freedom.
On the device side, you have to basically do two things:
A realistic overall throughput for a well optimized device is about 1 MByte/s.