Skip to content

topology2: add SDW echo reference function topologies#10600

Open
bardliao wants to merge 7 commits intothesofproject:mainfrom
bardliao:topology2-echo-ref-alternative
Open

topology2: add SDW echo reference function topologies#10600
bardliao wants to merge 7 commits intothesofproject:mainfrom
bardliao:topology2-echo-ref-alternative

Conversation

@bardliao
Copy link
Collaborator

@bardliao bardliao commented Mar 5, 2026

Add SoundWire echo reference function topologies. Those topologies can be connected to the base SoundWire jack/amp function topologies. Those with ref-dai suffix contain the Loopback_Virtual dai. The Loopback_Virtual dai should be created once and only once in the topology set. User can select the topology set by kernel module parameter.

Copy link
Contributor

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

Adds new SoundWire echo reference “function topology” fragments (jack/speaker) and optional Loopback_Virtual DAI support, intended to be selectable as part of topology sets.

Changes:

  • Add new SDCA generic build targets for amp/jack echo reference variants (including *-ref-dai).
  • Refactor jack/amp generic configs to always provide module-copier tap points and move echo-ref pipelines/PCMs into dedicated sdw-*-echo-ref.conf includes.
  • Update cavs-sdw.conf to conditionally include the new echo-ref fragments and to parameterize the Loopback_Virtual DAI pipeline index.

Reviewed changes

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

Show a summary per file
File Description
tools/topology/topology2/production/tplg-targets-sdca-generic.cmake Adds new SDCA targets for echo reference and echo-ref-dai variants.
tools/topology/topology2/platform/intel/sdw-jack-generic.conf Makes module-copier tap and routing unconditional for jack playback.
tools/topology/topology2/platform/intel/sdw-jack-echo-ref.conf New jack echo reference capture pipeline + PCM definition.
tools/topology/topology2/platform/intel/sdw-amp-generic.conf Makes module-copier tap and routing unconditional for speaker playback.
tools/topology/topology2/platform/intel/sdw-amp-echo-ref.conf New speaker echo reference capture pipeline + PCM definition.
tools/topology/topology2/cavs-sdw.conf Adds includes for new echo-ref fragments and adjusts Loopback_Virtual DAI index selection.

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

@lgirdwood
Copy link
Member

@bardliao are the last 2 copilot comments still open or resolved, if resolved we can click the button.

@bardliao
Copy link
Collaborator Author

@bardliao are the last 2 copilot comments still open or resolved, if resolved we can click the button.

They are resolved. The comments are duplicated between jack and amp topologies.

@lgirdwood
Copy link
Member

Some conflicts @bardliao

This is a preparation commit for creating a stand alone echo reference topology.
module-copier.1.12 is used by the echo reference, but it is harmless to
create it and connect it to the no echo reference topology. And then we
can connect the echo reference pipeline to module-copier.1.12 is echo
reference is needed.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
This is a preparation commit for creating a stand alone echo reference topology.
module-copier.1.22 is used by the echo reference, but it is harmless to
create it and connect it to the no echo reference topology. And then we
can connect the echo reference pipeline to module-copier.1.22 is echo
reference is needed.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The spk echo refference pipeline ID 22 is the same as 2nd spk pipeline
ID. Follow the convention that route and pipeline index start from pcm
id * 10 to set it to 120.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The Loopback_Virtual DAI's pipeline ID should be either spk echo
reference pipeline or jack echo reference pipeline. Use macro to select
one of them.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Currently, we implement the echo reference pipeline, widgets, routes in
the SoundWire config files. It is hard to create a stand alone echo
reference topology for the function topology usages. This commit moves
the echo reference part from the original config file and include the
new echo reference in the original file.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
sdw-amp-echo-ref.conf and sdw-jack-echo-ref.conf are included in the
sdw-amp-generic.conf and sdw-jack-generic.conf if needed. But for the
function topology usages, we will create the jack/amp function topology
and the corresponding echo reference topology separately.
Move to cavs-sdw.conf allow us create he jack/amp function topology
and the corresponding echo reference topology separately

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao bardliao force-pushed the topology2-echo-ref-alternative branch from 0b9fa7b to 69760f1 Compare March 11, 2026 14:36
@bardliao
Copy link
Collaborator Author

Some conflicts @bardliao

fixed

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

LGTM

@bardliao bardliao marked this pull request as draft March 12, 2026 03:10
@bardliao
Copy link
Collaborator Author

Convert to draft as I see source module-copier.21.22 for sink siggen.120.1 is not found issue.

@bardliao bardliao marked this pull request as ready for review March 12, 2026 03:51
@bardliao
Copy link
Collaborator Author

Convert to draft as I see source module-copier.21.22 for sink siggen.120.1 is not found issue.

Sorry, it was a false alarm. I tested with the original sof-sdca-jack-id0.tplg and sof-sdca-2amp-id2.tplg which don't have the module-copier for the echo reference topology to connect.

@lgirdwood
Copy link
Member

@ujfalusi good for you ?

Copy link
Contributor

@ujfalusi ujfalusi left a comment

Choose a reason for hiding this comment

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

@bardliao, I only have just few nitpicks.

{
direction "capture"
index 22
index 120
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we define this new magic number instead?

and I think we must have a separate file which defines the pipeline IDs and have a rule that magic numbers are not allowed, all index must be set with a defined value.

This example shows how unsustainable this magic number use is.... In the same file we have two things defined as 22:
ALH_2ND_SPK_ID 22
ALH_2ND_SPK_IN_ID 32

The 3rd speaker is
ALH_3RD_SPK_ID 23
ALH_3RD_SPK_IN_ID 33

I guess the 1st speaker is 21/31? There is pipeline 20 also which is speaker as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

the ask is to use define for the new magic ID in this PR.

SDW_AMP_FEEDBACK true
AMP_PLAYBACK_NAME 'Speaker Playback'
SDW_SPK_ECHO_REF_PCM_ID 12
SDW_SPK_ECHO_REF_PIPELINE_ID 120
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, this addresses the previous request

@@ -0,0 +1,52 @@
Define {
SDW_SPK_ECHO_REF_PCM_ID 12
SDW_SPK_ECHO_REF_PIPELINE_ID 120
Copy link
Contributor

Choose a reason for hiding this comment

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

if we would have a global 'registry' for IDs, you would not need to define in all places, which can be error prone.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree, we can do it later.

Add SoundWire echo reference feature topologies.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
@bardliao bardliao force-pushed the topology2-echo-ref-alternative branch from 69760f1 to 882d260 Compare March 13, 2026 07:38
@lgirdwood
Copy link
Member

@lrudyX good to merge, dont think tested by Internal CI ?

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.

4 participants