[PATCH] ASoC: qcom: q6apm-lpass-dais: Reset the codec DMA channel map in hw_params
From: Birk Skyum
Date: Sun Oct 18 2026 - 18:11:05 EST
Since commit c663014e452d ("ASoC: qcom: audioreach: compute active
channel maps from channel_map"), the codec DMA active channel mask is
built from the port's channel map instead of its channel count.
q6dma_hw_params() fills that map with
audioreach_set_default_channel_mapping(), but the map lives in the
DAI's module config for as long as the device exists and is never
cleared, and the default mapping only covers one, two and four
channels. Entries left from an earlier stream, or entries the default
mapping does not fill, give a mask that does not match the channel
count, and the DSP refuses to start the port. On the Lenovo Yoga Slim
7x every capture from the digital microphones fails with
q6apm-lpass-dais ...: Failed to start APM port 110
Clear the map before filling it, and map any channel the default
mapping leaves out. With this, capture through PipeWire and direct
captures with two, four and two channels in a row work again.
Fixes: c663014e452d ("ASoC: qcom: audioreach: compute active channel maps from channel_map")
Signed-off-by: Birk Skyum <birk.skyum@xxxxx>
---
sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
index e204fd5..403fe83 100644
--- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
+++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c
@@ -173,11 +173,16 @@ static int q6dma_hw_params(struct snd_pcm_substream *substream,
struct q6apm_lpass_dai_data *dai_data = dev_get_drvdata(dai->dev);
struct audioreach_module_config *cfg = &dai_data->module_config[dai->id];
int channels = hw_param_interval_c(params, SNDRV_PCM_HW_PARAM_CHANNELS)->max;
+ int i;
cfg->bit_width = params_width(params);
cfg->sample_rate = params_rate(params);
cfg->num_channels = channels;
+ memset(cfg->channel_map, 0, sizeof(cfg->channel_map));
audioreach_set_default_channel_mapping(cfg->channel_map, channels);
+ for (i = 0; i < channels && i < AR_PCM_MAX_NUM_CHANNEL; i++)
+ if (!cfg->channel_map[i])
+ cfg->channel_map[i] = i + 1;
return 0;
}
--
2.53.0