How to set persistent USB-Midi hardware device ID/name?

Ubuntu Studio 24.04

I have five USB midi devices -synthesizers, which are connected to a Digital Audio Workstation (Reaper / Ardour) via Midi-bridge.

The problem is every time the system is rebooted, or if a USB device is disconnected, it reconnects with a dynamically assigned number, even though it has the same unique identifier from the vendor. This means routing midi devices to recording tracks in the Digital Audio Workstation needs to be reconfigured every time the system is rebooted.

I have tried renaming the midi devices in the QJackCtl graph. This works for audio inputs, the names are persistent. But for midi inputs the ‘pretty’ names are reset when the device is disconnected.

I believe Pipewire handles the midi-bridge now.
It seems to me a2jmidid used to handle persistent naming of USB midi devices but pipewire doesn’t seem to do this.

I found one other potential fix by using ‘resetusb’, and running that for each midi device at login but this still creates a new number for each midi device, although it does shorten the device name.

The other option I found online was maybe I need to create udev rules for each device?

I need Reaper to see the same Midi device connected or Reaper creates a new midi device entry, as seen below:

Currently my workaround would be to disable pipewire when I’m doing audio work, and enable it when I need to listen to audio from the web browser. And use the older a2jmidid alsa/jack bridge to handle persistent naming of midi devices for audio work. I’m not sure what other issues this may create - disabling Pipewire. I don’t know if I will not be able to use other audio player applications that I need during the audio work.

I’m running audio and midi with ALSA/Jack, using Qjackctl.
I can see the routing with Patchance.
I’m using Reaper DAW but I confirmed the midi device naming issue exists with Ardour DAW also.

Thanks

1 Like

I’m now using chatgpt to answer this question, and give me a solution. Wow it’s really useful I have to admit. It explains what I needed to know really clearly. Great tool

ChatGPT, like other AI tools out there today, can indeed be very useful.

However, huge caveat coming…it should not be relied on for definitive answers especially with regards to technical matters.

As a guide to help get you moving in the right direction, possibly.

But I recommend you always test possible solutions or configurations on a non-productive platform such as a test laptop or better still in a virtual machine.

Additionally, it is best to check here before applying something so we can offer our best advice and support.

Thanks

3 Likes

Thanks. To be honest I have never had a response to a question I’ve asked in a linux forum before. This is the first time I have been on this forum but I have used other forums in the past. But I understand everyone has lives to live so I don’t expect anything.
I always try to follow the posting instructions, maybe my questions are just too long-winded.

Usually I can find the answer just by googling and using some else’s solution. But this problem I haven’t found the right solution after searching for hours and trying many things. It seems I need to configure wireplumber so I’m trying that now.

I don’t have any recommendations for your problems but I would suggest that if you are making system or configuration changes, you make note of the setting before you make the change and what the change was. Also, if you make a change in a configuration file, you make a backup copy of the file before the change. Common sense really but it’s amazing how many people don’t do this.

1 Like

Found the solution: Don’t use Jack!

I am now using ALSA as the Audio system for Reaper, this is set in Reaper preferences.
Reaper cannot use a separate audio and midi backends (Jack and alsa), so it must be Jack or ALSA.
ALSA handles stable midi device naming with Pipewire without any issues.

Somehow Jack must have been creating an extra layer of confusion.
For a single audio interface, Jack is not needed.
I thought I needed Jack due to many USB midi devices.
I found a thread on the Ardour forum, that said basically Jack is not needed for most people. I used it 10+ years ago so I was still in that mindset.
This issue seems to be the same in Ardour and Reaper.

It seems like the Alsa/Jack/Pipewire multi layer setup was causing the midi devices not to be able to be numbered persistently.

This might have been solved with udev rules and alsa config but trying that didn’t get results for me. It seems to be there’s some config needed in wireplumber, which is apparently ‘not for user configuration’ - I broke my audio system trying to configure wireplumber, so I did a fresh install of ubuntu studio.

To be fair, Ubuntu Studio’s policy is that we don’t support Reaper. Source: I’m the project lead.

Furthermore, that using ALSA as the audio system for Reaper makes sense. Ubuntu Studio has the PipeWire-JACK compatibility layer enabled by default, and doesn’t see the difference if it’s an ALSA backend or a JACK backend or a PulseAudio backend; it treats it all the same, but the naming conventions used on the graph might be different.

If you want persistent connections, I suggest using RaySession, installed by default, to manage the connections. It sees everything as JACK, but again, it doesn’t matter as PipeWire makes it agnostic from the user point-of-view.

1 Like

Blockquote To be fair, Ubuntu Studio’s policy is that we don’t support Reaper. Source: I’m the project lead. …
If you want persistent connections, I suggest using RaySession, installed by default, to manage the connections. It sees everything as JACK, but again, it doesn’t matter as PipeWire makes it agnostic from the user point-of-view.

Thanks.
The midi device dynamic numbering issue with Jack/pipewire also affects Ardour, as mentioned above. So it’s not a Reaper problem.

Ray session doesn’t show Ardour when Alsa is used for the Ardour audio system, only when Jack is used.
When Jack is selected as Ardour’s audio system, Ardour shows in Ray session, but the midi device dynamic numbering issue persists.

Have to say a big thanks for all the work that’s gone into this. I made a modest donation. If I continue to use Ubuntu Studio I’ll repeat and increase that amount. Cheers

This is because PipeWire starts numbers at 0 as opposed to JACK which started numbers at 1. It’s the GNU way vs the Roman way of numbering.

Thank you so much! That’s very kind!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.