Evan Laforge wrote:
On Mon, Feb 22, 2010 at 10:24 PM, Roger Dannenberg <[email protected]> wrote:
I made a stripped-down version of the PortMidi sysex loopback code that
loses messages under OS X and submitted it to Apple with a bug report.

...

I think portmidi might already use this api, and my memory from when I
implemented it is a little fuzzy, but the core midi MIDISendSysex
already spaces a large message into chunks separated by time to avoid
sending too much too fast.  I'm not sure if my core midi binding has
the same problem, but the code, included below, is very simple.  What
exactly is the pattern that causes problems?  Sending one very large
sysex?  A stream of them?

static void
sysex_complete(MIDISysexSendRequest *req)
{
...

PortMidi does not use MIDISendSysex since it does not require the sysex message to exist all at once in memory.

You can reproduce the problem by running the pm_test/sysex program where output goes to an IAC bus and input is from the same IAC bus. This is supposed to run forever sending/receiving random sysex messages, but at least on my machine it eventually drops data. I modified PortMidi to insert delays that limit the data rate, but even at 5000 bytes/sec, I still drop data. I modified my test program and reported this again to Apple. It could be that I just don't understand what "15000 bytes/second" means -- obviously the instantaneous rate is extremely high unless you send one byte per packet list, so I don't know whether I need to send one packet per packet list, limit the size of a packet list, put timestamps in to separate the packets in time, etc. Hopefully Apple will clarify what it takes to avoid dropped sysex data (and ordinary messages for that matter).

-Roger

_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to