# Can't get midi to work

## furanku

Hi!

I just bought a cheap "Genius Sound Maker Value 5.1" (CM8738 chip based) to use it just as a midi interface. The card has a MPU401 compatible midi interface. It is the third sound device in my computer (onboard sound intel8x0, DVB-T card cx88). I had to set PCI configuration form AUTO to MANUAL in my BIOS when installing the card, cause otherwise my WLAN card stopped working. In the BIOS (MS-7025 with Phoenix 6.00 PG Bios) I can't see any possibilties to set interrupts or IO base addreses manually. After that all other cards worked as before and I can see the card in lspci or lshw and the drivers load without any error messages.

Although all modules seem to load fine now I can't connect an external midi keyboard to a soft synth in kaconnect or qjackctl. The line indicating the connection shortly appears and vanishes immediatly. The message "midi depgraph changed" is shown in qjackctl but no bytes are received or send over the interface. I can't see any  error messages in the syslogs. I already tried to give all possible mpu_base location (0x300, 0x310, 0x320 and 0x330) as parameter to the kernel module. aadebug gives the following informations, which look to me as it should work:

Kernel:

```
Linux FranksDesktop 2.6.19-gentoo-r1 #2 SMP PREEMPT Tue Dec 12 22:38:4

9 CET 2006 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ AuthenticAMD GNU/Linux
```

Loaded modules:

```
snd_seq_midi           11968  0

snd_opl3_synth         19716  0

snd_seq_instr          10944  1 snd_opl3_synth

snd_seq_midi_emul      10176  1 snd_opl3_synth

snd_ainstr_fm           5120  1 snd_opl3_synth

snd_pcm_oss            50784  0

snd_mixer_oss          21376  1 snd_pcm_oss

snd_seq_oss            38784  0

snd_seq_midi_event     11136  2 snd_seq_midi,snd_seq_oss

snd_seq                64256  8 snd_seq_midi,snd_opl3_synth,snd_seq_instr,snd_seq_midi_emul,snd_seq_oss,snd_seq_midi_event

snd_cmipci             43264  1

snd_opl3_lib           14336  2 snd_opl3_synth,snd_cmipci

snd_hwdep              13768  1 snd_opl3_lib

snd_mpu401_uart        12288  1 snd_cmipci

snd_rawmidi            31328  2 snd_seq_midi,snd_mpu401_uart

snd_intel8x0           40232  2

snd_seq_device         11412  6 snd_seq_midi,snd_opl3_synth,snd_seq_oss,snd_seq,snd_opl3_lib,snd_rawmidi

snd_ac97_codec        115224  1 snd_intel8x0

snd_ac97_bus            5120  1 snd_ac97_codec

snd_pcm                95688  5 snd_pcm_oss,cx88_alsa,snd_cmipci,snd_intel8x0,snd_ac97_codec

snd_timer              28680  3 snd_seq,snd_opl3_lib,snd_pcm

snd                    70888  24 snd_opl3_synth,snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,cx88_alsa,snd_cmipci,snd_opl3_lib,snd_hwdep,snd_mpu401_uart,

    snd_rawmidi,snd_intel8x0,snd_seq_device,snd_ac97_codec,snd_pcm,snd_timer

snd_page_alloc         13008  2 snd_intel8x0,snd_pcm

```

Sound related kernel config:

```
CONFIG_SOUND=y

CONFIG_SND=m

CONFIG_SND_TIMER=m

CONFIG_SND_PCM=m

CONFIG_SND_HWDEP=m

CONFIG_SND_RAWMIDI=m

CONFIG_SND_SEQUENCER=m

CONFIG_SND_SEQ_DUMMY=m

CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=m

CONFIG_SND_PCM_OSS=m

CONFIG_SND_PCM_OSS_PLUGINS=y

CONFIG_SND_SEQUENCER_OSS=y

CONFIG_SND_RTCTIMER=m

CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y

CONFIG_SND_SUPPORT_OLD_API=y

CONFIG_SND_VERBOSE_PROCFS=y

CONFIG_SND_MPU401_UART=m

CONFIG_SND_OPL3_LIB=m

CONFIG_SND_AC97_CODEC=m

CONFIG_SND_AC97_BUS=m

CONFIG_SND_VIRMIDI=m

CONFIG_SND_SERIAL_U16550=m

CONFIG_SND_MPU401=m

CONFIG_SND_BT87X=m

CONFIG_SND_CMIPCI=m

CONFIG_SND_INTEL8X0=m

CONFIG_SND_INTEL8X0M=m

```

Modprobe conf:

```
alias char-major-10-116 snd

alias char-major-14-* soundcore

alias char-major-116-* snd

alias snd-card-0 snd_intel8x0

alias snd-card-1 cx88_alsa

alias snd-card-2 snd_cmipci

alias sound-slot-0 snd_intel8x0

alias sound-slot-1 cx88_alsa

alias sound-slot-2 snd_cmipci

alias sound-service-0-0 snd-mixer-oss

alias sound-service-0-1 snd-seq-oss

alias sound-service-0-3 snd-pcm-oss

alias sound-service-0-8 snd-seq-oss

alias sound-service-0-12 snd-pcm-oss

alias sound-service-1-0 snd-mixer-oss

alias sound-service-1-3 snd-pcm-oss

alias sound-service-1-12 snd-pcm-oss

alias sound-service-2-0 snd-mixer-oss

alias sound-service-2-1 snd-seq-oss

alias sound-service-2-3 snd-pcm-oss

alias sound-service-2-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss

alias /dev/dsp snd-pcm-oss

alias /dev/midi snd-seq-oss

options snd cards_limit=3

options snd_intel8x0 index=0

options snd_cmipci index=2 mpu_port=0x330 fm_port=0x388

```

Proc asound:

```
dvanced Linux Sound Architecture Driver Version 1.0.13 (Tue Nov 28 14:07:24 2006 UTC).

 0 [CK8S           ]: NFORCE - NVidia CK8S

                      NVidia CK8S with ALC850 at 0xfe02b000, irq 21

 1 [CX8811         ]: CX88x - Conexant CX8811

                      Conexant CX8811 at 0xf9000000

 2 [CMI8738MC6     ]: CMI8738-MC6 - C-Media PCI CMI8738-MC6

                      C-Media PCI CMI8738-MC6 (model 55) at 0x8c00, irq 18

  0: [ 0]   : control

  1:        : sequencer

 16: [ 0- 0]: digital audio playback

 18: [ 0- 2]: digital audio playback

 24: [ 0- 0]: digital audio capture

 25: [ 0- 1]: digital audio capture

 32: [ 1]   : control

 33:        : timer

 56: [ 1- 0]: digital audio capture

 64: [ 2]   : control

 68: [ 2- 0]: hardware dependent

 72: [ 2- 0]: raw midi

 80: [ 2- 0]: digital audio playback

 81: [ 2- 1]: digital audio playback

 82: [ 2- 2]: digital audio playback

 88: [ 2- 0]: digital audio capture

 90: [ 2- 2]: digital audio capture

02-00: OPL3 FM

00-02: Intel ICH - IEC958 : NVidia CK8S - IEC958 : playback 1

00-01: Intel ICH - MIC ADC : NVidia CK8S - MIC ADC : capture 1

00-00: Intel ICH : NVidia CK8S : playback 1 : capture 1

02-02: CMI8738-MC6 : C-Media PCI IEC958 : playback 1 : capture 1

02-01: CMI8738-MC6 : C-Media PCI 2nd DAC : playback 1

02-00: CMI8738-MC6 : C-Media PCI DAC/ADC : playback 1 : capture 1

01-00: CX88 Digital : CX88 Digital : capture 1

Client info

  cur  clients : 4

  peak clients : 4

  max  clients : 192

Client   0 : "System" [Kernel]

  Port   0 : "Timer" (Rwe-)

  Port   1 : "Announce" (R-e-)

    Connecting To: 15:0

Client  15 : "OSS sequencer" [Kernel]

  Port   0 : "Receiver" (-we-)

    Connected From: 0:1

Client  24 : "C-Media PCI CMI8738-MC6" [Kernel]

  Port   0 : "MPU-401 MIDI 2-0" (RWeX)

Client  25 : "OPL3 FM synth" [Kernel]

  Port   0 : "OPL3 FM Port" (-We-)

  Port   1 : "OPL3 OSS Port" (-we-)

```

Dev snd:

```
controlC0  hwC2D0    pcmC0D0p  pcmC1D0c  pcmC2D1p  seq

controlC1  midiC2D0  pcmC0D1c  pcmC2D0c  pcmC2D2c  timer

controlC2  pcmC0D0c  pcmC0D2p  pcmC2D0p  pcmC2D2p

```

Hardware:

```
00:00.0 Host bridge: nVidia Corporation nForce3 250Gb Host Bridge (rev a1)

00:06.0 Multimedia audio controller: nVidia Corporation nForce3 250Gb AC'97 Audio Controller (rev a1)

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

02:08.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)

02:09.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)

02:09.1 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port] (rev 05)

02:09.2 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)

02:09.4 Multimedia controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder [IR Port] (rev 05)

```

----------

## furanku

Sorry for relpying to myself!

I found some others having the same problem. In the CMedia forums it is rumored that the problem could be between the CMedia Chip and the nForce3 chipset. Is there anywhere I could look or anything (except for putting the soundcard in another computer, as I just have this one) I could try to see whether this is the reason or not?

----------

## furanku

Really no help available?

I asked in the manufactors forum, found an ubuntu user with the same problem, on the alsa-user mailing list but never got any reply ...   :Crying or Very sad: 

----------

## Gentree

do you need both sound cards?

I found things get very confused with the games port when using dual sound cards. I seem to recall reading the onboard device grabs the IO space or something. In any case the joysick port ended up on the onboard which did not even have one.

These onboard AC97 things are generally crap IMHO , if you can do without it disable it in BIOS.

 :Cool: 

----------

## furanku

The first answer!  :Smile:  I began to think that I'm invisible ...

Thanks, but disabling the "AC97" option on the "integrated periphials" page in the BIOS didn't change anything, sorry!

I finally filed a bug report to the alsa project, but as you can guess ... no reaction up to now.

----------

## titian

Hi!

I bought a device with the same chipset for the same purpose. I didn't even get MPU401 output under windows, so I thought I was ripped off and the device didn't support it. But that isn't the case at all: You just have to activate the interface.

For those who get here on this thread when they don't get MIDI input/output  through the gameort (aka MPU401):

The snd-cmipci module needs arguments in order to do it. I found this: http://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg13018.html.

I figured I need to load the module like this:

```
$ rmmod snd-cmipci

$ modprobe snd-cmipci mpu_port=0x330
```

(rmmod because the module is autoloaded at startup; I don't know how to change the arguments for modules loaded at startup time;

all applications using sound have to be stopped [rhythmbox can be paused], otherwise you will get "device is busy")

And now I can use qjackctl and timidity and jack-rack and rosegarden and stuff to get neat sound and everything in realtime. I googled like crazy for the URL I linked to, and it was well worth the efford.  :Laughing: 

Please NOTE that I don't know what the hex number for the port ("0x330") means; I just tried it and it worked on my cheap PCI device.

----------

## furanku

Whew, an answer after such a long time ...   :Smile:  I tried to set the mpu port address at that time as well, with no success.

Actually there really was a bug in the alsa driver at that time i started this thread, see this bug report, which was fixed in the beginning of the last year. Since I changed a lot of hardware I didn't tried to get midi working with the old cmi card, so thanks for your answer, maybe I'll try it again if it works now.

----------

## titian

Well I mostly posted for those people who wonder why they don't have the MPU401 interface although their C-Media card supports it. I thought that the case might have been different 2 years ago (it was), but it's still strange that the interface isn't activated by default...

----------

## furanku

To set the base adress for communication with the mpu (which is what the 0x330 means) you have to edit /etc/conf.d/modules (if you're using the newer baselayout version 2). Add the lines

```
modules_2_6="${modules_2_6} snd_cmipci"

module_snd_cmipci_args_2_6="mpu_port=0x330"

```

See the Baselayout and OpenRC Migration Guide for details.

[Edit] Just tried it again, it still doesn't work, so I guess my card is simply broken.

----------

