Re: Routing MIDI controllers with sndio on Linux.

From: Brian Durant <contact_at_anarchosaxophonist.org>
Date: Sat, 8 Apr 2023 17:49:31 +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, this is really weird. Anything with

"sndiod -q midi or rmidi/a single number or three numbers separated by 
comas"

just returns a new command line.

"midicat -d -q midi or rmidi/a single number or three numbers seperated 
by comas"

returns

"couldn't open port",

but sometimes returns,

"ALSA lib rawmidi_hw.c:352:(snd_rawmidi_hw_open) open /dev/snd/midiC1D0 
failed: No such file or directory
could't open port: No such file or directory",

depending on the number/numbers value entered after "mid/" or "rmidi".

All of the above relates to the Roland A-800 PRO MIDI controller.

However, issuing the following command with the little AKAI LPK25 MIDI 
controller plugged in instead, listed as:

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

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

works with LMMS. The LMMS version is 1.2.2 and Void Linux is a rolling 
release and up to date...

Audio output set to sndio "snd/0" in the LMMS preferences only works 
some of the time. Other times, I have to set the audio preferences to 
ALSA. I assume this has something to do with sndio and what it perceives 
as the sound source, which may be registered differently if I use 
Firefox to search for some information (?)

Note that the commands above have been issued after a reboot, if I 
switched MIDI controllers, plus a couple of instances where LMMS froze 
during the start-up process.
Received on Sat Apr 08 2023 - 17:49:31 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 09 2023 - 01:30:01 CEST