Repository navigation
Conversation
… monitor
Add sof-top, a GTK4 + Cairo live DSP resource, memory (SRAM + DRAM), and
task monitor along with supporting sof_remote_server improvements for
on-demand DSP boot, idle LL tick sanitization, LPSRAM sizing, and $AME
firmware manifest fallback.
Key changes:
- sof-top/sof-top:
- Directly executable GTK4 monitor featuring a moving 60s DSP Core
Utilization graph (% of DSP clock & KCPS per core), a moving 60s DSP
Memory Utilization graph (HPSRAM, LPSRAM, DRAM L3/IMR, and DSP Heaps),
and a unified filterable/sortable DSP Task List (Scheduler domains,
Zephyr RTOS threads, IPC4/PMW2 audio modules, and DAI gateways).
- sof-top/backend.py & sof-top/widgets_cairo.py:
- RemoteTcpBackend (SOFR/SOFZ wire compression) and LocalCdevBackend
(/dev/sof-dsp0 + DebugFS/SysFS), binary TEL2/PMW2 parsers, unified
DspTaskItem synthesizer, and hardware-accelerated GTK4/Cairo
UserDashboardCairoWidget with headless --render-png export.
- sof-top packaging & docs:
- Add README.md, pyproject.toml, requirements.txt, and desktop entry
(org.thesofproject.SofTop.desktop).
- sof-remote-server/sof_remote_server.c:
- Add read_debugfs_fw_state() and trigger_on_demand_dsp_boot() so --wake
automatically boots an unbooted DSP via non-blocking ALSA PCM open.
- Sanitize stale systick_info[0] inter-tick ccount gaps when the Zephyr LL
timer is stopped (reporting 0 KCPS / 0.0% in idle) and report accurate
1 x 64 KB unused LPSRAM fallback on ACE platforms.
- Synthesize loaded_modules from the active firmware .ri $AME manifest
when Window 1 IPC4 module notifications are absent.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects include client-thread data races, wake polls that persistently prevent runtime suspend, and PMW2 decoding without a valid header, compromising telemetry correctness and power management.
23 open issues
Synchronize initialization of the shared firmware cache · New Keep previous-tick history per client connection · New Restore temporary wake policy after polling · New Decode PMW2 records only when the header is valid · New Local backend never opens the requested character device · New Select boot-trigger PCMs from the SOF sound card · New Do not report a hard-coded firmware version · New Enumerate PCM substreams on the discovered SOF card · New Publish manifest entries in the expected runtime wire format · New Determine core idleness from that core’s counter progression · New Do not synthesize memory state without real bank data · New Do not revive removed components from unrelated PCM activity · New Clear cached performance data on a valid empty response · New Skip unused resource IDs regardless of their counters · New Do not report estimated memory values as live telemetry · New Do not report fabricated gateway performance measurements · New List only modules actually enumerated by the target · New Propagate snapshot RPC failures to GUI and PNG callers · New Start performance collection when the DSP is ready · New Move blocking backend polling off GTK’s main thread · New
And 3 more that still need to be addressed.
What changed in this PR
Introduces sof-top, a GTK4/Cairo DSP monitoring tool for SOF development, and extends sof_remote_server to support its telemetry needs.
Changes:
- Adds core and memory graphs, a unified task display, polling controls, and PNG export.
- Adds TCP telemetry collection and binary parsers, plus server-side boot triggering, idle-load sanitization, and firmware metadata fallbacks.
- Adds Python packaging, dependency documentation, a desktop launcher, and quick-start instructions.
| File | Description |
|---|---|
sof-top/widgets_cairo.py |
Implements dashboard graphs, resource bars, and task rendering. |
sof-top/sof-top |
Adds the application, controls, polling, and PNG export path. |
sof-top/requirements.txt |
Lists Python graphics dependencies. |
sof-top/README.md |
Documents features, dependencies, and usage. |
sof-top/pyproject.toml |
Defines package metadata and installation configuration. |
sof-top/desktop/org.thesofproject.SofTop.desktop |
Adds a desktop launcher definition. |
sof-top/backend.py |
Adds telemetry models, parsers, TCP transport, and task synthesis. |
sof-remote-server/sof_remote_server.c |
Extends DSP wake handling and telemetry fallbacks. |
README.md |
Lists the monitoring tools and adds quick-start commands. |
Review effort: Balanced
lgirdwood
pushed a commit
that referenced
this pull request
Nov 5, 2026
Fix all 23 review findings across sof-remote-server and sof-top: sof-remote-server: - Protect g_cached_fw_mods_tlv initialization and publication with g_fw_mods_lock mutex, and convert manifest headers to valid runtime (mod_id, state) wire entries. - Move previous per-core tick history (prev_core_ticks, has_prev_core_ticks) into per-connection client_telem_state. - Restore prior sysfs runtime PM policy (temp_sysfs_hold) after wake-on-poll snapshots when no explicit D0 hold is active. - Match the SOF PCI device's sound card index when selecting a boot trigger PCM stream and enumerate all pcm*/sub*/status entries on the SOF card. - Read firmware version from debugfs fw_version instead of hard-coding 2.14.99.1 on direct MMIO paths. - Determine per-core idleness from each core's tick counter progression and avoid fabricating fallback HPSRAM bank state or PMW2 component KCPS counters. sof-top: - Gate PMW2 decoding on a valid PMW2 magic header and reject 0xFFFFFFFF resource IDs unconditionally. - Clear cached_ext_perf on valid empty (count == 0) responses and keep WELL_KNOWN_IPC4_MODULES name lookup separate from target-enumerated loaded_modules. - Remove fabricated fallback heap estimates and use measured gateway performance counters. - Implement direct /dev/sof-dsp0 ioctl telemetry polling and PM control in LocalCdevBackend. - Run backend polling and PM RPCs on background worker threads and post UI updates via GLib.idle_add, initializing perf measurement state (2) when the DSP reaches BOOT_COMPLETE. - Separate display-independent UserDashboardRenderer from Gtk.Widget so --render-png works headlessly without an X11/Wayland display, use 60-second timestamped rolling history, and add scrollable/paged task list navigation. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects break local polling, PMW2 snapshot handling, and documented GUI startup, while missing shutdown cleanup can leave the device forced awake.
14 open issues
Use IoPerfItem's declared perf_usage field · New Define missing local telemetry window selectors · New Release Hold D0i0 and close the backend on shutdown · New Avoid passing parsed CLI options back to GTK · New Use the correct firmware driver prefix length · New Avoid double-counting the server-generated tone · New Derive fallback firmware profiles from the detected platform · New Use the wire's 64 KB HPSRAM entry size · New Replace cached components when the parsed window is empty · New Suppress cached live telemetry while the DSP is asleep · New Skip unused resource entries instead of stopping the scan · New Mark performance measurement initialized only on success · New Include retained history when scaling the memory graph · New Expose telemetry through accessible widgets and text · New
23 resolved since last review
Local backend never opens the requested character device Decode PMW2 records only when the header is valid Restore temporary wake policy after polling Keep previous-tick history per client connection Synchronize initialization of the shared firmware cache Provide a way to reach tasks beyond the first screenful Keep graph history to 60 seconds of elapsed time PNG rendering still requires an initialized GTK display Move blocking backend polling off GTK’s main thread Start performance collection when the DSP is ready Propagate snapshot RPC failures to GUI and PNG callers List only modules actually enumerated by the target Do not report fabricated gateway performance measurements Do not report estimated memory values as live telemetry Skip unused resource IDs regardless of their counters Clear cached performance data on a valid empty response Do not revive removed components from unrelated PCM activity Do not synthesize memory state without real bank data Determine core idleness from that core’s counter progression Publish manifest entries in the expected runtime wire format
And 3 more resolved.
Review effort: Balanced
Fix all 23 review findings across sof-remote-server and sof-top: sof-remote-server: - Protect g_cached_fw_mods_tlv initialization and publication with g_fw_mods_lock mutex, and convert manifest headers to valid runtime (mod_id, state) wire entries. - Move previous per-core tick history (prev_core_ticks, has_prev_core_ticks) into per-connection client_telem_state. - Restore prior sysfs runtime PM policy (temp_sysfs_hold) after wake-on-poll snapshots when no explicit D0 hold is active. - Match the SOF PCI device's sound card index when selecting a boot trigger PCM stream and enumerate all pcm*/sub*/status entries on the SOF card. - Read firmware version from debugfs fw_version instead of hard-coding 2.14.99.1 on direct MMIO paths. - Determine per-core idleness from each core's tick counter progression and avoid fabricating fallback HPSRAM bank state or PMW2 component KCPS counters. sof-top: - Gate PMW2 decoding on a valid PMW2 magic header and reject 0xFFFFFFFF resource IDs unconditionally. - Clear cached_ext_perf on valid empty (count == 0) responses and keep WELL_KNOWN_IPC4_MODULES name lookup separate from target-enumerated loaded_modules. - Remove fabricated fallback heap estimates and use measured gateway performance counters. - Implement direct /dev/sof-dsp0 ioctl telemetry polling and PM control in LocalCdevBackend. - Run backend polling and PM RPCs on background worker threads and post UI updates via GLib.idle_add, initializing perf measurement state (2) when the DSP reaches BOOT_COMPLETE. - Separate display-independent UserDashboardRenderer from Gtk.Widget so --render-png works headlessly without an X11/Wayland display, use 60-second timestamped rolling history, and add scrollable/paged task list navigation. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds
sof-top, a directly executable GTK4 + Cairo live SOF DSP resource, memory (SRAM+DRAM), and task monitor, along with supportingsof_remote_serverenhancements.Key Changes
sof-top/sof-top:%of DSP clock &KCPS) plus live per-core summary bars.SRAM+DRAM): Rolling 60s traces and live capacity bars for HPSRAM (24 x 128 KB), LPSRAM (1 x 64 KB), DRAM (L3 / IMR), and DSP Heaps.LL/DP), Zephyr RTOS Threads (TEL2), Audio Processing Modules (IPC4/PMW2), and DAI Gateways into a filterable, sortable table with CPU%,KCPS,SRAM/DRAMfootprint, and status.sof-top/backend.py&sof-top/widgets_cairo.py:RemoteTcpBackend(SOFR/SOFZwire decompression) andLocalCdevBackend(/dev/sof-dsp0+ DebugFS/SysFS fallback), binaryTEL2/PMW2parsers, andUserDashboardCairoWidgetwith headless--render-pngexport.sof-top/README.md,sof-top/pyproject.toml,sof-top/requirements.txt,sof-top/desktop/org.thesofproject.SofTop.desktop, and updated rootREADME.md.sof-remote-server/sof_remote_server.c:read_debugfs_fw_state,trigger_on_demand_dsp_boot) when polling with--wakebefore first stream open.systick_infosanitization (0 KCPS / 0.0%when LL timer is stopped) and1 x 64 KBunusedLPSRAMfallback on ACE..ri$AMEmanifest fallback (synthesize_modules_info_from_fw).