Architecture & System Design#
Sound Open Firmware (SOF) is built upon the Zephyr RTOS and is designed to run across diverse hardware architectures without being coupled to any specific DSP or host processor. SOF is designed to run on any architecture and SoC supported by Zephyr—spanning Tensilica Xtensa, ARM Cortex-M, and RISC-V targets. The architecture is strictly modular: silicon-specific and platform-specific implementations reside in partitioned directories and Zephyr device drivers, exposing generic, standardized APIs to the core framework.
System & Software Architecture#
The SOF software ecosystem supports two foundational deployment models tailored for different device form-factors:
Host-Based Architecture: Where the audio DSP is coupled to an application processor running a general-purpose operating system (Linux, Android, or ChromeOS). The host manages firmware lifecycle, parses topologies, and streams audio over DMA memory windows via inter-processor communication (IPC).
Hostless (Standalone / Embedded) Architecture: Where SOF firmware runs autonomously directly on a microcontroller or standalone DSP (such as the ESP32-P4 or Teensy 4.1 / i.MX RT1062) atop Zephyr RTOS without requiring a host CPU or external operating system.
Host-Based System & Software Architecture#
In host-based deployments (such as PCs, Chromebooks, smartphones, automotive infotainment, and servers), the audio stack is vertically integrated across the host OS, hardware interconnect, and DSP firmware:
Figure 2 SOF Host-Based End-to-End System & Software Stack Architecture#
Host Driver Stack (Linux ASoC)#
The host-side driver is integrated directly upstream in the mainline Linux kernel under sound/soc/sof/. Its primary responsibilities include:
DSP Lifecycle Management: Bringing the DSP out of reset, downloading signed firmware manifests, configuring boot addresses, and handling runtime power management (D0ix, D3 suspend/resume).
Topology Parsing: Loading compiled binary topology containers (
.tplg) and translating ALSA controls and widgets into runtime DSP pipeline instantiation commands.IPC Transport: Coordinating bidirectional communication with the DSP via hardware mailboxes, interrupt doorbells, and shared memory windows.
ALSA Device Exposure: Exposing standard PCM playback/capture devices, mixer controls, and byte controls to user-space audio servers (PipeWire, PulseAudio, CRAS, AudioFlinger) and ALSA applications (via
libasoundandtinyalsa).
Hostless (Standalone) Embedded Architecture#
In hostless deployments (such as smart speakers, conference microphones, standalone audio bridges, hearing aids, IoT voice endpoints, and embedded test cards like the ESP32-P4 and Teensy 4.1 / i.MX RT1062), SOF executes completely autonomously without requiring a host processor or general-purpose operating system:
Autonomous Zephyr Application: SOF operates as a self-contained Zephyr RTOS native application. It initializes on-chip peripherals, configures audio clocks, and begins pipeline processing immediately upon boot without waiting for host firmware downloads or handshakes.
Static Pre-Compiled Topologies: Instead of relying on a host kernel driver to dynamically parse binary
.tplgfiles at runtime, hostless systems utilize pre-compiled static topology graphs embedded directly in firmware flash ROM or compiled into static C data structures.Direct Hardware Audio IO: Audio data streams enter and exit directly through physical digital audio interfaces (I2S, TDM, SoundWire, or PDM microphone arrays), on-chip USB Audio Class (UAC2) endpoints, and Bluetooth audio controllers supporting modern wireless profiles (A2DP sink/source, HFP/mSBC voice call, LE Audio / LC3, and Auracast broadcast), eliminating the need for host DMA memory windows.
Deterministic Local Scheduling: Periodic execution is autonomously driven by the Zephyr RTOS Low-Latency (LL) timer scheduler or Earliest Deadline First (EDF) event scheduler, delivering sub-millisecond audio processing with zero host scheduling jitter.
Local Controls & Embedded Telemetry: Volume, mute, EQ profiles, and audio routing are controlled locally via GPIO buttons, rotary encoders, or local Zephyr application threads, with real-time diagnostic trace logging streamed over UART or USB CDC.
Figure 3 SOF Hostless Embedded System Architecture (ESP32-P4 / Teensy 4.1)#
High-Level Firmware Architecture#
The SOF firmware architecture is strictly partitioned into two decoupled tiers:
SOF Application Layer (Upper Part): Houses the audio signal processing engine, real-time pipeline schedulers, inter-processor communication (IPC) protocol decoders, dynamic module loading (LLEXT), and heterogeneous memory management.
Zephyr RTOS Layer (Lower Part): Provides the real-time operating system kernel, preemptive multi-threading, SMP multi-core load balancing, hardware timer ticks, device drivers (DMA, DAI, mailbox), and platform hardware abstraction layers (HAL).
Figure 4 Sound Open Firmware (SOF) High-Level Firmware Architecture: Application & Zephyr RTOS Layers#
Firmware Subsystem Architecture Breakdown#
The firmware stack comprises the following key components across the two layers:
Audio Processing Modules: Standardized DSP processing components chained within directed acyclic graphs (DAGs). Core components include Volume / Mute, Software Mixer, Sample Rate Converter (SRC), Parametric Equalizer (EQ FIR/IIR), Dynamic Range Compressor (DRC), Acoustic Echo Cancellation (AEC), Direction-of-Arrival (DoA) Beamformer, and Spatial Audio.
Dynamic Module Loader (LLEXT): Enables out-of-tree and closed-source vendor algorithms to be dynamically loaded, linked, and verified into DSP SRAM at runtime without rebuilding the base firmware.
Real-Time Pipeline Schedulers: Coordinates pipeline execution periods. Low-Latency (LL) timer-driven tasks run at fixed 1ms intervals (or native audio frames), while Earliest Deadline First (EDF) and workqueue tasks handle bulk non-real-time audio transformations.
IPC Protocol Engine: Handles asynchronous communication with the host OS over platform doorbells and mailboxes, supporting both Intel IPC4 and legacy IPC3 message formats.
Heterogeneous Memory System: Manages partitioned memory pools spanning High-Power (HP) and Low-Power (LP) SRAM, dynamic Intermediate Memory Residency (IMR) DRAM paging, and cache-aligned zero-copy audio ring buffers.
Audio Stream Endpoints: Interface boundaries that move audio data between host shared memory (Host DMA Copier) and physical audio interface hardware (SoundWire, I2S, PDM copiers).
Zephyr RTOS Integration: Powers the underlying DSP core with preemptive multi-threading, SMP multi-core task migration, architecture hardware timers, unified device drivers, runtime power management (D0ix/D3), and high-throughput dictionary logging.
Audio Topology Architecture#
Audio routing, component interconnects, and signal processing chains in SOF are completely decoupled from firmware code. Instead of hardcoding audio graphs in C, SOF uses ALSA Topology.
What is an SOF Topology?#
A topology configuration file defines the complete audio hardware and software graph: * Digital Audio Interfaces (DAI): Physical link configurations connected to external codecs, SoundWire links, PDM microphones, or HDMI transmitters. * Pipeline Layout: Directed acyclic graphs (DAG) defining which components (Volume, Mixer, SRC, EQ, DRC, AEC) are chained together. * Stream Parameters: Supported sample rates, channel maps, sample bit depths, and scheduling periods (e.g. 1ms low-latency timer or bulk). * ALSA Mixer Controls: Volume faders, mute switches, enum multiplexers, and vendor-specific binary coefficient blobs.
Audio Processing Pipelines (DAGs)#
At the heart of the firmware is the audio processing pipeline framework: * Directed Acyclic Graphs (DAGs): Audio pipelines are constructed as graphs of processing components connected by audio buffers. * Zero-Copy Buffer Management: Ring buffers are allocated in cache-aligned SRAM to ensure minimum latency and zero memory copying between adjacent components. * Schedulers: Periodic execution is coordinated by the Low Latency (LL) timer-based scheduler or the Earliest Deadline First (EDF) event scheduler, supporting both sub-millisecond real-time paths and bulk processing.
Figure 5 SOF Audio Processing Pipeline Graph (DAG) and ALSA Control Bindings#
Topology 2 Architecture#
Modern topologies are authored using Topology 2 (ALSA Conf / m4):
* Human-Readable Configurations: High-level graph definitions specifying audio pipelines, widgets, DAIs, and buffer bindings.
* Pre-Processing & Validation: Topology compiler tools (alsatplg / tplg2) validate buffer constraints, clock dividers, and memory requirements before producing the binary .tplg container.
* Runtime Dynamic Graph Building: When the host OS boots, the kernel driver parses the binary container and sends IPC messages instructing the DSP firmware to construct the requested graph dynamically.
* Static ROM Topologies (Hostless): In standalone embedded deployments, topologies are pre-compiled into static ROM manifests or C structs embedded directly into the firmware image, removing runtime parsing overhead.
Note
For detailed subsystem implementation specifications, host driver internals, and firmware architectural layers, see the Detailed Subsystem Architecture Guides in Developer Guides.