jackaudio / a2jmidid

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

Reliable restoration, jack1, Alsa port names #26

Open sjomae opened 2 weeks ago

sjomae commented 2 weeks ago
To ensure this uniqueness, a2jmidid will add the unique numeric ALSA client ID to the JACK port name. However this behaviour is known to be problematic when restoring connections using simplistic tools like aj-snapshot and jack_connect.

Jack1 has changed the ALSA port names so they never use the client number.

alsa_midi:Midi Through Port-0 (out)
alsa_midi:Midi Through Port-0 (in)
alsa_midi:MOTU-AVB MIDI 1 (out)
alsa_midi:MOTU-AVB MIDI 1 (in)
alsa_midi:Keystation 88 MIDI 1 (out)
alsa_midi:Keystation 88 MIDI 1 (in)
alsa_midi:Keystation 88 MIDI 2 (out)
alsa_midi:MidiSport 2x2 MIDI 1 (out)
alsa_midi:MidiSport 2x2 MIDI 1 (in)
alsa_midi:MidiSport 2x2 MIDI 2 (out)
alsa_midi:MidiSport 2x2 MIDI 2 (in)

This has never been picked up by a2jmidid, according to Paul Davis. Room for improvement here?

romsom commented 1 week ago

Can you provide a bit more context, like links to the quotes and the change in jack you mention?

sjomae commented 1 week ago

Was a discussion in #ardour irc with las / paul davis. For details you might be best of to ask him directly (via IRC or mail)


> ALSA midi port names, converted by a2jmidi are not consistent in the numbering right? That's a annoyance when using session management
>>> what do you mean by consistent?
> sometimes it seems to get number 129, sometimes 130 etc
>>> i changed things in jackd1 so that the names are better (they never use the ALSA client number), this was not picked up (so far) by a2jmidid
sjomae commented 1 week ago

Small annoyance, but it hurts workflow quite a bit when working with NSM session manager.

The a2jmidid manpage says:

ALSA does not guarantee client names to by unique. I.e. it is possible to have two apps that create two clients with same ALSA client name. JACK however requires port names to be unqiue. To ensure this uniqueness, a2jmidid will add the unique numeric ALSA client ID to the JACK port name. However this behaviour is known to be problematic when restoring connections using simplistic tools like aj-snapshot and jack_connect. In order to make them work, the -u option can be used. This option will cause a2jmidid to omit the numeric ALSA Client ID from JACK port names. In this mode, ALSA client name uniqueness must be guartanteed externally. 

https://manpages.org/a2jmidid

romsom commented 1 week ago

Thanks! :+1:

sjomae commented 1 week ago

No problem. Actually, when I think about it now, I think those midi ports is the only thing which I currently can't restore reliable in such a session manager. That means you don't have sound and you need to figure out what is causing it, find out that it's the midi connection ... and so forth.... So all though a small thing, it would be a big thing if this would be fixed. Not sure how pipewire handles this, but I use jack2 anyway.