Hard lock up when using ALSA midi in
Hi all,
I've been trying to use Rosegarden or Museseq to compose some music
and have discovered that, when software connects to the MIDI IN on my sound card, the machine locks up totally (a reboot is required).
I've done the following tests:
- Installed vkeybd (virtual midi keyboard) and fluidsynth (virtual
synth).
- Initially, aconnect shows the following as input and output MIDI
ports:
nige@sully ~ $ aconnect -i -o
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 16: 'MPU-401 MIDI 0-0' [type=kernel]
0 'MPU-401 MIDI 0-0'
- After starting vkeybd and fluidsynth:
nige@sully ~ $ aconnect -i -o
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 16: 'MPU-401 MIDI 0-0' [type=kernel]
0 'MPU-401 MIDI 0-0'
client 128: 'Virtual Keyboard' [type=user]
0 'Virtual Keyboard'
client 129: 'FLUID Synth (7495)' [type=user]
0 'Synth input port (7495:0)'
- Hooking together the keyboard and fluidsynth works (after loading a
soundfont into fluidsynth). Playing notes on the virtual keyboard makes audio from the sound card:
nige@sully ~ $ aconnect 128:0 129:0
- Disconnect fluidsynth and vkeybd and connect vkeybd to the MIDI port
(with a hardware synth attached). Playing notes on the virtual keyboard makes noises from the external synth:
nige@sully ~ $ aconnect -d 128:0 129:0
nige@sully ~ $ aconnect 128:0 16:0 - Trying to connect the MIDI port (with external keyboard attached) to
fluidsynth causes the system lock up:
nige@sully ~ $ aconnect 16:0 129:0
An even simpler way to get the system to lock up is to use aseqdump,
this can be done straight after boot up without having to start X or anything:
nige@sully ~ $ aseqdump -p 16:0
I presume that the system locking up means it's a kernel thing (in
either a module or the main kernel).
Oddly, it has worked in the past. Though possibly using OSS only
rather than ALSA (it was a while ago).
I have a C-Media 8378 card and am using cmipci as my sound card in the
kernel (2.6.16).
lspci | grep audio
00:0b.0 Multimedia audio controller: C-Media Electronics Inc CM8738
(rev 10)
My kernel config:
Device Drivers
Sound
<*> Sound card support
Advanced Linux Sound Architecture
<M> Advanced Linux Sound Architecture
<M> Sequencer support
<M> Sequencer dummy client
<M> OSS Mixer API
<M> OSS PCM (digital audio) API
[ ] OSS Sequencer API
[ ] Support old ALSA API
Generic devices
<M> Generic MPU-401 UART driver
PCI devices
<M> C-Media 8738, 8338
Open Sound System
< > Open Sound System (DEPRECATED)
Any insight into this problem or help getting it working again would
be greatly appreciated. I've definitely hit the limit of my understanding of how MIDI should work under ALSA!
Thanks in advance,
-Nige
Signature · 10 lines
Nigel Gilbert <[email protected]> ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
At Wed, 03 May 2006 11:33:27 +0100,
Quoted 63 lines · Nigel Gilbert
Hi all,
I've been trying to use Rosegarden or Museseq to compose some music
and have discovered that, when software connects to the MIDI IN on my sound card, the machine locks up totally (a reboot is required).I've done the following tests:
- Installed vkeybd (virtual midi keyboard) and fluidsynth (virtual
synth).- Initially, aconnect shows the following as input and output MIDI
ports:nige@sully ~ $ aconnect -i -o
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 16: 'MPU-401 MIDI 0-0' [type=kernel]
0 'MPU-401 MIDI 0-0'- After starting vkeybd and fluidsynth:
nige@sully ~ $ aconnect -i -o
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]0 'Midi Through Port-0'
client 16: 'MPU-401 MIDI 0-0' [type=kernel]
0 'MPU-401 MIDI 0-0'
client 128: 'Virtual Keyboard' [type=user]
0 'Virtual Keyboard'
client 129: 'FLUID Synth (7495)' [type=user]
0 'Synth input port (7495:0)'- Hooking together the keyboard and fluidsynth works (after loading a
soundfont into fluidsynth). Playing notes on the virtual keyboard makes audio from the sound card:nige@sully ~ $ aconnect 128:0 129:0- Disconnect fluidsynth and vkeybd and connect vkeybd to the MIDI port
(with a hardware synth attached). Playing notes on the virtual keyboard makes noises from the external synth:nige@sully ~ $ aconnect -d 128:0 129:0 nige@sully ~ $ aconnect 128:0 16:0- Trying to connect the MIDI port (with external keyboard attached) to
fluidsynth causes the system lock up:nige@sully ~ $ aconnect 16:0 129:0An even simpler way to get the system to lock up is to use aseqdump,
this can be done straight after boot up without having to start X or anything:nige@sully ~ $ aseqdump -p 16:0I presume that the system locking up means it's a kernel thing (in
either a module or the main kernel).
Oddly, it has worked in the past. Though possibly using OSS only
rather than ALSA (it was a while ago).
Quoted 5 lines
I have a C-Media 8378 card and am using cmipci as my sound card in the
kernel (2.6.16).
lspci | grep audio
00:0b.0 Multimedia audio controller: C-Media Electronics Inc CM8738
(rev 10)
It's likely the problem of integrated mpu401 on cmedia chip. In the earlier version, only the legacy mpu port (0x300-0x330) was used, but it was changed to detect the availabilty of the built-in mpu
port in the recent version. It seems that this brings up a problem
sometimes (e.g. at rmmod).
Try the patch below to disable the integrated midi. You need to pass mpu_port=0x300 or another value to activate the legacy MPU port on this chip. Or, depending on the hardware implementation, you need to use snd-mpu401 with ACPI PnP as the secondary card, instead.
Takashi
pci/cmipci.c +2 -1
@@ -2931,7 +2931,8 @@return err; } - integrated_midi =snd_cmipci_read_b (cm,CM_REG_MPU_PCI ) !=0xff ; +/* integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff; */ + integrated_midi =0 ;if (integrated_midi) iomidi = cm->iobase +CM_REG_MPU_PCI ;else {
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Quoted 9 lines · Takashi Iwai
At Wed, 03 May 2006 11:33:27 +0100,
Quoted 7 lines · Nigel Gilbert
Hi all,
I've been trying to use Rosegarden or Museseq to compose some music
and have discovered that, when software connects to the MIDI IN on my sound card, the machine locks up totally (a reboot is required).
[snip]
Quoted 5 lines
It's likely the problem of integrated mpu401 on cmedia chip. In the earlier version, only the legacy mpu port (0x300-0x330) was used, but it was changed to detect the availabilty of the built-in mpu
port in the recent version. It seems that this brings up a problem
sometimes (e.g. at rmmod).
Out of interest, when you say "earlier version" do you mean earlier version of the hardware, or earlier version of the driver?
Quoted 5 lines
Try the patch below to disable the integrated midi. You need to pass mpu_port=0x300 or another value to activate the legacy MPU port on this chip. Or, depending on the hardware implementation, you need to use snd-mpu401 with ACPI PnP as the secondary card, instead.
That patch works a treat. I already had mpu_port=0x320 as a module option and it just works.
Cheers,
-Nige
Quoted 17 lines
Takashi
diff -r
0f367ec087bbpci/cmipci.cpci/cmipci.c +2
-1@@ -2931,7 +2931,8 @@return err; } - integrated_midi =snd_cmipci_read_b (cm,CM_REG_MPU_PCI ) !=0xff ; +/* integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff; */ + integrated_midi =0 ;if (integrated_midi) iomidi = cm->iobase +CM_REG_MPU_PCI ;else {
Signature · 10 lines
Nigel Gilbert <[email protected]> ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
At Thu, 04 May 2006 10:01:07 +0100,
Quoted 14 lines · Nigel Gilbert
Quoted 9 lines · Takashi Iwai
At Wed, 03 May 2006 11:33:27 +0100,
Quoted 7 lines · Nigel Gilbert
Hi all,
I've been trying to use Rosegarden or Museseq to compose some music
and have discovered that, when software connects to the MIDI IN on my sound card, the machine locks up totally (a reboot is required).[snip]
Quoted 8 lines
Quoted 5 lines
It's likely the problem of integrated mpu401 on cmedia chip. In the earlier version, only the legacy mpu port (0x300-0x330) was used, but it was changed to detect the availabilty of the built-in mpu
port in the recent version. It seems that this brings up a problem
sometimes (e.g. at rmmod).Out of interest, when you say "earlier version" do you mean earlier version of the hardware, or earlier version of the driver?
The driver.
Quoted 7 lines
Quoted 4 lines
Try the patch below to disable the integrated midi. You need to pass mpu_port=0x300 or another value to activate the legacy MPU port on this chip. Or, depending on the hardware implementation, you need to use snd-mpu401 with ACPI PnP as the secondary card, instead.
That patch works a treat. I already had mpu_port=0x320 as a module option and it just works.
OK, then I'll change the check of integrated_midi only when mpu_port=1 module option is given.
Takashi
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642