Re: [Jack-Devel] CoreMIDI driver bug fix

PrevNext  Index
DateSat, 02 Mar 2013 11:29:53 -0800
From Devin Anderson <[hidden] at gmail dot com>
ToChristian Schoenebeck <[hidden] at crudebyte dot com>
CcJack devel <[hidden] at lists dot jackaudio dot org>
Hi Christian,

On Sat, Mar 2, 2013 at 11:10 AM, Christian Schoenebeck
<[hidden]> wrote:
> On Saturday 02 March 2013 19:47:05 you wrote:
>
>> The CoreMIDI spec seems to disallow running status.  The description
>
> I haven't checked yet whether that is actually true on OSX, however on iOS
> (which is also providing the complete CoreMIDI API of OSX), events with
> "running status" did occur, even on latest iOS 6.x. Many CoreMIDI iOS apps
> have that bug. So chances are high that this can also happen on OSX as well.

That's interesting.  The iOS CoreMIDI spec says the same thing as the
MacOSX CoreMIDI spec.  Is that MIDI coming from the hardware driver,
or from other CoreMIDI applications?  Has a bug been filed against
either CoreMIDI or whatever is sending the MIDI messages?

>> However, something that I didn't notice before (was it there when I
>> implemented the CoreMIDI driver?) is that a MIDIPacket can contain
>> multiple MIDI messages.  I don't remember accounting for that when I
>> wrote the driver.  That's a bug that will need to be fixed.
>
> I will have a look at that.

Thanks. :)

> BTW, was there are a specific reason that you did not use
> JackMidiRawInputWriteQueue for parsing the MIDI stream in the CoreMIDI driver?

The JackMidiRawInputWriteQueue parses packets, and there's some
overhead that occurs because it uses a two-pass algorithm.  At the
time, I thought MIDIPacket structures only contained one MIDI message
each, with the exception of system exclusive messages; so, using the
JackMidiRawInputWriteQueue seemed like overkill.

Due to the fact that a MIDIPacket can contain multiple MIDI messages,
it makes sense to use the JackMidiRawInputWriteQueue ... which would
be *awesome*, as the spaghetti code that I wrote in the CoreMIDI
driver to deal with partitioned system exclusive messages is awful,
and should be replaced. :)

If you plan on adding the JackMidiRawInputWriteQueue, then I'd like to
make a suggestion.  The alsarawmidi driver and the FFADO driver use
the JackMidiRawInputWriteQueue.  If you need a reference on how to use
the driver, you can look at those drivers.  The alsarawmidi driver is
probably more relevant because it uses the two thread scheme to handle
MIDI messages, just like CoreMIDI.

If you have any other questions regarding the MIDI queue system,
please send me a message.  I'm happy to help. :)

> (I am not on the JACK dev list, so this email probably wont make it to the
> list).

I'll CC this reply to the list.

Thanks,

-- 
Devin Anderson
surfacepatterns (at) gmail (dot) com

blog - http://surfacepatterns.blogspot.com/
midisnoop - http://midisnoop.googlecode.com/
psinsights - http://psinsights.googlecode.com/
synthclone - http://synthclone.googlecode.com/
PrevNext  Index

1362252599.22469_0.ltw:2,a <CAG7zqTpXypWBfhwJ9xd3Q485JmGCrFLKiv-ujBccs==jgh6v-w at mail dot gmail dot com>