Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbdHCNrm (ORCPT ); Thu, 3 Aug 2017 09:47:42 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:37458 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbdHCNri (ORCPT ); Thu, 3 Aug 2017 09:47:38 -0400 MIME-Version: 1.0 In-Reply-To: <60e20968-28b2-dd91-c30c-318aee9d298f@linux.intel.com> References: <20170731104734.5776-1-cychiang@chromium.org> <20170801033006.GL3053@localhost> <60e20968-28b2-dd91-c30c-318aee9d298f@linux.intel.com> From: Cheng-yi Chiang Date: Thu, 3 Aug 2017 21:47:06 +0800 X-Google-Sender-Auth: fn4TI79izsqfxem13k6-fXA8jbI Message-ID: Subject: Re: [alsa-devel] [PATCH v2] ASoC: Intel: Reset hw_ptr on resume trigger To: Keyon Jie Cc: Vinod Koul , Jie Yang , alsa-devel@alsa-project.org, Liam Girdwood , linux-kernel@vger.kernel.org, Takashi Iwai , Mark Brown , "U . Artie Eoff" , Jarkko Nikula Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v73DlkKm018444 Content-Length: 2599 Lines: 76 +Jarkko Nikula Hi Keyon, Sorry for the late reply. I spent some time trying to figure out previous suspend resume patch in BYT. From the patch for restore_stream flag: https://patchwork.kernel.org/patch/4706611/, the restore_stream flag means that ADSP was in power off state during system suspend/resume cycle. You are right that the resuming won't play from the pausing point of the last suspending. I am not sure whether it is intended in ADSP coming back from power off case. Jarkko and Ullysses might have better idea on this. In my testing I have found that this patch sometimes causes playback failure upon resume. I have put the logs in https://bugs.chromium.org/p/chromium/issues/detail?id=752107. I think we should not merge this until it is resolved. I have cc'ed Intel folks on the issue. Thanks! On Tue, Aug 1, 2017 at 1:04 PM, Keyon Jie wrote: > > On 2017年08月01日 11:30, Vinod Koul wrote: >> >> On Mon, Jul 31, 2017 at 06:47:34PM +0800, Cheng-Yi Chiang wrote: >>> >>> From: "U. Artie Eoff" >>> >>> Reset the hw_ptr before queuing the restore_stream_context >>> work to eradicate a nasty white audio noise on resume. >> >> >> Liam, Jie? This on legacy BYT driver.. >> >>> >>> Tested-by: Cheng-Yi Chiang >>> Signed-off-by: U. Artie Eoff >>> Signed-off-by: Cheng-Yi Chiang >>> --- >>> sound/soc/intel/baytrail/sst-baytrail-pcm.c | 4 +++- >>> 1 file changed, 3 insertions(+), 1 deletion(-) >>> >>> diff --git a/sound/soc/intel/baytrail/sst-baytrail-pcm.c >>> b/sound/soc/intel/baytrail/sst-baytrail-pcm.c >>> index 4765ad474544..e0db7070cd42 100644 >>> --- a/sound/soc/intel/baytrail/sst-baytrail-pcm.c >>> +++ b/sound/soc/intel/baytrail/sst-baytrail-pcm.c >>> @@ -187,8 +187,10 @@ static int sst_byt_pcm_trigger(struct >>> snd_pcm_substream *substream, int cmd) >>> sst_byt_stream_start(byt, pcm_data->stream, 0); >>> break; >>> case SNDRV_PCM_TRIGGER_RESUME: >>> - if (pdata->restore_stream == true) >>> + if (pdata->restore_stream == true) { >>> + pcm_data->hw_ptr = 0; > > > Won't this break the hw_ptr and make the resuming won't play from the > pausing point of the last suspending? > > Thanks, > ~Keyon > > >>> schedule_work(&pcm_data->work); >>> + } >>> else >>> sst_byt_stream_resume(byt, pcm_data->stream); >>> break; >>> -- >>> 2.12.2 >>> >> >