* [PATCH] ASoC: fsl_ssi: Add suspend/resume support
@ 2014-05-23 5:38 Fabio Estevam
2014-05-23 9:18 ` Shawn Guo
2014-05-26 13:24 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2014-05-23 5:38 UTC (permalink / raw)
To: broonie; +Cc: Fabio Estevam, alsa-devel, timur, shawn.guo
From: Fabio Estevam <fabio.estevam@freescale.com>
Doing a suspend/resume sequence while playing an audio track in the backgroung
causes broken audio right after resume:
root@freescale /$ aplay clarinet.wav &
root@freescale /home$ Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian,
Rate 44100 Hz, Mono
root@freescale /home$ echo mem > /sys/power/state
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.002 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
Suspending console(s) (use no_console_suspend to debug)
PM: suspend of devices complete after 37.082 msecs
PM: suspend devices took 0.040 seconds
PM: late suspend of devices complete after 4.234 msecs
PM: noirq suspend of devices complete after 4.618 msecs
Disabling non-boot CPUs ...
PM: noirq resume of devices complete after 4.013 msecs
PM: early resume of devices complete after 4.000 msecs
PM: resume of devices complete after 68.907 msecs
PM: resume devices took 0.070 seconds
Restarting tasks ... Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
Suspended. Trying resume. Failed. Restarting stream. Done.
....
Add SNDRV_PCM_TRIGGER_RESUME/SUSPEND cases so that we can gracefully handle
system suspend/resume.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
sound/soc/fsl/fsl_ssi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index f233d91..090f449 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -874,6 +874,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
fsl_ssi_tx_config(ssi_private, true);
@@ -882,6 +883,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
break;
case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
fsl_ssi_tx_config(ssi_private, false);
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: fsl_ssi: Add suspend/resume support
2014-05-23 5:38 [PATCH] ASoC: fsl_ssi: Add suspend/resume support Fabio Estevam
@ 2014-05-23 9:18 ` Shawn Guo
2014-05-26 13:24 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2014-05-23 9:18 UTC (permalink / raw)
To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, broonie, timur
On Fri, May 23, 2014 at 02:38:56AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Doing a suspend/resume sequence while playing an audio track in the backgroung
> causes broken audio right after resume:
>
> root@freescale /$ aplay clarinet.wav &
>
> root@freescale /home$ Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian,
> Rate 44100 Hz, Mono
>
> root@freescale /home$ echo mem > /sys/power/state
> PM: Syncing filesystems ... done.
> Freezing user space processes ... (elapsed 0.002 seconds) done.
> Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
> Suspending console(s) (use no_console_suspend to debug)
> PM: suspend of devices complete after 37.082 msecs
> PM: suspend devices took 0.040 seconds
> PM: late suspend of devices complete after 4.234 msecs
> PM: noirq suspend of devices complete after 4.618 msecs
> Disabling non-boot CPUs ...
> PM: noirq resume of devices complete after 4.013 msecs
> PM: early resume of devices complete after 4.000 msecs
> PM: resume of devices complete after 68.907 msecs
> PM: resume devices took 0.070 seconds
> Restarting tasks ... Suspended. Trying resume. Failed. Restarting stream. Done.
> Suspended. Trying resume. Failed. Restarting stream. Done.
> Suspended. Trying resume. Failed. Restarting stream. Done.
> Suspended. Trying resume. Failed. Restarting stream. Done.
> Suspended. Trying resume. Failed. Restarting stream. Done.
> Suspended. Trying resume. Failed. Restarting stream. Done.
> Suspended. Trying resume. Failed. Restarting stream. Done.
> ....
>
> Add SNDRV_PCM_TRIGGER_RESUME/SUSPEND cases so that we can gracefully handle
> system suspend/resume.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: fsl_ssi: Add suspend/resume support
2014-05-23 5:38 [PATCH] ASoC: fsl_ssi: Add suspend/resume support Fabio Estevam
2014-05-23 9:18 ` Shawn Guo
@ 2014-05-26 13:24 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-05-26 13:24 UTC (permalink / raw)
To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, timur, shawn.guo
[-- Attachment #1.1: Type: text/plain, Size: 266 bytes --]
On Fri, May 23, 2014 at 02:38:56AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Doing a suspend/resume sequence while playing an audio track in the backgroung
> causes broken audio right after resume:
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-26 13:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 5:38 [PATCH] ASoC: fsl_ssi: Add suspend/resume support Fabio Estevam
2014-05-23 9:18 ` Shawn Guo
2014-05-26 13:24 ` Mark Brown
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).