Skip to contentSkip to conversation

ESS Solo1 IRQ issue take 2

PATCH In review [email protected] 2 participants 6 messages Oct 10, 2005 – Oct 31, 2005 1 message not in the archive Sound

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 ESS Solo1 IRQ issue take 2

Hello,

Quoted 3 lines

ACK (modulo formatting). [It is probably best to cc alsa-devel or linux-kernel, even on small changes].
Pavel

Ok here we go - second try.

This patch fixes the suspend/resume issue I'm having with ESS-Solo1 soundcard. Without this patch I might get after resume message that kernel is disabling the IRQ5 (soundcard). If there was something playing it wont continue after resume without this patch.

There is one thing left. When I suspending to ram or to disk while playing something I got repeated sound what left without the IRQ. Like ta ta ta ta ta ta you know that sound ;)
I tried to disable the DMA crt on the soundcard in suspend routine but it wont help. Perhaps userspace process is stopped and is not delivering new data?! Will pci_disable_device also disable the DMA?

Thanks,

Regards
Rudolf

pci/es1938.c renamed from sound/pci/es1938.c +3 -1
@@ -1390,7 +1397,8 @@
 		*d = snd_es1938_reg_read(chip, *s);
 
 	outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */
-
+	if (chip->irq >= 0)                                                                         
+		free_irq(chip->irq, (void *)chip);  
 	pci_disable_device(chip->pci);
 	return 0;
 }
@@ -1401,6 +1409,7 @@
 	unsigned char *s, *d;
 
 	pci_enable_device(chip->pci);
+	request_irq(chip->pci->irq, snd_es1938_interrupt, SA_INTERRUPT|SA_SHIRQ, "ES1938", (void *)chip);
 	snd_es1938_chip_init(chip);
 
 	/* restore mixer-related registers */

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

#2 lore raw

At 10 Oct 2005 09:46:29 -0000,

Quoted 7 lines · [email protected] wrote:

Hello,

Quoted 3 lines

ACK (modulo formatting). [It is probably best to cc alsa-devel or linux-kernel, even on small changes].
Pavel

Quoted 8 lines

Ok here we go - second try.

This patch fixes the suspend/resume issue I'm having with ESS-Solo1 soundcard. Without this patch I might get after resume message that kernel is disabling the IRQ5 (soundcard). If there was something playing it wont continue after resume without this patch.

Thanks, now applied to ALSA tree.

Quoted 6 lines

There is one thing left. When I suspending to ram or to disk while playing something I got repeated sound what left without the IRQ. Like ta ta ta ta ta ta you know that sound ;)
I tried to disable the DMA crt on the soundcard in suspend routine but it wont help. Perhaps userspace process is stopped and is not delivering new data?! Will pci_disable_device also disable the DMA?

No, you have to stop the stream explicitly in suspend. The following patch should fix this problem.

Takashi

Index: alsa-kernel/pci/es1938.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/es1938.c,v retrieving revision 1.52
retrieving revision 1.55

pci/es1938.c +10 -2
diff -u -r1.52 -r1.55
@@ -543,10 +543,12 @@
 	int val;
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
+	case SNDRV_PCM_TRIGGER_RESUME:
 		val = 0x0f;
 		chip->active |= ADC1;
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
+	case SNDRV_PCM_TRIGGER_SUSPEND:
 		val = 0x00;
 		chip->active &= ~ADC1;
 		break;
@@ -563,6 +565,7 @@
 	es1938_t *chip = snd_pcm_substream_chip(substream);
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
+	case SNDRV_PCM_TRIGGER_RESUME:
 		/* According to the documentation this should be:
 		   0x13 but that value may randomly swap stereo channels */
                 snd_es1938_mixer_write(chip, ESSSB_IREG_AUDIO2CONTROL1, 0x92);
@@ -575,6 +578,7 @@
 		chip->active |= DAC2;
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
+	case SNDRV_PCM_TRIGGER_SUSPEND:
 		outb(0, SLIO_REG(chip, AUDIO2MODE));
 		snd_es1938_mixer_write(chip, ESSSB_IREG_AUDIO2CONTROL1, 0);
 		chip->active &= ~DAC2;
@@ -592,10 +596,12 @@
 	int val;
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
+	case SNDRV_PCM_TRIGGER_RESUME:
 		val = 5;
 		chip->active |= DAC1;
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
+	case SNDRV_PCM_TRIGGER_SUSPEND:
 		val = 0;
 		chip->active &= ~DAC1;
 		break;
@@ -1390,7 +1396,7 @@
 		*d = snd_es1938_reg_read(chip, *s);
 
 	outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */
-	if (chip->irq >= 0)                                                                         
+	if (chip->irq >= 0)
 		free_irq(chip->irq, (void *)chip);  
 	pci_disable_device(chip->pci);
 	return 0;
@@ -1402,7 +1408,9 @@
 	unsigned char *s, *d;
 
 	pci_enable_device(chip->pci);
-	request_irq(chip->pci->irq, snd_es1938_interrupt, SA_INTERRUPT|SA_SHIRQ, "ES1938", (void *)chip);
+	request_irq(chip->pci->irq, snd_es1938_interrupt,
+		    SA_INTERRUPT|SA_SHIRQ, "ES1938", (void *)chip);
+	chip->irq = chip->pci->irq;
 	snd_es1938_chip_init(chip);
 
 	/* restore mixer-related registers */

-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl

#3 lore raw
Quoted 7 lines
Quoted 3 lines

I tried to disable the DMA crt on the soundcard in suspend routine but it wont help. Perhaps userspace process is stopped and is not delivering new data?! Will pci_disable_device also disable the DMA?

No, you have to stop the stream explicitly in suspend. The following patch should fix this problem.

Hello,

Sorry for the delay. I tried the patch but still it is the same. The notebook is 333MHz, so maybe userspace processes are stopped and it takes time before the drivers are stopped too?

Any other ideas?

Regards

Rudolf

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#4 lore raw

At Sat, 22 Oct 2005 22:32:58 +0200,

Quoted 6 lines · Rudolf Marek
Quoted 6 lines
Quoted 4 lines

I tried to disable the DMA crt on the soundcard in suspend routine but it wont help. Perhaps userspace process is stopped and is not delivering new data?! Will pci_disable_device also disable the DMA?

Quoted 7 lines
Quoted 2 lines

No, you have to stop the stream explicitly in suspend. The following patch should fix this problem.

Hello,

Sorry for the delay. I tried the patch but still it is the same. The notebook is 333MHz, so maybe userspace processes are stopped and it takes time before the drivers are stopped too?

The driver itself stops the all PCM streams, so it should have nothing to do with user-space.

Could you check whether the trigger callbacks are really called during suspend?

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#5 lore raw

Hello,

Quoted 1 line
Quoted 1 line

Sorry for the delay.

And again.

Quoted 2 lines

Could you check whether the trigger callbacks are really called during suspend?

I check and they are not called.
(No command type suspend)

Regards
Rudolf

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information

#6 lore raw

At Mon, 31 Oct 2005 16:14:29 +0100,

Quoted 5 lines · Rudolf Marek

Hello,

Quoted 1 line
Quoted 1 line

Sorry for the delay.

Quoted 7 lines

And again.

Quoted 2 lines

Could you check whether the trigger callbacks are really called during suspend?

I check and they are not called.
(No command type suspend)

Weird, the suspend trigger must be called when you call snd_pcm_suspend_all()...

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information