Discussion:
[LAU] Is -Xalsarawidi the same as -Xraw or -Xseq?
Victor A. Stoichita
2018-06-18 09:19:20 UTC
Permalink
Hi,

I’ve read in various places (like here [1]) about an option to
jack2 named -Xalsarawmidi. The man page of my jackdmp 1.9.12
documents only "raw" and "seq". Is alsarawmidi an alias for one
of these?

Regards,
Victor

[1]http://jack-audio.10948.n7.nabble.com/Jack-Devel-a2jmidi-and-jack-tp19285p19286.html
Paul Davis
2018-06-18 12:18:52 UTC
Permalink
Just a note. You should NEVER use ALSA raw MIDI with JACK unless you don't
care about timing in any way.
Hi,
I’ve read in various places (like here [1]) about an option to jack2
named -Xalsarawmidi. The man page of my jackdmp 1.9.12 documents only "raw"
and "seq". Is alsarawmidi an alias for one of these?
Regards,
Victor
[1]http://jack-audio.10948.n7.nabble.com/Jack-Devel-a2jmidi-
and-jack-tp19285p19286.html
_______________________________________________
Linux-audio-user mailing list
https://lists.linuxaudio.org/listinfo/linux-audio-user
David Kastrup
2018-06-18 12:20:19 UTC
Permalink
Post by Paul Davis
Just a note. You should NEVER use ALSA raw MIDI with JACK unless you don't
care about timing in any way.
So a2jmidid is better in that respect?
--
David Kastrup
Paul Davis
2018-06-18 12:24:40 UTC
Permalink
Absolutely much better.

And for those wierdos/smart folks/rebels out there using Jack1, remember
that a2jmidid is builtin to Jack1 itself.
Post by David Kastrup
Post by Paul Davis
Just a note. You should NEVER use ALSA raw MIDI with JACK unless you
don't
Post by Paul Davis
care about timing in any way.
So a2jmidid is better in that respect?
--
David Kastrup
Victor A. Stoichita
2018-06-18 13:55:50 UTC
Permalink
Post by Paul Davis
Just a note. You should NEVER use ALSA raw MIDI with JACK unless
you don't care about timing in any way.
(…)
Post by Paul Davis
And for those wierdos/smart folks/rebels out there using Jack1,
remember that a2jmidid is builtin to Jack1 itself.
Thanks Paul for the hints! I do care about timing, that’s why I’m
researching this. I think that I may run into some jitter when
recording midi in Ardour or Qtractor (or I really play worse than
I thought!). That’s what got me to the advice of
using -Xalsarawmidi combined with a2jmidid. I’m still not sure
whether this is the same as -Xseq or -Xraw.

For the background I got the explanation by Fons Adriaensen (10
years ago) relayed at
https://wiki.linuxaudio.org/faq/start#qwhat_is_the_difference_between_jack-midi_and_alsa-midi
Post by Paul Davis
"Interestingly, JACK developers (by way of Paul Davis) recommend
using a2jmidid for exposing raw midi ports
(https://community.ardour.org/node/4336), while the a2jmidid
author recommends using the '-X raw' flag for JACK
(https://gna.org/bugs/index.php?23272)."
That made me wonder what I should do. gna.org is down so
I couldn’t check/understand the second comment.

I tried to locate the current repo of a2jmidid but could only find
Post by Paul Davis
"Main goal of this project is to ease usage of legacy, not
JACK-ified apps, in a JACK MIDI enabled system."
If I only use Ardour, Yoshimi, Qmidiarp and mididings (all of
which can do jack-midi on their own), should I still connect them
through a2jmidid just for the sake of timing?

I’d be ready to join the Jack1 rebels if this could simplify my
midi setup. I only need one server on one local computer, no dbus
etc. But I also need low latency for live performances and some
dsp overhead. On these topics I’m confronted with another decade
of contradictory informations
The feature comparison on the jack website [1] seems to give
a slight advantage to jack2 in my case, mainly because of
"Supports multiple processors (SMP)" (I do have parallel subgraphs
in my setup). That had prompted me to switch to jack2 some 3 or
4 years ago. Now the state of midi support makes me look back…

So I wonder:
- if I use jack2 and a2jmidid, what -X option should I give to
jackd at startup? Will that reproduce the native behavior
of jack1?
- are there recent benchmarks to compare jack1 vs jack2 regarding
latency and dsp load?

Cheers,
Victor

[1]
https://github.com/jackaudio/jackaudio.github.com/wiki/Q_difference_jack1_jack2
Rui Nuno Capela
2018-06-18 14:08:56 UTC
Permalink
...
- if I use jack2 and a2jmidid, what -X option should I give to  jackd at
startup? Will that reproduce the native behavior  of jack1?
- are there recent benchmarks to compare jack1 vs jack2 regarding
 latency and dsp load?
here a 2-point rule-to-kill-them'all:

- when on JACK2, use a2jmidid -e; forget -Xwhatever; you've been warned,
probably way too many times ;)...
- when on JACK1, use -Xalsamidi (ie. integrated a2jmidid in jackd, as
Paul's referred to...);

hth.
cheers
--
rncbc aka. Rui Nuno Capela
***@rncbc.org
Chris Caudle
2018-06-18 14:18:11 UTC
Permalink
using -Xalsarawmidi combined with a2jmidid. I'm still not sure
whether this is the same as -Xseq or -Xraw.
I think -Xraw is an alias for -Xalsarawmidi, but in any case you should
not use either.
For the background I got the explanation by Fons Adriaensen (10
years ago)
Out of date since a2jmidid is available. Use "none" as the ALSA setting
for jackd, load a2jmidid, and just route through the exposed jack MIDI
ports.

Note that only applies to accessing ALSA hardware MIDI ports.
I tried to locate the current repo of a2jmidid
Interesting, until you pointed it out I had not noticed that a2jmidid was
not available with all the various zita tools at
http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html
There are several distributions which have a copy, you should be able to
find a copy of the source if you need it. Or just install the binaries
for now for whichever distribution you are running.
If I only use Ardour, Yoshimi, Qmidiarp and mididings (all of
which can do jack-midi on their own), should I still connect them
through a2jmidid just for the sake of timing?
No, a2jmidid is only for getting your ALSA hardware MIDI ports exposed in
jack. If you are not using hardware synths then you have no need for ALSA
MIDI at all, connect everything through jackd.
- if I use jack2 and a2jmidid, what -X option should I give to
jackd at startup? Will that reproduce the native behavior
of jack1?
Use "none" as the ALSA selection if you are starting jackd through
qjackctl or similar. If you are starting directly from a terminal you do
not need to give any argument for MIDI, just leave out the "-X" section of
the command line.
--
Chris Caudle
Robin Gareus
2018-06-18 14:38:57 UTC
Permalink
Post by Chris Caudle
Post by Victor A. Stoichita
I tried to locate the current repo of a2jmidid
Interesting, until you pointed it out I had not noticed that a2jmidid was
not available with all the various zita tools
[...]

a2j was written by Nedko Arnaudov, not Fons. It was hosted on gna! and
meanwhile went AWOL when the site shut down last year.

There is however http://repo.or.cz/a2jmidid.git

ciao,
robin
Ralf Mardorf
2018-06-18 17:57:03 UTC
Permalink
Post by Chris Caudle
using -Xalsarawmidi combined with a2jmidid. I'm still not sure
whether this is the same as -Xseq or -Xraw.
I think -Xraw is an alias for -Xalsarawmidi, but in any case you should
not use either.
Wrong! Better use alsarawmidi!
Chris Caudle
2018-06-18 18:24:51 UTC
Permalink
Post by Ralf Mardorf
Post by Chris Caudle
using -Xalsarawmidi combined with a2jmidid. I'm still not sure
whether this is the same as -Xseq or -Xraw.
I think -Xraw is an alias for -Xalsarawmidi, but in any case you should
not use either.
Wrong! Better use alsarawmidi!
The current manpage for jackd does not mention the term "alsarawmidi" at
all, only seq or raw. Searching the current source tree for jackd v2 I
found a description in JackALSARawMidiDriver.cpp that it was an
"Alternative ALSA raw MIDI backend."
I do not see a way to instantiate that separately, however, the command
line processing has only entries for "seq" and "raw" as arguments to the
ALSA driver.

In any case, the correct answer is still to not use any -X argument at
all, let a2midid control the ALSA MIDI data and act as a jack client, at
least for jackd v2.
--
Chris Caudle
Ralf Mardorf
2018-06-18 19:37:15 UTC
Permalink
Post by Chris Caudle
Post by Ralf Mardorf
Post by Chris Caudle
using -Xalsarawmidi combined with a2jmidid. I'm still not sure
whether this is the same as -Xseq or -Xraw.
I think -Xraw is an alias for -Xalsarawmidi, but in any case you
should not use either.
Wrong! Better use alsarawmidi!
The current manpage for jackd does not mention the term "alsarawmidi"
at all, only seq or raw. Searching the current source tree for jackd
v2 I found a description in JackALSARawMidiDriver.cpp that it was an
"Alternative ALSA raw MIDI backend."
I do not see a way to instantiate that separately, however, the
command line processing has only entries for "seq" and "raw" as
arguments to the ALSA driver.
In any case, the correct answer is still to not use any -X argument at
all, let a2midid control the ALSA MIDI data and act as a jack client,
at least for jackd v2.
No, if you want to reduce MIDI jitter when using the MIDI hardware IOs,
use -Xalsarawmidi!
Paul Davis
2018-06-18 14:42:52 UTC
Permalink
One other note: in Jack1, to aid with "back compatibility", if you were to
use -Xseq, Jack1 will interpret that as "use my embedded version of
a2jmidid".

as noted by others, unless you do not care about timing, you should never
use -Xraw. You should use -Xseq only with Jack1, where it is equivalent to
starting up a2jmidid -e, which is the recommended approach for Jack2.
Post by Paul Davis
Just a note. You should NEVER use ALSA raw MIDI with JACK unless you
don't care about timing in any way.
(
)
Post by Paul Davis
And for those wierdos/smart folks/rebels out there using Jack1, remember
that a2jmidid is builtin to Jack1 itself.
Thanks Paul for the hints! I do care about timing, that’s why I’m
researching this. I think that I may run into some jitter when recording
midi in Ardour or Qtractor (or I really play worse than I thought!). That’s
what got me to the advice of using -Xalsarawmidi combined with a2jmidid.
I’m still not sure whether this is the same as -Xseq or -Xraw.
For the background I got the explanation by Fons Adriaensen (10 years ago)
relayed at https://wiki.linuxaudio.org/faq/start#qwhat_is_the_differenc
e_between_jack-midi_and_alsa-midi
Post by Paul Davis
"Interestingly, JACK developers (by way of Paul Davis) recommend using
a2jmidid for exposing raw midi ports (https://community.ardour.org/
node/4336), while the a2jmidid author recommends using the '-X raw' flag
for JACK (https://gna.org/bugs/index.php?23272)."
That made me wonder what I should do. gna.org is down so I couldn’t
check/understand the second comment.
I tried to locate the current repo of a2jmidid but could only find this
Post by Paul Davis
"Main goal of this project is to ease usage of legacy, not JACK-ified
apps, in a JACK MIDI enabled system."
If I only use Ardour, Yoshimi, Qmidiarp and mididings (all of which can do
jack-midi on their own), should I still connect them through a2jmidid just
for the sake of timing?
I’d be ready to join the Jack1 rebels if this could simplify my midi
setup. I only need one server on one local computer, no dbus etc. But I
also need low latency for live performances and some dsp overhead. On these
topics I’m confronted with another decade of contradictory informations
The feature comparison on the jack website [1] seems to give a slight
advantage to jack2 in my case, mainly because of "Supports multiple
processors (SMP)" (I do have parallel subgraphs in my setup). That had
prompted me to switch to jack2 some 3 or 4 years ago. Now the state of midi
support makes me look back

- if I use jack2 and a2jmidid, what -X option should I give to jackd at
startup? Will that reproduce the native behavior of jack1?
- are there recent benchmarks to compare jack1 vs jack2 regarding latency
and dsp load?
Cheers,
Victor
[1] https://github.com/jackaudio/jackaudio.github.com/wiki/Q_dif
ference_jack1_jack2
Ralf Mardorf
2018-06-18 17:45:56 UTC
Permalink
Post by David Kastrup
So a2jmidid is better in that respect?
You should consider to use a2jmidid in combination with -Xalsarawmidi
to reduce MIDI jitter. "alsarawmidi" is neither an alias for "raw" nor
for "seq".
Victor A. Stoichita
2018-06-19 11:05:13 UTC
Permalink
I just found this thread from 2014 about alsarawmidi [1]. At that
time the intention was apparently that alsarawmidi would replace
both 'seq' and 'raw' [2]. a2jmidid was described as pretty much
dead. Now the wheel of life has turned I guess. I don’t really get
the rest of that discussion.

Thanks to all who shared their advices and Golden Rules on this!
What to do now as an "end-user" is much clearer for me.

Blue skies,
Victor

[1]
http://jack-audio.10948.n7.nabble.com/Jack-Devel-Jack2-alsarawmidi-slave-Pluggable-device-registration-problem-tp18200.html

[2]
http://jack-audio.10948.n7.nabble.com/Jack-Devel-Jack2-alsarawmidi-slave-Pluggable-device-registration-problem-td18200.html#a18210
Len Ovens
2018-06-19 14:45:40 UTC
Permalink
Post by Victor A. Stoichita
I just found this thread from 2014 about alsarawmidi [1]. At that
time the intention was apparently that alsarawmidi would replace
both 'seq' and 'raw' [2]. a2jmidid was described as pretty much
dead. Now the wheel of life has turned I guess. I don’t really get
the rest of that discussion.
Sometimes people are way too quick to call things dead. There is a thing
called bitrot where changing lib versions kill older code. This is very
true with code that uses a system GUI like QT or GTK (GCDMaster is a good
example). However, in the case of very basic c utilities that really use
an API that hasn't changed for years, just looking at the git repo and
calling something dead because that last entry is a few years old doesn't
mean anything.

That being said, there are two ways to run a2jmidid, from
the command line as a2jmidid -e and through dbus with a2j_control. I would
advise against using a2j_control as I have found it sometimes "jams" (I am
sure there is a better word) and creates a disk filling log file in short
order.

Do remember MIDI notes come at about 1khz (31k/10bits/3events) chords are
groups of notes... depending on the keyboard scan direction your chord
will always be top to bottom or bottem to top with the last delayed a few
ms from the first. Beside that jitter has to be pretty low frequency to be
an issue. Not that jitter is ok, but that MIDI itself is an issue already
before it gets to the computer.

--
Len Ovens
www.ovenwerks.net
Ralf Mardorf
2018-06-19 18:16:01 UTC
Permalink
Beside that jitter has to be pretty low frequency to be an issue. Not
that jitter is ok, but that MIDI itself is an issue already before it
gets to the computer.
Hi Len,

I won't comment this claim or any other claim in this thread.
Measuring a system by itself could be questioned, but The OP should
consider to measure different MIDI interfaces, the results might or
might not be something to keep in mind.

$ alsa-midi-latency-test -l

The output of the above command does show the port(s), replace xy:z of
the below command by a port. Connect MIDI in with MIDI out and run

alsa-midi-latency-test -Rrw=5 -ixy:z -oxy:z

After running the above test, the OP should chose the best MIDI
interface and launch jackd with and without alsarawidi. IOW the OP
should record a four-to-the-floor MIDI track and after that record an
external MIDI instrument's kick several times, to one audio track after
the other. How exact are all the kicks played in unisone? Is it just a
phasing, or an early reflection alike effect the OP hears? Is there a
difference between the tracks recorded with and without alsarawidi?

There's no need to answer this questions by an email. Everybody
interested could do this, just to verify if it's something important to
the tester.

https://github.com/koppi/alsa-midi-latency-test

Regards,
Ralf
Tim
2018-06-19 16:14:15 UTC
Permalink
I just found this thread from 2014 about alsarawmidi [1]. At that time
the intention was apparently that alsarawmidi would replace both 'seq'
and 'raw' [2]. a2jmidid was described as pretty much dead. Now the wheel
of life has turned I guess. I don’t really get the rest of that discussion.
Thanks to all who shared their advices and Golden Rules on this! What to
do now as an "end-user" is much clearer for me.
Blue skies,
Victor
[1]
http://jack-audio.10948.n7.nabble.com/Jack-Devel-Jack2-alsarawmidi-slave-Pluggable-device-registration-problem-tp18200.html
[2]
http://jack-audio.10948.n7.nabble.com/Jack-Devel-Jack2-alsarawmidi-slave-Pluggable-device-registration-problem-td18200.html#a18210
Hi, that's my old post.

Just a quick note:
At the time I found a2jmidid would not compile.
But I just now pulled and built it from http://repo.or.cz/a2jmidid.git
Despite a warning about wrong dbus location, it seems to build
and install OK now, here on openSUSE Tumbleweed, a cutting-edge
rolling distro. I have not tested it.

Tim.
Chris Caudle
2018-06-19 17:43:26 UTC
Permalink
Post by Tim
At the time I found a2jmidid would not compile.
But I just now pulled and built it from http://repo.or.cz/a2jmidid.git
Despite a warning about wrong dbus location, it seems to build
There cannot have been any severe problem building it, Fedora has been
shipping a2jmidid in the distribution repository for years now.
I'm still not sure why Ralf doesn't like a2jmidid, that is the
implementation which ships internally in jackd1 and is recommended by the
jack developers for jackd 2.
--
Chris Caudle
Ralf Mardorf
2018-06-19 18:47:49 UTC
Permalink
Post by Chris Caudle
There cannot have been any severe problem building it, Fedora has been
shipping a2jmidid in the distribution repository for years now.
I'm still not sure why Ralf doesn't like a2jmidid, that is the
implementation which ships internally in jackd1 and is recommended by
the jack developers for jackd 2.
I like a2jmidid a lot, alsarawmidi doesn't replace it. When using
alsarawmidi you need a bridge, this bridge should be a2jmidid. FWIW I
guess we are talking about MIDI jitter when connecting the computer
with external gear. There should be no jitter at all, when using the
studio in the box without external MIDI gear.

Even Paul once didn't know jack2's alsarawmidi and IIRC it was Stéphane
who corrected him. However, a user who is satisfied with the result the
user hears, doesn't need to care about all this talk. A user
experiencing an issue shouldn't waste time by asking questions, the
user simply should test if "things" such as alsarawmidi make a
difference or not.

Loading...