On Thu, Mar 25, 2010 at 10:19:50AM +0100, Philipp wrote:
Very strange, -Xraw is said to perform better than
-Xseq.
Maybe there's a difference between outboard and software?
In software land jack midi is the clear winner, -Xraw is said to perform
better than -Xseq, so if it's different for outboard gear, where does
the difference come from?
I haven't looked closely at the MIDI code in Jack's Alsa
backend, so I can't tell. But AFAIK
1. Alsa's Raw interface does not provide scheduling of
events to be transmitted at some particular time,
nor timestamps on received events.
If timing is important to your use, you have to do
it yourself, by calling the write() function at the
right time, and by reading some timer for received
data.
Assuming that the backend is not doing this, event
timing would be quantised to audio period boundaries.
Note that doing your own timing in this case requires
a separate thread - the backend as seem from Jack's
engine must never wait, except for audio period
boundaries.
Also to ensure immediate transmission when calling
the write() function, the caller has to either open
the device with the SYNC flag set, or use the drain()
function. Failure to do either could explain the very
large quantisation I observed with the raw interface
- it leaves it up to the Alsa code when to transfer
data from user space to kernel (driver) space, and
this decision will probably be based on the number
of bytes waiting etc.
2. The Alsa Sequencer interface allows to put a timestamp
on transmitted data, and then Alsa will ensure it gets
transmitted at the right time. It will also provide
timestamps on received data.
Ciao,
--
FA
O tu, che porte, correndo si ?
E guerra e morte !