Hardware-accelerated GTK4 + Cairo real-time Sound Open Firmware (SOF) DSP resource, memory, and task monitor for Linux host systems and remote DUTs (sof_remote_server).
sof-top tries the local SOF host first (reading read-only from Linux SOF DebugFS/SysFS, /proc/asound, or an explicit /dev/sof-dsp0 character device), and when no local device is available, disables the local option in the UI so you can connect to any remote sof_remote_server over SOFZ-compressed TCP.
- Moving DSP Core Utilization Graph:
- Rolling 60-second time-series graph of per-core CPU load (
Core 0..Nin%of DSP clock andKCPS) plus aggregate peak/average load. - Per-core summary cards showing clock frequency (
MHz), active state, average/peakKCPS, and utilization bars.
- Rolling 60-second time-series graph of per-core CPU load (
- Moving DSP Memory Utilization Graph (SRAM + DRAM):
- Rolling 60-second multi-trace time-series graph tracking:
- HPSRAM (
L2 High-Performance SRAMpowered banks, e.g.,24 x 128 KB = 3072 KB) - LPSRAM (
L2 Low-Power SRAMpowered banks, e.g.,1 x 64 KB = 64 KB) - DRAM (
L3 / IMR) (IMR / L3backing storage, e.g.,16,384 KBbudget +.l3_rodatafootprint + LLEXT DRAM heaps) - DSP Heaps (Combined active allocations across System, Runtime, Module, Shared, Buffer, and LLEXT heaps)
- HPSRAM (
- Side-by-side capacity gauges for
HPSRAM,LPSRAM,DRAM (L3/IMR), andDSP Heaps.
- Rolling 60-second multi-trace time-series graph tracking:
- Unified DSP Task List with Resources & Status:
- Consolidates Scheduler Domains (
LL/DP), Zephyr RTOS Threads (TEL2), Audio Processing Modules (IPC4/PMW2), and DAI Gateways into a single filterable, sortable table (Sort: CPU %,Memory KB,Type,Name) showing Task ID, Name/UUID, Type, Core, Status (ACTIVE,READY,RESIDENT,IDLE,GATED),CPU %,KCPS(avg/max),SRAM (KB),DRAM (KB), and Stack/Cycles/XRUN details.
- Consolidates Scheduler Domains (
sof-top requires Python 3.10+ and the following Python packages (listed in requirements.txt and pyproject.toml):
| Python Package | Version | Purpose |
|---|---|---|
PyGObject |
>= 3.42.0 |
Python GObject Introspection bindings (Gtk 4.0, Gdk 4.0, GLib 2.0, Pango 1.0, PangoCairo 1.0) |
pycairo |
>= 1.20.0 |
Cairo 2D vector graphics bindings for hardware-accelerated custom GTK4 widgets and headless PNG rendering |
sudo apt update
sudo apt install \
python3 \
python3-pip \
python3-gi \
python3-gi-cairo \
gir1.2-gtk-4.0 \
gir1.2-pango-1.0sof-top is directly executable (#!/usr/bin/env python3, chmod +x) — no need to prefix python3:
# Auto-connect to local SOF device via read-only DebugFS/SysFS (or prompt for remote host if none present):
./sof-top/sof-top
# Explicitly monitor local host (may need sudo if /sys/kernel/debug is mode 0700):
sudo ./sof-top/sof-top --local
# Connect to a remote DUT running sof_remote_server:
./sof-top/sof-top --host <hostname> --wake
# Connect to an explicit local character device (/dev/sof-dsp0):
./sof-top/sof-top --local /dev/sof-dsp0
# Headless high-DPI PNG snapshot export (for CI or reports):
./sof-top/sof-top --host <hostname> --wake --render-png /tmp/softop_user
# Command-line snapshot / streaming extractor (`sof-top-cli`, no GTK required):
./sof-top/sof-top-cli --list-elements
./sof-top/sof-top-cli --host <hostname> --wake --format json
./sof-top/sof-top-cli --host <hostname> --wake --stream -n 5 -i 200 --format jsonl -e summary,cores,memory.hpsram
./sof-top/sof-top-cli --host <hostname> --wake -e tasks.name,tasks.cpu_pct,tasks.avg_kcps --active-only --format text| Option | Default | Description |
|---|---|---|
-H, --host HOST |
(none) | Remote DUT hostname or IP running sof_remote_server (omit to auto-detect local host) |
-p, --port PORT |
9998 |
Remote TCP port for sof_remote_server |
-l, --local [DEV] |
(auto) | Local read-only DebugFS/SysFS telemetry, or explicit device path (e.g. /dev/sof-dsp0) |
-i, --interval MS |
250 |
Telemetry poll interval in milliseconds |
-w, --wake |
false |
Hold/wake DSP via PM runtime when polling telemetry (TCP / CDEV only) |
--dsp-clock-mhz MHZ |
(auto) | Override the DSP clock used for %/KCPS (also SOF_TOP_DSP_CLOCK_HZ in Hz); needed for FPGA/sim targets |
--render-png PATH |
(empty) | Render dashboard headlessly to PNG file and exit |
The DSP core clock is not part of the SOF telemetry, so sof-top looks up the maximum DSP clock
(the Zephyr CONFIG_XTENSA_CCOUNT_HZ of the target) in a built-in database, dsp_clocks.py:
--dsp-clock-mhz/SOF_TOP_DSP_CLOCK_HZoverride- PCI vendor:device ID (read from sysfs locally;
sof_remote_serverappends it to the platform string as#DDDD) - Platform / driver name (non-PCI targets, or servers that do not report the ID)
- 400 MHz fallback, shown as
400 MHz?in the UI and CLI header
Actual DSP clock scaling is not tracked, so utilization may read low when the DSP runs below its maximum.
To add a platform, add a row to PCI_DID_CLOCKS / NAME_CLOCKS with the Zephyr Kconfig file the value comes from;
make test cross-checks the table against a Zephyr tree (ZEPHYR_BASE).
SPDX-License-Identifier: BSD-3-Clause — see ../LICENSE.