Repository navigation
topology2: sdw-dmic-generic: fix channel map/cfg regression - #11258
Conversation
The IncludeByKey.SDW_DMIC_PCM_CHANNELS + nested Define pattern introduced to set SDW_DMIC_CHANNEL_CFG/SDW_DMIC_CHANNEL_MAP is broken: outer constants ($CHANNEL_CONFIG_STEREO, $CHANNEL_MAP_STEREO, etc.) evaluate to 0 inside a Define block nested within IncludeByKey, overwriting the correct defaults from input_audio_format.conf with zeroes. Fix by removing the broken intermediate variable initialization entirely and replacing all uses of $SDW_DMIC_CHANNEL_CFG/$SDW_DMIC_CHANNEL_MAP in format blocks with direct IncludeByKey.SDW_DMIC_PCM_CHANNELS blocks using the correct constants. The 2-channel (stereo) case is handled by the existing defaults in input_audio_format.conf / output_audio_format.conf, so no explicit entry is needed for it. This restores token1904 (in_ch_map) to 0xffffff10 and token1905 (in_ch_cfg) to 1 for the alh-copier.Capture-SmartMic.0 widget in ARL/MTL SDW DMIC topologies. Fixes: 87dc581 ("topology2: sdw-dmic-generic: add multiple DMIC number support") Link: https://github.com/thesofproject/linux/issues/5960 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The direct mappings are consistent, preserve stereo defaults, and address the reported regression.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes the SoundWire DMIC channel configuration regression affecting stereo capture.
Changes:
- Removes broken nested
Definechannel-map initialization. - Applies channel-specific mappings directly while preserving stereo defaults.
| File | Description |
|---|---|
tools/topology/topology2/platform/intel/sdw-dmic-generic.conf |
Corrects channel configuration and maps for SDW DMIC formats. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "1" { | ||
| in_ch_cfg $CHANNEL_CONFIG_MONO | ||
| in_ch_map $CHANNEL_MAP_MONO | ||
| } |
There was a problem hiding this comment.
Isn't this handling the corner cases, i.e. stereo would be default ?
There was a problem hiding this comment.
Double-checked @bardliao @lgirdwood the defaults (values for stereo set in input_audio_format.conf and output_audio_format.conf) are passed correctly to output tplg files and we don't need to have a case for "2" here.
|
Still looking at the possibility that newer alsatplg can support variable expansion like this. This definitely does not work with fixed alsa-lib version in SOF main. Additionally, recent alsa-lib has broken SOF topology2 build, so testing anything newer is not possible ATM -- filed #11263 for this. I did test the last working alsa-lib commit (3c4b16a1f6e49aac20b1b9fe2a2eb333eaf3efb0) and with that, #11271 still occurs. |
PR 11258: test resultsRun date: 2026-10-05 13:28 UTC Tested commit: ffe0da835fec43c2a96bbdaafb8a719a127ab7c4 |
singalsu
left a comment
There was a problem hiding this comment.
Plenty of repetitions. Could maybe avoid it with <> include of code block? But not sure it's a good idea.
|
Ack @singalsu I'll follow-up with attempt to support a more compact form, but I'll merge this as a quick fix. |
The IncludeByKey.SDW_DMIC_PCM_CHANNELS + nested Define pattern introduced to set SDW_DMIC_CHANNEL_CFG/SDW_DMIC_CHANNEL_MAP is broken: outer constants ($CHANNEL_CONFIG_STEREO, $CHANNEL_MAP_STEREO, etc.) evaluate to 0 inside a Define block nested within IncludeByKey, overwriting the correct defaults from input_audio_format.conf with zeroes.
Fix by removing the broken intermediate variable initialization entirely and replacing all uses of $SDW_DMIC_CHANNEL_CFG/$SDW_DMIC_CHANNEL_MAP in format blocks with direct IncludeByKey.SDW_DMIC_PCM_CHANNELS blocks using the correct constants. The 2-channel (stereo) case is handled by the existing defaults in input_audio_format.conf / output_audio_format.conf, so no explicit entry is needed for it.
This restores token1904 (in_ch_map) to 0xffffff10 and token1905 (in_ch_cfg) to 1 for the alh-copier.Capture-SmartMic.0 widget in ARL/MTL SDW DMIC topologies.
Fixes: 87dc581 ("topology2: sdw-dmic-generic: add multiple DMIC number support")
Link: #11271