Using a2jmidid to Re-Route ALSA MIDI

As I created a larger setup I discovered that my MIDI connections were becoming complicated. Some programs support ALSA MIDI, some support JACK MIDI, and some support both. My MIDI controller hardware is only supported by ALSA.

My version of JACK (0.124.1) handles this reasonably well in many cases by automatically bridging ALSA MIDI ports as JACK MIDI ports. However, I have a case that it doesn’t handle: having multiple devices of the same model. The automatic ALSA-JACK bridge only showed one port when I had three identical devices. Fortunately, I found a2jmidid, which shows all three ports.

I use QjackCtl to control JACK. Here’s how I originally had it configured for MIDI (I stopped JACK and clicked QjackCtl’s Setup button to see the Setup dialog).

On the Settings tab, MIDI Driver (near the lower right corner) was set to seq:

a2j-01

On the Misc tab, Enable ALSA Sequencer support was checked:

a2j-02

With this configuration I started JACK and connected a KORG nanoKONTROL device. The nanoKONTROL appeared on the ALSA tab in the Connections window:

a2j-03

The nanoKONTROL also appeared on the MIDI tab as a sub-device of alsa_midi:

a2j-04

I then connected a second nanoKONTROL unit. The second nanoKONTROL appeared on the ALSA tab:

a2j-05

The second nanoKONTROL didn’t appear on the MIDI tab:

a2j-06

In a terminal, I executed the following:

[steve@audio ~]$ a2jmidid --export-hw

(Option -e can be used instead of —export-hw)

A new entry a2j appeared in the MIDI tab and both nanoKONTROLs were present:

a2j-07

I then stopped JACK, clicked the Setup button, and simplified my QjackCtl configuration with a few simple tweaks.

On the Settings tab, I changed MIDI Driver to none. This will eliminate the alsa_midi entry on the MIDI tab:

a2j-08

On the Misc tab, I unchecked Enable ALSA Sequencer support. This will eliminate the ALSA tab:

a2j-09

On the Options tab, I checked Execute script after Startup and entered a2jmidid –export-hw & in the box (note that there are two dashes before export-hw). This will start a2jmidid automatically after JACK starts:

a2j-10

After clicking OK I saw a message that I needed to restart QjackCtl, which I did. I started JACK and opened the new, simplified Connections window:

a2j-11

One issue I’ve found is that Nano-Basket doesn’t work when connected via a2jmidid; it seems to require regular ALSA MIDI. My workaround is to connect Nano-Basket using a program other than QjackCtl; I tried Patchage, which worked fine (although I also noticed that a2jmidid won’t start if Patchage is already running).

I’m very pleased with how a2jmidid has simplified my setup.

Advertisements
Tagged with: , , , ,
Posted in Tools

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: