From: Takashi Iwai Subject: Re: Hard lock up when using ALSA midi in Date: Wed, 03 May 2006 13:44:51 +0200 Message-ID: References: <1146652407.7497.4.camel@maltbury3.norbnet.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <1146652407.7497.4.camel@maltbury3.norbnet.org> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Nigel Gilbert Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Wed, 03 May 2006 11:33:27 +0100, Nigel Gilbert wrote: > > 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) 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 diff -r 0f367ec087bb pci/cmipci.c --- a/pci/cmipci.c Wed May 3 09:59:03 2006 +++ b/pci/cmipci.c Wed May 3 13:43:23 2006 @@ -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