docs: add topology2 README with structure and conventions#10623
docs: add topology2 README with structure and conventions#10623kv2019i wants to merge 1 commit intothesofproject:mainfrom
Conversation
kv2019i
commented
Mar 13, 2026
- document directory structure, class-based object model, and build pipeline
- add PCM ID and pipeline ID convention tables for SoundWire and HDA
- describe cmake target registration, platform overrides, and route definitions
There was a problem hiding this comment.
Pull request overview
This PR adds a comprehensive README for the SOF Topology2 system, documenting its directory structure, class-based object model, build pipeline, and conventions for PCM/pipeline IDs.
Changes:
- Added a new
README.mddocumenting directory structure, build process, and the class-based object model - Documented PCM ID and pipeline ID convention tables for SoundWire and HDA topology families
- Described CMake target registration, platform overrides, route definitions, and widget naming conventions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| | HDMI 2 | 4 | `HDMI2_PCM_ID` | | ||
| | HDMI 3 | 5 | `HDMI3_PCM_ID` | | ||
| | DMIC0 | 6 | `DMIC0_PCM_ID` | | ||
| | Deep Buffer | 31 | `DEEP_BUFFER_PCM_ID` | |
There was a problem hiding this comment.
| Compress HDA Analog | 50 | COMPR_PCM_ID |
tools/topology/topology2/README.md
Outdated
| | Deep Buffer (Jack) | 31 | `DEEP_BUFFER_PCM_ID` | | ||
| | Deep Buffer (Speaker) | 35 | `DEEP_BUFFER_PCM_ID_2` | | ||
| | DMIC Deep Buffer | 46 | `DMIC0_DEEP_BUFFER_PCM_ID` | | ||
| | Compressed Playback 1 | 50 | `COMPR_PCM_ID` | |
tools/topology/topology2/README.md
Outdated
| | Deep Buffer (Speaker) | 35 | `DEEP_BUFFER_PCM_ID_2` | | ||
| | DMIC Deep Buffer | 46 | `DMIC0_DEEP_BUFFER_PCM_ID` | | ||
| | Compressed Playback 1 | 50 | `COMPR_PCM_ID` | | ||
| | Compressed Playback 2 | 52 | `COMPR_2_PCM_ID` | |
| | HDMI 3 Host / DAI | 70 / 71 | `HDMI3_HOST_PIPELINE_ID` / `HDMI3_DAI_PIPELINE_ID` | | ||
| | HDMI 4 Host / DAI | 80 / 81 | `HDMI4_HOST_PIPELINE_ID` / `HDMI4_DAI_PIPELINE_ID` | | ||
| | Compressed 1 / 2 | 90 / 92 | `COMPR_PIPELINE_ID` / `COMPR_2_PIPELINE_ID` | | ||
| | PCH DMIC0 Host / DAI | 100 / 101 | `DMIC0_HOST_PIPELINE_ID` / `DMIC0_DAI_PIPELINE_ID` | |
There was a problem hiding this comment.
why only these random pipeline IDs? There is pipeline with ID 22 for example and based on this readme, it is up for grab, when if you define a pipeline with 22, it will have really fun side effects as it is used by something else...
There was a problem hiding this comment.
@ujfalusi I don't think the readme needs to be exhaustive. pipeline IDs are not visible in the public ALSA interface, so as long as the resulting topology is consistent internally, the pipeline IDs do not matter. I do think it's useful to highlight with some practical examples that within families of topology files (that used shared definitions), one must understand the pipeline ID conventions.
tools/topology/topology2/README.md
Outdated
| | HDMI 2 Host / DAI | 60 / 61 | `HDMI2_HOST_PIPELINE_ID` / `HDMI2_DAI_PIPELINE_ID` | | ||
| | HDMI 3 Host / DAI | 70 / 71 | `HDMI3_HOST_PIPELINE_ID` / `HDMI3_DAI_PIPELINE_ID` | | ||
| | HDMI 4 Host / DAI | 80 / 81 | `HDMI4_HOST_PIPELINE_ID` / `HDMI4_DAI_PIPELINE_ID` | | ||
| | Compressed 1 / 2 | 90 / 92 | `COMPR_PIPELINE_ID` / `COMPR_2_PIPELINE_ID` | |
There was a problem hiding this comment.
Compress Jack and Speaker...
| | HDMI 1 Host / DAI | 50 / 51 | `HDMI1_HOST_PIPELINE_ID` / `HDMI1_DAI_PIPELINE_ID` | | ||
| | HDMI 2 Host / DAI | 60 / 61 | `HDMI2_HOST_PIPELINE_ID` / `HDMI2_DAI_PIPELINE_ID` | | ||
| | HDMI 3 Host / DAI | 70 / 71 | `HDMI3_HOST_PIPELINE_ID` / `HDMI3_DAI_PIPELINE_ID` | | ||
| | HDMI 4 Host / DAI | 80 / 81 | `HDMI4_HOST_PIPELINE_ID` / `HDMI4_DAI_PIPELINE_ID` | |
There was a problem hiding this comment.
Compress HDA Analog is 90 and who knows what pipeline IDs are in use in HDA topology, I would not dare to guess...
There was a problem hiding this comment.
You can also use alsatplg --decode to just check. Agreed the build doesn't notify if you have conflicting pipeline IDs, so one needs to either use tplgtool2.py or test the topology with Linux kernel to really verify pipeline ID usage.
kv2019i
left a comment
There was a problem hiding this comment.
Thanks @ujfalusi . I'll make some improvements to V2 based on the comments. See also my replies inline. I don't think this readme should be the complete documentation (I'll add a link to https://thesofproject.github.io/latest/developer_guides/topology2/topology2.html ), nor full database of IDs, but provide enough examples for people to understand what are key things to pay attention to when writing new topologies (or updating existing once).
| | HDMI 2 | 4 | `HDMI2_PCM_ID` | | ||
| | HDMI 3 | 5 | `HDMI3_PCM_ID` | | ||
| | DMIC0 | 6 | `DMIC0_PCM_ID` | | ||
| | Deep Buffer | 31 | `DEEP_BUFFER_PCM_ID` | |
| | HDMI 3 Host / DAI | 70 / 71 | `HDMI3_HOST_PIPELINE_ID` / `HDMI3_DAI_PIPELINE_ID` | | ||
| | HDMI 4 Host / DAI | 80 / 81 | `HDMI4_HOST_PIPELINE_ID` / `HDMI4_DAI_PIPELINE_ID` | | ||
| | Compressed 1 / 2 | 90 / 92 | `COMPR_PIPELINE_ID` / `COMPR_2_PIPELINE_ID` | | ||
| | PCH DMIC0 Host / DAI | 100 / 101 | `DMIC0_HOST_PIPELINE_ID` / `DMIC0_DAI_PIPELINE_ID` | |
There was a problem hiding this comment.
@ujfalusi I don't think the readme needs to be exhaustive. pipeline IDs are not visible in the public ALSA interface, so as long as the resulting topology is consistent internally, the pipeline IDs do not matter. I do think it's useful to highlight with some practical examples that within families of topology files (that used shared definitions), one must understand the pipeline ID conventions.
| | HDMI 1 Host / DAI | 50 / 51 | `HDMI1_HOST_PIPELINE_ID` / `HDMI1_DAI_PIPELINE_ID` | | ||
| | HDMI 2 Host / DAI | 60 / 61 | `HDMI2_HOST_PIPELINE_ID` / `HDMI2_DAI_PIPELINE_ID` | | ||
| | HDMI 3 Host / DAI | 70 / 71 | `HDMI3_HOST_PIPELINE_ID` / `HDMI3_DAI_PIPELINE_ID` | | ||
| | HDMI 4 Host / DAI | 80 / 81 | `HDMI4_HOST_PIPELINE_ID` / `HDMI4_DAI_PIPELINE_ID` | |
There was a problem hiding this comment.
You can also use alsatplg --decode to just check. Agreed the build doesn't notify if you have conflicting pipeline IDs, so one needs to either use tplgtool2.py or test the topology with Linux kernel to really verify pipeline ID usage.
- document directory structure, class-based object model, and build pipeline - add PCM ID and pipeline ID convention tables for Intel SoundWire and HDA - describe cmake target registration, platform overrides, and route definitions Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
96c10d0 to
25dd574
Compare
|
V2 pushed:
|