0

According to How create a second midi device? n´one can create multiple virmidi devices, but that does not seem to work for me - according to aconnect -l I get exactly one:

client 14: 'Midi Through' [type=Kernel]
    0 'Midi Through Port-0'

This is the config (and the options) I've tried.

> cat /etc/modules-load.d/90-virmidi.conf
snd-virmidi
# check params:
> /usr/sbin/modinfo snd-virmidi

# configure the module
# attempt #1
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi enable=1,1 midi_devs=1,1
# attempt #2
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi index=0 enable=1 midi_devs=1
options snd-virmidi index=1 enable=1 midi_devs=1
# attempt #3
> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi index=0,1 enable=1,1 midi_devs=2,2
# reboot
# check params:
> cat /sys/module/snd_virmidi/parameters/*
Y,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N
(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4

A few things that I find confusing:

  • lsmod shows the module as "snd_virmidi", but the file is snd-virmidi.ko - I am not sure which speling needs to be used in the config
  • I have fou d not way to check from logs if the /etc/modprobe.d/90-virmidi.conf is used or not.

Any ideas what I am missing?

1 Answer 1

1

Have you tried this exactly as in the Q&A you linked?

The first step is to run modprobe directly, to verify the driver works. If I do that on my machine, I get

$ sudo modprobe snd-virmidi enable=1,1,1,1,1 midi_devs=1,1,1,1,1
$ ll /dev/midi*
crw-rw---- 1 root audio 14, 18 Dez 29 19:52 /dev/midi1
crw-rw---- 1 root audio 14, 34 Dez 29 19:52 /dev/midi2
crw-rw---- 1 root audio 14, 50 Dez 29 19:52 /dev/midi3
crw-rw---- 1 root audio 14, 66 Dez 29 19:52 /dev/midi4
crw-rw---- 1 root audio 14, 82 Dez 29 19:52 /dev/midi5

So that works. If it also works on your machine, the next step is to create your config file

> cat /etc/modprobe.d/90-virmidi.conf
options snd-virmidi enable=1,1 midi_devs=1,1

and then run modprobe snd-virmidi. Because options only sets the default options, it doesn't insert the kernel module.

If you want the module to get inserted on boot, then there are various ways for that, so you'd need to decide which way works best for you. That depends on your use case (what do you need the virtual MIDI interfaces for?), which you have not explained.

6
  • Thanks - we're getting there. Somehow the options are not applied at boot time for me:.See gist.github.com/ensonic/645e74acfc11ad78a61d0d9fe6e9aee3 Commented Dec 30, 2021 at 14:39
  • So how is snd-virmidi loaded at boot on your system? Commented Dec 30, 2021 at 14:54
  • This is the big question. I am now suspecting udev - udevadm info --query=path --name=/dev/midi /devices/platform/snd_virmidi.0/sound/card0/midi Thanks for all the help. I'll give up on this for now. To answer the earlier question. I wanted a 2nd vimidi to sync two apps where one only support raw-midi. Commented Dec 30, 2021 at 16:27
  • Ohhh my. I was missing 'sudo mkinitrd' . Commented Dec 30, 2021 at 16:49
  • You can also try JACK for raw midi devices, if you can't get ALSA to work. Commented Dec 30, 2021 at 17:18

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.