Skip to contentSkip to conversation

cmipci driver locking up linux hard

DISCUSSION Christoph Lameter 2 participants 13 messages Aug 4, 2006 – Aug 9, 2006 Sound

lore
Share & tools
lore
#0 lore raw

I recently bought a cmpci pci card with support for 6 channel surround sound. Vendor was PPA Int'l.

I can play music for shorter or longer time period but then it invariably locks up. If one tries the surround sound then it locks up very fast. Guess some concurrency issue? Run on a P4M800PROC Motherbord with a Pentium940 (verified that lockup also occurs with single processor).

Tried to enable the nmi_watchdog but it also could not revive linux.

How do I debug this thing?

christoph@pentium940:/proc/asound$ cat cards
 0 [CMI8738MC6     ]: CMI8738-MC6 - C-Media PCI CMI8738-MC6
                      C-Media PCI CMI8738-MC6 (model 55) at 0xe800, irq 201
christoph@pentium940:/proc/asound/card0$ cat cmipci
C-Media PCI CMI8738-MC6 (model 55) at 0xe800, irq 201

00: 02 00 00 00
04: 10 0c 00 00
08: 03 00 09 00
0c: 00 00 00 0a
10: c0 00 00 00
14: 00 00 00 00
18: 00 00 80 0c
1c: 00 00 fe ff
20: 10 40 08 00
24: 00 01 00 04
28: ff ff ff ff
2c: ff ff ff ff
30: 00 00 00 00
34: 00 00 00 00
38: 00 00 00 00
3c: 00 00 00 00

christoph@pentium940:/proc/asound/card0$ cat id
CMI8738MC6

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#1 lore raw

At Fri, 4 Aug 2006 16:22:56 -0700 (PDT),

Quoted 8 lines · Christoph Lameter

I recently bought a cmpci pci card with support for 6 channel surround sound. Vendor was PPA Int'l.

I can play music for shorter or longer time period but then it invariably locks up. If one tries the surround sound then it locks up very fast. Guess some concurrency issue? Run on a P4M800PROC Motherbord with a Pentium940 (verified that lockup also occurs with single processor).

Does it happen with 2.6.18rc kernel, too?

There is no big change in the driver and it didn't get much troubles. One significant fix after 2.6.17 is to disable the support of the integrated MPU401 interface as default, which may cause lock up at module loading time.

Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#2 lore raw
Quoted 6 lines · Takashi Iwai

At Fri, 4 Aug 2006 16:22:56 -0700 (PDT),

Quoted 4 lines · Christoph Lameter

I recently bought a cmpci pci card with support for 6 channel surround sound. Vendor was PPA Int'l.

Quoted 6 lines
Quoted 4 lines

I can play music for shorter or longer time period but then it invariably locks up. If one tries the surround sound then it locks up very fast. Guess some concurrency issue? Run on a P4M800PROC Motherbord with a Pentium940 (verified that lockup also occurs with single processor).

Does it happen with 2.6.18rc kernel, too?

Yes. This was reported against 2.6.18-rc3.

Quoted 4 lines

There is no big change in the driver and it didn't get much troubles. One significant fix after 2.6.17 is to disable the support of the integrated MPU401 interface as default, which may cause lock up at module loading time.

What else could it be? Is there any additional way to get more information about the failure?

-------------------------------------------------------------------------
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

#3 lore raw

At Mon, 7 Aug 2006 09:29:59 -0700 (PDT),

Quoted 9 lines · Christoph Lameter
Quoted 6 lines · Takashi Iwai

At Fri, 4 Aug 2006 16:22:56 -0700 (PDT),

Quoted 4 lines · Christoph Lameter

I recently bought a cmpci pci card with support for 6 channel surround sound. Vendor was PPA Int'l.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I can play music for shorter or longer time period but then it invariably locks up. If one tries the surround sound then it locks up very fast. Guess some concurrency issue? Run on a P4M800PROC Motherbord with a Pentium940 (verified that lockup also occurs with single processor).

Does it happen with 2.6.18rc kernel, too?

Yes. This was reported against 2.6.18-rc3.

:-<

Did you set CONFIG_SND_DEBUG=y, just to be sure?

Quoted 7 lines
Quoted 4 lines

There is no big change in the driver and it didn't get much troubles. One significant fix after 2.6.17 is to disable the support of the integrated MPU401 interface as default, which may cause lock up at module loading time.

What else could it be? Is there any additional way to get more information about the failure?

I have also no clue what's broken since the driver is fairly simple and the interrupt handler looks OK. You can try to disable some unnecessary features like midi and opl3 stuff, such as below, to eliminate the possible causes.

Also, you can still try the old OSS cmpci driver...

Takashi

pci/cmipci.c +3 -1
diff -r c02c4dc749e7 pci/cmipci.c
@@ -2825,7 +2825,7 @@ static int __devinit snd_cmipci_create(s
 		.dev_free =	snd_cmipci_dev_free,
 	};
 	unsigned int val = 0;
-	long iomidi;
+	long iomidi = 0;
 	int integrated_midi;
 	int pcm_index, pcm_spdif_index;
 	static struct pci_device_id intel_82437vx[] = {
@@ -2931,6 +2931,7 @@ static int __devinit snd_cmipci_create(s
 		return err;
 	}
 
+#if 0
 	integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff;
 	if (integrated_midi && mpu_port[dev] == 1)
 		iomidi = cm->iobase + CM_REG_MPU_PCI;
@@ -2953,6 +2954,7 @@ static int __devinit snd_cmipci_create(s
 
 	if ((err = snd_cmipci_create_fm(cm, fm_port[dev])) < 0)
 		return err;
+#endif
 
 	/* reset mixer */
 	snd_cmipci_mixer_write(cm, 0, 0);

-------------------------------------------------------------------------
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

#4 lore raw
Quoted 5 lines · Takashi Iwai
Quoted 1 line

Yes. This was reported against 2.6.18-rc3.

:-<

Did you set CONFIG_SND_DEBUG=y, just to be sure?

#
# Advanced Linux Sound Architecture
#
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
CONFIG_SND_HWDEP=m
CONFIG_SND_RAWMIDI=m
# CONFIG_SND_SEQUENCER is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_RTCTIMER=m
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
CONFIG_SND_DEBUG_DETECT=y
# CONFIG_SND_PCM_XRUN_DEBUG is not set

Quoted 1 line

Also, you can still try the old OSS cmpci driver...

I have tried older version for the VIA8237/ALC655 issue but not for this one yet. I bought a USB audio stick for $20. That works but no surround sound. sighn. Will try the patch and report back.

-------------------------------------------------------------------------
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

#5 lore raw
In reply to Takashi Iwai
Quoted 22 lines · Takashi Iwai

diff -r c02c4dc749e7 pci/cmipci.c

pci/cmipci.c +2 -1
@@ -2825,7 +2825,7 @@ static int __devinit snd_cmipci_create(s
 		.dev_free =	snd_cmipci_dev_free,
 	};
 	unsigned int val = 0;
-	long iomidi;
+	long iomidi = 0;
 	int integrated_midi;
 	int pcm_index, pcm_spdif_index;
 	static struct pci_device_id intel_82437vx[] = {
@@ -2931,6 +2931,7 @@ static int __devinit snd_cmipci_create(s
 		return err;
 	}
 
+#if 0
 	integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff;
 	if (integrated_midi && mpu_port[dev] == 1)
 		iomidi = cm->iobase + CM_REG_MPU_PCI;

pci/cmipci.c static int __devinit snd_cmipci_create(s · line 2960

Quoted 7 lines
pci/cmipci.c +1 -0
@@ -2953,6 +2954,7 @@ static int __devinit snd_cmipci_create(s
 
 	if ((err = snd_cmipci_create_fm(cm, fm_port[dev])) < 0)
 		return err;
+#endif
 
 	/* reset mixer */
 	snd_cmipci_mixer_write(cm, 0, 0);

Tried the patch and it looked up on the first gnome sound. Rebooted again and now its okay just occasionally doing gnome beeps (same as before). Will lockup if I play an mp3.

-------------------------------------------------------------------------
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

#6 lore raw

At Mon, 7 Aug 2006 12:53:47 -0700 (PDT),

Quoted 29 lines · Christoph Lameter
Quoted 26 lines · Takashi Iwai

diff -r c02c4dc749e7 pci/cmipci.c

pci/cmipci.c +3 -1
@@ -2825,7 +2825,7 @@ static int __devinit snd_cmipci_create(s
 		.dev_free =	snd_cmipci_dev_free,
 	};
 	unsigned int val = 0;
-	long iomidi;
+	long iomidi = 0;
 	int integrated_midi;
 	int pcm_index, pcm_spdif_index;
 	static struct pci_device_id intel_82437vx[] = {
@@ -2931,6 +2931,7 @@ static int __devinit snd_cmipci_create(s
 		return err;
 	}
 
+#if 0
 	integrated_midi = snd_cmipci_read_b(cm, CM_REG_MPU_PCI) != 0xff;
 	if (integrated_midi && mpu_port[dev] == 1)
 		iomidi = cm->iobase + CM_REG_MPU_PCI;
@@ -2953,6 +2954,7 @@ static int __devinit snd_cmipci_create(s
 
 	if ((err = snd_cmipci_create_fm(cm, fm_port[dev])) < 0)
 		return err;
+#endif
 
Quoted 7 lines

pci/cmipci.c static int __devinit snd_cmipci_create(s · line 2960

Quoted 3 lines
pci/cmipci.c +0 -0
 	/* reset mixer */
 	snd_cmipci_mixer_write(cm, 0, 0);

Tried the patch and it looked up on the first gnome sound. Rebooted again and now its okay just occasionally doing gnome beeps (same as before). Will lockup if I play an mp3.

Hm, it sounds really odd.

I'm afraid that the problem might lie rahter on the VIA controller side. Which devices are sharing the same irq line?

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

#7 lore raw
Quoted 6 lines · Takashi Iwai
Quoted 1 line

Will lockup if I play an mp3.

Hm, it sounds really odd.

I'm afraid that the problem might lie rahter on the VIA controller side. Which devices are sharing the same irq line?

pentium940:/usr/src/linux-2.6# cat /proc/interrupts
           CPU0       CPU1
  0:     757651     740334    IO-APIC-edge  timer
  1:         10          3    IO-APIC-edge  i8042
  9:          0          0   IO-APIC-level  acpi
 14:       4974       3633    IO-APIC-edge  ide0
 15:       6542       6659    IO-APIC-edge  ide1
185:       4494          0   IO-APIC-level  eth0
201:       2291       2450   IO-APIC-level  uhci_hcd:usb1, uhci_hcd:usb2, 
uhci_h cd:usb3, uhci_hcd:usb4, ehci_hcd:usb5
209:         45        122   IO-APIC-level  CMI8738-MC6
NMI:    1497891    1497799
LOC:    1497738    1497765

-------------------------------------------------------------------------
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

#8 lore raw
In reply to Takashi Iwai
Quoted 1 line · Takashi Iwai

Also, you can still try the old OSS cmpci driver...

Well that one is still in the kernel but one cannot enable it in menuconfig. I needed the following patch to make it possible to enable that module. It was not loaded automatically on bootup so I needed to do a

modprobe cmpci

After that I had sound for 2 minutes before the system locked up again. Same code base?

sound/oss/Kconfig +6 -0
Index: linux-2.6/sound/oss/Kconfig
===================================================================
@@ -479,6 +479,12 @@
 
 	  This driver is also available as a module and will be called aci.
 
+config SOUND_CMPCI
+	tristate "CMPCI Sound"
+	depends on SOUND_OSS
+	help
+		CMPCI sound
+
 config SOUND_CS4232
 	tristate "Crystal CS4232 based (PnP) cards"
 	depends on SOUND_OSS

-------------------------------------------------------------------------
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

#9 lore raw

At Mon, 7 Aug 2006 13:23:02 -0700 (PDT),

Quoted 10 lines · Christoph Lameter
Quoted 1 line · Takashi Iwai

Also, you can still try the old OSS cmpci driver...

Well that one is still in the kernel but one cannot enable it in menuconfig. I needed the following patch to make it possible to enable that module. It was not loaded automatically on bootup so I needed to do a

Quoted 4 lines

modprobe cmpci

After that I had sound for 2 minutes before the system locked up again. Same code base?

Not same but the control part does pretty similar thing. I also didn't expect much it would work, but who knows.

I still don't get it right whether the problem is in the interrupt lockup or it hits some hardware things. The fact that the lockup happens after playing mp3 sounds like the former, though.

Could you check the values of registers CM_REG_INT_STATUS and CM_REG_INT_HLDCLR in snd_cmipci_interrupt() by printk?

Also, you can comment out the whole block of if (cm->pcm) { ... } in snd_cmipci_interrupt(). This will skip the processing of data, i.e. exclude the possibility in ALSA PCM core part.

Takashi

pci/cmipci.c +1 -0
diff -r c02c4dc749e7 pci/cmipci.c
@@ -1301,6 +1301,7 @@ static irqreturn_t snd_cmipci_interrupt(
 	
 	/* fastpath out, to ease interrupt sharing */
 	status = snd_cmipci_read(cm, CM_REG_INT_STATUS);
+	printk("XXX cmipci STAT=0x%x, INT=0x%x\n", status, snd_cmipci_read(cm, CM_REG_INT_HLDCLR);
 	if (!(status & CM_INTR))
 		return IRQ_NONE;
 

-------------------------------------------------------------------------
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

#10 lore raw
Quoted 6 lines · Takashi Iwai

I still don't get it right whether the problem is in the interrupt lockup or it hits some hardware things. The fact that the lockup happens after playing mp3 sounds like the former, though.

Could you check the values of registers CM_REG_INT_STATUS and CM_REG_INT_HLDCLR in snd_cmipci_interrupt() by printk?

Ok. Output was

XXXX cmpci STAT=0x800000c1 INT=0xa010000

Was not able to use the system with this.

Quoted 3 lines

Also, you can comment out the whole block of if (cm->pcm) { ... } in snd_cmipci_interrupt(). This will skip the processing of data, i.e. exclude the possibility in ALSA PCM core part.

Did that at the same time as adding the printk part. Will now take out the printk to see if it still works.

-------------------------------------------------------------------------
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

#11 lore raw
Quoted 2 lines · Christoph Lameter

Did that at the same time as adding the printk part. Will now take out the printk to see if it still works.

System hangs on X startup. All screens are grey (background) and I hear a murmuring sound from the speakers. wirr wirr wirr. The murmuring sound continues until I reset the system.

-------------------------------------------------------------------------
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

#12 lore raw
In reply to Christoph Lameter

At Tue, 8 Aug 2006 17:14:52 -0700 (PDT),

Quoted 7 lines · Christoph Lameter
Quoted 4 lines · Takashi Iwai

I still don't get it right whether the problem is in the interrupt lockup or it hits some hardware things. The fact that the lockup happens after playing mp3 sounds like the former, though.

Quoted 8 lines
Quoted 2 lines

Could you check the values of registers CM_REG_INT_STATUS and CM_REG_INT_HLDCLR in snd_cmipci_interrupt() by printk?

Ok. Output was

XXXX cmpci STAT=0x800000c1 INT=0xa010000

Was not able to use the system with this.

Hm, the bits look OK. Only PCM channel 0 issues irq. Puzzling...

I'm afraid that it's not in the driver code but some hardware confliction or hardware bug. If so, it's likely specific to your mobo.

Do you have any chance to try this c-media card on another machine?

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