jackaudio / a2jmidid

ALSA sequencer to JACK MIDI bridging (for jack2)
GNU General Public License v2.0
40 stars 13 forks source link

Doesn't work with the M-Audio Keystation MK3 and possibly other devices that generate two alsa ports on the same device #25

Open rtega opened 3 months ago

rtega commented 3 months ago

The M-Audio Keystation Mk3 has two ports on it's Alsa device: one for the keys on the keyboard and the second for the control and transport buttons. When running the command a2jmidid -e this generates the follow messages:

JACK MIDI <-> ALSA sequencer MIDI bridge, version 9 built on Thu Jan  1 01:00:00 1970
Copyright 2006,2007 Dmitry S. Baikov
Copyright 2007,2008,2009,2011,2012 Nedko Arnaudov

Bridge starting...
Using JACK server 'default'
Hardware ports will be exported.
Bridge started
Press ctrl-c to stop the bridge
port created: Midi Through [14] (capture): Midi Through Port-0
port created: Midi Through [14] (playback): Midi Through Port-0
port created: Keystation 88 MK3 [28] (capture): Keystation 88 MK3 Keystation 88
port created: Keystation 88 MK3 [28] (playback): Keystation 88 MK3 Keystation 88
ERROR: a2j_port_create: jack_port_register() failed for 'Keystation 88 MK3 [28] (capture): Keystation 88 MK3 Keystation 88'
ERROR: a2j_port_create: jack_port_register() failed for 'Keystation 88 MK3 [28] (playback): Keystation 88 MK3 Keystation 88'

This also gives the following message on the jackd side:

port_name "a2j:Keystation 88 MK3 [28] (capture): Keystation 88 MK3 Keystation 88" already exists
port_name "a2j:Keystation 88 MK3 [28] (playback): Keystation 88 MK3 Keystation 88" already exists

This renders the control and transport buttons unusable unless you manually setup a bridge. Using the -u option does nothing to solve this problem.

rtega commented 3 months ago

Some aditional info: amidi -l shows:

Dir Device    Name
IO  hw:3,0,0  Keystation 88 MK3 Keystation 88
IO  hw:3,0,1  Keystation 88 MK3 Keystation 88

According to this thread on linuxmusicians the naming convention in the kernel changed after kernel 5.11 thus confusing a2jmidid.

This looks to be a bug in a2jmidid.

rtega commented 3 months ago

I compiled the daemon from source here and the issue is already resolved on this latest version but not the ubuntu 22.04 version that I used before. I'll file a bug against ubuntu then. I see that this has been solved with pull request #5 .

romsom commented 3 months ago

Actually there never was a new release/tag after the fix had been merged. The last release still shows the behaviour you described. Unless Ubuntu wants to pull in the fix manually...

If you had a look at the conversation for the PR you know @nedko pointed out it would possibly break existing scripts and sessions because of the changes to the port naming convention. So as a result he didn't want to merge it into his re-adopted (for the lack of a better word) reverse-fork.

I still use the a2jmidid-git package from AUR, but I still would like to have this fixed in a future release (whoever might tag it). I'll see if I can find some time after the holidays to build the switch to optionally disable the fix for old setups.

rtega commented 3 months ago

Thanks for your comment. I didn't look at the comment as it fixed the issue in my case.