om-synth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Om-synth] alsa-midi vs jack-midi


From: Lars Luthman
Subject: Re: [Om-synth] alsa-midi vs jack-midi
Date: Wed, 07 Dec 2005 14:55:21 +0100

On Wed, 2005-12-07 at 10:32 +0100, Atte André Jensen wrote:
> Could someone explain the difference between alsa-midi and jack-midi to 
> me? Which apps (a few examples) use which and are they compatible?

ALSA is the "old" MIDI API for Linux systems. It can be used to connect
MIDI output ports in one client to MIDI input ports in other clients (by
having the input ports "subscribe" to the output port). It also supports
other ways of transporting MIDI between programs (and hardware ports),
for example the client that generates MIDI can set a different
destination port for every single event, regardless of whether that port
is "subscribed" to the generating client's port. This makes the ALSA
MIDI transport a bit more flexible, but also a bit more complicated to
code for. In JACK MIDI there are connections between ports, just like
with JACK audio, and there's no way for a client to send events to a
specific port - everything that the client sends to an output port will
be sent to all clients that are connected to that output port.
Personally I think this is all that is needed.

In ALSA you can timestamp events, but (as far as I know) there is no way
to map the timestamps to the JACK frame time without some jitter. In
JACK MIDI all events are given a timestamp which is the frame offset
from the start of the current JACK period. This means that JACK MIDI
always is perfectly synchronised with JACK audio, even when
freewheeling, and you also get all the MIDI events given to you in an
input port buffer in the process() callback, (almost) just like audio -
no need to read from a file descriptor in a separate thread, like you do
with ALSA, with all the synchronisation and programming problems that
adds.

So, short summary: I think that JACK MIDI gives better accuracy and
reliability for users, and a nicer, easier API for programmers.

The only programs I know that use JACK MIDI now are Om (in CVS),
Ghostess, and Dino (in CVS). There are also patches posted on the
jackit-devel list for Specimen and ZynAddSubFX which enables them to use
JACK MIDI and ALSA at the same time (for Ghostess and Om you have to
choose one, and Dino uses JACK exclusively). JACK and ALSA are not
compatible in the sense that you would be able to connect a JACK MIDI
port to an ALSA port directly, but there are programs called
alsaseq2jackmidi and jackmidi2alsaseq that you can use to convert from
one to the other. Hopefully future versions of JACK MIDI or JACK MIDI
patchbays will have some way to do this automatically.

-- 
Lars Luthman
PGP key:     http://www.d.kth.se/~d00-llu/pgp_key.php
Fingerprint: FCA7 C790 19B9 322D EB7A  E1B3 4371 4650 04C7 7E2E

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]