From patchwork Wed Sep 20 11:41:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 113101 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp660114qgf; Wed, 20 Sep 2017 04:41:53 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCpzfRr0VDmE1szYbIwOOUPLuxMDYUXeOe0x3S7qnP/2RejOTpUgtBzBVFMrizUHonob6vd X-Received: by 10.223.182.10 with SMTP id f10mr4526377wre.38.1505907713010; Wed, 20 Sep 2017 04:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505907713; cv=none; d=google.com; s=arc-20160816; b=XpIjwxV4/yOKgprE1RWe9F4MgucjrpCLLILB79WJ5c8D65CboRQZ2BbyWScGvpjz7R 3WYiGaqdir8s4Hct72Omw1fZp2BWKdqpsaJfE/HOnivis9j+CNmt3d5M9nEFExTwfm/6 TOYTHg3wWqT8RbZ4DiJp9Jgs6MgflqCsLtCZpMrWRxOGY6KfiQMgC9JCa2rLoPUmHg29 ugMNPW94/QWtKe5bEOsNqb4MtHTxyV0cFCciNZxKnCMzm3KcYng8fkHsR/GMPEfBQqyp kg672uF2Ji1w7MjoitF/KIor3YdQRtAVAfaNzQhJSvUuxBWIFcJLCJEzKr5rmwI0k7gB 0dNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=vmWhoW2o1u5QdWvoGdFoK0FGlFmgoVc1Lb+n5JDULoQ=; b=EnjsKnEpaTnnr1B5kMrpbrGTJRMGgY6WoVtshn+epmJ2eP3t+JVgqAXQNZ0DcR+VAV jXDwD7+2LGwl356XfIr8XNxH3wDxuFAUYAeCoTbnni851YYxo10u+yRJhwFDCdGXVpLG C+3WaujmphvhZfqObrvPfoRn8cAjulB0QYm2yatEbAbHHf7DFkN2MHJ/f9fKjWFuA0rz pU/6OY5JF/xSccLchhVIKYEsvCvwTnu8EK8lqxJglaO//xNd+/GDqBGPyuAzOciJR2kB F3b5QjVoDZTGTulep1S/rlQ2UfAqz0t1WRepHaU9GfTh1z+O6tK9KiEWircgptN756+F LxGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=gNpmkX98; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id x7si1240875wme.169.2017.09.20.04.41.52; Wed, 20 Sep 2017 04:41:52 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=gNpmkX98; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 99B412674EA; Wed, 20 Sep 2017 13:41:51 +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 AE3612674F1; Wed, 20 Sep 2017 13:41:50 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 2F89E266B21 for ; Wed, 20 Sep 2017 13:41:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=68xo1F6HKotnkWLJmpueO1Q7Mxju9oFgJMoO8iGiwNQ=; b=gNpmkX984bIY 5OglaJ4YWT1YcDFlVE7dO1Ge7ysG/re9V+sQ3QFiKzysSqF3PYXAlqKT+bSHPBwdZtBZ1kusnY1kY Kcwt92mx50jH3sY2x5dWo11o2IMK1IunSoyaSFzOkPvPYMyleIiOKplQikxs/RAAAhWn+loztSZDK QiBY8=; Received: from [2001:470:1f1d:6b5:7e7a:91ff:fede:4a45] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dudO0-0003ji-8O; Wed, 20 Sep 2017 11:41:48 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id D7A0D4400D3; Wed, 20 Sep 2017 04:41:47 -0700 (PDT) From: Mark Brown To: jiada wang In-Reply-To: <20170920062530.12252-1-jiada_wang@mentor.com> Message-Id: <20170920114147.D7A0D4400D3@finisterre.ee.mobilebroadband> Date: Wed, 20 Sep 2017 04:41:47 -0700 (PDT) Cc: alsa-devel@alsa-project.org, jiada_wang@mentor.com, linux-kernel@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, broonie@kernel.org Subject: [alsa-devel] Applied "ASoC: soc-pcm: check symmetry after hw_params" to the asoc tree 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 The patch ASoC: soc-pcm: check symmetry after hw_params has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 957ce0c6b8a1f26559864507ae0bfcba29d924ad Mon Sep 17 00:00:00 2001 From: jiada wang Date: Wed, 20 Sep 2017 15:25:30 +0900 Subject: [PATCH] ASoC: soc-pcm: check symmetry after hw_params hw_params may be fixup by be_hw_params_fixup, calling soc_pcm_params_symmetry() before hw_params will have issue if there is hw_params changes in be_hw_params_fixup. For example, with following use case 1. a dai-link which is able to convert sample rate on BE side 2. set BE playback and capture sample rate to 44100Hz 3. play a 48000Hz audio stream with this dai-link 4. record from this dai-link with 44100Hz sample rate Got following error message when record starts [ 495.013527] be_link_ak4613: ASoC: unmatched rate symmetry: 48000 - 44100 [ 495.021729] be_link_ak4613: ASoC: hw_params BE failed -22 [ 495.028589] rsnd_link0: ASoC: hw_params BE failed -22 Because in soc_pcm_hw_params(), FE rate is still having value before it is fixup by be_hw_params_fixup(), when soc_pcm_params_symmetry() checks symmetry, thus soc_pcm_params_symmetry() complains about the unmatched rate between the active stream and the new stream tries to start. This patch moves soc_pcm_params_symmetry() after hw_params to resolve the above issue. Signed-off-by: Jiada Wang Signed-off-by: Mark Brown --- sound/soc/soc-pcm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.13.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 94b88b897c3b..f11421f08065 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -855,11 +855,6 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, int i, ret = 0; mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); - - ret = soc_pcm_params_symmetry(substream, params); - if (ret) - goto out; - if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) { ret = rtd->dai_link->ops->hw_params(substream, params); if (ret < 0) { @@ -930,6 +925,10 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, cpu_dai->sample_bits = snd_pcm_format_physical_width(params_format(params)); + + ret = soc_pcm_params_symmetry(substream, params); + if (ret) + goto platform_err; out: mutex_unlock(&rtd->pcm_mutex); return ret;