# Howto install an M-Audio USB MIDI Keyboard!!!  IT WORKS!

## BeanDip

VERY easy, thought I'd point folks in the right direction.  First of all, make sure you have hotplug and all working and usb-audio and the alsa usb-audio drivers compiled as modules in your kernel.  I won't tell you how to do any of that here as it is very well documented elsewhere in the  forums and docs.  Simply go to http://usb-midi-fw.sourceforge.net/ and download the firmware loader.  Unpack it in a temp directory, next download your WINDOWS driver for your  keyboard from the following list:

   MidiSport 1x1/Uno:

http://www.m-audio.com/images/global/drivers/MS1x1_1010_web.exe

   MidiSport 2x2:

http://www.m-audio.com/images/global/drivers/MS2x2_1010_web.exe

   MidiSport 4x4:

http://www.m-audio.com/images/global/drivers/MS4x4_1010_web.exe

   MidiSport 8x8:

http://www.m-audio.com/images/global/drivers/MS8x8_1010_web.exe

   Keystation/Oxygen/Radium:

http://www.m-audio.com/images/global/drivers/KS1x1_1010_web.exe

if you have wine emerge'd run "wine FILENAME" where FILENAME is the name of the driver you just downloaded.  example for the Oxygen8 is "wine KS1x1_1010_web.exe"

This will open the windows driver installer which will fail after a series of screens, that's ok, what you ae doing is letting it extract needed files into wine's temp dir.  On a default emerge of wine this will be /tmp   Look in /tmp and find your firmware data file:   

   MidiSport 1x1/Uno:        USB11LDR.SYS

   MidiSport 2x2:            USB22LDR.SYS

   MidiSport 4x4:            USB44LDR.SYS

   MidiSport 8x8:            USB88LDR.SYS

   Keystation/Oxygen/Radium: UKS11LDR.SYS

(or you can do this in your windows boot and find the file to save for transfer to your gentoo box.)

move this file to the directory where you have extracted the firmware loader from http://usb-midi-fw.sourceforge.net/ and run as root "make install"

now plug in your keyboard and turn the power on.  on the Oxy8 switch it to usb-power, and you will see in dmesg something like this:

usb 2-2: new full speed USB device using address 3

usbcore: registered new driver snd-usb-audio

Yay!!! it works.  to verify run cat /dev/snd/midiC2D0  or whatever device it attached to, there are a few midiCxDx devices in this dir and it will be attached to one of them, while you are running the cat and pressing keys, you will see some garbage scroll on the screen, that's your MIDI data!!!  now you can make some music! or you can control some devices with lirc if you are clever enough... but that's another story.  Enjoy fellow musicians, I hope it has been a help.

----------

## Wilko

Just some ammedments:

For the  Keystation/Oxygen/Radium, I found it was impossible to get the .sys file using windows. It just didn't seem to create the file anywhere. I had to get it using wine.

Additionally, rather than getting success when I turned the device on and getting this "usbcore: registered new driver snd-usb-audio"

I got this: "midi: probe of 2-2:1.0 failed with error -5"

So I did tail -f /var/log/messages, and it said something about missing fxload.

I powered off the machine, and then emerged fxload.

And when I powered it back up.. Still no go, Now var/log/messages shows me that its partially working:

```

Feb 14 00:10:57 warrengentoo usb 2-2: new full speed USB device using uhci_hcd and address 5

Feb 14 00:10:57 warrengentoo midi: probe of 2-2:1.0 failed with error -5

Feb 14 00:10:57 warrengentoo /etc/hotplug/usb/midisport_fw: load /usr/share/usb/midisport/MidiSportKS.ihx for 763/1014/1 to /proc/bus/usb/002/005

Feb 14 00:11:03 warrengentoo usb 2-2: USB disconnect, address 5

Feb 14 00:11:04 warrengentoo usb 2-2: new full speed USB device using uhci_hcd and address 6

Feb 14 00:11:04 warrengentoo midi: probe of 2-2:1.0 failed with error -5

```

You can see the device comes up, gets identified, and has its firmware copied over too it. The device then disconnects, and is supposed to come up again and be detected.

I think I've tracked the problem down though,  this page (http://ccrma.stanford.edu/planetccrma/software/usbmidi.html) mentions that you need to blacklist usb-midi (usb-midi driver, non-alsa) and audio (oss audio) so they don't try to take over the usb device. Unfortunately I can't do that, because there compiled into the kernel. So I'm off to recompile the kernel.

I wasn't completely out of the woods yet, I had to undo some erronous changes I had made earlier.

in the file /etc/modules.d/alsa

I had sort of 'assumed' that I would need to specify the midi device here, so I had created an extra sound card that used snd-usb-audio as the driver. I don't think this hurt anything but it wasn't necessary.

The other, IMPORTANT, thing to do is to change

from: options snd card_limit 1

to: options snd card_limit 3 

if you have only a single sound card in the machine, the usb audio device seems to exists as two cards. If your limit isn't set high enough, the the driver for usb-snd-audio and snd-usb-lib won't be able to be created.

So a general rule of thumb, if it seems to be working, the driver is sent over to the device, but then nothing else happens, try upping your snd_limit.

----------

