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: thesofproject/linux#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 ?
|
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, thesofproject/linux#5960 still occurs. |
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: thesofproject/linux#5960