Latency question

I searched the forum but could not find my problem.
I have rather big latency, and am trying to find the cause.
Ableton 10, track 1 sends a melody with some notes exactly on the beat to midihub USB A.
Midihub has a simple pipeline with USB A in directly to USB B out.
Ableton track 2 records midi from midihub USB B.
All recorded notes are about 27 msecs behind the beat.
Is this normal?
Midihub is connected through a USB hub (because I have about 30 USB instruments to connect).
Thanks for helping me out.

Hey @mrdrbobo, welcome to the forum

@giedrius will be able to give you a definitive answer to this, but I recall G giving figures for a PC → MH → PC round-trip test a while back and the results were better than that.

btw, This was new knowledge for me about how USB MIDI works.

I searched the forum but could not find my problem

I think a Tutorial on USB vs DIN MIDI (and what can affect performance) would be useful to many.

What latency do you see when plugging in Midihub directly to a USB port on your computer, not through the hub? It may be a good idea to temporarily disconnect the hub. This way we’ll know if this changes anything, if not, it might be software configuration issue.

Your USB chain does sound quite big, and given that USB hosts are scanning each device for new messages once every 1 millisecond, it could easily sum up to the latency value you observe. A way to improve that would be to split out the USB devices to distinct USB ports on your PC, hoping that some of them are handled by an independant host controller unit.

Thanks @Giedrius and @resonotter.
I compared results with Midihub connected through a 7 port USB hub and directly connected to a USB3 port on the PC. The tracks with recorded return notes from the MH are yellow when going thru a USB hub and blue when going direct to USB on PC.
In the pics attached (1 gridunit is 10ms) you see that TODAY the average roundrip latency is between 15 and 20 msecs. Mostly the “direct” and “via-hub” timing is identical. In the first note the “direct” note is worse by 2 ms, in the fifth note the “direct” note is 5 ms better. Both methods show some jitter in timing (results vary unpredictably between 15 and 20 ms).
Windows 10, i7 PC, Live version 11
Regarding your comment on my large USB chain, do you mean that the total USB clients connected to a PC matters? Or the total USB clients to one USB port? I have made sure that no cascading takes place (no hub in a hub), so all my gear is connected via not more than one hub.
The summing you mention seems not to be the cause here, because removing the USBhub gives almost identical results.
I would like to resolve this very much because latencies above about 8 a 10 ms are very audible for me (not to mention “playability” above 10ms is very hard).

…and this is the Ableton setup: source sequence on track 1 outputting to MH USB A. Recording the MH ouput from MH USB B on track 2.