Skip to content

doc: api: align core C APIs with Doxygen taxonomy, scheduling, memory, pipeline, and module documentation - #540

Merged
lgirdwood merged 5 commits into
thesofproject:masterfrom
lgirdwood:topic/c-api-alignment-docs
Oct 13, 2026
Merged

lgirdwood merged 5 commits into
thesofproject:masterfrom
lgirdwood:topic/c-api-alignment-docs

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Summary

This PR aligns sof-docs with the modernized Doxygen C API taxonomy introduced in SOF firmware PR thesofproject/sof#11296. It expands Sphinx and Breathe integration across core Sound Open Firmware architectural subsystems.

Note

Dependency Notice:
This PR depends on thesofproject/sof#11296 being merged into thesofproject/sof:main first.
The sof-docs CI workflow (.github/workflows/pull-request.yml) clones thesofproject/sof:main directly to generate Doxygen XML. Until PR #11296 merges into sof:main, CI will fail under Sphinx -W because the new Doxygen groups (scheduler_api, memory_api, pipeline_graph_api, module_api, etc.) are not yet present on main.
Verified locally with zero warnings: make html -W SOF_ROOT=../sof-dox-work.


Key Additions & Changes

  1. Breathe Anonymous Struct Warning Suppression (conf.py):

    • In Sphinx C domain, Breathe generates duplicate variable declarations when a C union contains multiple anonymous structs sharing member names (such as scheduler_dp_thread_ipc_param in dp_schedule.h). Added duplicate_declaration.c warning suppression filter to avoid spurious fatal errors under Sphinx -W mode.
  2. Memory Management Infrastructure (api/memory.rst):

    • Added dedicated documentation page covering virtual memory regions (vregion), virtual page allocation (vpage), runtime buffer allocator (rballoc), memory tags, capabilities, and physical memory topologies (L2 HP-SRAM, L2 LP-SRAM, L3).
    • Rendered Doxygen groups memory_api and sof_memory_management via Breathe.
  3. Scheduling Infrastructure (api/scheduling.rst):

    • Added dedicated documentation page covering Low-Latency (LL) timer and DMA scheduling domains, Dynamic Processing (DP) threads and Zephyr RTOS mapping, legacy EDF and TWB schedulers, task operations, and lifecycle state machines.
    • Rendered Doxygen groups scheduler_api, schedule_task_api, ll_scheduler_api, dp_scheduler_api, edf_scheduler_api, twb_scheduler_api, and zephyr_dp_schedule.
  4. Pipeline Modularization:

    • Deconstructed monolithic api/pipeline.rst into focused architectural sub-pages:
      • api/pipeline_graph.rst: Directed Acyclic Graph (DAG) construction, scheduling task binding (LL/DP), traversal, and state transitions.
      • api/component_infra.rst: Unified component driver model (comp_ops), trigger state machines, and multi-core IDC bindings.
      • api/audio_buffer.rst: Interconnect buffers (comp_buffer), circular stream endpoints, and lockless ring buffers.
      • api/audio_format.rst: Channel mapping, PCM sample conversion, and saturation arithmetic.
    • Transformed api/pipeline.rst into an architectural hub page with an overview ASCII diagram and sub-page toctree.
  5. Audio Processing Components & Modules (api/components.rst):

    • Populated the components page with the full Module Adapter layer architecture and built-in processing component catalog (Volume, Mixer, EQ, DRC, SRC, ASRC, Smart Amp, Sound Dose).
    • Documented module lifecycle contracts (init, prepare, process, set/get_configuration, reset, free), streaming endpoints, dynamic LLEXT loading, and UUID registration.
    • Integrated full Breathe C API reference for module_api and removed redundant api/modules.rst.
  6. Navigation Updates:

    • Updated api/index.rst and api/rtos.rst navigation trees and cross-references.

Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com

…mous structs

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add comprehensive architectural and reference documentation for SOF's
memory management subsystem:
- Virtual memory regions (vregion) and virtual page allocation (vpage)
- Heap allocators: system heap, runtime buffer allocator (rballoc)
- Memory capabilities, flags, tags, and physical memory topologies
- Expose memory_api and sof_memory_management Doxygen groups via Breathe
- Update index.rst and rtos.rst navigation

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…cture page

Add dedicated documentation page for SOF scheduling architecture:
- Core scheduler contracts and task operations
- Low-Latency (LL) scheduling domains (timer and DMA driven)
- Dynamic Processing (DP) threads and Zephyr RTOS thread mapping
- Legacy Earliest Deadline First (EDF) and Time-Warp Buffer (TWB) schedulers
- Task lifecycle state machine diagrams and cross-core scheduling contracts
- Expose scheduler_api, schedule_task_api, ll_scheduler_api, dp_scheduler_api,
  edf_scheduler_api, twb_scheduler_api, and zephyr_dp_schedule via Breathe
- Update index.rst, pipeline.rst, and rtos.rst navigation

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
- Deconstruct the monolithic pipeline API page into four focused sub-pages:
  * pipeline_graph.rst: Directed Acyclic Graph (DAG) construction, scheduling
    task binding (LL/DP), pipeline traversal, and graph-wide state transitions.
  * component_infra.rst: Unified component driver model (comp_ops), trigger
    state machines, and multi-core IDC bindings.
  * audio_buffer.rst: Interconnect buffers (comp_buffer), circular stream
    endpoints, and lockless ring buffers.
  * audio_format.rst: Channel mapping and PCM sample saturation arithmetic.
- Transform api/pipeline.rst into an architectural hub page with an overview
  ASCII diagram and a sub-page toctree.
- Update api/index.rst module overview to reflect the new pipeline structure.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
- Update api/components.rst to provide comprehensive documentation for
  Audio Processing Components & Modules API, including:
  * Architecture overview and Module Adapter layer diagram
  * Processing Component catalog (Volume, Mixer, EQ, DRC, SRC, ASRC, Smart Amp, Sound Dose)
  * Module lifecycle contracts (init, prepare, process, set/get_configuration, reset, free)
  * Source and sink streaming endpoint buffer interfaces
  * Dynamic LLEXT loading and UUID registration
  * Complete Breathe C API reference via module_api group
- Remove redundant api/modules.rst and update api/index.rst navigation to point
  directly to the unified components reference.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
lgirdwood merged commit 69f37d4 into thesofproject:master Oct 13, 2026
7 of 9 checks passed
@lgirdwood
lgirdwood deleted the topic/c-api-alignment-docs branch October 13, 2026 08:26
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.

2 participants