What Will said. Numbers:

For a hypothetical controller and MIDI device that speaks USB 2...
USB 2 has a minimum latency of ~.125ms and a bandwidth of 480 Mbps.
Note on/off = 3 bytes; 24/480M = .00005ms, which we can round to 0.
Even on USB 1.1, that's only 24/12M = .002ms.
(I ignored any other bits that may have to be transmitted.)

It seems like <1ms for a note message is pretty reasonable expectation.
In fact, it sure seems like <1ms total for 100 messages might be reasonable. :)

I figure most of the meaningful delays will come from the driver and OS
scheduling, but I think the hardware is more than capable.

cheers,
Greg

On Thu, Jun 16, 2022 at 10:38:11PM +0200, Fons Adriaensen wrote:
On Thu, Jun 16, 2022 at 08:37:49PM +0100, Will Godfrey wrote:

Over a hardware DIN port this is of course approx. 1mS, but does anyone know
if it's the same over a USB link?

Presumably, it would have to be if the source was also sending to the DIN
route.

Not really, it could be much faster. When the source starts transmitting the
first byte on the standard MIDI port, it probably has the complete message
(3 bytes for a note on/off) ready. There is no reason why the USB message
should be derived from the serial MIDI data.

Following on from that, what about the multiport adaptors that have 4 hardware
ports going down one USB cable. I would guess that these could be interleaved
so that (assuming the 1mS granularity holds) the overall rate is still 1mS with
the ports spaced up to 250uS apart.

AFAIK, USB transfers are not interleaved at byte level, doing that  would
create a lot of overhead. So even if you have a note event on all four ports
at the same time, that would probably be 4 separate USB transfers, one after
the other. Still this could take less than 1 ms, it just depends on the USB
data rate.

Ciao,

--
FA

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
https://lists.linuxaudio.org/listinfo/linux-audio-dev
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
https://lists.linuxaudio.org/listinfo/linux-audio-dev

Reply via email to