[PATCH 0/2] ASoC: qcom: qdsp6: fix 24-bit PCM on QDSP6 ADSPs
From: Srinivas Kandagatla
Date: Thu Nov 26 2026 - 06:58:02 EST
24-bit PCM through q6asm is ~48 dB too quiet in both directions.
q6asm sends ASM_MEDIA_FMT_MULTI_CHANNEL_PCM_V2 for every LINEAR_PCM
stream. V2 has no sample_word_size, so the DSP defaults to
word_size = 32 and expects the 24-bit sample MSB-justified, while
ALSA S24_LE is LSB-justified.
Patch 1 switches to V4 or V5 based on ac->q6asm->ainfo.api_version,
plumbs sample_word_size through both playback and capture, and
drops S24_LE from the MultiMedia FE PCM in favour of S24_3LE and
S32_LE. plughw converts legacy S24_LE requests to S24_3LE
transparently; clients opening hw: directly must pick S24_3LE or
S32_LE.
Patch 2 (originally by me, rebased by Riccardo as part of his
Arduino UNO Q DP audio series) adds S24_LE and S32_LE on the MI2S
playback BE DAIs and teaches q6routing about S32_LE.
A different approach was proposed by Michael McAllister and was
developed independently:
Link: https://lore.kernel.org/179416102230.53258.7301268454500974217.q6asm-pcm-format-v2@xxxxxxxxxxxxxxxxxxxxx/
That series keeps V2 and routes 24-bit through S32_LE + msbits = 24
so plughw repacks every 24-bit source into a 32-bit buffer. This
series carries sample_word_size natively in V4/V5 and advertises
S24_3LE on the FE, preserving the zero-copy packed 24-bit path.
Tested on db845c (SDM845, LT9611 HDMI): S24_3LE, S32_LE and float32
at 48 kHz play at full level through HDMI; S16_LE unaffected. DMIC
capture at S16_LE and S24_3LE verified on target. db845c reports
ASM API version 1, so only the V4 branch has been exercised.
Srinivas Kandagatla (2):
ASoC: qcom: q6asm: fix 24-bit PCM level via media format V4/V5
ASoC: qcom: q6dsp: add S24_LE and S32_LE to MI2S playback DAIs
sound/soc/qcom/qdsp6/q6asm-dai.c | 26 +++-
sound/soc/qcom/qdsp6/q6asm.c | 184 +++++++++++++++++++----
sound/soc/qcom/qdsp6/q6asm.h | 6 +-
sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c | 19 ++-
sound/soc/qcom/qdsp6/q6routing.c | 3 +
5 files changed, 195 insertions(+), 43 deletions(-)
--
2.53.0