Keyboard not recognized as MIDI input via USB

I have a Yamaha P-115 keyboard with USB MIDI output. I setup Zynthian on a Raspberry PI v4 with no other hardware, so was hoping to get the keyboard recognized through the USB. Unfortunately I cannot seem to get Zynthian to recognize any MIDI input at all coming from the Yamaha. The MIDI log is completely blank.

I entered this in the Zynthian terminal to see the connection properties:

amidi -p hw:0,0,0 -d

Here is the response:

ALSA lib rawmidi_hw.c:233: (snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: Device or resource busy cannot open port "hw:0,0,0": Device or resource busy

Any thoughts as to what else I may need to configure in order to get Zynthian to recognize MIDI input coming from the USB?


Hi @tkc - welcome to the community. I hope you will enjoy your Zynthian adventure.

The command you used tried to dump output from a specific MIDI port (which may not be the one you want) which is already in use, e.g. Zynthian may have captured it.

To get the list of available MIDI ports enter into the console:

amidi -l

Also watch what happens as you plug in your USB keyboard after entering:

dmesg -w

which shows the kernel messages. You should see activity as you plug in the keyboard.

What version of Zynthian have you installed? (Which image did you flash to the sdCard?)

[Edit] I observe the P-115 has Windows drivers for its USB connectivity. This may indicate it is not class compliant which may cause an issue but try the above and let’s see what we find.

I think it’s nice to have something to visualise during these threads . . .

What yamaha say . . .

Sadly not much . . . :frowning:

Yamaha’s literature is contradictory. It gives a MIDI spec but says the device does not have MIDI interface. It says you can move SMF files over USB but does not mention MIDI over USB (well it kinda does but doesn’t). Very confusing but I hope we can find a solution for you.

Thanks much for getting back to me.

I entered amidi -l into the console and got this response

Dir Device    Name                                                                                                               
IO  hw:0,0    f_midi                                                                                                             

I then entered dmesg -w, then plugged in the Yamaha P-115 into the USB slot. There was no activity, so I guess that suggests that the Yamaha is sending a message that the Raspberry Pi doesn’t understand. If it would be helpful I could post everything returned by the dmesg output, but if the essential question is whether there is any activity registered when the keyboard USB is plugged in, the answer is no.

I have installed Zynthian from the 2021-03-25-zynthianos-stable-2103.img image and configured it per the very helpful instructions provided in Beginners Headless Zynthian Tutorial - ZynthianWiki. I ran the software update after installing and have ran it again for good measure. I also ran sudo apt update and sudo apt upgrade.

Please let me know if you have any other suggestions. Thanks again for your help!


UPDATE: I forgot to mention earlier that I have successfully used the Yamaha P-115 to send MIDI to my Windows computer, so I know that it sends MIDI, just don’t know whether it sends MIDI in a format that the Raspberry Pi will recognize.

I believe it should send midi over usb. This P-115 midi ref may help clear things up. Are you sure your USB cable is good?

I have woken up MIDI devices by sending them a midi message which kick them into life

Thanks, I will try another USB cable and see if that helps. I have used this cable before to send MIDI to a Windows machine and it worked, so I know that the Yamaha P-115 sends MIDI in some manner.

Might I have bungled the Zynthian configuration somehow by running these steps?

sudo apt update
sudo apt upgrade

If so, I could try starting over with re-imaging the SD card from 2021-03-25-zynthianos-stable-2103.img.

I will first though try a different USB cable to see if perhaps that’s all it is.

Thanks again for all your help!


You must not do apt upgrade. It will break Zynthian. You will need to reflash the image. There is a later version than you have.

I would expect something in dmesg even if the device is not recognised, Zynthian should detect a device being plugged in. Confirm you see something when you plug another USB device, e.g. a mouse or memory stick.

Thanks Riban, that must be it then. I tried plugging a mouse in and that didn’t register either, so running upgrade must have been the culprit. I’ll re-flash and try again.

The re-flash fixed it, everything is now working. Thanks everyone for all your help!


1 Like

That is great. We are working on resolving the issue with apt upgrade but it isn’t highest priority. My old friend @wyleu would now ask you to click on the :face_with_monocle: then offer a sacrificial audio recording by way of thanks to the gods that created this awesome device. Please oblige his whim.

I will happily oblige this weekend.

Another image for the graphic novel fans: Control change transmission toggle;
Screen Shot 2021-05-17 at 7.29.39 AM

Probably not Zynthian related, a how to setup a pi as a midi host video.

A 2016 forum comment:
“some Yamaha keyboards in the Portable Grand line may not support USB MIDI class and need a custom driver; I’m not sure if linux supports these.”

(I see some Yamahas with built in speakers that can play audio passed in over USB, which could be a source of confusion or conflict, saw a report of going silent after 8 minutes, will also shut down itself as if it didn’t detect any USB connect after 15 minutes.)

Another 2018 forum reply:

Most Yamaha keyboards that I’ve encountered are NOT USB MIDI class compliant (a couple of their newer, more expensive ones are, and at least the latest versions of the MX workstation have been upgraded to be class compliant)…Yamaha’s P115 online pages don’t say anything about class compliance, and their P115 downloads page lists a computer driver that can be downloaded - which usually means that the instrument is not class compliant, since if it is you don’t need a driver…

Only a Windows driver was offered for the P115, a glanced through the main user manual for the P115, seemed to only mention data backed up via USB.

uh oh. That is scary.

I spent a lot of time wrestling with getting vnc server to work properly on current Zynthian image. Wiki steps said to use raspi-config to enable VNC, and it did a lot of apt stuff, including getting stuck yesterday on not finding an image for one of the libraries, which came back to raspi-config saying it failed to setup vncserver. But today it succeeded, and vnc finally connects to Zynthian.

I was really surprised i had to go through all that. I couldnt think of a good reason the Zynthian image shouldnt be delivered with all that already done. Checking the vnc server in the web.config, and rebooting, definitely was not enough to get vnc server to connect.

How could I check for the brokenness than running apt upgrade might cause?

apt upgrade will update some libraries and application which Zynthian needs to be at a particular version or with bespoke patches. After apt upgrade the Zynthian won’t run. You may get the error screen.

Out of the box Zynthian offers VNC server for ancillary views, i.e. engine GUIs, patchage, terminal, etc. Not the main UI. There is a feature request to enable main UI via VNC. You should not have to jump through many hoops to get VNC working.

As promised, here’s my take on “Mercy, Mercy, Mercy” by Joe Zawinul: