From patchwork Tue May 22 09:13:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiChieh Chuang X-Patchwork-Id: 10417669 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 B553260224 for ; Tue, 22 May 2018 09:13:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A413E28B78 for ; Tue, 22 May 2018 09:13:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97EF528B7F; Tue, 22 May 2018 09:13:59 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham 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 E8D3928B78 for ; Tue, 22 May 2018 09:13:58 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AADF7267662; Tue, 22 May 2018 11:13:48 +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 8822326765F; Tue, 22 May 2018 11:13:45 +0200 (CEST) Received: from mailgw01.mediatek.com (unknown [210.61.82.183]) by alsa0.perex.cz (Postfix) with ESMTP id 7F14226765C for ; Tue, 22 May 2018 11:13:36 +0200 (CEST) X-UUID: da33ed2061194b028c5eb9d361bc9d81-20180522 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1711043527; Tue, 22 May 2018 17:13:32 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Tue, 22 May 2018 17:13:30 +0800 Received: from mtksdaap41.mediatek.inc (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Tue, 22 May 2018 17:13:30 +0800 From: KaiChieh Chuang To: Date: Tue, 22 May 2018 17:13:28 +0800 Message-ID: <1526980408-1935-3-git-send-email-kaichieh.chuang@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526980408-1935-1-git-send-email-kaichieh.chuang@mediatek.com> References: <1526980408-1935-1-git-send-email-kaichieh.chuang@mediatek.com> MIME-Version: 1.0 X-MTK: N Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com, kaichieh.chuang@mediatek.com Subject: [alsa-devel] [PATCH 2/2] ASoC: dpcm: symmetry constraint on FE substream 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP We should set BE symmetric constraint on FE substream. in case one BE is used by two FE1/FE2, the first BE runtime will use FE1's substream->runtime. hence the FE1's will be constrained by BE symmetry property. Though, second FE2 call dpcm_apply_symmetry, the be_substream->runtime == FE1's substream->runtime. The FE2's substream->runtime will not be constrained by BE's symmetry property. Signed-off-by: KaiChieh Chuang --- sound/soc/soc-pcm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 481604a..1ef7514 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1779,14 +1779,15 @@ static int dpcm_apply_symmetry(struct snd_pcm_substream *fe_substream, /* Symmetry only applies if we've got an active stream. */ if (rtd->cpu_dai->active) { - err = soc_pcm_apply_symmetry(be_substream, rtd->cpu_dai); + err = soc_pcm_apply_symmetry(fe_substream, + rtd->cpu_dai); if (err < 0) return err; } for (i = 0; i < rtd->num_codecs; i++) { if (rtd->codec_dais[i]->active) { - err = soc_pcm_apply_symmetry(be_substream, + err = soc_pcm_apply_symmetry(fe_substream, rtd->codec_dais[i]); if (err < 0) return err;