Re: [RFC PATCH 00/23] ASoC: qcom: AudioReach Active speaker protection for WSA884x
From: Srinivas Kandagatla
Date: Wed Oct 28 2026 - 17:56:22 EST
Hi Fabian,
Thanks for trying this out,
On 10/28/26 4:31 PM, Fabian Renn-Giles wrote:
> Hi Srinivas,
>
> I tried this series on a Lenovo Yoga Slim 7x (X1E80100/Hamoa, 4x
> WSA8845, Linux 7.3.0 based tree). I found one bug and have one open
> problem.
>
> 1. Over-read in audioreach_get_module_priv_data() (oops on topology load)
>
Have you looked at
https://lore.kernel.org/all/20261023171316.819857-1-srinivas.kandagatla@xxxxxxxxxxxxxxxx/
this has fix for the exact issue, along with the VI fixes in codec,
please pick them up.
My Next target is X1 T14s Gen6 platform, I have not tried it yet, but am
hoping that it should work.
I will keep you posted.
> The function allocates
> struct_size(pdata, data, le32_to_cpu(mod_array->size)) and then
> memcpy()s from the topology blob. It crashed on the first load of a
> topology containing the speaker protection module config blob. The
> cause is in the size computation. data[] is __le32, so struct_size()
> counts elements while mod_array->size is in bytes. The allocation is
> 4x too large and the memcpy runs past the topology data. This is what
> I used instead:
>
> size_t len = sizeof(*pdata) + le32_to_cpu(mod_array->size);
>
> pdata = kzalloc(len, GFP_KERNEL);
> if (!pdata)
> return ERR_PTR(-ENOMEM);
>
> memcpy(pdata, ((u8 *)private->data + sz), len);
> return pdata;
>
> 2. Slim 7x bring-up: V/I feedback never reaches the DSP
>
> DT changes for the Slim 7x:
> - The WSA codec list is extended with the VISENSE ports
> <&swr0 10>, <&swr0 11> on the left pair and the mirrored ports on
> swr3. The speaker nodes get #sound-dai-cells = <1>.
> - The static port-mapping is <1 2 3 7 10 13> / <4 5 6 7 11 13>. On
> Hamoa the din ports are 10 and 11, versus 12 and 13 on Glymur.
> - I cloned the CRD topology and UCM, using 4 speakers, with the
> WSA_CODEC_DMA_TX_0 VI capture at S32_LE/8 kHz.
>
Speaker tuning data might be different, but overall it should work.
I will have to recheck on the port-mapping.
> What works:
> - The card probes and the SP/VI controls appear.
> - Normal playback through the SP graph runs without errors.
>
> What doesn't:
> - Calibration (Operation Mode set to Calibration, then silence
> played) times out waiting for V/I. R0/T0 stay 0.
> - I read back the SoundWire master and slave port registers, the WSA
> macro SPKR_PROT TX path enables, and the DSP module config. They
> all looked as intended.
> - With the SP graph active, the amp stays gated and playback is
> silent. This matches the calibration never completing.
>
> Question: is there anything Hamoa-specific on the VISENSE path (din
> port numbers or channel masks, the macro TX decimator routing,
> multi_direction_codecs handling) that I should check? I can run any
> debug patches you want on this machine.
>
> Unrelated noise: SoundWire parity errors/clash messages appear in the
> logs, but they also show up without the series applied, so I don't
> think they relate to it.
I did hit some soundwire issue related to runtime pm, which was
triggering the timeout too, Can you try to disable runtime pm and give
it a spin.
--srini
>
> Regards,
> Fabian