Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To: libin.yang@intel.com, alsa-devel@alsa-project.org, tiwai@suse.de
Cc: broonie@kernel.org, ranjani.sridharan@intel.com,
	pierre-louis.bossart@linux.intel.com, rander.wang@intel.com
Subject: Re: [PATCH V2] ASoC: soc-pcm: BE dai needs prepare when pause release after resume
Date: Wed, 08 May 2019 09:30:08 -0700	[thread overview]
Message-ID: <aa0c6eea81a721f340dd1362801e49049a6620dd.camel@linux.intel.com> (raw)
In-Reply-To: <1557282761-26146-1-git-send-email-libin.yang@intel.com>

On Wed, 2019-05-08 at 10:32 +0800, libin.yang@intel.com wrote:
> From: Libin Yang <libin.yang@intel.com>
> 
> If playback/capture is paused and system enters S3, after system
> returns
> from suspend, BE dai needs to call prepare() callback when
> playback/capture
> is released from pause if RESUME_INFO flag is not set.
Hi Takashi,

This is a question for you. We've run into the problem of not being
able to do a pause-release after the system resumes from S3 after we
removed INFO_RESUME from the SOF driver. 

Apparently, with this flag removed, when the user does a pause release
after resuming from S3, the prepare() callback gets invoked for the FE
but doesnt happen for the the BE. Could you please guide us on whether
this is the right approach and if not, suggest an alternative?

Thanks,
Ranjani
> 
> Currently, the dpcm_be_dai_prepare() function will block calling
> prepare()
> if the pcm is in SND_SOC_DPCM_STATE_PAUSED state. This will cause the
> following test case fail if the pcm uses BE:
> 
> playback -> pause -> S3 suspend -> S3 resume -> pause release
> 
> The playback may exit abnormally when pause is released because the
> BE dai
> prepare() is not called.
> 
> This patch allows dpcm_be_dai_prepare() to call dai prepare()
> callback in
> SND_SOC_DPCM_STATE_PAUSED state.
> 
> Signed-off-by: Libin Yang <libin.yang@intel.com>
> ---
>  sound/soc/soc-pcm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index d2aa560..0888995 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -2471,7 +2471,8 @@ int dpcm_be_dai_prepare(struct
> snd_soc_pcm_runtime *fe, int stream)
>  
>  		if ((be->dpcm[stream].state !=
> SND_SOC_DPCM_STATE_HW_PARAMS) &&
>  		    (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)
> &&
> -		    (be->dpcm[stream].state !=
> SND_SOC_DPCM_STATE_SUSPEND))
> +		    (be->dpcm[stream].state !=
> SND_SOC_DPCM_STATE_SUSPEND) &&
> +		    (be->dpcm[stream].state !=
> SND_SOC_DPCM_STATE_PAUSED))
>  			continue;
>  
>  		dev_dbg(be->dev, "ASoC: prepare BE %s\n",

  reply	other threads:[~2019-05-08 16:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  2:32 [PATCH V2] ASoC: soc-pcm: BE dai needs prepare when pause release after resume libin.yang
2019-05-08 16:30 ` Ranjani Sridharan [this message]
2019-05-08 21:20   ` Takashi Iwai
2019-05-09  2:30     ` Yang, Libin
2019-05-12  8:07       ` Mark Brown
2019-05-13  1:09         ` Yang, Libin
2019-05-09 16:56     ` Ranjani Sridharan
2019-05-09 17:35       ` Takashi Iwai
2019-05-09 18:00         ` Ranjani Sridharan
2019-05-09 23:23         ` Yang, Libin
2019-05-10  2:02           ` Ranjani Sridharan
2019-05-10  2:32             ` Yang, Libin
2019-05-10 12:39               ` Takashi Iwai
2019-05-13 12:30 ` Applied "ASoC: soc-pcm: BE dai needs prepare when pause release after resume" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa0c6eea81a721f340dd1362801e49049a6620dd.camel@linux.intel.com \
    --to=ranjani.sridharan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=libin.yang@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rander.wang@intel.com \
    --cc=ranjani.sridharan@intel.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox