Re: [PATCH v2] ASoC: qcom: q6asm: Correct the 24-bit PCM format

From: Srinivas Kandagatla

Date: Mon Nov 16 2026 - 10:03:38 EST


On 11/16/26 9:20 AM, Demeter Barna wrote:
> On 2026-11-15 13:12, Srinivas Kandagatla wrote:
>> Can you please try this change and see if it helps. I have not tested
>> this myself as am travelling atm.
>
> Hi Srinivas,
>
> Thanks, I gave it a go on SM8350.
>
> The DSP takes the V4 blocks without complaining, but nothing changes for
> me: S24_LE playback is still 48 dB down, same as without the patch. I
> played a 440 Hz tone and recorded it with the DMICs:
>
>                                     without    with
>   S16_LE                            -25 dBFS   -25 dBFS
>   S24_LE (bits 23:0)                -73 dBFS   -73 dBFS
>   S24_LE, shifted into bits 31:8    -25 dBFS   -25 dBFS
>
> Capture is the same story, the samples still come back in bits 31:8.
>
> Michael's v2 does work here, for what it's worth: S32_LE playback comes
> out at -25 dBFS like S16_LE, and S32_LE capture records the tone at the
> same level as S16_LE.
>
> So it looks like this DSP just ignores mode 23. Maybe that depends on
> the firmware version, but with the firmware this device ships it doesn't
> work. If you have another way to fix this in mind, I'm happy to test it.
Thanks Demeter,

If its easy, Could you try:

---
sound/soc/qcom/qdsp6/q6asm-dai.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c
b/sound/soc/qcom/qdsp6/q6asm-dai.c
--- a/sound/soc/qcom/qdsp6/q6asm-dai.c
+++ b/sound/soc/qcom/qdsp6/q6asm-dai.c
@@ -286,7 +286,7 @@ static int q6asm_dai_prepare(struct
snd_soc_component *component,
*/
if (prtd->bits_per_sample == 24) {
word_size = 32;
- mode = 23;
+ mode = 0; /* DEFAULT_QF: Q31 / MSB-aligned (bits 31:8) */
} else {
word_size = prtd->bits_per_sample;
mode = 0;
--
2.45.0