You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: extend topology2 README with conventions and ID tables
- 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>
Copy file name to clipboardExpand all lines: tools/topology/topology2/README.md
+309Lines changed: 309 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,35 @@
2
2
3
3
This directory contains the ALSA Topology v2 source files for Sound Open Firmware.
4
4
5
+
This readme is a quick intro to the topic. Please refer to full documentation
6
+
at https://thesofproject.github.io/latest/developer_guides/topology2/topology2.html
7
+
5
8
## Overview
6
9
7
10
Topology v2 is a modernization of the ALSA topology infrastructure. It aims to solve the verbosity and complexity issues of Topology v1 without relying as heavily on external macro processors like `m4`.
8
11
9
12
Topology v2 introduces an object-oriented pre-processing layer directly into the newer `alsatplg` compiler (invoked via the `-p` flag). This allows the configuration files to define classes, objects, and attributes natively within the ALSA configuration syntax.
10
13
14
+
Building topologies requires `alsatplg` version 1.2.7 or later. The version check is
15
+
enforced in `CMakeLists.txt` at configure time.
16
+
11
17
## Key Advantages
12
18
13
19
-**Object-Oriented Syntax**: Topology v2 allows for the definition of classes (`Class.Widget`, `Class.Pipeline`) and object instantiation, making the topology files much easier to read, maintain, and extend.
14
20
-**Reduced Pre-Processing**: By handling templating and instantiation inside the `alsatplg` tool itself, the build process is cleaner and errors are easier to trace back to the source files, as opposed to deciphering expanded `m4` output.
15
21
-**Dynamic Variables**: Attributes can be parameterized and passed down to nested objects, allowing for highly flexible definitions of audio pipelines.
16
22
23
+
Topology2 uses a class-based object model built on four core concepts:
***Objects** (`Object.Pipeline`, `Object.Widget`, `Object.PCM`) instantiate classes with
28
+
specific parameter values
29
+
***Define blocks** provide variable substitution using `$VARIABLE` syntax, enabling
30
+
parameterized topologies
31
+
***IncludeByKey** enables conditional includes based on variable values, used primarily
32
+
for platform-specific overrides
33
+
17
34
## Structure and Component Assembly
18
35
19
36
Topology v2 shifts the source code layout from macro definitions to class definitions, leveraging the structured nature of the newer compiler.
@@ -28,6 +45,35 @@ The directory is built around these core parts:
28
45
-**`platform/`**: Hardware-specific configurations and overrides (e.g., Intel-specific IPC attributes).
29
46
-**Top-Level `.conf` files**: The board-specific configurations (e.g., `cavs-rt5682.conf`). These behave like standard ALSA `.conf` files but utilize the `@include` directive to import classes and instantiate them dynamically.
30
47
48
+
### Detailed Directory Layout
49
+
50
+
```text
51
+
tools/topology/topology2/
52
+
├── CMakeLists.txt # Build system entry point
53
+
├── get_abi.sh # ABI version extraction script
54
+
├── cavs-sdw.conf # SoundWire topology entry point
55
+
├── sof-hda-generic.conf # HDA generic topology entry point
56
+
├── cavs-mixin-mixout-hda.conf # HDA with mixer pipelines
0 commit comments