From patchwork Thu May 30 01:17:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 800231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E00BC25B75 for ; Thu, 30 May 2024 01:21:54 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 72D2C846; Thu, 30 May 2024 03:21:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 72D2C846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1717032112; bh=HcR3Z/effrP1FZUPqig3Zvj7l0KDHU6Suc98FZZqaxU=; h=From:Subject:To:In-Reply-To:References:Date:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=oAJs7BymCETbPlfncDyqOg2dCy55a4kFmg032MSDorfZbBQIhlA/wnfHPlnT4yA2M kMi4W7O5xJkCLKwwmZD9H4xLzIt8q6x+o44KMuCfg6VCxJXdzdGdD9dtgzOOIrOhot JBOxg8cI36UANfGDZ+YgclWEvi7v/oprov6/Yogk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59AEBF8062F; Thu, 30 May 2024 03:20:33 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D9BB2F80631; Thu, 30 May 2024 03:20:32 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D865FF80149; Thu, 30 May 2024 03:19:45 +0200 (CEST) Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazlp170110000.outbound.protection.outlook.com [IPv6:2a01:111:f403:c407::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4212BF800E9 for ; Thu, 30 May 2024 03:18:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4212BF800E9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=QzHcUlRj ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f7ENcu41rU3mvVzYwshZpA68yt3yEJpb1TAWBuslHnhotw3pq46zZvzf1HhjIxG36rHMnBm+nz4DsdM9akscQKfggL6RaHKufzn83rPMpkII68suoSLM4xCDnEk+vtiajYeEQ0xI5d5oKVX6C3YHL59JWqZUXUU5yjvuuSyPm5MMQkITwqGpDdU8+KB7aqsWJBk/Nqfie9C5WNvYdpnMAiFfmnzEFql2QU4Wi3TJBRPpZVG08Fjbux/exCZZ/E8HwcuF0AMAEn6qic0ToRGFvnVz6IvM7r8gMDqXaIsXx8sezKdV/XCrt5tSz18vsha3F8QbPNTQiGLbopcq9grbRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2vonKr3xCTVsyBVxO7nQoUW2nAXyiCWU2/z8amjUQWY=; b=M6CFICq86dg60BXZA7J+NN/Pw2IiAOcVf6fCUeBcxu3MPDgCDZzb5KzPhlnKxEQOCr8sBtGg6D1yFm80Tr4Gmm07hNHXvvh8iXIn8bKqn8plKp9Js+N2mIkPASV+UXQ+pmxujwBv5qR1tfXHamXCZzpGtK9CmhMlwC5waUBRGAAfwJzbyAaV5qWU7+41Re/MU7PADCZvMzj7wM5xY2ZbgMfz0e5Tq4gRslUo7BNFmFol8r/zzmbzlX6xXN97LS8aB/JE/8YlFxzz+lVCAmrFsueu7wCh5o7TuCOjkF2G8GXKTbN/pnoLdBo+JlVQWhHf1SpYZNGROFLV/tFP3f18vQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2vonKr3xCTVsyBVxO7nQoUW2nAXyiCWU2/z8amjUQWY=; b=QzHcUlRjq5UmYoYR75aDdDwWjEVaK08hjydv+enf2959Lv+xY8oV219fJZeWAXbL5T2T3yEVqEwudo5OiKMUX1n2IxiK8iQHlw2O15zX0LM5KH6ul8Cu6SVQNzPiy03jjND2C5u6susKoe45m5nx1xNZ4BAZopeRQdODJTEZ80o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB6933.jpnprd01.prod.outlook.com (2603:1096:604:12c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Thu, 30 May 2024 01:17:59 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7633.018; Thu, 30 May 2024 01:17:58 +0000 Message-ID: <87a5k8qerd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 1/4] ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: =?iso-8859-2?q?=22Amadeusz_S=B3awi=F1ski=22?= , Alexandre Belloni , Alper Nebi Yasak , AngeloGioacchino Del Regno , Banajit Goswami , Bard Liao , Brent Lu , Cezary Rojewski , Charles Keepax , Claudiu Beznea , Cristian Ciocaltea , Daniel Baluta , Hans de Goede , Jaroslav Kysela , Jerome Brunet , Jiawei Wang , Jonathan Corbet , Kai Vehmanen , Kevin Hilman , Liam Girdwood , Mark Brown , Maso Huang , Matthias Brugger , Neil Armstrong , Nicolas Ferre , Peter Ujfalusi , Pierre-Louis Bossart , Ranjani Sridharan , Sascha Hauer , Shawn Guo , Shengjiu Wang , Srinivas Kandagatla , Sylwester Nawrocki , Takashi Iwai , Vinod Koul , Xiubo Li , alsa-devel@alsa-project.org, imx@lists.linux.dev, linux-doc@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87bk4oqerx.wl-kuninori.morimoto.gx@renesas.com> References: <87bk4oqerx.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 30 May 2024 01:17:58 +0000 X-ClientProxiedBy: TYCP286CA0106.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB6933:EE_ X-MS-Office365-Filtering-Correlation-Id: 30274907-6755-4f2c-7e4e-08dc804657bd X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|376005|366007|52116005|921011|38350700005;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QROa13Utn1CtpkTmhd/KGxxIMkCNSAKuT6LVTaVUHLb1MNvU/+F3QCjjwHKVvjBaJxy9/o5Cl30jBAKA9gkqlDvjcytSGoqpmgr4dre2HjEev3qTj1ny9LYOU/x/Uhjg541Q5Ar7saQFq/5NUm+OqYn++7VlGmjerJ3oHKQLZpB01X0cbMYCxad5SACOrok7GYepKmS9KJTp7Xbyw3dHLDkLuCa3YwOO5BTecfkEpfi+r/P8cFNao0hQw8aD5ta1Yddbm1rLJEs= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(7416005)(1800799015)(376005)(366007)(52116005)(921011)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QHj/gk9lShh9Y+z5bdHcO/7qVcndMgJzYjFAlGOEgOit7mCDms9OmJlfkj/XBUPl0wU+r94/qqO80Or4wU5XS2l3w9N8/FXFf0MJURiodvSQ65q7UeGwJUORJaKwwnfTn82n/ZYxDkXIHOUw4DFBfvOmxXFDM+Pg3ZYoT4q4d/O6iUlZQ0L/4vacgKxRLVmjY+TfpsWkNnZ0nCWhuCDKAKVbZPfq5RdhcQcQMl9BAftW4skFE1Ha+MAVdbudWnZXJ+gHbBvQ/y7tu5QjinNbmWjJ5TODAFq3qT83nnZICPggKXDFgeD+Y7WWRM9IC2LbJ9z803fLZiILwTkAIAUIjRoQOjx+1LyZ6IaJImw9y0AiWNFYARG7OnHXkqHwnvlCXV4iRvoB3Gq0/YhK0s8kYCLlsSwUoXUNlXmC1Ah5HnGN5P7Exua7Qie5+0ovTeZBB+IMvih6eDhbXMHuWHEGqtZz23i3w/OPtTUPmiWUyRbATwvKS/o2HDh/0d9CUieWt1Ce89S/+7q8z7vUrNc6myg+IIXb783btfrlOj2aEb98gGppNkuksd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xQyvc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 30274907-6755-4f2c-7e4e-08dc804657bd X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2024 01:17:58.8911 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5uf9v+/Q52PurZtdv/AZS7S+WOTYW+j+GOzyaHBuN8PwAx7l9jUBCXe8d2Qlf86O+yHFnHu3PJySJswv/iNoK3ZAomNQh03Y2t8HWzig9UsdYGoe1lPCWA6ye101wz6u X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB6933 Message-ID-Hash: LQIDVTRIPAI4ZLTPMN22URIAMYTSRGHR X-Message-ID-Hash: LQIDVTRIPAI4ZLTPMN22URIAMYTSRGHR X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I have been wondering why DPCM needs special flag (= dpcm_playback/capture) to use it. Below is the history why it was added to ASoC. (A) In beginning, there was no dpcm_xxx flag on ASoC. It checks channels_min for DPCM, same as current non-DPCM. Let's name it as "validation check" here. if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { if (cpu_dai->driver->playback.channels_min) playback = 1; if (cpu_dai->driver->capture.channels_min) capture = 1; (B) commit 1e9de42f4324 ("ASoC: dpcm: Explicitly set BE DAI link supported stream directions") force to use dpcm_xxx flag on DPCM. According to this commit log, this is because "Some BE dummy DAI doesn't set channels_min for playback/capture". But we don't know which DAI is it, and not know why it can't/don't have channels_min. Let's name it as "no_chan_DAI" here. According to the code and git-log, it is used as DCPM-BE and is CPU DAI. I think the correct solution was set channels_min on "no_chan_DAI" side, not update ASoC framework side. But everything is under smoke today. if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { playback = rtd->dai_link->dpcm_playback; capture = rtd->dai_link->dpcm_capture; (C) commit 9b5db059366a ("ASoC: soc-pcm: dpcm: Only allow playback/capture if supported") checks channels_min (= validation check) again. Because DPCM availability was handled by dpcm_xxx flag at that time, but some Sound Card set it even though it wasn't available. Clearly there's a contradiction here. I think correct solution was update Sound Card side instead of ASoC framework. Sound Card side will be updated to handle this issue later (commit 25612477d20b ("ASoC: soc-dai: set dai_link dpcm_ flags with a helper")) if (rtd->dai_link->dynamic || rtd->dai_link->no_pcm) { ... playback = rtd->dai_link->dpcm_playback && snd_soc_dai_stream_valid(cpu_dai, ...); capture = rtd->dai_link->dpcm_capture && snd_soc_dai_stream_valid(cpu_dai, ...); This (C) patch should have broken "no_chan_DAI" which doesn't have channels_min, but there was no such report during this 4 years. Possibilities case are as follows - No one is using "no_chan_DAI" - "no_chan_DAI" is no longer exist : was removed ? - "no_chan_DAI" is no longer exist : has channels_min ? Because of these history, this dpcm_xxx is unneeded flag today. But because we have been used it for 10 years since (B), it may have been used differently. For example some DAI available both playback/capture, but it set dpcm_playback flag only, in this case dpcm_xxx flag is used as availability limitation. We can use playback_only flag instead in this case, but it is very difficult to find such DAI today. Let's add grace time to remove dpcm_playback/capture flag. This patch don't use dpcm_xxx flag anymore, and indicates warning to use xxx_only flag if both playback/capture were available but using only one of dpcm_xxx flag, and not using xxx_only flag. Link: https://lore.kernel.org/r/87edaym2cg.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Tested-by: Jerome Brunet --- include/sound/soc.h | 1 + sound/soc/soc-pcm.c | 65 ++++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 33671437ee896..2a3da1d913776 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -815,6 +815,7 @@ struct snd_soc_dai_link { /* This DAI link can route to other DAI links at runtime (Frontend)*/ unsigned int dynamic:1; + /* REMOVE ME */ /* DPCM capture and Playback support */ unsigned int dpcm_capture:1; unsigned int dpcm_playback:1; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 711b2f49ed88d..7fe5ee3bcfd4e 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2795,6 +2795,7 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, { struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_dai *cpu_dai; + struct snd_soc_dai_link_ch_map *ch_maps; int has_playback = 0; int has_capture = 0; int i; @@ -2805,43 +2806,51 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } if (dai_link->dynamic || dai_link->no_pcm) { - int stream; - if (dai_link->dpcm_playback) { - stream = SNDRV_PCM_STREAM_PLAYBACK; + for_each_rtd_ch_maps(rtd, i, ch_maps) { + cpu_dai = snd_soc_rtd_to_cpu(rtd, ch_maps->cpu); - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - if (snd_soc_dai_stream_valid(cpu_dai, stream)) { - has_playback = 1; - break; - } - } - if (!has_playback) { - dev_err(rtd->card->dev, - "No CPU DAIs support playback for stream %s\n", - dai_link->stream_name); - return -EINVAL; - } + if (snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK)) + has_playback = 1; + + if (snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE)) + has_capture = 1; } - if (dai_link->dpcm_capture) { - stream = SNDRV_PCM_STREAM_CAPTURE; - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - if (snd_soc_dai_stream_valid(cpu_dai, stream)) { - has_capture = 1; - break; - } + /* + * REMOVE ME + * + * dpcm_xxx flag will be removed soon, Indicates warning if dpcm_xxx flag was used + * as availability limitation + */ + if (has_playback && has_capture) { + if ( dai_link->dpcm_playback && + !dai_link->dpcm_capture && + !dai_link->playback_only) { + dev_warn(rtd->card->dev, + "both playback/capture are available," + " but not using playback_only flag (%s)\n", + dai_link->stream_name); + dev_warn(rtd->card->dev, + "dpcm_playback/capture are no longer needed," + " please use playback/capture_only instead\n"); + has_capture = 0; } - if (!has_capture) { - dev_err(rtd->card->dev, - "No CPU DAIs support capture for stream %s\n", - dai_link->stream_name); - return -EINVAL; + if (!dai_link->dpcm_playback && + dai_link->dpcm_capture && + !dai_link->capture_only) { + dev_warn(rtd->card->dev, + "both playback/capture are available," + " but not using capture_only flag (%s)\n", + dai_link->stream_name); + dev_warn(rtd->card->dev, + "dpcm_playback/capture are no longer needed," + " please use playback/capture_only instead\n"); + has_playback = 0; } } } else { - struct snd_soc_dai_link_ch_map *ch_maps; struct snd_soc_dai *codec_dai; /* Adapt stream for codec2codec links */