Ardour and ALSA midi devices

I have been trying to work this out for a few days now.

I have two synths that act a soundcards (usb audio), the soundcard part I am not concerned with right now, as someone with more clue is presumed needed to write a driver/patch for that, it’s the MIDI I’m concentrating on at present.

The synths are Roland Boutiques, a JP-08 and a JX-03. I have managed to get them to work via USB and a alsa-base.conf entry, “options snd-usb-audio index=1,2,3,4,5 vid=…” etc. however the pid/vid for both devices is the same, as is the name: USB-Audio - Boutiq and ID 0582:01b5 Roland Corp. The entry seems to keep them static, but is obviously not ideal as the cards could still swap to my understanding. There are guides to udev on the ALSA site, but they are out of date and don’t really address the issue I have.

I have written a kludgy udev rule - this sets the ID via a DEVPATH== and this can set ATTR{id}=“JX-03” for example.

In aconnectgui the cards show up and can be routed to - no problem, but they have the same name, so it doesn’t use ATTR{id}=. I could probably live with that alone.

In Ardour 4.7, (just in ALSA) however, only one of the devices is recognised, so I’m guessing it’s because the names are the same, and Ardour is dropping one because of this, and I don’t know how Ardour obtains ALSA midi device names, not via the ID certainly.

So what to do? some kind if devious udev rule based in the serial number? I can get that via “$ udevadm info -a -n /dev/bus/usb/002/002 | grep ‘{serial}’ | head -n1” for example.
Maybe some .asoundrc / alsa-base.conf magic, to alias the name to something Ardour will see?

The only other way I can think of is if Roland put meaningful info into a firmware update that was device specific, under Windows 7 with the drivers installed, the device names just increment, and you still don’t know which is which.

Incidentally, Roland state quite clearly that you can’t use the drivers and connect via a virtual machine. You can, Virtualbox with USB passthrough enabled.

Any suggestions?

Ardour only displays PCM device names, which excludes all pseudo-device names defined in a ~/.asoundrc file. This is unfortunate, but the change to enumerating all device names, both physical and user-defined, is a bit more complex than one might imagine.

However, to accomodate another user who needed to use an ALSA “multi” device (a pseudo-device made up of more than one physical device), the Ardour nightlies recognize an environment variable ARDOUR_ALSA_DEVICE. If set, this is the only device name that will be offered (and thus used). You may want o consider using this.

Thanks Paul, I’ll look into the nightly builds and ARDOUR_ALSA_DEVICE.