From patchwork Mon Jul 31 10:47:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-yi Chiang X-Patchwork-Id: 9871577 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD63E6037D for ; Mon, 31 Jul 2017 10:48:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFAA328572 for ; Mon, 31 Jul 2017 10:48:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A485C2858E; Mon, 31 Jul 2017 10:48:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D449028572 for ; Mon, 31 Jul 2017 10:48:40 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4B28A266FA1; Mon, 31 Jul 2017 12:48:38 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 61CDD266FBD; Mon, 31 Jul 2017 12:48:36 +0200 (CEST) Received: from mail-pg0-f45.google.com (mail-pg0-f45.google.com [74.125.83.45]) by alsa0.perex.cz (Postfix) with ESMTP id 2AE53266FA1 for ; Mon, 31 Jul 2017 12:48:32 +0200 (CEST) Received: by mail-pg0-f45.google.com with SMTP id 125so136855359pgi.3 for ; Mon, 31 Jul 2017 03:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=jd/r8SKYskl0dTHPd4r/zH7fpkEbCLEjdNWTtbdS31w=; b=FALzbi1hHvZPThTNWC7h2JMtFEo54mPsVEbS40hLXMdRFb9x5ltUcaJaeyMf+4aGV1 SL8hceI9gzwAxPZoDdMCHCtkSktKi1llNi6GERtdqVOzud2fibFlnyaY17QfBPzvVC56 A8r6ICJy1xLIpxlyei0v2gJVt1+iPonKh2w3c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jd/r8SKYskl0dTHPd4r/zH7fpkEbCLEjdNWTtbdS31w=; b=gn6NaOGhAKmpEvHAHOZ7cYE6sp9mKemfsVcb+v1h4jgJ9f0SAH32cBX/RpgrZHJaYr AdkPNrWkJS7/qdM4Ns3i6LEys3H4e8zYASVs3YIz1XOFMrmy/NWGPAEKYL4Uj6AA+pHv uZc9XM63j+kJhvdl9TJJfJRWX8RJPNymSp6oi9weXQZfvIuZJDLec3erV+sT66vQFvn5 UD/jBKRurh3Omtl+Dy9O9M6s2VHE8IB91CaN8cyV9xGuoe9q1kD6AlZYTaXMUu41V21L 3ftpco0OPgZkIdVJ934Ra7TlRvV7fsogP4ACxo7U/cHPGDF+uM5oUHnZuAYU8j8QULDz k0vQ== X-Gm-Message-State: AIVw113LXTPj4/20Ov1aMN7nsgS6+9NFhvDxGw8V7stLyumI8OVlR7tL bUiE7tzvDGRefslN X-Received: by 10.101.90.73 with SMTP id z9mr14950325pgs.450.1501498111252; Mon, 31 Jul 2017 03:48:31 -0700 (PDT) Received: from cychiang-z840.tpe.corp.google.com ([2401:fa00:1:b:612b:2452:d424:c4de]) by smtp.gmail.com with ESMTPSA id p67sm50818355pga.79.2017.07.31.03.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 03:48:29 -0700 (PDT) From: Cheng-Yi Chiang To: linux-kernel@vger.kernel.org Date: Mon, 31 Jul 2017 18:47:34 +0800 Message-Id: <20170731104734.5776-1-cychiang@chromium.org> X-Mailer: git-send-email 2.12.2 Cc: alsa-devel@alsa-project.org, Vinod Koul , Takashi Iwai , Liam Girdwood , Mark Brown , "U . Artie Eoff" , Cheng-Yi Chiang Subject: [alsa-devel] [PATCH v2] ASoC: Intel: Reset hw_ptr on resume trigger X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: "U. Artie Eoff" Reset the hw_ptr before queuing the restore_stream_context work to eradicate a nasty white audio noise on resume. 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; schedule_work(&pcm_data->work); + } else sst_byt_stream_resume(byt, pcm_data->stream); break;