SendSX and SysEx buffering

kenh

2014-01-30 14:20:08

Hi,

I've been working on developing USB MIDI peripherals and SendSX has been incredibly useful in testing their operation. I have, however, run into 2 issues that would be nice if they were fixed:

Issue #1: Missing reception of SysEx messages given multiple fast transmissions.
One peripheral in question is a High Speed USB MIDI device. I have the receive and transmit endpoints set to 512 bytes/subframe on the peripheral which can imply a MIDI data transfer rate of up to 3MB/s (512 * 3/4 * 1/125us).

When I send a single large SysEx message from the peripheral, 31K in size, SendSX has no problem receiving it.

When I send multiple small SysEx messages with no delay between them, totalling 8K in size, SendSX does not receive all of them. It does receive each whole SysEx message (no missing data bytes, no overrun into the next message), just not all of them. Trying to send the same messages multiple times results in varying amounts of data received. A coworker make a quick utility in Max to confirm the PC was receiving all the data, and it is. If I add a 1ms delay between each message, all messages are received.

Issue #2: SysEx messages are accumulated in a side buffer while other MIDI messages are written to the output window
In another instance, I have a peripheral that might have a poorly behaving sensor in the units of some testers. I wrote a version of firmware that would spit out a SysEx debug message alongside the CC output while the peripheral was in use.

The data I got back (I asked the testers to use SendSX to capture the data and send it back to me) showed the SysEx debug messages all at the end of the syx file after the CC messages. I ran the test myself to confirm.

I understand that for large dumps it makes sense to dump the data into a side buffer while its still being received so as to prevent the UI redraw taking so much time. However, it would make sense to buffer the non-SysEx content in that same buffer.


Let me know if there's any additional information you need

florian

2014-08-05 11:59:51

Hi Ken,

I had seen your post before, and recorded your suggestions, but just now I get to respond to say thanks! I hope to fix both issues soon. The side buffer should not be necessary anymore these days.

Regards,
Florian