From patchwork Sun Jan 1 06:44:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Lai X-Patchwork-Id: 9492859 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 E130560415 for ; Sun, 1 Jan 2017 06:47:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7385525F31 for ; Sun, 1 Jan 2017 06:47:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6845926785; Sun, 1 Jan 2017 06:47:24 +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 AB49C25F31 for ; Sun, 1 Jan 2017 06:47:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 24213266639; Sun, 1 Jan 2017 07:47:22 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7B408266639; Sun, 1 Jan 2017 07:45:03 +0100 (CET) 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 64FDE2666AD; Sun, 1 Jan 2017 07:44:54 +0100 (CET) Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by alsa0.perex.cz (Postfix) with ESMTP id 4B1D7266639 for ; Sun, 1 Jan 2017 07:44:51 +0100 (CET) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E6B5E61180; Sun, 1 Jan 2017 06:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1483253090; bh=rZ7L3krUiMUkFrT7WtGU1T44ISkLFxba4J/jl2LlnAE=; h=From:To:Cc:Subject:Date:From; b=hfqu6mpigBSEcVx5r2U4bEIsDO16K7u3qoctDM8475vr/7SAbHe9+FFb1/bDnXVxq 7WxgUf3XR+enoc5jWWkCAXUK5ho6aWK+NPN56/OhcmWDEOjlOomXEm3JIfUTzqLkKf BHnYdlkoiNGfssHCJC/2Tq1Vx43H0nKoKNbqhpZw= Received: from plai-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: plai@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 53C296089D; Sun, 1 Jan 2017 06:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1483253090; bh=rZ7L3krUiMUkFrT7WtGU1T44ISkLFxba4J/jl2LlnAE=; h=From:To:Cc:Subject:Date:From; b=hfqu6mpigBSEcVx5r2U4bEIsDO16K7u3qoctDM8475vr/7SAbHe9+FFb1/bDnXVxq 7WxgUf3XR+enoc5jWWkCAXUK5ho6aWK+NPN56/OhcmWDEOjlOomXEm3JIfUTzqLkKf BHnYdlkoiNGfssHCJC/2Tq1Vx43H0nKoKNbqhpZw= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 53C296089D Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=plai@codeaurora.org From: Patrick Lai To: broonie@kernel.org Date: Sat, 31 Dec 2016 22:44:39 -0800 Message-Id: <1483253079-7978-1-git-send-email-plai@codeaurora.org> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, bgoswami@codeaurora.org, Patrick Lai Subject: [alsa-devel] [PATCH] ASoC: dpcm: Avoid putting stream state to STOP when FE stream is paused 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 When multiple front-ends are using the same back-end, putting state of a front-end to STOP state upon receiving pause command will result in backend stream getting released by DPCM framework unintentionally. In order to avoid backend to be released when another active front-end stream is present, put the stream state to PAUSED state instead of STOP state. Signed-off-by: Patrick Lai --- sound/soc/soc-pcm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index e7a1eaa..6aba140 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2184,9 +2184,11 @@ static int dpcm_fe_dai_do_trigger(struct snd_pcm_substream *substream, int cmd) break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: fe->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; break; + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; + break; } out: