All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: SDCA: don't narrow DAI channels by port mask on DPCM BE links
@ 2026-12-01 10:06 Srinivas Kandagatla
  2026-12-02 10:47 ` Charles Keepax
  0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Kandagatla @ 2026-12-01 10:06 UTC (permalink / raw)
  To: broonie
  Cc: ckeepax, mstrozek, yung-chuan.liao, pierre-louis.bossart,
	lgirdwood, perex, tiwai, linux-sound, patches,
	Srinivas Kandagatla

Commit 8bb24d87078f ("ASoC: SDCA: Add port constraints into
sdca_asoc_set_constraints()") started intersecting the DAI channel
mask with the SoundWire DP port min_ch/max_ch for both Input and
Output Terminals, installed via snd_pcm_hw_constraint_list() from
startup().

In DPCM dpcm_be_dai_startup() aliases be_substream->runtime to
fe_substream->runtime, so the per-substream rule lands on the FE
and narrows its hw_refine().

For Output Terminals the port sits below the DSP capture graph,
which can present an FE PCM with a channel count different from
the wire. WCD9378's headset mic is single-channel on DP2 but is
exposed as a stereo FE capture by Qualcomm LPASS; port_ch_mask is
0x1 and any arecord with channels_min > 1 fails with "Slave PCM
not usable".

Only intersect with port_ch_mask for Input Terminals and leave
Output Terminals on the cluster mask, restoring the behaviour
there to what it was before 8bb24d87078f.

Fixes: 8bb24d87078f ("ASoC: SDCA: Add port constraints into sdca_asoc_set_constraints()")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
---
Changes since v1:
	added fixme comment as requested by Charles.

 sound/soc/sdca/sdca_asoc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c
index d58be660ced7..bf447d0f34a1 100644
--- a/sound/soc/sdca/sdca_asoc.c
+++ b/sound/soc/sdca/sdca_asoc.c
@@ -1625,7 +1625,17 @@ int sdca_asoc_set_constraints(struct device *dev, struct sdw_slave *sdw,
 
 	constraints->channels.count = ARRAY_SIZE(channel_list);
 	constraints->channels.list = channel_list;
-	constraints->channels.mask = cluster_ch_mask & port_ch_mask;
+	/*
+	 * FIXME: OT paths may re-channelize downstream of the port (e.g. a
+	 * DSP between the port and the FE PCM), so only narrow with
+	 * port_ch_mask for Input Terminals. The proper fix is in DPCM,
+	 * which aliases be_substream->runtime to fe_substream->runtime and
+	 * lands this per-substream rule on the FE's hw_refine().
+	 */
+	if (entity->type == SDCA_ENTITY_TYPE_IT)
+		constraints->channels.mask = cluster_ch_mask & port_ch_mask;
+	else
+		constraints->channels.mask = cluster_ch_mask;
 
 	if (!constraints->channels.mask || !constraints->width) {
 		dev_err(dev, "%s: no valid constraint masks channel: %#x,%#x width: %#llx\n",
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 10:06 [PATCH v2] ASoC: SDCA: don't narrow DAI channels by port mask on DPCM BE links Srinivas Kandagatla
2026-12-02 10:47 ` Charles Keepax

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.