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