The ALSA developers in their wisdom have changed the naming convention of USB MIDI devices. Previously the alsa device name was likely to be unique (although not guaranteed). Since the change (around a couple of years ago) they seem to concatenate the device name and the endpoint name, e.g. “Launchkey Mini MK3 Launchkey Mini MK3 MIDI” which can result in a name longer than the max. 31 characters. For some devices (like the Launchkey) that results in its ports being indistinguisable, e.g.
Launchkey Mini MK3 Launchkey Mini MK3 MIDI -> Launchkey Mini MK3 Launchkey Mi
Launchkey Mini MK3 Launchkey Mini MK3 DAW -> Launchkey Mini MK3 Launchkey Mi
This is a problem because we cannot distinguish between these interfaces and worse - a2jd (that we use to present these ALSA MIDI ports to jack) fails for the second port so we only see one. Other ways of presenting the ports (e.g. jack options -X raw & -X seq) do not give identifiable names, e.g. “capture 1”.
These changes were made to ALSA about two years ago and the development team there don’t seem to be concerned about it so we may need to find a solution in userspace or recompile the kernel modules. We will try these approaches and also lobby our friends over at ALSA but I would like help from anyone who can manipulate devices, e.g. via udev rules.
I am not an udev expert and have not managed to implement any rules that work. What I would like to do is detect the device endpoint names and use this as the device name before the alsa driver binds the interface so that alsa uses the new name.
Is there anyone who can help with this? Please?
[Edit] It is actually more likely the linux kenel rather than alsa that is to blame for this. This may limit our ability to use udev but I still hold hope…
Thanks @hyves42. I think you are right that this isn’t going to help. I have written some code so that Zynthian uses the device name and port number so we have a way to handle this now.