On Tue, Sep 23, 2008 at 12:04:39AM +0200, Christoph Eckert wrote:
I'm having
difficulty understanding what the difference is between jack
midi clients and alsa sequencer midi clients.
ALSA just is a driver layer. Formerly, it has been (ab)used to in- and output
audio as well as MIDI. Which is not the job of a driver IMHO.
JACK has been introduced as a low latency *audio* driver, but it *didn't*
support MIDI. Thus we ran audio via JACK but MIDI via ALSA sequencer.
Weird enough? Yes, it is. So meanwhile JACK finally supports MIDI besides
audio.
If you want to, ALSA sequencer MIDI clients are just deprecated.
Rather ideological and not very informative IMHO.
To understand how all this fits together you need
to know the following.
1. The bottom layer: ALSA audio and ALSA raw midi.
On most (nearly all) linux systems these are the
drivers handling audio and midi devices respectively.
A program can use these directly, but then it is
limited to connecting to hardware devices only.
2. Interconnecting applications and hardware: Jack
and ALSA midi sequencer.
Jack can interconnect audio programs that are written
to use it to each other and to an audio card. To talk
to the audio card Jack uses the ALSA driver in mose cases.
This is what you see in the 'AUDIO' tab in qjackctl.
The ALSA midi sequencer does the same for midi. It can
connect applications to each other and to physical midi
interfaces (raw ALSA ports). This is what you see in the
'ALSA' tab of qjackctl.
3. Jack midi replacing ALSA midi sequencer.
Using the ALSA midi sequencer can be hard (for a programmer)
and also it has had serious problems with timing, mainly
because of lack of high-resolution timer support in Linux
until recent times. This has resulted in the development
of midi-in-Jack, which can (almost) be used as a replacement
for the ALSA midi sequencer. It has its pros and cons. This
is what you see in the 'MIDI' tab in qjackctl.
Currently the two midi routing system coexist, and this
leads to some confusion.
In qjackctl you have three options for midi-in-Jack:
1. 'None' - this means that Jack will not use any ALSA
midi devices. Applications that use midi-in-jack
(e.g. Aeolus) will still show up in the 'MIDI' tab,
but you can't connect them to any physical ALSA midi
ports, only to other apps (if there are any other).
2. 'Raw' - this means that Jack will grab the raw ALSA
(hardware) midi devices, and convert them into Jack
midi ports with rather useless names. The same devices
are still shown in the 'ALSA' tab, but you will notice
you can't connect them there anymore - they are usually
supporting only one client, and Jack has already taken
them. This means that applications that only support
connecting to ALSA midi sequencer can't be connected
to physical midi devices anymore. In the dreams of the
Jack midi developers, such apps will soon cease to exists,
and if that happens the 'raw' option is the normal one to
use.
3. 'Seq' - this means Jack will convert *all* ALSA sequencer
ports into Jack midi ports. The original ones remain
accessible in the 'ALSA' tab.
Now Aeolus has both an ALSA midi sequencer port, and a
midi-in-Jack port. You will see Aeolus in both the 'MIDI'
and 'ALSA' tabs. If you use 'Raw', you will have to
use the Jack connection to connect Aeolus to a keyboard.
If you use 'Seq' you can make the connection in either
system.
Also if you use 'Seq' there will be two Jack-midi ports
for Aeolus: the Jack-midi port that Aeolus creates, and
a Jack-midi copy of the ALSA sequencer port of Aeolus,
shown as system:playback_#, with # some number.
Don't use the latter. What happens if you do that is that
the midi data from your keyboard will follow a rather long
route: Raw ALSA -> Jack port -> Jack port -> ALSA sequencer
-> Aeolus.
The most direct route is still the one in the 'ALSA' tab:
Raw ALSA -> ALSA sequencer -> Aeolus.
Ciao,
--
FA
Laboratorio di Acustica ed Elettroacustica
Parma, Italia
Wie der Mond heute Nacht aussieht !
Ist es nicht ein seltsames Bild ?