[solved] Linux: Missing ports in a2jmidi

Not sure if this really is the fault of midihub, but this used to work at least a year ago.

I noticed that on my desktop using a2jmidi I only see the first port appear in the connection graph.

In the logs I see the following:

Sat Aug 16 13:14:51 2025: ERROR: a2j_port_create: jack_port_register() failed for 'Midihub MH-2KPRPDN [32] (capture): Midihub MH-2KPRPDN Midihub MH-2'
Sat Aug 16 13:14:51 2025: ERROR: a2j_port_create: jack_port_register() failed for 'Midihub MH-2KPRPDN [32] (playback): Midihub MH-2KPRPDN Midihub MH-2'
Sat Aug 16 13:14:51 2025: ERROR: a2j_port_create: jack_port_register() failed for 'Midihub MH-2KPRPDN [32] (capture): Midihub MH-2KPRPDN Midihub MH-2'
Sat Aug 16 13:14:51 2025: ERROR: a2j_port_create: jack_port_register() failed for 'Midihub MH-2KPRPDN [32] (playback): Midihub MH-2KPRPDN Midihub MH-2'
Sat Aug 16 13:14:51 2025: ERROR: a2j_port_create: jack_port_register() failed for 'Midihub MH-2KPRPDN [32] (capture): Midihub MH-2KPRPDN Midihub MH-2'
Sat Aug 16 13:14:51 2025: ERROR: a2j_port_create: jack_port_register() failed for 'Midihub MH-2KPRPDN [32] (playback): Midihub MH-2KPRPDN Midihub MH-2'

It seems there are naming conflicts for these ports.
In amidi -l I see this:

Dir Device    Name
IO  hw:4,0,0  Midihub MH-2KPRPDN Midihub MH-2
IO  hw:4,0,1  Midihub MH-2KPRPDN Midihub MH-2
IO  hw:4,0,2  Midihub MH-2KPRPDN Midihub MH-2
IO  hw:4,0,3  Midihub MH-2KPRPDN Midihub MH-2

On my laptop I see the ports as this:

Dir Device    Name
IO  hw:1,0,0  Midihub MH-2KPRPDN A
IO  hw:1,0,1  Midihub MH-2KPRPDN B
IO  hw:1,0,2  Midihub MH-2KPRPDN C
IO  hw:1,0,3  Midihub MH-2KPRPDN D

Where each port is clearly distinguished and there are no conflicts.

Both the desktop and laptop are running Debian 12/bookworm, but on the desktop it’s pure alsa + jack audio.
On the laptop I am using pipewire, but I’d think that in this case the port naming comes from the alsa implementation right?

Any ideas/insight into how this port naming conflict is caused are welcome.

ps;

I have the exact same udev rules on both machines:

SUBSYSTEM=="tty", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0c9c", MODE="0666", SYMLINK+="midihub_%s{serial}"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0c9c", MODE="0666", SYMLINK+="midihub%n"

There are however different kernels:

  • desktop: 6.1.0-17-amd64
  • laptop: 6.15.6-1-liquorix-amd64

Hmm, I found this post on Linux Musicians forum that describes the issue as well: Alsa Midi port name ambiguity trouble - Page 2 - LinuxMusicians

Apparently the naming changed in 5.13 kernel?
However on my laptop running liquorix it seems they reverted the change again ..

Hmm, another topic on the Zynthian forums: ALSA Names - udev call for help [SOLVED!] - Development - Zynthian Discourse

Hmm, to add to this: another machine with the same kernel as the desktop but also running pipewire I see the same conflicting port names as on desktop, but I also see 4 unique midi i/o ports on the connection graph.

As described in the Zynthian thread pipewire already resolves these conflicts and provides an a2jmidi service as well.

However I don’t want to run pipewire on my desktop at all, it needs to have a dedicated jack server. So any ideas on how to resolve this are still very much welcome!

The port names are assigned by the USB MIDI driver in Linux kernel:

There seems to be a significant and welcome difference in v6.15.6, where it is detecting duplicate information.

If you can’t upgrade your Desktop kernel, you may build a customized version of only snd-usbmidi kernel module, or alternatively - try renaming the Default Port names for USB ports in Midihub (using Device → Edit Default Port Names… menu). These USB port names are provided to the OS via the USB string descriptors, maybe it will help make a difference. It is required to disconnect and reconnect Midihub for USB naming changes to take effect. (some OSes like macOS also require deleting the device from cache)

1 Like

Oh thank you for looking into that!
It seems that Debian 13/Trixie will come with 6.12 so that’s a bit of a bummer.

I’ll see if I can build the custom snd-usbmidi module later.

From what I can tell renaming the Default Port names is not going to solve it, one of the reasons seems to be the character limit on the port names, so creating different names on the device won’t solve that I think.

6.12 looks like has the same deduplication:

You should give it a try anyway, it may be sending short enough string.

Indeed! also changing the device name makes it much shorter, which actually already solves it!
In Settings -> General -> Device Name

I changed it to mhub and now I can see all my ports again. Thnx for the tips!

I didn’t even know this was possible and would’ve of course tried this had I known :wink:

1 Like