Page 1 of 1

Jack Interface Numbering?

Posted: Sun Mar 18, 2018 12:31 am
by everythingsgonegreen
Hi, I'm just getting started with this whole making/recording music thing, but have been using linux extensively for the past 20+ years, so please bear with me.

I've got my system setup as far as I can tell and just picked up a Roland Rubix22 and an Akai MPK mini mk2 to play around with along with my guitars and everything seems to be working, but I've run into a slight annoyance and was wondering if those with experience with Jack/Ardour5 might have an answer.

I've noticed if I reboot or unplug the midi controller, the midi_capture_x interface numbering changes for the devices depending on how they are enumerated when booting up, or if I've unplugged and re-plugged in one of the interfaces. Anytime this happens I need to go into my saved session in Ardour and re-map the inputs. Is there any way in Jack to setup a static config with the interface numbers being fixed based on the USB device id?

I noticed this start happening as I was writing a native config tool to setup the MPK mini so I don't have to run wine and I noticed my numbering changing after I released to controller back to the kernel driver. Ideally I'd like to be able to edit the config while Jack and Ardour are running, rather than shutting everything down, changing the programming on the MPK mini and then re-launching everything, mainly for testing as I'm aware most people won't be editting the stored programs on the fly.

Anyway, is Jack in its current form capable of handling this? I know people likely aren't removing devices and re-attaching them to the bus while recording, but I did see it happen across a reboot where the controller was enumerated before the Rubix while it was the other way around when I first started things up.

Thanks!

Re: Jack Interface Numbering?

Posted: Sun Mar 18, 2018 6:55 pm
by Pablo
Does this help?

https://alsa.opensrc.org/MultipleCards

Sorry but I don't think the problem has anything to do with jack even if it seems so. :)

EDIT. Sorry for the confusion. I just reread the article and decided to strike through the above :oops:
EDIT, again: I just deleted the bad hint . Take a look at the article, I hope it helps

Re: Jack Interface Numbering?

Posted: Mon Mar 19, 2018 11:50 am
by everythingsgonegreen
Thanks, I'll take a look. Initially it looks like it may resolve the ordering issue, but I'll see if it also resolves the incrementing index when the devices go away and come back individually.

Re: Jack Interface Numbering?

Posted: Mon Mar 19, 2018 1:46 pm
by noedig
Hardware MIDI devices are handled by ALSA and are made avaiable to JACK via some kind of bridge.
For instance, I use "a2jmidid -ue" to make the devices visible in JACK.
The "e" option ensures that hardware devices are bridged (i.e. your MIDI controller);
The "u" option removes the ALSA port numbering, which helps a lot for JACK clients when the ALSA port numbers change as you have noticed.

I'm not sure how to achieve this with other ALSA/JACK MIDI bridges.

Re: Jack Interface Numbering?

Posted: Mon Mar 19, 2018 6:51 pm
by Baggypants
I don't know how to do it with Ardour but using qjackctl you can use regular expressions in the patchbay definitions. Edit your plug so it's 'midi_capture_.*'

Re: Jack Interface Numbering?

Posted: Mon Mar 23, 2020 1:24 am
by jaimiejaimie
Hi, any luck setting up the Rubix22? I am trying but I might have to return it.

Re: Jack Interface Numbering?

Posted: Wed Mar 25, 2020 4:54 pm
by thumbknuckle
noedig wrote:
Mon Mar 19, 2018 1:46 pm
The "u" option removes the ALSA port numbering, which helps a lot for JACK clients when the ALSA port numbers change as you have noticed.
This is super helpful, now the patchbay in QjackCtl doesn't get confused every time I reboot.

Thanks!