[linux-audio-user] Connecting to external midi device

From: Adrian Blockley <adrian@email-addr-hidden>
Date: Sun Feb 19 2006 - 11:12:41 EET

G'day all,

I am trying to connect to an external midi device (casio CTK-900
keyboard) through a cheap soundcard (Cmedia 3738 chip) with
midi interface. I have managed to get this working under Windows XP and
can at least get Midi files to play through the keyboard, so in principal
it could also work in Linux but I haven't quite managed to get this
working.

Sound in general works fine and I have now successfully managed to connect
to the software synth, Timidity, using Rosegarden and aplaymidi. I have
tried a number of things but can't get the connection to the harware
synthesiser to work.

Alsa config in modules.conf:
# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
alias sound-slot-0 snd_cmipci
options snd-cmipci id="first" mpu_port=0x330

# OSS/Free portion - card #1
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-12 snd-pcm-oss

cat /proc/asound cards produces the following:
 0 [first ]: CMI8738-MC6 - C-Media PCI CMI8738-MC6
                      C-Media PCI CMI8738-MC6 (model 55) at 0xd000, irq 10

running lsmod produces a lot of output which I won't copy just yet but it
does include the line:

snd_mpu401_uart 6400 1 snd_cmipci

I am using qjackctl to run jack using the following command:
/usr/bin/jackd -R -dalsa -dhw:0 -r44100 -p512 -n2 -i2 -o2

linux kernel = 2.6.15-nitro2 (Gentoo)

aconnect -io produces the following:

client 0: 'System' [type=kernel]
    0 'Timer '
    1 'Announce '
client 16: 'MPU-401 MIDI 0-0' [type=kernel]
    0 'MPU-401 MIDI 0-0'
client 17: 'OPL3 FM synth' [type=kernel]
    0 'OPL3 FM Port '
client 128: 'TiMidity' [type=user]
    0 'TiMidity port 0 '
    1 'TiMidity port 1 '
    2 'TiMidity port 2 '
    3 'TiMidity port 3 '

Running
aplaymidi --port 16:0 mysong.MID

produces no output or error message but the following is printed using
dmesg:

cmd: 0xff failed at 0x330 (status = 0xff, data = 0xff)
cmd: 0x3f failed at 0x330 (status = 0xff, data = 0xff)

My guess is that the midi i/o port address is wrong. Now i don't
understand a great deal about PCI but my guess is that the midi i/o port
address on the sound card probably isn't 0x330 (please note I've also
tried 300, 310 and 320). Are other addresses possible? I've tried using
the Windows device manager to find out what address port I should be using
but i can only find the address of the sound card and not the mpu401.

Does anyone have any suggestions as to what I am doing wrong or where to
proceed from here (my thoughts are another sound card but I am trying to
avoid doing that just yet...)?

Cheers

Adrian

-- 
"There are only 10 kinds of people in the world: Those who 
understand binary, and those who don't."
Adrian  Blockley	 
32 Darwinia Loop 
Canningvale WA, 6155
Ph: 08 9256 1953
Mobile: 0405 609 990
Received on Sun Feb 26 20:15:37 2006

This archive was generated by hypermail 2.1.8 : Sun Feb 26 2006 - 20:15:37 EET