From: Alexey Klimov alexey.klimov@linaro.org
[ Upstream commit 9565c9d53c5b440f0dde6fa731a99c1b14d879d2 ]
Setting format to s16le is required for compressed playback on compatible soundcards.
Signed-off-by: Alexey Klimov alexey.klimov@linaro.org Link: https://patch.msgid.link/20250911154340.2798304-1-alexey.klimov@linaro.org Signed-off-by: Mark Brown broonie@kernel.org Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES – forcing S16LE in the backend fixup is a necessary bug fix and safe to carry into stable.
- `sc8280xp_be_hw_params_fixup()` now applies `snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE)` (sound/soc/qcom/sc8280xp.c:92-101) and includes the proper header to access that helper (sound/soc/qcom/sc8280xp.c:10). Without this restriction the BE inherits whatever format the FE negotiated (often S32_LE), so the CDC DMA path tries to run at the wrong width. - The hardware side really needs the negotiated width to be 16-bit: the Q6 backend programs `cfg->bit_width = params_width(params);` before starting the CDC DMA port (sound/soc/qcom/qdsp6/q6afe-dai.c:364-366). When the format stays at 32‑bit the DSP refuses to start compressed- playback streams, which is the user-visible failure cited in the commit message. - Other Qualcomm soundwire machine drivers already lock their BE formats to S16LE (e.g. sound/soc/qcom/sm8250.c:62-71), so this change simply brings sc8280xp into line with established practice and with the firmware expectations of the WCD/WSA codecs on this platform. - The patch is tiny, contained to the machine driver, and has no architectural fallout. It fixes a real regression (compressed playback breaking on supported boards) and does not alter the channel/rate handling beyond what was already enforced, so the regression risk is minimal.
Given the clear user impact, alignment with existing platforms, and the low risk of the change, it should be backported to stable kernels that carry the sc8280xp machine driver.
sound/soc/qcom/sc8280xp.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/sound/soc/qcom/sc8280xp.c b/sound/soc/qcom/sc8280xp.c index 6847ae4acbd18..78e327bc2f077 100644 --- a/sound/soc/qcom/sc8280xp.c +++ b/sound/soc/qcom/sc8280xp.c @@ -7,6 +7,7 @@ #include <sound/soc.h> #include <sound/soc-dapm.h> #include <sound/pcm.h> +#include <sound/pcm_params.h> #include <linux/soundwire/sdw.h> #include <sound/jack.h> #include <linux/input-event-codes.h> @@ -86,8 +87,10 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); + struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
rate->min = rate->max = 48000; + snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE); channels->min = 2; channels->max = 2; switch (cpu_dai->id) {