I am having trouble getting a midi controller (piano keyboard) to work on a raspberry pi. It works on my linux laptop, and another midi keyboard does work on the pi. It is listed under lsusb, so I know the vendor/model id's, but not under amidi -l or aconnect -i. The pi also has a version of a few years old. So I am guessing that the udev does not know this usb device, yet. I already found out that udev uses some internal database with a lot of usb devices. But I could not find, yet, a how-to on adding a new usb device to the udev database.

I only see a lot of tutorials on how to add an udev rule, but that is, I guess, something else. I need to tell the system that this vender/model id is a midi controller.

How does this work?

1 Answer 1


udevd is just responsible for creating symlinks in /dev, running additional programs on creation or removal of devices etc. If you can't see the device in ALSA, no matter what you do with udevadm, you won't be able to get it recognized that way.

Hardware recognition by the kernel is baked into the corresponding modules. For USB in particular, there are patterns that encode the vendor and device id, and other things. You can find out what patterns a particular module will trigger on using modinfo.

So in your case, the RaspPi very likely doesn't have an up-to-date module for your piano keyboard - either the module already exists, but doesn't contain your piano keyboard identifiers, or maybe even the module isn't present.

So upgrade the kernel on the RaspPi to the newest version. If that doesn't solve the problem, identify the module that's reacting to your keyboard on your laptop (for that you can use udevadm, or just lsmod). Then have a look at what modinfo says for the corresponding module on your RaspPi.

  • Good explanation. I downloaded the linux kernel sources for the version on my laptop (4.15) and that on the pi (3.16) and found the usb vendor:model id in /sound/usb/midi.c but only in the new linux version. So I have to get a larger SD card required for the upgrade of the pi, the old version fits in 4GB, the new needs 8GB.
    – Roland
    Oct 14, 2018 at 21:02
  • 1
    Another option is to (cross-) compile just the kernel, disabling stuff you don't need (which needs a bit of experience). The kernel itself isn't that large. But just buying a new 8GB is a lot simpler, of course.
    – dirkt
    Oct 15, 2018 at 5:47
  • Quarter century ago I indeed routinely compiled linux kernels, when I considered the kernel as very large. There were no modules, so you had to configure the features that you needed. It is not that I got lazy, but the kernel on this Pi is 5 years old so it needs to be upgraded anyway. I will buy a micro-sd in an adapter, so I will be able to reuse it when I buy a newer model Pi.
    – Roland
    Oct 15, 2018 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .