Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp34159lqo; Tue, 7 May 2024 11:16:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4xhMEfX8SbEzlFaTf+2tZKLD+9Y10tsIo4NSJGL1epMCMNMW9hslEeZPmgDWS//oVGHvGI9+O2GQspGJ6TFpREP/coHkv6d57+XayWg== X-Google-Smtp-Source: AGHT+IFYaoY76riCAFkXK+D3ZywuEg5e/QaN+WqK+FwPD1GOFk//eGT99yijmSQlH2dS3be621/D X-Received: by 2002:a17:906:1110:b0:a59:9edf:14b8 with SMTP id a640c23a62f3a-a59fb94b8e2mr16166266b.3.1715105782888; Tue, 07 May 2024 11:16:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715105782; cv=pass; d=google.com; s=arc-20160816; b=UZUzZNTs9YvHFTWihlVLh5QJjYZyIc+/YHSTX7vxwyvQWSNWlD1tR2HZSw6fXdHJ2K lQ4LGwFfiYXEx+gTDA8+80F97qHvg5VokbLug8xu7TtDSkaDsOx51nXV514sd6v3GUJY Ot0RKjg8HhFUfGOQ+JPUeSWz+fwIzziGSAeiwcwBzO64MHBo0CRkBH3RCxYEMKKXcbdW YpXMsNkxYuOlPLabTqaWvUPqgZ9WJ0XD9YGU0jD2H2Xy7xihq3h8dSlpEtNAuSlbrSWT UcL07lKxxh7yIGtvLZRISd2hc/6cyzOKcle5S647atL3+1v8u2AuOe9SkXTiQAWdFLw7 CClQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=32C2VWO0lNkaeoP0mjNW3/Db2bUiU2Lhen0koGKYiUM=; fh=Jo/aE0H9ELJiuMm7X/YfHaUPJsFXktB1vVc15jRaJjE=; b=v55HKPxWfrPKGB8vxN5/rgVmWT6nRKmO42AhpO+9TyIL1XkpbOguVQWmjo6xlikZ8b 34iA/K9mVDLrmFOU2dIr1z/3042DDUJI/Ufp8YsHjZuDuov/T8AlbO9pUHL1PjErheQL UyTlUwXg0xQnQs6vLSK5+VexHg0dLzqi9y977+HMSTniTfu0MajsXlF7kv+wTdOyEbys /zmJUmtdfa7QHriYXT/KoPzyoShwo7n2Fq/SB6qXfJt/OvqMdTmTdI/9BnWlVaPBY955 l1yFPQm2XNzipaVN45wfag9BGj67Wy//yvhWoF2wdPahCiGE7lig0tE/ISI0OPIdTMqR pgHQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=za29yH6G; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id he20-20020a1709073d9400b00a59ae34c5fbsi3970469ejc.40.2024.05.07.11.16.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 11:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=za29yH6G; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 6A5061F2652F for ; Tue, 7 May 2024 18:16:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C34CB16D4EE; Tue, 7 May 2024 18:15:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="za29yH6G" Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DDB516D4DF for ; Tue, 7 May 2024 18:15:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715105755; cv=none; b=We1ZHksVIo6gbaYhTPSse0FC7pG4hCWtOh2PK/URSXODV4HC21/9TAr3wlNCOUhV1epWWWSBUPN7hV2NjCXCvIgEI4BbWQawM/HfzWPdIO5ss1hFtc+ABpGXPOh1K92LLOLjWqTqxQtANpKtbrPLqazn1slIuSV6Tg1KJA0RdT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715105755; c=relaxed/simple; bh=e+Ui+xuAdmPzJfWHKGip4nd/QAAMiIFEurpFnUaCqqM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PGXU3hjWkwwJx7PSRS8bAtUv2+CRKm9kZ+FTLiGs6/+Tn9pJmZt0fFCYTTNeOb5o6byLUpaxW0EnKRL7Ki/eEkCsnla5qGiHdOcAXigMfNcnHtGpuNPbOlFqXsDQRG9J6KLklg9jJqsYdeqw+kNyo4oO4aWBaRDGmdAklz8z4bc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=za29yH6G; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a59a0168c75so899171066b.1 for ; Tue, 07 May 2024 11:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715105752; x=1715710552; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=32C2VWO0lNkaeoP0mjNW3/Db2bUiU2Lhen0koGKYiUM=; b=za29yH6GuqAy7ACnaDkTEepI4s1nM4gfmGbvStsBMOA0puPJpm9OJOPuaYKjVM86eT 4iSABOQ3U+I8auaBcEMxyXTFXgDr9vpTa/k40izuFXehAWWUGvNwjyqheNg9LFdxgTtp Usnu7JuR1It/AqLVDHkOwLWmMLxyWZHLmyzdybdVtc/O7AlPmsPr+wOQbJ8l0WMObfiq R5uwtq1Kyp3vO0A3+MsLiSu8lI1GccKgwfWndRPl652dpUP0GoLP4MNvd1c19BOcAcBS pxAfhuY3XSeb7mhNxu6vAE1XXHqIVuxedQK8b1ZlvKq3ywfwuwtblyvhaLz3wXYNT2ub anog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715105752; x=1715710552; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=32C2VWO0lNkaeoP0mjNW3/Db2bUiU2Lhen0koGKYiUM=; b=gVL1Y844mzsDR4iwR0/9sLy3Mn4DLhyl+OI2fGa44MbLClvjlBdE/Ls24mg3C4AK3u HQbae2u6QDMm89IrXy0A39Hi8500CclN8iRrJOF4IUbZ4/Dixs08IJCA/95giKrxbr8Z GdjbRK6Eggzv9yRNYxk1edUS/TnCGm5CD8bPfm3DNgWrrx6Gfo4aHiTBRggmxcI8HIbs K6R0pyltYmfao3F1m+iQJZNnFx2pjMszPw6dXIGDKFSnjA9zR+wc9WaADJTk5bttgSJo MzBk5esDjpBoM2y4UOd+y4JZh3ww/Ws1Zw3JtR1NddI0kjrO6mkFGJsafnizw919+F2p BxiA== X-Forwarded-Encrypted: i=1; AJvYcCUG8XDGu4yw3J5FEaP7KB489B0UDtofaQPzmperaLjQHD91Axyhexz8x1uz+6iJ6XkVJGZ/dvtzTItLpcKf5ngud9K02SPhuiu8tY6h X-Gm-Message-State: AOJu0YwNWwE94dWpalx7MKxkB5HDHWkoneb/2KFZn19YOIQaTzi7OEos NwvOYRYR8ew2DsOfOLSAgDPtidiXPx2h35qWfTjF5tcTiH4iTixO7u8PGQ9sSqk= X-Received: by 2002:a50:c319:0:b0:570:5b3d:91f with SMTP id 4fb4d7f45d1cf-5731d9db2d1mr347441a12.23.1715105752469; Tue, 07 May 2024 11:15:52 -0700 (PDT) Received: from [192.168.1.20] ([178.197.206.169]) by smtp.gmail.com with ESMTPSA id n15-20020a05640206cf00b00572b029ca57sm6499357edy.25.2024.05.07.11.15.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 May 2024 11:15:52 -0700 (PDT) Message-ID: Date: Tue, 7 May 2024 20:15:49 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] ASoC: qcom: x1e80100: Correct channel mapping To: Srinivas Kandagatla , James Schulman , David Rhodes , Richard Fitzgerald , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Lars-Peter Clausen , =?UTF-8?Q?Nuno_S=C3=A1?= , Banajit Goswami Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240507-asoc-x1e80100-4-channel-mapping-v1-0-b12c13e0a55d@linaro.org> <20240507-asoc-x1e80100-4-channel-mapping-v1-4-b12c13e0a55d@linaro.org> <738045d2-a445-4f93-abfd-203348a538d1@linaro.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq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MQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <738045d2-a445-4f93-abfd-203348a538d1@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 07/05/2024 15:20, Srinivas Kandagatla wrote: > Thanks Krzystof for the patch. > > On 07/05/2024 11:27, Krzysztof Kozlowski wrote: >> X1E80100 CRD board comes with four speakers arranged as left front+back >> and then right front+back. Using default channel mapping causes front >> right speaker to play left back stream. >> >> Adjust the channel maps for frontend DAIs to fix stereo and four-channel >> playback. >> >> Signed-off-by: Krzysztof Kozlowski >> --- >> sound/soc/qcom/x1e80100.c | 37 +++++++++++++++++++++++++++++++++++-- >> 1 file changed, 35 insertions(+), 2 deletions(-) >> >> diff --git a/sound/soc/qcom/x1e80100.c b/sound/soc/qcom/x1e80100.c >> index c3c8bf7ffb5b..e90c68815b5c 100644 >> --- a/sound/soc/qcom/x1e80100.c >> +++ b/sound/soc/qcom/x1e80100.c >> @@ -12,6 +12,7 @@ >> >> #include "common.h" >> #include "qdsp6/q6afe.h" >> +#include "qdsp6/q6dsp-common.h" >> #include "sdw.h" >> >> struct x1e80100_snd_data { >> @@ -74,7 +75,7 @@ static int x1e80100_snd_hw_params(struct snd_pcm_substream *substream, >> return qcom_snd_sdw_hw_params(substream, params, &data->sruntime[cpu_dai->id]); >> } >> >> -static int x1e80100_snd_prepare(struct snd_pcm_substream *substream) >> +static int x1e80100_snd_be_prepare(struct snd_pcm_substream *substream) >> { >> struct snd_soc_pcm_runtime *rtd = substream->private_data; >> struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); >> @@ -96,12 +97,34 @@ static int x1e80100_snd_hw_free(struct snd_pcm_substream *substream) >> &data->stream_prepared[cpu_dai->id]); >> } >> >> +static int x1e80100_snd_fe_prepare(struct snd_pcm_substream *substream) >> +{ >> + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); >> + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); >> + >> + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { >> + const unsigned int rx_slot[4] = { PCM_CHANNEL_FL, >> + PCM_CHANNEL_LB, >> + PCM_CHANNEL_FR, >> + PCM_CHANNEL_RB }; >> + >> + snd_soc_dai_set_channel_map(cpu_dai, 0, NULL, ARRAY_SIZE(rx_slot), >> + rx_slot); > > Channel mapping are specific to backend dais rather than front end pcm dais. > > This will set all the playback pcms with this channel maps, which is a > problem. > > example the 2 channel headset we will endup with data of front channel > and zeros on the right channel, however a speaker might work as you have > 4 speakers in your system. > > > So No for this approach. OK, I'll go with setting channels for MFC (and expecting MFC being part of backend). Best regards, Krzysztof