* Re: [alsa-devel] [PATCH 5/5] snd-ice1712: Fix resume on ice1724
@ 2012-10-30 19:34 Ondrej Zary
2012-10-31 7:29 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Ondrej Zary @ 2012-10-30 19:34 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, linux-kernel
On Wednesday 17 October 2012 08:57:39 Takashi Iwai wrote:
> At Sun, 14 Oct 2012 21:09:23 +0200,
>
> Ondrej Zary wrote:
> > set_pro_rate() is called from hw_params() but not from prepare(),
> > breaking running PCM on suspend/resume. Call it from prepare() if PCM was
> > suspended to fix the problem.
> >
> > Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
>
> This should be fixed in the resume callback. Could you check the
> patch below instead?
I've now verified that this patch fixes a real problem. When "multi track rate
locking" is disabled and some sound is played at non-default (non-48kHz)
frequency during suspend, the frequency is wrong (48kHz) after resume. This
patch fixes that.
> thanks,
>
> Takashi
>
> ---
> diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
> index 161c8f6..5cc3fa5 100644
> --- a/sound/pci/ice1712/ice1724.c
> +++ b/sound/pci/ice1712/ice1724.c
> @@ -2867,7 +2867,12 @@ static int snd_vt1724_resume(struct device *dev)
> ice->set_spdif_clock(ice, 0);
> } else {
> /* internal on-card clock */
> - snd_vt1724_set_pro_rate(ice, ice->pro_rate_default, 1);
> + int rate;
> + if (ice->cur_rate)
> + rate = ice->cur_rate;
> + else
> + rate = ice->pro_rate_default;
> + snd_vt1724_set_pro_rate(ice, rate, 1);
> }
>
> update_spdif_bits(ice, ice->pm_saved_spdif_ctrl);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Ondrej Zary
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [alsa-devel] [PATCH 5/5] snd-ice1712: Fix resume on ice1724
2012-10-30 19:34 [alsa-devel] [PATCH 5/5] snd-ice1712: Fix resume on ice1724 Ondrej Zary
@ 2012-10-31 7:29 ` Takashi Iwai
0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2012-10-31 7:29 UTC (permalink / raw)
To: Ondrej Zary; +Cc: alsa-devel, linux-kernel
At Tue, 30 Oct 2012 20:34:00 +0100,
Ondrej Zary wrote:
>
> On Wednesday 17 October 2012 08:57:39 Takashi Iwai wrote:
> > At Sun, 14 Oct 2012 21:09:23 +0200,
> >
> > Ondrej Zary wrote:
> > > set_pro_rate() is called from hw_params() but not from prepare(),
> > > breaking running PCM on suspend/resume. Call it from prepare() if PCM was
> > > suspended to fix the problem.
> > >
> > > Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
> >
> > This should be fixed in the resume callback. Could you check the
> > patch below instead?
>
> I've now verified that this patch fixes a real problem. When "multi track rate
> locking" is disabled and some sound is played at non-default (non-48kHz)
> frequency during suspend, the frequency is wrong (48kHz) after resume. This
> patch fixes that.
OK, the patch was applied now. Thanks for checking.
Takashi
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/5] snd-ice1712: Add Philips PSC724 Ultimate Edge
@ 2012-10-14 19:09 Ondrej Zary
2012-10-14 19:09 ` [PATCH 5/5] snd-ice1712: Fix resume on ice1724 Ondrej Zary
0 siblings, 1 reply; 3+ messages in thread
From: Ondrej Zary @ 2012-10-14 19:09 UTC (permalink / raw)
To: alsa-devel; +Cc: linux-kernel, broonie
Hello,
this patch series adds full support for Philips PSC724 Ultimate Edge sound
card to snd-ice1712 driver. Unlike other snd-ice1712 subdrivers, the codec
code is splitted into separate files, reusable by other ice1712 subdrivers.
Working: all analog outputs (front, rear, center+lfe, headphone) and inputs
(front mic, rear mic, line, cd, aux), mixer, headphone jack detection,
suspend/resume
Untested: SPDIF
--
Ondrej Zary
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 5/5] snd-ice1712: Fix resume on ice1724
2012-10-14 19:09 [PATCH 0/5] snd-ice1712: Add Philips PSC724 Ultimate Edge Ondrej Zary
@ 2012-10-14 19:09 ` Ondrej Zary
2012-10-17 6:57 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Ondrej Zary @ 2012-10-14 19:09 UTC (permalink / raw)
To: alsa-devel; +Cc: linux-kernel, broonie
set_pro_rate() is called from hw_params() but not from prepare(), breaking running PCM on suspend/resume.
Call it from prepare() if PCM was suspended to fix the problem.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
sound/pci/ice1712/ice1724.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 0eb7ec6..ade3354 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -783,6 +783,13 @@ static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream)
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
unsigned char val;
unsigned int size;
+ int err;
+
+ if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
+ err = snd_vt1724_set_pro_rate(ice, substream->runtime->rate, 0);
+ if (err < 0)
+ return err;
+ }
spin_lock_irq(&ice->reg_lock);
val = (8 - substream->runtime->channels) >> 1;
@@ -853,6 +860,13 @@ static int snd_vt1724_pcm_prepare(struct snd_pcm_substream *substream)
{
struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
const struct vt1724_pcm_reg *reg = substream->runtime->private_data;
+ int err;
+
+ if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) {
+ err = snd_vt1724_set_pro_rate(ice, substream->runtime->rate, 0);
+ if (err < 0)
+ return err;
+ }
spin_lock_irq(&ice->reg_lock);
outl(substream->runtime->dma_addr, ice->profi_port + reg->addr);
--
Ondrej Zary
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 5/5] snd-ice1712: Fix resume on ice1724
2012-10-14 19:09 ` [PATCH 5/5] snd-ice1712: Fix resume on ice1724 Ondrej Zary
@ 2012-10-17 6:57 ` Takashi Iwai
2012-10-18 22:02 ` [alsa-devel] " Ondrej Zary
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2012-10-17 6:57 UTC (permalink / raw)
To: Ondrej Zary; +Cc: alsa-devel, broonie, linux-kernel
At Sun, 14 Oct 2012 21:09:23 +0200,
Ondrej Zary wrote:
>
> set_pro_rate() is called from hw_params() but not from prepare(), breaking running PCM on suspend/resume.
> Call it from prepare() if PCM was suspended to fix the problem.
>
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
This should be fixed in the resume callback. Could you check the
patch below instead?
thanks,
Takashi
---
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 161c8f6..5cc3fa5 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -2867,7 +2867,12 @@ static int snd_vt1724_resume(struct device *dev)
ice->set_spdif_clock(ice, 0);
} else {
/* internal on-card clock */
- snd_vt1724_set_pro_rate(ice, ice->pro_rate_default, 1);
+ int rate;
+ if (ice->cur_rate)
+ rate = ice->cur_rate;
+ else
+ rate = ice->pro_rate_default;
+ snd_vt1724_set_pro_rate(ice, rate, 1);
}
update_spdif_bits(ice, ice->pm_saved_spdif_ctrl);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [alsa-devel] [PATCH 5/5] snd-ice1712: Fix resume on ice1724
2012-10-17 6:57 ` Takashi Iwai
@ 2012-10-18 22:02 ` Ondrej Zary
0 siblings, 0 replies; 3+ messages in thread
From: Ondrej Zary @ 2012-10-18 22:02 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, broonie, linux-kernel
On Wednesday 17 October 2012 08:57:39 Takashi Iwai wrote:
> At Sun, 14 Oct 2012 21:09:23 +0200,
>
> Ondrej Zary wrote:
> > set_pro_rate() is called from hw_params() but not from prepare(),
> > breaking running PCM on suspend/resume. Call it from prepare() if PCM was
> > suspended to fix the problem.
> >
> > Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
>
> This should be fixed in the resume callback. Could you check the
> patch below instead?
Now I'm confused. This patch does not work with mplayer+dmix. And my patch
doesn't either...
When mplayer is set to s32le (without dmix), it works fine without this or my
patch. Also aplay seems to work without these patches.
I bet that when I tested my patch before, it fixed some real problem. But I'm
now unable to reproduce that...
> thanks,
>
> Takashi
>
> ---
> diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
> index 161c8f6..5cc3fa5 100644
> --- a/sound/pci/ice1712/ice1724.c
> +++ b/sound/pci/ice1712/ice1724.c
> @@ -2867,7 +2867,12 @@ static int snd_vt1724_resume(struct device *dev)
> ice->set_spdif_clock(ice, 0);
> } else {
> /* internal on-card clock */
> - snd_vt1724_set_pro_rate(ice, ice->pro_rate_default, 1);
> + int rate;
> + if (ice->cur_rate)
> + rate = ice->cur_rate;
> + else
> + rate = ice->pro_rate_default;
> + snd_vt1724_set_pro_rate(ice, rate, 1);
> }
>
> update_spdif_bits(ice, ice->pm_saved_spdif_ctrl);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Ondrej Zary
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-31 7:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-30 19:34 [alsa-devel] [PATCH 5/5] snd-ice1712: Fix resume on ice1724 Ondrej Zary
2012-10-31 7:29 ` Takashi Iwai
-- strict thread matches above, loose matches on Subject: below --
2012-10-14 19:09 [PATCH 0/5] snd-ice1712: Add Philips PSC724 Ultimate Edge Ondrej Zary
2012-10-14 19:09 ` [PATCH 5/5] snd-ice1712: Fix resume on ice1724 Ondrej Zary
2012-10-17 6:57 ` Takashi Iwai
2012-10-18 22:02 ` [alsa-devel] " Ondrej Zary
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).