Re: Routing MIDI controllers with sndio on Linux.

From: Brian Durant <>
Date: Sun, 9 Apr 2023 14:08:36 +0200
On 4/8/23 11:42 AM, Alexandre Ratchov wrote:
> On Sat, Apr 08, 2023 at 10:44:41AM +0200, Brian Durant wrote:
>> On 4/5/23 5:20 PM, Alexandre Ratchov wrote:
>>> On Wed, Apr 05, 2023 at 04:54:53PM +0200, Brian Durant wrote:
>>>> How are MIDI controllers routed with sndio on Linux? On OpenBSD, MIDI ports
>>>> are named "midi/0", "midi/1", and they correspond to the "midi0 at ..."
>>>> lines of dmesg. I am currently using sndio on Void Linux (mainly for support
>>>> of my MIDI controllers), and the MIDI controllers are typically listed as:
>>>> [ 75.825351] usb 1-12: Product: A-PRO
>>>> [ 75.825355] usb 1-12: Manufacturer: Roland
>>>> [ 142.346575] usb 1-12: USB disconnect, device number 7
>>>> [ 215.239705] usb 1-12: new full-speed USB device number 8 using xhci_hcd
>>>> [ 215.367162] usb 1-12: New USB device found, idVendor=09e8, idProduct=0076,
>>>> bcdDevice= 1.00
>>>> Unfortunately, I am unable to route any of my controllers to LMMS (with
>>>> sndio set as the MIDI interface in the LMMS preferences), such as to the SF2
>>>> plugin. I am able to set the MIDI input properly in LMMS (in the plugin),
>>>> but I am apparently not getting a MIDI signal from the keyboard. This is
>>>> where that I suspect that there could be a routing issue.
>>>> Sooo, assuming that everything else is equal to sndio on OpenBSD, I need to
>>>> run a similar command, with the equivalent of "midi/0" in Linux:
>>>> $ midicat -d -q midi/0 -q midithru/0
>>>> Of course with the correct variable for the relevant MIDI device.
>>> It's supposed to be the same than on OpenBSD, for better and for worse.
>>> Could you post the output of 'amidi -l'?
>> Hmm. My reply didn't seem to get through. Here it is again:
>> $ amidi -l
>> Dir Device    Name
>> IO  hw:0,0,0  UMC404HD 192k UMC404HD 192k MID
>> IO  hw:3,0,0  A-PRO MIDI
>> IO  hw:3,0,1  A-PRO 1
>> I   hw:3,0,2  A-PRO 2
> Oh, my bad, on linux, devices have the ",X,Y" suffix, so you need
> these sndiod options for the same openbsd commands to work there:
> sndiod -q rmidi/0 -q rmidi/3,0,0 -q rmidi/3,0,1 -q rmidi/3,0,2 <your-other-options>
> this will map what programs refer to as "midi/0", "midi/1", ... to
> above.

OK, even a bit weirder, I have now been able to get my Roland keyboard 

$ amidi -l
Dir Device    Name
IO  hw:3,0,0  A-PRO MIDI
IO  hw:3,0,1  A-PRO 1
I   hw:3,0,2  A-PRO 2


$ midicat -d -q rmidi/3,0,1 -q midithru/0

however, the little

$ amidi -l
Dir Device    Name
IO  hw:3,0,0  LPK25 MIDI 1

still only works with

$ midicat -d -q midi/3 -q midithru/0

rather than "rmidi".

Another try with the Roland keyboard (without reboot) only works with 
"rmidi". "sndiod" still doesn't do anything, nor does the "-i" variable, 
it has to be "midicat". With audio output set to sndio "snd/0" in the 
LMMS preferences, the audio is slightly laggy with the SF2 plugin.

Using $ midicat -d -q rmidi/3,0,2 -q midithru/0 gives me the following:
ALSA lib rawmidi_hw.c:352:(snd_rawmidi_hw_open) open /dev/snd/midiC3D0 
failed: No such device
could't open port: No such device
rmidi/3,0,2: couldn't open port

Despite there clearly being a listing for:
I   hw:3,0,2  A-PRO 2.
Received on Sun Apr 09 2023 - 14:08:36 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 10 2023 - 01:30:01 CEST