From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B39F47A0B2 for ; Tue, 16 Jun 2026 18:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781635969; cv=none; b=GYJz7s0Y/cQCP4r1XcFaldBZTrop+gziJ3tDcCzDf/fsVa0e5n9L0NoccJ4UaHD9e8gon7V/7BRRecicxHeZZzazWFq40bmKAhcl7BP/+JE7kQ2asej92p8N3NoorNynTnhWVZdtSsVdyXbBQk3k9h3bNHdKd/cc7XeM97tASfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781635969; c=relaxed/simple; bh=71YRGNfb6pVliDbZc+wyDG8P1MQuklaHbOzojhZ8seQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LDGXWrL/jf9bYRby4TcSkfJ3H5gS0dB7FtgTWS2kKkkyhbHOtWIGL9xNC8uTz86fijVbr8F3AeFMEG22ezrQdPWNqywefzwbWRrpvlWA7Dlcg7R7Aq9sf+X1BxJg1cxdSpuyVIwjfwKEt7JEQGh//sHcFH/TZswuLUqYZincvgo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=DYZT6pTt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=jSD3UFNH; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="DYZT6pTt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="jSD3UFNH" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65GIOrYh172546 for ; Tue, 16 Jun 2026 18:52:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= a9RsvBKT8pQ+ENjTfA/wlzxT+pVsKeuMFCetpo/hRJo=; b=DYZT6pTty40HzhEk yW777nxpkYDPpXF8OF+GlsG4zgmgwlsJeaeOoFzyCERsDbr5wT6cSHOViFnA0UtU D5+WY7cN/3U4fZvCjBajMWUtN58OZqwczKCJ9yRNjSFSV0YT37vQn5NC4zFvNbp/ kdKHZtLGqz7AgKJOKaM9F3JkjMHgebq6VhZFrkzgKLBk/9NIh0b49orWSoNwxePN fjiiYLjO/jzPtyxyAD+kEutyIcG4wbLrISKhEuAJvaCsEjMAY/JGnSrmIoD+Qmng NeO1CHwnw+up8U2p/DkKEM3h4yw5j3c/tGdFZs6cQchGN6WxmaGU42TyNPrfEtUS rqQHjA== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eu09kbkd9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 16 Jun 2026 18:52:46 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-915b6b63056so964848085a.1 for ; Tue, 16 Jun 2026 11:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1781635966; x=1782240766; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=a9RsvBKT8pQ+ENjTfA/wlzxT+pVsKeuMFCetpo/hRJo=; b=jSD3UFNHREBNAyCSXgFgmK6UEbMgdvL8h3RZV5hItBiprGwHfwwUG3fkEa+tA91irf y0ffrAvzVEe9KVsZ94YIeq/YYz0rtpNEiRZfgGg+O2jaPG6aAk8x6DDp4DaYuJGzJG7r vFnb+NuCgFXj9ufSW+XzQs4jEViSLaI6yviLoOf4RDG4Z04Q8BwkqajtbZE7JcEaQbED 0z/jvFH7sqW+PCEkSbubRyraQqKnlbuydK+rQ6HFcb6g7IcJPsIKlFsFYWd5vBiziRRr VNeSx7iIUSmo2JZ8Fnq9A5pdtPRh/H+D9vcFJD/+HyRIQ1eKOQ7yM6EXaTk5nRV3xVOX DLFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781635966; x=1782240766; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a9RsvBKT8pQ+ENjTfA/wlzxT+pVsKeuMFCetpo/hRJo=; b=rMWC1zcSiFVeJlhP8zpcaMhXkeZM8mG/fDKArKyYZgq2YiIISAtbeSndDxPD2gp4FM BwANBL1iZmbcbvnmVgAMxaU6oodJNSOcEZLk7lN4nXQI2MzGpfQGtZ6zaK/X7w1ZFaAS ANYpfb+I258QmGMPLszdU8wL9O/M/2Aj1ze1zSBpsFJ+Y7Zp5tijKvmQbghIFxLyAI9Z ecKs5K229ZpQLEXYq2tKe429RU2xhtukewWK7XY1xr6PyjCtw1jk5DKSIYQdYju25WsJ LKuo1kRahC5Gm6mKr+stSVOmIyiDqZ5KAScDiJnGHg33GJRFYmP3JnzqNLCfCKWTjdI3 3jeA== X-Forwarded-Encrypted: i=1; AFNElJ+btkaWv/+rSH9ToXu9YZ00aKIW8DZ6okCrEIwjC+ugXrmcYFCiA9WkUDiraXBTzYT9Cdxh11cRriNcUeQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwJaDrLWUeTdnC2s42pK6813QapQBa0fNdN6U/AQRPQSNWqnCMj uGDJSyIp0mSLibhVpV08CvDC4w4n+3UKP3GQYlbvOCwinQAmLtsw0+2XVQyZEOaCRMr1p2pTkyy zl/qD6YIotjKrDKQlVZuVwSdU2unr4oAi9VFyN/1dzmEs0nYrVMZsAC1+Q21itYHr4uw= X-Gm-Gg: Acq92OHJ1YV9sKqOYlDqv/Cc5200hza8cEtZ2uMfBkluADO36pbK0z1LR9RW+qldQMd D53cq3S7iX/oUg8ANJYszHK5iCJ5r6oGTUN/ieL8RlMj1LiJfKm+PRdaNhEnTNGPQFnKIC62ghC nPtQ+xKqVWzNjjt7F7jEYtJKRgHpehMUoIOevCQEMmflOJbSNHcYjVamH7KuXvtwsp9SO4YWA3K 6w3DmgJja76JCJkgLrp07i7638QiP3LX+vQY+hKAfBImc8CvAYT0UeD1hiHO5FBGKIJlEzM8xGn zQJSR6njqIqACkwC3U0xM9UORkyg+dwQ/qExR8wl7ylmQe+j1542uk31aHbNlrdata7myx6RZax 2gfv0WqvGgEuPd/VSWTYEBA398y6h/605ohjNU13TSJjhrd/I X-Received: by 2002:a05:620a:2981:b0:916:10f6:780f with SMTP id af79cd13be357-91d8d0b99e5mr159569685a.27.1781635965553; Tue, 16 Jun 2026 11:52:45 -0700 (PDT) X-Received: by 2002:a05:620a:2981:b0:916:10f6:780f with SMTP id af79cd13be357-91d8d0b99e5mr159564085a.27.1781635965003; Tue, 16 Jun 2026 11:52:45 -0700 (PDT) Received: from [192.168.68.125] ([5.133.47.210]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-461eaa0d1c7sm3642568f8f.7.2026.06.16.11.52.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jun 2026 11:52:44 -0700 (PDT) Message-ID: <3287ae19-508d-47eb-abf9-259867e7d044@oss.qualcomm.com> Date: Tue, 16 Jun 2026 19:52:43 +0100 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 1/4] ASoC: qcom: audioreach: compute active channel maps from channel_map To: Neil Armstrong , Srinivas Kandagatla , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: kancy2333@outlook.com, linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20260610-topic-sm8650-ayaneo-pocket-s2-wsa2-fix-v1-0-18bb19c5ca22@linaro.org> <20260610-topic-sm8650-ayaneo-pocket-s2-wsa2-fix-v1-1-18bb19c5ca22@linaro.org> <937aed10-9ec6-4ca4-bc60-db892121a416@kernel.org> <05e15363-d49e-4a7b-82b3-0f07537b5366@kernel.org> <16d2e8e8-91bc-437d-8225-eb6eedb4bd8a@linaro.org> Content-Language: en-US From: Srinivas Kandagatla In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNjE2MDE5MiBTYWx0ZWRfX7yOdGDP63szk 3bSgWYrVtcCVVI/8kZxFNp417FCvwg4XmyHMA9HZpkojqktbq/1Njg3KbDN9+GDqDI9lHikmzPc KLC1q2KacPICtHCwltGWeXGP+65gTzY= X-Proofpoint-GUID: 5A7yf3WwM6EeqhGHBwut84lPpvzhoLlF X-Authority-Analysis: v=2.4 cv=DoZmPm/+ c=1 sm=1 tr=0 ts=6a319b7e cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=ZsC4DHZuhs/kKio7QBcDoQ==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=KEe7bkdQAAAA:20 a=EUspDBNiAAAA:8 a=G2-bsJ9txPRm7R4i2XwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 a=bA3UWDv6hWIuX7UZL3qL:22 X-Proofpoint-ORIG-GUID: 5A7yf3WwM6EeqhGHBwut84lPpvzhoLlF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjE2MDE5MiBTYWx0ZWRfXyRcFk8KAnQpD JG9g6gdjFkZqXArz24Hd+lj6XMeO5z/jDsqQciGRpqj62iIRUgzY6/q0hvgKbr/erpyRdJrh7/w hm//jI02DE9NAX1ZdKntZ8EaQ8PRoA6N9XBXhFOgTGDcde61rQo99aZJcKUu0ohQa9WbXoeZ5ZN K7lG9oCQRSzXS3Y4C1MYJnZ96SZriQn2vUU6Cd4QJoxUnc4bMlY1YT/uk9UchuG+EoPPAwtQgCe umhimahlJL+aeoQ11SpFOtT9NunnZV+nK1p946pyaIa2shT0nHXzSgHxaBoTgJvZ4SQciZMo/3+ t9rrm1PMWvtMbGrMuhtTnkQAnFWTu4P8nWg5kL4TnQ6SPy/S5nEDTdgfHdEgKfbJs5RlQy3Hn/+ WVnCI1r6nLRWUHm8KTK9ULdV1VvWAkBA16ryYqy74Gfev35/YGUSkerlYqT7Y43aet1S+HtLmHe 8a/aiAKguaGbF6cLT0A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-16_05,2026-06-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606040000 definitions=main-2606160192 On 6/16/26 4:12 PM, Neil Armstrong wrote: > On 6/16/26 16:59, Srinivas Kandagatla wrote: >> >> >> On 6/15/26 2:54 PM, Neil Armstrong wrote: >>> On 6/15/26 11:36, Srinivas Kandagatla wrote: >>>> On 6/15/26 10:31 AM, Neil Armstrong wrote: >>>>> On 6/15/26 10:38, Srinivas Kandagatla wrote: >>>>>> >>>>>> >>>>>> On 6/10/26 8:41 AM, Neil Armstrong wrote: >>>>>>> The Qualcom SM8650 based Ayaneo Pocket S2 gaming device has a set >>>>>>> of 2 WSA speakers connected on the WSA2 lines. >>>>>>> >>>>>>> But the Audioreach DSP only handles WSA2 in pair with the WSA >>>>>>> interface by using the upper bits of the active_channels_mask >>>>>>> for WSA2 and the lower bits for WSA: >>>>>>> >>>>>>> /-------------------------------------------------\ >>>>>>> | Bits  |     3    |     2    |   1     |     0   | >>>>>>> |-------------------------------------------------| >>>>>>> | Line  | WSA2 Ch2 | WSA2 Ch1 | WSA Ch2 | WSA Ch1 | >>>>>>> \-------------------------------------------------/ >>>>>>> >>>>>> No, this is not totally correct, if the setup only has WSA2, then >>>>>> channel 0 and 1 should be WSA2 channels. >>>>>> >>>>>> What is the backend dai id that is in DT, it should be >>>>>> >>>>>>       sound-dai = <&q6apmbedai WSA2_CODEC_DMA_RX_0>; >>>>>> > > Yeah 0xC0 for active_channels_mask and channel_mapping = > { PCM_CHANNEL_FL, PCM_CHANNEL_FR }; > > I tried to keep the leading 0, but since the channel_mapping table is > allocated with > the size of the num_channels parameter, you can ony have 2 entries. > >> >>  From DSP docs: >> https://github.com/AudioReach/audioreach-engine/blob/master/fwk/api/ >> modules/media_fmt_api_basic.h#L780 >> >> Channel[i] mapping describes channel i. Each element i of the array >> describes channel i inside the buffer where i is less than num_channels. >> An unused channel is set to 0. >> >> >> So unused channels should be set to zero, but the patch padding the >> channels starting form zero. > > My understanding in my trial and error is that the DSP will map each > entry of the channel_mapping to the active_channels_mask bits in order > so you can have a non linear active_channels_mask like b10101010 which > has 4 channels active and pass a channel_mapping table with 4 entries. > You are correct, I was mis-interpreting some of the comments from modules/media_fmt_api_basic.h specially the channel map comment. Also confirmed this internally so we are good, I tested this on T14s, Tested-by: Srinivas Kandagatla Reviewed-by: Srinivas Kandagatla --srini > The is what I implemented here, and it gives a lot of flexibility on how > to connect speakers to the interface. > > Neil