Skip to content

tools: tplgtool2: Support for feature topologies and merging of topologies#1362

Open
ujfalusi wants to merge 3 commits into
thesofproject:mainfrom
ujfalusi:peter/topic/tplgtool2-merge-topologies
Open

tools: tplgtool2: Support for feature topologies and merging of topologies#1362
ujfalusi wants to merge 3 commits into
thesofproject:mainfrom
ujfalusi:peter/topic/tplgtool2-merge-topologies

Conversation

@ujfalusi
Copy link
Copy Markdown
Contributor

@ujfalusi ujfalusi commented Jun 8, 2026

This PR builds on #1361 (which will be closed):
It adds support for handling of feature topologies: fragment topologies which plugs into existing function or monolithic topology.

./tools/tplgtool2.py -D /tmp/ -d pcm,graph <path to sof-sdca-amp-ref-dai.tplg>

pcm_id=12;name=Speaker Echo Reference;type=capture ;rate_min=     0;rate_max=     0;ch_min=2;ch_max=2;fmts=S16_LE S24_LE S32_LE
WARNING: graph-only node(s) without matching widget: module-copier.21.22
sof-sdca-amp-ref-dai

It also adds a new command line parameter: --merge which will attempt to merge the topology files specified as command line parameters into a single view with noting the source of widgets and merge point(s):

./tools/tplgtool2.py -D /tmp/ -d pcm,graph --merge <path to sof-sdca-2amp-id2.tplg> <path to sof-sdca-amp-ref-dai.tplg>

pcm_id= 2;name=Speaker               ;type=playback;rate_min=     0;rate_max=     0;ch_min=2;ch_max=2;fmts=S16_LE S24_LE S32_LE
pcm_id=35;name=Deepbuffer Speaker    ;type=playback;rate_min=     0;rate_max=     0;ch_min=2;ch_max=2;fmts=S16_LE S24_LE S32_LE
pcm_id=12;name=Speaker Echo Reference;type=capture ;rate_min=     0;rate_max=     0;ch_min=2;ch_max=2;fmts=S16_LE S24_LE S32_LE
merged_2_tplgs

ujfalusi added 3 commits June 5, 2026 15:11
Feature topologies may contain graph endpoints that do not map to a
DAPM widget (for example, mixout.21.1).

Make tplgtool2 robust to these graph-only nodes instead of raising
KeyError while building graph metadata. Keep the issue visible by
emitting a warning and by rendering graph-only nodes with a distinct
style and label in graph output.

This keeps parsing and rendering usable for feature topologies while
still surfacing broken/incomplete graph<->widget mappings.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add --merge to combine multiple tplg inputs into one view for pcm and graph dumping.

Emit warnings for duplicate widget names, PCM IDs, and PCM names in merged mode.

Document merge usage in tools/README.md and README.md.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add unit tests for merged topology duplicate warning detection, including no-duplicate and duplicate cases.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@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