Absolutely agree, the challange though is to make a testpattern that exactly mimics the Arturia.But if you can craft a test program on Teensy 4.0, of course that's much better because it's consistent
20:06:56.886 -> Note On, ch = 1, note = 68, velocity = 127, NumNotes = 1
20:06:56.886 -> Note On, ch = 1, note = 66, velocity = 127, NumNotes = 2
20:06:56.886 -> Note On, ch = 1, note = 54, velocity = 127, NumNotes = 3
20:06:56.886 -> Note On, ch = 1, note = 53, velocity = 127, NumNotes = 4
20:06:56.886 -> Note On, ch = 1, note = 67, velocity = 127, NumNotes = 5
20:06:56.886 -> Note On, ch = 1, note = 65, velocity = 127, NumNotes = 6
20:06:56.886 -> Note On, ch = 1, note = 55, velocity = 127, NumNotes = 7
20:06:56.886 -> Note On, ch = 1, note = 60, velocity = 127, NumNotes = 8
20:06:56.886 -> Note On, ch = 1, note = 56, velocity = 127, NumNotes = 9
20:06:56.886 -> Note On, ch = 1, note = 62, velocity = 127, NumNotes = 10
20:06:56.886 -> Note On, ch = 1, note = 52, velocity = 127, NumNotes = 11
20:06:56.886 -> Note On, ch = 1, note = 57, velocity = 127, NumNotes = 12
20:06:56.886 -> Note On, ch = 1, note = 59, velocity = 127, NumNotes = 13
20:06:56.886 -> Note On, ch = 1, note = 58, velocity = 127, NumNotes = 14
20:06:56.886 -> Note Off, ch = 1, note = 58, velocity = 0, NumNotes = 13
20:06:57.075 -> Note Off, ch = 1, note = 56, velocity = 0, NumNotes = 12
20:06:57.075 -> Note Off, ch = 1, note = 59, velocity = 0, NumNotes = 11
20:06:57.075 -> Note Off, ch = 1, note = 57, velocity = 0, NumNotes = 10
20:06:57.075 -> Note Off, ch = 1, note = 62, velocity = 0, NumNotes = 9
20:06:57.075 -> Note Off, ch = 1, note = 64, velocity = 0, NumNotes = 8
20:06:57.075 -> Note Off, ch = 1, note = 68, velocity = 0, NumNotes = 7
20:06:57.075 -> Note Off, ch = 1, note = 52, velocity = 0, NumNotes = 6
[COLOR="#FF0000"]20:06:57.075 -> Note Off, ch = 1, note = 66, velocity = 0, NumNotes = 5[/COLOR]
20:06:57.075 -> Note Off, ch = 1, note = 67, velocity = 0, NumNotes = 4
20:06:57.122 -> Note Off, ch = 1, note = 65, velocity = 0, NumNotes = 3
20:06:57.122 -> Note Off, ch = 1, note = 60, velocity = 0, NumNotes = 2
20:06:57.122 -> Note Off, ch = 1, note = 54, velocity = 0, NumNotes = 1
20:06:57.122 -> Note Off, ch = 1, note = 55, velocity = 0, NumNotes = 0
20:06:57.122 -> Note Off, ch = 1, note = 53, velocity = 0, NumNotes = -1
I am only user of a T3.5 project with similar USB issues resolved by an intermediate USB hub...
The host sees 14 Note ON's but 15 Note OFF's [note 66 does not have an ON message].
20:06:56.886 -> Note On, ch = 1, note = 68, velocity = 127, NumNotes = 1
[COLOR="#FF0000"]20:06:56.886 -> Note On, ch = 1, note = 66, velocity = 127, NumNotes = 2[/COLOR]
20:06:56.886 -> Note On, ch = 1, note = 54, velocity = 127, NumNotes = 3
20:06:56.886 -> Note On, ch = 1, note = 53, velocity = 127, NumNotes = 4
20:06:56.886 -> Note On, ch = 1, note = 67, velocity = 127, NumNotes = 5
20:06:56.886 -> Note On, ch = 1, note = 65, velocity = 127, NumNotes = 6
20:06:56.886 -> Note On, ch = 1, note = 55, velocity = 127, NumNotes = 7
20:06:56.886 -> Note On, ch = 1, note = 60, velocity = 127, NumNotes = 8
20:06:56.886 -> Note On, ch = 1, note = 56, velocity = 127, NumNotes = 9
20:06:56.886 -> Note On, ch = 1, note = 62, velocity = 127, NumNotes = 10
20:06:56.886 -> Note On, ch = 1, note = 52, velocity = 127, NumNotes = 11
20:06:56.886 -> Note On, ch = 1, note = 57, velocity = 127, NumNotes = 12
20:06:56.886 -> Note On, ch = 1, note = 59, velocity = 127, NumNotes = 13
20:06:56.886 -> Note On, ch = 1, note = 58, velocity = 127, NumNotes = 14
20:06:56.886 -> Note Off, ch = 1, note = 58, velocity = 0, NumNotes = 13
20:06:57.075 -> Note Off, ch = 1, note = 56, velocity = 0, NumNotes = 12
20:06:57.075 -> Note Off, ch = 1, note = 59, velocity = 0, NumNotes = 11
20:06:57.075 -> Note Off, ch = 1, note = 57, velocity = 0, NumNotes = 10
20:06:57.075 -> Note Off, ch = 1, note = 62, velocity = 0, NumNotes = 9
[COLOR="#FF0000"]20:06:57.075 -> Note Off, ch = 1, note = 64, velocity = 0, NumNotes = 8[/COLOR]
20:06:57.075 -> Note Off, ch = 1, note = 68, velocity = 0, NumNotes = 7
20:06:57.075 -> Note Off, ch = 1, note = 52, velocity = 0, NumNotes = 6
[COLOR="#FF0000"]20:06:57.075 -> Note Off, ch = 1, note = 66, velocity = 0, NumNotes = 5[/COLOR]
20:06:57.075 -> Note Off, ch = 1, note = 67, velocity = 0, NumNotes = 4
20:06:57.122 -> Note Off, ch = 1, note = 65, velocity = 0, NumNotes = 3
20:06:57.122 -> Note Off, ch = 1, note = 60, velocity = 0, NumNotes = 2
20:06:57.122 -> Note Off, ch = 1, note = 54, velocity = 0, NumNotes = 1
20:06:57.122 -> Note Off, ch = 1, note = 55, velocity = 0, NumNotes = 0
20:06:57.122 -> Note Off, ch = 1, note = 53, velocity = 0, NumNotes = -1
Yes correct, my mistake.Looks like note 64 off message is the one without a corresponding note on message
I'm kinda wondering if Arturia sends unnecessary note off messages? When I get one in a couple days, will capture its USB packets...
I'm kinda wondering if Arturia sends unnecessary note off messages? When I get one in a couple days, will capture its USB packets...
A hanging note on a synth means too few note off messages rather than too many. Remember also that the issue only arises when using the host port, and then is remedied by inserting a hub. I don't think the Arturia is at fault.
Note On, ch = 1, note = 41, velocity = 4D, NumNotes = 1
Note On, ch = 1, note = 43, velocity = 46, NumNotes = 2
Note On, ch = 1, note = 39, velocity = 5C, NumNotes = 3
Note On, ch = 1, note = 3B, velocity = 53, NumNotes = 4
Note On, ch = 1, note = 37, velocity = 56, NumNotes = 5
Note On, ch = 1, note = 3E, velocity = 5C, NumNotes = 6
Note On, ch = 1, note = 40, velocity = 5C, NumNotes = 7
Note On, ch = 1, note = 3C, velocity = 5D, NumNotes = 8
Note On, ch = 1, note = 35, velocity = 66, NumNotes = 9
Note On, ch = 1, note = 45, velocity = 45, NumNotes = 10
Note Off, ch = 1, note = 45, velocity = 0, NumNotes = 9
Note Off, ch = 1, note = 35, velocity = 0, NumNotes = 8
Note Off, ch = 1, note = 40, velocity = 0, NumNotes = 7
Note Off, ch = 1, note = 3C, velocity = 0, NumNotes = 6
Note Off, ch = 1, note = 3E, velocity = 0, NumNotes = 5
Note Off, ch = 1, note = 37, velocity = 0, NumNotes = 4
Note Off, ch = 1, note = 39, velocity = 0, NumNotes = 3
Note Off, ch = 1, note = 41, velocity = 0, NumNotes = 2
Note Off, ch = 1, note = 3B, velocity = 0, NumNotes = 1
Thanks a lot for testing and sharing your thoughts on your findings so far. I concur with your plausible assumption.My gut feeling (guesswork) is the Arturia firmware is just throwing away data during those times, because we weren't polling rapidly enough
Thinking (out loud) about this problem some more, the Arturia must be failing to transmit some MIDI messages (otherwise they would appear in the packet capture), but it's probably in response to something we're doing (or not doing, or not doing well enough) on the Teensy side.
My current theory is the Arturia probably has 1 or 2 packet buffers and if it wants to transmit another packet when the buffer(s) are full, it probably just discards the data rather than waiting. Or maybe it overwrites the waiting data. If this is really what's going on, it would explain why all attempts to reproduce it with Teensy 4.0 are unsuccessful. USB MIDI device code on Teensy 4.0 won't immediately drop outbound data if the USB packet buffers are full. But whatever firmware exists on Arturia probably does.
My guess is the missing Note Off message probably was generated during this time with the red circle, where no IN poll attempts occurred.
..
Here is another run where 2 Note On messages were missing. It also has a substantial time where no polling occurred.
..
My gut feeling (guesswork) is the Arturia firmware is just throwing away data during those times, because we weren't polling rapidly enough.
I still need to compare with the PC and with a USB hub, but my guess is the Linux MIDI driver allocates a lot of buffers. The hub case is complicated because Arturia communicates with the Transaction Translator inside the hub (since it's 12 MBit/sec) and Teensy uses split transactions at 480 Mbit/sec to talk to the TT. But the TT probably implements as least a couple buffers. Later tonight or tomorrow I'll look more carefully at the polling behavior downstream of the TT.
Right now, I'm out of time for working on this... so just a rambling message to share my current thoughts and theories about this problem.
did you also try this after Paul posted the first fix?
I'm glad you own this pricey Beagle USB 480 Protocol Analyzer - it's nearly impossible to debug these kind of issues without such a device.
If I read the USB 2.0 spec correct, that bInterval value should be between 1 and 16.
Could the host code have an problem with this bInterval = 0?
Looked at this USB protocol analyzer: usbpacketviewer but do not feel comfortable about the software... Price is ~$160...I guess you get what you pay for.Yep, it's pretty much essential for developing USB host
Just curious, what transfer/endpoint types are used for Arturia communication? I guess only Control?bInterval isn't used for bulk or control endpoints. It only applies to interrupt and maybe isochronous (many complicated timing things regarding isochronous which I don't really know well).
Looked at this USB protocol analyzer: usbpacketviewer but do not feel comfortable about the software... Price is ~$160...I guess you get what you pay for.
Just curious, what transfer/endpoint types are used for Arturia communication? I guess only Control?
Paul