-   Linux - Hardware (
-   -   How do I get my keyrig 49 to work? (

hedron 07-02-2011 07:53 PM

How do I get my keyrig 49 to work?
What am I supposed to modprobe?

It says it needs to be enabled in the kde sound info control panel. (Synth devices: NOT ENABLED IN CONFIG) How do I do this? It doesn't say anything about midi devices though.

When I open qsynth I get the following error:


Qsynth1: Failed to create the MIDI driver (alsa_raw).

No MIDI input will be available.



22:58:03.864 Qsynth1: Creating synthesizer engine...
22:58:03.893 Qsynth1: Creating audio driver (alsa)...
22:58:03.938 Qsynth1: Creating MIDI router (alsa_raw)...
22:58:03.939 Qsynth1: Creating MIDI driver (alsa_raw)...
22:58:03.941 Qsynth1: Failed to create the MIDI driver (alsa_raw). No MIDI input will be available.
fluidsynth: warning: Requested a period size of 64, got 940 instead
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failedfluidsynth: warning: Failed to set thread to high priority
: No such file or directory
fluidsynth: error: Error opening ALSA raw MIDI port

On a somewhat related note, I cannot seem to play audio in alsa mode with XMMS. I get the error: "Please check that: Your soundcard is configured properly You have the correct output plugin selected No other program is blocking the soundcard" I have to use OSS emulation in order to play music. Amarok works, but I can't figure out whether it's using OSS or alsa.

EDDY1 07-03-2011 02:35 PM
Check in dmesg to see if device is being recognized, on the older systems it was said that you have to install firmware, on the new linux releases it's supposed to recognize automatically.
Usually in my experiences, when there is no file or directory it has been because I didn't have permissions in place, you may need to chmod or chown withh write permissions, which I personally can't give you, maybe someone her can help you with the command.
But in the mean time post output of "dmesg" & "lsusb"

hedron 07-04-2011 11:51 AM



usb 6-1: new full speed USB device using uhci_hcd and address 3
usb 6-1: New USB device found, idVendor=0763, idProduct=019b
usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 6-1: Product: KeyRig 49
usb 6-1: Manufacturer: M-Audio
usbcore: registered new interface driver snd-usb-audio

lsusb -s 6:3 -v

Bus 006 Device 003: ID 0763:019b Midiman KeyRig 49
Device Descriptor:
  bLength                18
  bDescriptorType        1
  bcdUSB              1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass        0
  bDeviceProtocol        0
  bMaxPacketSize0        8
  idVendor          0x0763 Midiman
  idProduct          0x019b KeyRig 49
  bcdDevice            1.00
  iManufacturer          1 M-Audio
  iProduct                2 KeyRig 49
  iSerial                0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                9
    bDescriptorType        2
    wTotalLength          72
    bNumInterfaces          2
    bConfigurationValue    1
    iConfiguration          0
    bmAttributes        0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                9
      bDescriptorType        4
      bInterfaceNumber        0
      bAlternateSetting      0
      bNumEndpoints          0
      bInterfaceClass        1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0
      iInterface              0
      AudioControl Interface Descriptor:
        bLength                9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC              1.00
        wTotalLength            9
        bInCollection          1
        baInterfaceNr( 0)      1
    Interface Descriptor:
      bLength                9
      bDescriptorType        4
      bInterfaceNumber        1
      bAlternateSetting      0
      bNumEndpoints          1
      bInterfaceClass        1 Audio
      bInterfaceSubClass      3 MIDI Streaming
      bInterfaceProtocol      0
      iInterface              0
      MIDIStreaming Interface Descriptor:
        bLength                7
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC              1.00
        wTotalLength          36
      MIDIStreaming Interface Descriptor:
        bLength                6
        bDescriptorType        36
        bDescriptorSubtype      2 (MIDI_IN_JACK)
        bJackType              2 External
        bJackID                2
        iJack                  0
      MIDIStreaming Interface Descriptor:
        bLength                9
        bDescriptorType        36
        bDescriptorSubtype      3 (MIDI_OUT_JACK)
        bJackType              1 Embedded
        bJackID                3
        bNrInputPins            1
        baSourceID( 0)          2
        BaSourcePin( 0)        1
        iJack                  0
      Endpoint Descriptor:
        bLength                9
        bDescriptorType        5
        bEndpointAddress    0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type              None
          Usage Type              Data
        wMaxPacketSize    0x0040  1x 64 bytes
        bInterval              0
        bRefresh                0
        bSynchAddress          0
        MIDIStreaming Endpoint Descriptor:
          bLength                5
          bDescriptorType        37
          bDescriptorSubtype      1 (GENERAL)
          bNumEmbMIDIJack        1
          baAssocJackID( 0)      3
Device Status:    0x0000
  (Bus Powered)

EDDY1 07-04-2011 12:40 PM

From what I see the device is recognized so you have to enable it in the control panel, which I provided link in previous post.

hedron 07-04-2011 07:04 PM


~ $ kcontrol
bash: kcontrol: command not found

Isn't there just a simple, 1 2 3 bam! midi is configured guide on the internet? I have searched.

When I open qsynth, there is a drop down menu in the midi tab called: MIDI device. It should have an option for keyrig49 or K49 or similar. Same in the audio tab there should be option in the audio device. But there isn't.

EDDY1 07-05-2011 01:45 AM

You have to issue command as root, thru root terminal or using su.
I believe after you enable device directory will be created.

su -c kcontrol &

Shadow_7 10-22-2012 04:04 AM

A bit dated. But it looks like your device was recognized. As long as you have the 49e model anyway. Which I do and find myself in a similar boat.

$ cat /proc/asound/cards

You should see an entry for K49e there, which means your midi device is just fine and dandy. Recognize and a driver for it loaded at least. In the short term timidity is a lot simpler and less quirky to just use to verify that your "hardware" is all there and accounted for.

$ timidity -Oj -iA
(for using jack anyway. -Os for alsa and other options)

Although the way I've been able to route the midi to the software synth to date is with rosegarden. Under the Studio menu option is the option to control routing. Again with timidity is just works, although soundfonts are quite limited.

I've gotten it working long long ago. But pulseaudio and udev now in the way, it's not so simple. I've gotten past the running jack AND pulseaudio hurdle handled now at least.

And qsynth and fluidsynth seem to be running just fine. But like you the K49 isn't listed where it should be. And even running fluidsynth directly to play a midi file outputs no sound. Although I seem to recall having to edit some midi file to specifically assign channel and program / patch to have that work before. From what I recall from days of old you have to load a soundfont and tell it which channel and stuff. Probably from the midi tab that lacks the K49 entry. I'm still getting back up to speed with the new ways of doing stuff.

My current huntch is that udev isn't creating the /dev/ entry for the midi device. As I doubt that /dev/snd/seq is sufficient. Missing the old ways of running that snd-devices script from the alsa-driver sources. I'll try to update here when it works for me. I have gotten it going before under debian with relative ease. But ubuntu is just one big troll when it comes to using midi by the looks of it. Not even ubuntustudio gets this right (yet). At least not for me. So many post boot / post installation steps these days. But at least I didn't have to compile anything (yet) this time around.

Shadow_7 10-22-2012 02:12 PM

With pulse playing with jackd. I can run timidity and get results. One more option as far as connecting keyboard to synth I guess.

$ timidity -Oj -iA

$ aconnect -i

client 0: 'System' [type=kernel]
    0 'Timer          '
    1 'Announce        '
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 28: 'Keystation 49e' [type=kernel]
    0 'Keystation 49e MIDI 1'

$ aconnect -o

client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 28: 'Keystation 49e' [type=kernel]
    0 'Keystation 49e MIDI 1'
client 128: 'TiMidity' [type=user]
    0 'TiMidity port 0 '
    1 'TiMidity port 1 '
    2 'TiMidity port 2 '
    3 'TiMidity port 3 '

$ aconnect 28 128

And this works fine. Key input form 49e triggers piano sound from timidity.

$ aconnect -i -l
$ aconnect -i -o

To verify the connection is made.


So far fluidsynth seems to run. And run fine, but I've yet to get a sound out of it. And that aconnect app seems to do all the same stuff. But no joy in terms of a generated sound from fluidsynth. So much like origami instructions. There's a step missing somewhere. Or a file. Or a compile option.

Shadow_7 10-22-2012 02:35 PM

Adding the -g 1 option seems to output sound now. I guess gain is set too low to hear anything by default.


set synth.gain 1
The above if you're at the fluidsynth command line. In combination with the aconnect parts, and I have sound. It's patch 1 program 1 aka piano, and I want drums but at least I know all the hardware and drivers are there and works.

$ fluidsynth -C no -R no -a jack -g 1 -j /usr/share/sounds/sf2/FluidR3_GM.sf2

For my current rendition of things. Adding a midi file after all those options plays the midi file.

Shadow_7 10-22-2012 03:56 PM

Annoying but functional.

Some fluidsynth interface things applicable to my uses.

> help
> help all
> help general
> help event
> settings

> select 0 1 128 048
(the redirection of the keyboard to the soundfont for the drums)
where 0 is the default input aka the 49e (might be related to synth.device-id)
where 1 is the ID of the sound font
> fonts

ID Name
 1 /usr/share/sounds/sf2/FluidR3_GM.sf2

where 128 048 is the actual sounds in that font
> inst 1
(where 1 is once agin the ID of the font)

(really long list)...
128-048 Orchestra Kit

With a simpler gain at the cli.
> gain 1

And like most things cli you can Shift+PgUp and Shift+PgDown to scroll through the lists. Plus up and down cursors to scroll through the history of past commands. Hopefully that's enough to get most folks started at least.

Shadow_7 12-17-2012 01:36 PM

I guess I finally found peace with pulse audio.

in file /etc/pulse/client.conf

autospawn = no
This allows one to start and stop pulseaudio.

$ pulseaudio --start
$ pulseaudio --kill
(note that --stop is NOT a valid option)

At which point you're mostly free to run old school with jack on the command line.

$ pulseaudio --kill
$ jackd -d alsa -d hw:0 -r 44100

$ fluidsynth -j -a jack -r 44100 -gain 1 -o audio.periods=2 /usr/share/sounds/sf2/FluidR3_GM.sf2

$ aconnect -o -l
$ acconect 28 128
(or whatever numbers apply for the midi input and port for fluidsynth)

Things to look out for:

(if it's configured for pulse, you might want to disable it by renaming it)
(be sure to name it back when you want to use pulse again)

padsp firefox
(this will not start pulse, but wont fail to run either. pulseaudio --start before for full audio)

openjdk / icedtea-web
(your distro likely packages these around pulseaudio, so it's adviseable to have it running)
(otherwise your favorite games might be silent or only giving you part of the audio element)

All times are GMT -5. The time now is 06:33 PM.