From patchwork Wed Jun 19 00:19:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 805662 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 A727EC27C4F for ; Wed, 19 Jun 2024 00:22:04 +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 D7B18DF9; Wed, 19 Jun 2024 02:21:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D7B18DF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718756522; bh=se4WcdwbITVFDokTGVdfhD2eqTW+zcMvrCXrgISiZrM=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=NKwnLDDaMpbHADM6whHNcCPZ3uC8mbKtltXpZHwEv28GqUDhMqhVQMf3V6gABuumU OScfONGv5Zoh3LUPF2lc8lE1HBUSrUSV0uO4eyCypdK5t3pyJMMAWPAJHzUu7GHhR3 yxJe+2fr6gZJV70KAHu7dJFxBDPkJ15Y9vc8ZmMg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 20C2CF805BA; Wed, 19 Jun 2024 02:21:29 +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 51010F805B0; Wed, 19 Jun 2024 02:21:29 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E0423F80587; Wed, 19 Jun 2024 02:19:48 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20602.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::602]) (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 06524F80588 for ; Wed, 19 Jun 2024 02:19:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 06524F80588 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=l1JXsh09 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+7OKzc0NFKdUjCAaBnzkXzmpEeHU6Xr0/jaL2+EsyI8+BIK+qb8iAoYS3XhM11gDTY+CZt49y0ssEiwnjw2Ik4W6gY7o2Xo3icm8XygB01pU2DYT5FCv/nMVOZKJH1R/qa6IsMKZm3y/3bAAefZe5TEyUzeA8DKXeL++sEPtCtLnt54ZZqGlxADocsUCiDpPQ10ciTEggLDS8UBYAVkoLTneApx5ePWy09GRotW3u1PyU6FKe87aLfeV1tCdh0J9vD6lcDfbjpclZx7nfP+cKd9lqmF7VCpmyDV6opFnXkN7qAsd8RzdBQURyvZ7gR9OwhRPID9onqDCdoMrOftnQ== 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=AdMd3EFoHmtq/QP8bndNVlYrUlJsRXLuagPZvm7tS9k=; b=Ooy/dgMf53QHf26X8sj2gOjBbVbZVtLwfG2G1f+486pyXDnZA6Wi74efyvQ+7wumvEVDNAUAbsQkFVKeTZOdTl/LgeaKgjnc+hmGSqowjDYlxXHSq/uTbsVTQGrWewXfPWE/0cYznP1ApdPJSraT33ysy+H3qvRGfQe8caw6uXSFeqnFSrFtjq/1hqqlis34ohzoyVFNmzvH7IJBAiGZMUhqH1VCygZDM+J2hQoDOcqnmSsKS4m8r4LhTdAbJm6nzxvIM+QrfMN8/Stikg6J8RvD+wZF+YN2eYGt4/A2Reg+j0isOc9eom85rfHR6PPukq1fOOIrz5+K0DEaILntfg== 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=AdMd3EFoHmtq/QP8bndNVlYrUlJsRXLuagPZvm7tS9k=; b=l1JXsh09h5URJqm0CqqA300J+EH+j9hEHkV1kIpR0WmBFDbX4gA1xs8ASZXe3hsLPjClTJTQkp87rZzV2PW3j/9dT382HEQzsLMXf3hkRfb5xkiH1myK0zwsDyAPbWFkWfENGu+aRZjMe9ESUNar5/y4LOYpZ67jBtTiglKbMQ4= 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 TYCPR01MB11717.jpnprd01.prod.outlook.com (2603:1096:400:37d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Wed, 19 Jun 2024 00:19:36 +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.7677.030; Wed, 19 Jun 2024 00:19:36 +0000 Message-ID: <87plsdwzqf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v6 1/4] ASoC: soc-pcm: Indicate warning if dpcm_playback/capture were used for availability limition 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 Cc: alsa-devel@alsa-project.org, imx@lists.linux.dev, linux-doc@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87r0ctwzr4.wl-kuninori.morimoto.gx@renesas.com> References: <87r0ctwzr4.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 19 Jun 2024 00:19:36 +0000 X-ClientProxiedBy: TYCP286CA0077.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB11717:EE_ X-MS-Office365-Filtering-Correlation-Id: 5fb00101-c67e-4bc8-860d-08dc8ff5806e 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:13230037|366013|52116011|7416011|376011|1800799021|38350700011|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hkD1/4Uz3x03rOKD6UhfA6bE8q39M+a5fr/grJ0qMe6Cw8ENXDz4K9864XpwM9N7GASjk8CJcbxtI/Z0jFO8/GGR+rGGZeI/eVcmTNpduq2Hmvs0BdYoRhgf+7sczGAizIZiHlh+Oix0tgYUXjuVnLHu3XK2ERMutPRqu13c5Em1bZDOqnHLdfdVazaVrYq3CZCwjLLcMYrzIaO6/6wAmOWUMGtmNvBamFMN/7hRGerqfc277xbnMgpAglQJPGSsr+LTS0RNuJeJksreO7ekjcipV3SVabDYCT92+BR7ocg9Qan00bwQEHtd7hkInBnhqMOJ7cdTaYPw== 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:(13230037)(366013)(52116011)(7416011)(376011)(1800799021)(38350700011)(921017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PskQuAB9X7LIOKpsJWRFcN7KTYp8a9SuCLX8TtnXE7GVtkuwquqto8QMpmhkSy2pDUyLj35h4w8Yqrv84EK/ZPO1qigL6pAD09SoRkIi6MM0dDBhwllLDaa+b4IsRRtIP0AIkAD0Xb7IwYyX66UKh06Eb+NWf1ZgCG79DM/KzvE5406VuWcd/o8PkOcSQp5wpxmnprwsFNAc+B9j2gYriC++JJixoZ1rSVvH9Q1G8Yl9Q65ebsvp4rA6McWxwK9LFl2xfvLGVhAWbXPC74424HYjhIvdq/jnmvQ289WcuYFADLAR9UXUpZmxCvz+47PpmmfhRI8ov5utLX2KVVpKxu8UdZoeLDjN+wVCunLUGS3AajBNFRMpPTQ6+HJn+Z5OCZH0WitUsHgRG99vIhy25O7UivoGH7Njw/nvAs0f3G6hDqDKV7jisLmG4CRIBy9m6OgMzSkMV9a7j3DZuvHsvdE2xwKM4gDjJmeHktBiuweapcZDypVmepv16JaTYiICWjt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67R3Dlvyo8WLEXvmz4iz03cp9zQKvSLSTdcskk0XeNWXVsfjE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fb00101-c67e-4bc8-860d-08dc8ff5806e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2024 00:19:36.6221 (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: dC44GJqxBl4c96KiMdinNuvO5/RxOMYR+cRMuCSKk3oe2nuPhW3uevo45SYIrMdtsudKgBEVJxCv+0+YDbqMKVQgZCDNZKua1rkJJ/qWe0W4mOfScGSRc6DsQbbPe8m8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11717 Message-ID-Hash: 3BV5XEI6YT6OAC3XDTECLKLO2KH252PR X-Message-ID-Hash: 3BV5XEI6YT6OAC3XDTECLKLO2KH252PR 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 33671437ee89..2a3da1d91377 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 711b2f49ed88..7fe5ee3bcfd4 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 */