From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ranjani Sridharan Subject: Re: [PATCH V2] ASoC: soc-pcm: BE dai needs prepare when pause release after resume Date: Thu, 09 May 2019 19:02:38 -0700 Message-ID: <9a392d4db4e6e700cf473f6ddaab532fcf3876f2.camel@linux.intel.com> References: <1557282761-26146-1-git-send-email-libin.yang@intel.com> <96A12704CE18D347B625EE2D4A099D19528396E1@SHSMSX103.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AEE18F89673 for ; Fri, 10 May 2019 04:02:42 +0200 (CEST) In-Reply-To: <96A12704CE18D347B625EE2D4A099D19528396E1@SHSMSX103.ccr.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" To: "Yang, Libin" , Takashi Iwai Cc: "alsa-devel@alsa-project.org" , "Sridharan, Ranjani" , "broonie@kernel.org" , "pierre-louis.bossart@linux.intel.com" , "Wang, Rander" List-Id: alsa-devel@alsa-project.org > > > > > > 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. > > Ranjani, with "regular pause-release", do you mean pause-release > without S3? The prepare() is called from alsa core (pcm_native.c) in > S3 case. > Prepare() being called in pause-release after S3 is because of S3, > not because > of pause-release. Actually, if you pause-release without S3 (not sure > in > pm-runtime case), ASoC's prepare() will not be called. So > dpcm_be_dai_prepare() will not be called. So you assumption of > "regular pause-release" calling prepare() is wrong. Oh yes. That's right. Thanks for pointing it out. In this case, the patch sounds like a good fix. Basically, you're saying that if the FE prepare() gets called (which happens in the case of pause-release without INFO_RESUME) it should also call the BE prepare(), right? Takashi, what do you think? > > Please let me describe the flow below: > 1. Pause-release after S3 without RESUME_INFO > Prepare() -> trigger start > 2. pause-release without S3 without/with RESUME_INFO > Trigger pause-release > 3. Pause-release after S3 with RESUME_INFO > Trigger resume Are you sure about this? A paused stream will not be suspended. So it would still be trigger PAUSE-RELEASE in this case? Thanks, Ranjani