Repository navigation
Commit 2fc03a7
committed
pipeline: introduce declarative static topology definition and loader
Add support for declarative static audio pipelines in Sound Open Firmware.
In microcontroller, hostless, and standalone embedded environments (such
as ESP32-P4/S3/C6, PJRC Teensy 4.1, Nordic nRF54, RP2350, smart speakers,
and audio bridges), there is no dynamic IPC host driver (Linux ALSA/SoundWire
or Windows) to build topologies at runtime.
This introduces:
1. Declarative topology structures, capability flags, and constructor
macros in <sof/audio/pipeline/static_pipeline.h> with full Doxygen
docblocks covering all structures, fields, enums, macros, and public
APIs. Complete sample rate masks (8k through 384k) aligned with
SOF_RATE_* and frame format masks aligned with enum sof_ipc_frame.
2. Ops-driven static module architecture: generic headers and loader
engine are 100% decoupled from individual audio processing components.
Audio processing modules define and register their own operations
(struct sof_static_module_ops) providing .create, .apply_volume,
.apply_switch, and .apply_enum callbacks directly in their own source
files (SRC, ASRC, Volume/Gain, Level Multiplier, Selector, EQ IIR,
DRC, and TDFB) using DECLARE_STATIC_MODULE_OPS().
3. Generic module operations registry and base IPC4 config synthesizer
in static_pipeline_modules.c: completely generic infrastructure for
ops registration, lookup with error logging, base configuration
synthesis with macros for IPC4 channel maps, and default fallback
component instantiation.
4. Concise, generic constructor macros (SOF_STATIC_MODULE,
SOF_STATIC_MODULE_RATE_CONV, SOF_STATIC_ENDPOINT_DAI, and
SOF_STATIC_ENDPOINT_USB) allowing clean, compact topology definitions
for any audio processing module and DAI endpoint.
5. Modular IPC configuration and base config synthesizer: synthesizes
standard IPC4 base module configurations (struct ipc4_base_module_cfg)
on behalf of the absent host, calculating input and output buffer sizes
(IBS/OBS) dynamically from component capabilities and pipeline periods.
6. Dynamic multi-rate, multi-channel, and format negotiation: eliminates
hardcoded sample rates and channel counts in buffer initialization and
pipeline/component prepare, supporting sample rate converters (SRC/ASRC),
up/down mixers, and format conversions with per-buffer rate/channel inheritance.
7. Generic static topology loader engine in static_pipeline_loader.c
to parse and instantiate native SOF components, buffers, routes,
and kcontrols directly at boot.
8. Component preparation and parameter negotiation to ensure all
processing modules reach ready state prior to streaming.
9. Direct pipeline start, stop, and trigger control with separate
start/stop execution paths (sof_static_pipeline_start,
sof_static_pipeline_stop), strict error checking preventing triggers
on prepare failures, state validation, and copy task management.
10. Decoupled custom kcontrol callback handler to support platform-
and board-specific controls without polluting core audio modules.
11. CONFIG_STATIC_PIPELINE Kconfig option and CMakeLists.txt integration.
12. Comprehensive developer documentation, architecture overview, and
step-by-step tutorial with multi-rate SRC examples in
src/audio/pipeline/README.md.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>1 parent b6c6a05 commit 2fc03a7
15 files changed
Lines changed: 3003 additions & 1 deletion
File tree
- src
- audio
- asrc
- drc
- eq_iir
- level_multiplier
- pipeline
- selector
- src
- tdfb
- volume
- include/sof/audio/pipeline
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
846 | 846 | | |
847 | 847 | | |
848 | 848 | | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
849 | 884 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
484 | 510 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
261 | 300 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
207 | 249 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments