From: Takashi Iwai <tiwai@suse.de>
To: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: libin.yang@intel.com, alsa-devel@alsa-project.org,
ranjani.sridharan@intel.com,
pierre-louis.bossart@linux.intel.com, rander.wang@intel.com,
broonie@kernel.org
Subject: Re: [PATCH V2] ASoC: soc-pcm: BE dai needs prepare when pause release after resume
Date: Thu, 09 May 2019 19:35:17 +0200 [thread overview]
Message-ID: <s5hd0krmsyy.wl-tiwai@suse.de> (raw)
In-Reply-To: <ac99b2fefe05833787e473cbd2327a35c02de68b.camel@linux.intel.com>
On Thu, 09 May 2019 18:56:12 +0200,
Ranjani Sridharan wrote:
>
> > Hm, it's a good question. Currently the PCM core doesn't care about
> > the paused stream wrt PM by the assumption that the paused / stopped
> > stream doesn't need a special resume treatment. But, generally
> > speaking, the pause-release won't work for a hardware that doesn't
> > support the full resume, either. For example, the legacy HD-audio
> > may
> > restart from some wrong position if resumed from the pause.
> >
> > Maybe this problem hasn't been seen just because the pause function
> > is
> > rarely used.
> >
> > So, the safe behavior would be to let the stream being SUSPENDED
> > state
> > at snd_pcm_stream_suspend() when it's in the PAUSED and has no
> > INFO_RESUME capability. Then the application does re-prepare the
> > stream like the running one.
> >
> > But the question is what's expected at next. Should the application
> > re-start? But it was paused. Should PCM core automatically move to
> > pause? But most hardware can't move the pointer to any random
> > position.
> >
> > My gut feeling is just to treat like a normal error-restart,
> > i.e. re-prepare / re-start. But I'm open and would like to hear more
> > opinions.
>
> Hi Takashi,
>
> So in the current scenario what we see is that after resuming from S3,
> a pause-release action from the user results in a FE prepare() followed
> by the START trigger (and not a PAUSE-RELEASE trigger).
>
> Libin's patch proposes to do a prepare() for the BE even in the case of
> a regular pause-release. But this might not be ideal since other
> drivers might have logic in the prepare() ioctl that might end up with
> errors.
Right.
> So I am thinking maybe we can have some internal logic in the SOF
> prepare() callback that will also call the BE prepare() when the
> be->dpcm[stream].state is SND_SOC_DPCM_STATE_PAUSED? Would that make
> sense?
Yes, that would work, I guess. Eventually this might be needed to be
addressed in ALSA core side, too, but it's good to have some fix
beforehand in DPCM.
thanks,
Takashi
next prev parent reply other threads:[~2019-05-09 17:35 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
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 [this message]
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=s5hd0krmsyy.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--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=ranjani.sridharan@linux.intel.com \
/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