From: Takashi Iwai Subject: Re: [PATCH] ESS Solo1 IRQ issue take 2 Date: Mon, 10 Oct 2005 14:41:17 +0200 Message-ID: References: <20051010085543.GB2369@elf.ucw.cz> <20051010094629.12123.qmail@desitka.sh.cvut.cz> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <20051010094629.12123.qmail@desitka.sh.cvut.cz> 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: R.Marek@sh.cvut.cz Cc: alsa-devel@lists.sourceforge.net, pavel@suse.cz List-Id: alsa-devel@alsa-project.org At 10 Oct 2005 09:46:29 -0000, R.Marek@sh.cvut.cz wrote: > > Hello, > > >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. > > Signed-Off-By: Rudolf Marek Thanks, now applied to ALSA tree. > 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 diff -u -r1.52 -r1.55 --- alsa-kernel/pci/es1938.c 10 Oct 2005 11:08:47 -0000 1.52 +++ alsa-kernel/pci/es1938.c 10 Oct 2005 12:39:22 -0000 1.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