Skip to content

Conversation

@bardliao
Copy link
Collaborator

Add echo reference support to jack and amp function topologies

Currently, the "Loopback_Virtual" copier DAI is created in both
sdw-amp-generic.conf and sdw-jack-generic.conf. It works fine in the
monolithic topology because with the SDW_SPK_ECHO_REF flag, it will
be created either by sdw-amp-generic.conf or sdw-jack-generic.conf.
However, it doesn't work in the function topology case. The jack
function topology will be loaded first and the "Loopback_Virtual"
copier DAI is not created in the jack function topology if the amp
function topology is also loaded.
The commit suggests to use a SDW_ECHO_REF_DAI flag to indicate whether
the "Loopback_Virtual" copier DAI is required or not. So that we can set
the flag in the cmake file and create the "Loopback_Virtual" copier DAI
in the jack function topology even when the amp function topology is
loaded, too.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors echo reference support in topology2 configurations by centralizing the shared alh-copier widget instantiation. The PR moves the Loopback_Virtual alh-copier widget definition from individual jack and amp configuration files to a central location in cavs-sdw.conf, controlled by a new SDW_ECHO_REF_DAI flag. This consolidation eliminates code duplication and provides a cleaner approach for enabling echo reference DAI support across different topology configurations.

Changes:

  • Added new SDW_ECHO_REF_DAI flag and centralized alh-copier widget definition in cavs-sdw.conf
  • Removed duplicate alh-copier widget definitions from sdw-jack-generic.conf and sdw-amp-generic.conf
  • Added SDW_SPK_ECHO_REF=true and SDW_ECHO_REF_DAI=true parameters to existing and new topology configurations

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/topology/topology2/cavs-sdw.conf Adds SDW_ECHO_REF_DAI flag definition and centralized alh-copier widget for echo reference support
tools/topology/topology2/platform/intel/sdw-jack-generic.conf Removes duplicate alh-copier widget definition previously instantiated conditionally
tools/topology/topology2/platform/intel/sdw-amp-generic.conf Removes duplicate alh-copier widget definition for speaker echo reference
tools/topology/topology2/production/tplg-targets-sdca-generic.cmake Updates existing topologies with echo reference flags and adds new ref_dai topology variants
tools/topology/topology2/development/tplg-targets.cmake Adds SDW_ECHO_REF_DAI=true to development topology configurations with echo reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 14 to 16
"cavs-sdw\;sof-sdca-1amp-id2\;NUM_SDW_AMP_LINKS=1,SDW_JACK=false,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true"
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_SPK_ECHO_REF=true"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing SDW_ECHO_REF_DAI=true parameter. The SDW_SPK_ECHO_REF=true flag requires the alh-copier widget "Loopback_Virtual" to be instantiated, which is now only created when SDW_ECHO_REF_DAI=true (see cavs-sdw.conf lines 142-171). Without SDW_ECHO_REF_DAI=true, the route at sdw-amp-generic.conf:1102 will reference a non-existent "alh-copier.Loopback_Virtual.25" widget, causing a topology build or runtime error. Either add SDW_ECHO_REF_DAI=true to this topology configuration or remove SDW_SPK_ECHO_REF=true.

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 20
"cavs-sdw\;sof-sdca-2amp-id2\;NUM_SDW_AMP_LINKS=2,SDW_JACK=false,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true"
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_SPK_ECHO_REF=true"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing SDW_ECHO_REF_DAI=true parameter. The SDW_SPK_ECHO_REF=true flag requires the alh-copier widget "Loopback_Virtual" to be instantiated, which is now only created when SDW_ECHO_REF_DAI=true (see cavs-sdw.conf lines 142-171). Without SDW_ECHO_REF_DAI=true, the route at sdw-amp-generic.conf:1102 will reference a non-existent "alh-copier.Loopback_Virtual.25" widget, causing a topology build or runtime error. Either add SDW_ECHO_REF_DAI=true to this topology configuration or remove SDW_SPK_ECHO_REF=true.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. The "Loopback_Virtual" will be vreated by the jack topology.

Comment on lines 22 to 24
"cavs-sdw\;sof-sdca-3amp-id2\;NUM_SDW_AMP_LINKS=3,SDW_JACK=false,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true"
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_SPK_ECHO_REF=true"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing SDW_ECHO_REF_DAI=true parameter. The SDW_SPK_ECHO_REF=true flag requires the alh-copier widget "Loopback_Virtual" to be instantiated, which is now only created when SDW_ECHO_REF_DAI=true (see cavs-sdw.conf lines 142-171). Without SDW_ECHO_REF_DAI=true, the route at sdw-amp-generic.conf:1102 will reference a non-existent "alh-copier.Loopback_Virtual.25" widget, causing a topology build or runtime error. Either add SDW_ECHO_REF_DAI=true to this topology configuration or remove SDW_SPK_ECHO_REF=true.

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 28
"cavs-sdw\;sof-sdca-4amp-id2\;NUM_SDW_AMP_LINKS=4,SDW_JACK=false,\
SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true"
DEEPBUFFER_FW_DMA_MS=10,DEEP_BUF_SPK=true,SDW_SPK_ECHO_REF=true"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing SDW_ECHO_REF_DAI=true parameter. The SDW_SPK_ECHO_REF=true flag requires the alh-copier widget "Loopback_Virtual" to be instantiated, which is now only created when SDW_ECHO_REF_DAI=true (see cavs-sdw.conf lines 142-171). Without SDW_ECHO_REF_DAI=true, the route at sdw-amp-generic.conf:1102 will reference a non-existent "alh-copier.Loopback_Virtual.25" widget, causing a topology build or runtime error. Either add SDW_ECHO_REF_DAI=true to this topology configuration or remove SDW_SPK_ECHO_REF=true.

Copilot uses AI. Check for mistakes.
topologies

Add echo reference support to the jack and amp function topologies.
The function topologies will be loaded with the jack -> amp order.
So always create the "Loopback_Virtual" DAI copier in the jack function
topology and there are 2 versions of amp function topologies. One is
with the "Loopback_Virtual" DAI copier and the other doesn't. The
Linux driver will select the one with "Loopback_Virtual" DAI copier
if no jack function is loaded and select the one without
"Loopback_Virtual" DAI copier otherwise.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant