From: Jonathan W. <jw...@ph...> - 2008-03-30 22:49:30
|
Hi everyone Over the weekend I spent some time with MIDI transmission/reception and actually tested this myself for the first time in a long time. :-) The practical upshot of this work is that I now have MIDI transmission working. I haven't tested it with really long streams, but jack-keyboard seems to happily drive my MIDI keyboard now and gmidimonitor reliably sees events from the same external keyboard. It turns out that the MOTU MIDI hardware is fairly sensitive to the timing of MIDI bytes being sent to it. If it's much faster than the "standard" MIDI rate of 3125 bytes per second (10 bits per byte on the wire, giving 31250 baud) then bytes will be either dropped or corrupted in interesting ways. The simplest way to fix this, at least for now, is to implement some local MIDI stream buffering in the MOTU transmit processor. I have done this. As as been argued elsewhere over the weekend the long term solution may be to add this sort of functionality to the ffado jack backend. I would still argue for its retention in the MOTU driver though since it is an inherant property of the MOTU hardware that the MIDI byte rate is observed. The new code makes this requirement explicit, and the overhead involved is extrememly small. Having said that, having a more intelligent rate limiter "upstream" as well is probably a good idea since it could act on whole MIDI messages - if the rate is too great a MIDI message could be dropped for example, rather than individual bytes. That way the upstream limiter could work on MIDI message level while the MOTU limiter ensured that the byte stream rate within a message during playout remains within spec. There is still a small issue I have to deal with regarding MIDI reception to ensure we don't write beyond the end of the buffer. I'll probably get to that tonight since it's pretty trivial to fix. Regards jonathan |