Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1082890rda; Mon, 23 Oct 2023 01:42:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEyYVSwmk/UlnTKi0FdShSGecexjrhJbMDNdsSSTc7AMEEHSb2c8KcV2cluhq6XchZGG8mC X-Received: by 2002:a05:620a:260d:b0:775:9766:cb69 with SMTP id z13-20020a05620a260d00b007759766cb69mr8351827qko.75.1698050567837; Mon, 23 Oct 2023 01:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698050567; cv=none; d=google.com; s=arc-20160816; b=ImowJqb19ul9yOIDVJ/oPqdBm962lccQfIIixza8TwmTsH7fe1aWFt64QIYWFKQa70 lsQVE85c5pQAIavrI67skAmqBRyU614U3MB04FgBhJlk/DEZW9c+Cloa8+bumpphM13V rHRbpQPsoA3/hNAJlfzJAIejG6V59PKGxNyjNYSmer+xvxbp3CzhqCnECBRgcSvDALTp hmmM1CWy68/SqR9srCOjLbeas/hVL9p2PEvKAke14t626G3gwE7iHkhgLNbzYk6fch5V OU5jU8YIApRf+zaXqdbHLT7U6q5dEJAyudvq5H0dpYaVQZRrM0963TcP3qJgR+tgMhcL UG7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=ikJXXD4nCot/7ZdxIzEXxNGZwix+QfZwpIvhbz0HTEg=; fh=ANTcVq+kxfa2ykyIDBsFGBknl3eT6B3/aSpbhBCUJ9s=; b=oC9fL6S51X/pb8Lw4+ecd5JDxNcIFiLQzpHABE/yvvytXuH6j8M4GAS2tUtNbv/CuK OSZxL4Ajuoj1+TCIG5QADG4fPEA+ZYmjtTeh5kWojqZjwHPeBUvzUi6J9zgXEE6HYs+S kxu9GI2pq7w6FHfVa4YzVHoudR7sJvvO7fNXTcxmJt/p1dEdjyGNoFPWcSPCwlAP50pU 8Y6ZI6FNDZP9z85NBH1PTGPxDvYorjFyPeF+GGDRmomGKPTTYeg/9kRzAIup7sAS0/0x Kk3y9nOVY6YrC0WXjgqKVW1xM9/yHe99B3X+OTM2Mzoa6o3Jid40sQpO6yTq9cKf6vEd V8BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HttbhHvs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id o14-20020a05620a110e00b0077898811fcesi4832410qkk.587.2023.10.23.01.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 01:42:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HttbhHvs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BECBF80A7742; Mon, 23 Oct 2023 01:42:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232291AbjJWImg (ORCPT + 99 others); Mon, 23 Oct 2023 04:42:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232096AbjJWImf (ORCPT ); Mon, 23 Oct 2023 04:42:35 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BE48D79 for ; Mon, 23 Oct 2023 01:42:33 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-32d9552d765so2229481f8f.2 for ; Mon, 23 Oct 2023 01:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698050551; x=1698655351; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ikJXXD4nCot/7ZdxIzEXxNGZwix+QfZwpIvhbz0HTEg=; b=HttbhHvsFpyMq4ZZSZddq//iIzKvN51ebsG+X6NNgTEa/MGt3liXELuPLtQDWnzHGb kuYUGEDLdFgXazA8e+kJE6AQ0xzW+YOx0z1EqLXqBao1ohAAHwhL1Wj4dgxxoZDj0LPT qkAhyVzeWRBiQo+RXaIevwqaZHSnfltniNhaN8s+rTh4DJNvuOztedm+BVfg9DonYGCP J3MgrB//p49JVdk6QsgfWB2aQ+xvr5f+nczdG8n/XT+FUY8D9gy40hRQIavRIVgUVhnP MzHMBFZ1jZSwSB/gCNagbjLv/lKJ8A5TwHc9LF+n7Gi/pCpFDYZRf6S3cEpCYPuzoG2b rFDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698050551; x=1698655351; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ikJXXD4nCot/7ZdxIzEXxNGZwix+QfZwpIvhbz0HTEg=; b=Tbr+GegocM34B5/+H8bySdHtCMaAa9fagQWgFvBLRPbqQx6Ia5kWERDuROVw6alhrP 269tOkfmPgc2+HmxT4qxjIrPT37Rg2Ng/hmSQNubImn505Hit353bic4UqYRLiCgdpaw hamJLVNi+s/zCtw1V0oBsqOD9c4yWsknNJVLEPEbFxgMAwvYmXp2DhnLuNzOoKro1hNR v2GN2Hjf8fXl8+r+XxCzW8D/Mqo7ApvJRMsWPrst9I0VRMkemOk0xNaEDR/0Ghop51D+ jskJcsT85Y452zW9Kh8MhzmDCqeKdUK9P+TC4qxMx4+hoPJPMBQ+2jR/0/nyffqOgTQP XT+g== X-Gm-Message-State: AOJu0Yz6LjwX7CMYNSW2WJQzRpfs+IPo/jZHqehCxAhXrum4j3ia1vZt vI8bic2tHvQn7zbKEdQBDjWogA== X-Received: by 2002:a5d:6392:0:b0:32d:827e:7bd8 with SMTP id p18-20020a5d6392000000b0032d827e7bd8mr7171371wru.70.1698050551160; Mon, 23 Oct 2023 01:42:31 -0700 (PDT) Received: from [192.168.86.24] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id d17-20020a5d6451000000b0032da022855fsm7244090wrw.111.2023.10.23.01.42.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Oct 2023 01:42:30 -0700 (PDT) Message-ID: Date: Mon, 23 Oct 2023 09:42:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ASoC: qcom: audioreach: Add 4 channel support Content-Language: en-US To: Krzysztof Kozlowski , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org References: <20231020084919.18628-1-krzysztof.kozlowski@linaro.org> From: Srinivas Kandagatla In-Reply-To: <20231020084919.18628-1-krzysztof.kozlowski@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 01:42:45 -0700 (PDT) Thanks for the patch, On 20/10/2023 09:49, Krzysztof Kozlowski wrote: > Add support four channel streams. Map channel 3 and 4 to left/right > surround ("quad(side)" from ffmpeg standard channel list) to match what > is in qdsp6/q6dsp-common.c driver. > > Signed-off-by: Krzysztof Kozlowski > > --- > > quad(side): > https://trac.ffmpeg.org/wiki/AudioChannelManipulation#Listchannelnamesandstandardchannellayouts > --- > sound/soc/qcom/qdsp6/audioreach.c | 25 ++++++++++++++++++++++--- > 1 file changed, 22 insertions(+), 3 deletions(-) > > diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c > index 5974c7929dd3..4dd2a2e261c9 100644 > --- a/sound/soc/qcom/qdsp6/audioreach.c > +++ b/sound/soc/qcom/qdsp6/audioreach.c > @@ -833,6 +833,11 @@ static int audioreach_mfc_set_media_format(struct q6apm_graph *graph, > } else if (num_channels == 2) { > media_format->channel_mapping[0] = PCM_CHANNEL_L; > media_format->channel_mapping[1] = PCM_CHANNEL_R; > + } else if (num_channels == 4) { > + media_format->channel_mapping[0] = PCM_CHANNEL_FL; > + media_format->channel_mapping[1] = PCM_CHANNEL_FR; > + media_format->channel_mapping[2] = PCM_CHANNEL_LS; > + media_format->channel_mapping[3] = PCM_CHANNEL_RS; These are fine, but duplicated from q6dsp_map_channels(), Please consider using q6dsp_map_channels(). Also when you do that pl get rid of PCM_CHANNEL_L and PCM_CHANNEL_R defines in audioreach.h thanks, --srini > } > > rc = q6apm_send_cmd_sync(graph->apm, pkt, 0); > @@ -869,6 +874,11 @@ static int audioreach_set_compr_media_format(struct media_format *media_fmt_hdr, > } else if (mcfg->num_channels == 2) { > mp3_cfg->channel_mapping[0] = PCM_CHANNEL_L; > mp3_cfg->channel_mapping[1] = PCM_CHANNEL_R; > + } else if (mcfg->num_channels == 4) { > + mp3_cfg->channel_mapping[0] = PCM_CHANNEL_FL; > + mp3_cfg->channel_mapping[1] = PCM_CHANNEL_FR; > + mp3_cfg->channel_mapping[2] = PCM_CHANNEL_LS; > + mp3_cfg->channel_mapping[3] = PCM_CHANNEL_RS; > } > break; > case SND_AUDIOCODEC_AAC: > @@ -1057,7 +1067,7 @@ static int audioreach_pcm_set_media_format(struct q6apm_graph *graph, > int rc, payload_size; > struct gpr_pkt *pkt; > > - if (num_channels > 2) { > + if (num_channels > 4) { > dev_err(graph->dev, "Error: Invalid channels (%d)!\n", num_channels); > return -EINVAL; > } > @@ -1094,7 +1104,11 @@ static int audioreach_pcm_set_media_format(struct q6apm_graph *graph, > } else if (num_channels == 2) { > media_cfg->channel_mapping[0] = PCM_CHANNEL_L; > media_cfg->channel_mapping[1] = PCM_CHANNEL_R; > - > + } else if (num_channels == 4) { > + media_cfg->channel_mapping[0] = PCM_CHANNEL_FL; > + media_cfg->channel_mapping[1] = PCM_CHANNEL_FR; > + media_cfg->channel_mapping[2] = PCM_CHANNEL_LS; > + media_cfg->channel_mapping[3] = PCM_CHANNEL_RS; > } > > rc = q6apm_send_cmd_sync(graph->apm, pkt, 0); > @@ -1116,7 +1130,7 @@ static int audioreach_shmem_set_media_format(struct q6apm_graph *graph, > struct gpr_pkt *pkt; > void *p; > > - if (num_channels > 2) { > + if (num_channels > 4) { > dev_err(graph->dev, "Error: Invalid channels (%d)!\n", num_channels); > return -EINVAL; > } > @@ -1158,6 +1172,11 @@ static int audioreach_shmem_set_media_format(struct q6apm_graph *graph, > else if (num_channels == 2) { > cfg->channel_mapping[0] = PCM_CHANNEL_L; > cfg->channel_mapping[1] = PCM_CHANNEL_R; > + } else if (num_channels == 4) { > + cfg->channel_mapping[0] = PCM_CHANNEL_FL; > + cfg->channel_mapping[1] = PCM_CHANNEL_FR; > + cfg->channel_mapping[2] = PCM_CHANNEL_LS; > + cfg->channel_mapping[3] = PCM_CHANNEL_RS; > } > } else { > rc = audioreach_set_compr_media_format(header, p, mcfg);