From patchwork Mon Jun 17 00:50:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 806781 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 A1C83C27C53 for ; Mon, 17 Jun 2024 00:52:10 +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 EF7CCE97; Mon, 17 Jun 2024 02:51:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EF7CCE97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718585529; 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=YEViiFH3d0xcZakYw56lEWwnlZX+9tKAwix/3tbZZom9oztEdmE5e1DjkClBhJ7HS 0JSCi/L3Bw8EZJOMmlO6V6Xgw1t27DR5zUooxVn6mYQr2aT/d53j/Uf/7V7Gdjehx9 pKMVsjzpsLOcsUsjp6ivbLT+kOlkqvELt03H0pQM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id BCAD4F805EB; Mon, 17 Jun 2024 02:51:14 +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 BD890F805D7; Mon, 17 Jun 2024 02:51:14 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 379EDF8023A; Mon, 17 Jun 2024 02:50:48 +0200 (CEST) Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on20629.outbound.protection.outlook.com [IPv6:2a01:111:f403:201a::629]) (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 3A932F800ED for ; Mon, 17 Jun 2024 02:50:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3A932F800ED 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=Hpcnl8Hx ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sd20TUWJQSgTDrtn/dXoyK+1CSMvaSydB6GBMIRh3K3cLrVC7QPRCd5nivcrIo3OWNyMjSh8CJtv1gV6VQid6ttuW7LD04oQhDBLtZbAh9U5Bp8fjz1WDSJbvX2sOnrn0JvWsAfPSZur4fFjWgVoBWRyCPaYioruuI8tKteMdSivHbUPiSZIDJqBpomgPhfE50Wc5/ZQ46BT0abndWZ2AvxY1sldaT4g8XmvHHUImZQHftKdEfuOY80P8Ki4qKyw3Izmv6/4AdfA1alKcYgWpmXDmUJZKS1K0gOfLFx2bhwXj3KbCPWK07KP0RZXHQK8WEYpxRWv5eNIOFPXJx0tNA== 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=M3K+YrmeFOxD/pPWdCvgNaV883gADE6UcheUUa8m37ecfAKwwZwb3QQr6GlZyDeMUcSgr63c8+dlwLH0zMkW7nMjHE3pzOId2Pu0nE15Zr8WN+0ynPOv0j0Q0wW0NMt9k/k4w4uowPRMSK3oeGeDkVhPXNKX+vPPPbh28Qk2FeX63H+ucGDlCNRh73dTTHvnN9u3Yw9Tor8plkHI7hlFf/Rho/Yq/clk97c8u7USppG6+xxJQ7cSHdLduJEloZh4DjzAb0IhB/cAvlLgiyKM1fbNdo42vEpSbahd227muzt2RZwlqBE799IJSyY0gYNrozp6CHLlRmkhLCn4hFYbHQ== 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=Hpcnl8HxUVIp0l0nA3p13VaXR6kaGEshbc6QjrCCukQawwjod5e2d20yoPARLX/Ibl4ZrcYHbLlBUHxI7W5XH2lxpEJHTWQ02Qmg0myc90nmV8VKAxDhbsoVV75cVZP6NdUNdiMV9oinwiuyjqBuNuKCzyhFic/NJQVz0+sgOmk= 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 TYVPR01MB11229.jpnprd01.prod.outlook.com (2603:1096:400:36c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 00:50:32 +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; Mon, 17 Jun 2024 00:50:32 +0000 Message-ID: <871q4wtmsp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 resend 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 , alsa-devel@alsa-project.org, imx@lists.linux.dev, linux-doc@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <8734pctmte.wl-kuninori.morimoto.gx@renesas.com> References: <8734pctmte.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 17 Jun 2024 00:50:30 +0000 X-ClientProxiedBy: TYAPR01CA0197.jpnprd01.prod.outlook.com (2603:1096:404:29::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYVPR01MB11229:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ebcdd8b-c3ee-4b62-1412-08dc8e677d86 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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DP4c9qL+iKYnR5vLztSdbKO/Obmy6sp/ZGn74irGn1/YdhjwS9/1MaYj5KIdsn1fLIHYAafigPdAbm5fdBfVuK5mLGB51pviJB//iVDoYbOrru62eCeovweNf3Q2OVhxJ1ultFkb2aOQHwxRzifkmZoHL8zaSHzp9LmKgRdC35VzzaqUU+wgLshcI6iYw2DTfbMtQRxUn9I+FM7Kv5BfChBUPShVnCGQdxzW8Ifgb0ngzLR+wx/t9420p7wjIUXgWrrAZwCSVzVACIzz6f8WKNOQucg4qO3mhPN1Fi1xtx9b+l5awOXRwpBuIutA== 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: 7bQ0Sm8MwW4R9lK3kt5vxeAEQ9FkEeDO9fAf1q8XswclQG+BH5lbnyIiJ16LS3WVLpqMxMvYmeR+h0EzvQHWc4GraMReClaD4Uvts4E+/3j6M7qiWwDs3fnvLPLc664jc7EP7D6yst/jKFOHeSrq1qab/nREzxQDCyLOJODA9D049uBKZqegys+lvw1YWFpcusz10H7/kYr43Uy9UxwyaKEPEFQDiXiOquOAiLhCkyYcvIc51Jc5m2gSP4kkXkgt+N4MWA5xbjdIbGS8ja6ZazBhrz49SodaMZbgsKT+KizHEtN7GwdIwFKV120iBCBlaAUYW24CEVDU/bpKoOlEjNzi/5AF7xye/zgrKsRc1wbui6SB8ztViIDeJoyO3qqHBwQLFyDakKy/WUKYvbeIhwzC/5wzlCmelWh3xrHLKgSa5bLJnxHl6q32SbGNnQqKm4nXBCI7nGmaPfZZCEpZ4TOYAAFuH/P+sqlm5aNDnT/s7LXkLt5xfpxlDuMtbGWvsqow/fRAELSfOkM9J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UwmEQsW4uOAMJf3IygljAr0xXbe/eDnWAOm0upmw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ebcdd8b-c3ee-4b62-1412-08dc8e677d86 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 00:50:32.0111 (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: H2QZtwtf6oicnXsRIeklNAruAGc4r9MXt3gQKjvqC3ddY88kNGzDjX9suSi8LVJAXK6sJDOdndNj5C46YZ4WfWGYdE/C7pViJ7VMYMP/tV7TwfqtRuAFbeqfa+gzQ7T8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYVPR01MB11229 Message-ID-Hash: UXF7GNDAJNQCU5I5A6XT2XHA26VIS2RY X-Message-ID-Hash: UXF7GNDAJNQCU5I5A6XT2XHA26VIS2RY 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 */