Skip to content

sof-top: notify user when local kernel devices are missing or inaccessible - #10

Draft
lgirdwood wants to merge 1 commit into
mainfrom
feat/sof-top-local-device-notices
Draft

lgirdwood wants to merge 1 commit into
mainfrom
feat/sof-top-local-device-notices

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Summary

Adds clear user-facing diagnostics across sof-top (GTK4 UI + headless render), sof-top-cli, and backend.py whenever either local SOF kernel interface (/dev/sof-dsp0 vs SOF DebugFS /sys/kernel/debug/sof + PCI/ALSA SysFS) is absent or inaccessible:

  • Backend probe (probe_local_sof_device):
    • Checks /dev/sof-dsp0 accessibility (R_OK | W_OK) alongside DebugFS and PCI/ALSA SysFS discovery.
    • Populates explicit warning and reason messages for partial or completely missing local interfaces (missing /dev/sof-dsp0, permission-denied /dev/sof-dsp0, missing/unmounted DebugFS, permission-denied DebugFS, or SysFS/DebugFS absent).
  • Local backend (LocalCdevBackend):
    • Separates non-fatal connection/telemetry notices into last_note so healthy read-only/CDEV telemetry keeps summary.last_error == "" in sof-top-cli.
    • Fixes auto mode fallback to /dev/sof-dsp0 when SysFS/DebugFS discovery returns false but /dev/sof-dsp0 exists.
    • Improves explicit /dev/sof-dsp* open failure messages with hints when SysFS/DebugFS is available.
  • CLI (sof-top-cli) & UI (sof-top):
    • Prints non-fatal device notices as WARNING: to stderr in sof-top-cli and sof-top --render-png (keeping stdout JSON clean).
    • Warns on stderr when --wake or --hold-d0 is ignored in read-only mode.
    • Surfaces device warnings in the sof-top GTK4 UI Local Device dropdown tooltip, disabled PM button tooltips, connection status banner, and polling status bar Note:.

Verification

  • make -C sof-top check (py_compile) passes.
  • Mocked verification covering all combinations (neither interface present, DebugFS without /dev/sof-dsp0 + --wake, /dev/sof-dsp0-only auto fallback, permission-denied DebugFS/cdev, both interfaces present cleanly, UI headless render warnings, and missing explicit /dev/sof-dsp99).
  • Live smoke tests on Dragon Fly (sof-arl-s): verified non-sudo --wake read-only warning, missing /dev/sof-dsp99 error, and sudo --local /dev/sof-dsp0 --wake full CDEV telemetry.

…sible

Surface clear warnings and status messages across backend probing, CLI
(sof-top-cli), and GTK4 UI (sof-top) whenever either /dev/sof-dsp0 or
SOF DebugFS/SysFS is absent or lacks permissions:

- backend.probe_local_sof_device(): check /dev/sof-dsp0 accessibility
  (R_OK|W_OK) alongside DebugFS/SysFS presence and emit explicit
  'warning' / 'reason' diagnostics for missing or inaccessible devices.
- backend.LocalCdevBackend: track non-fatal device notices in 'last_note'
  without polluting 'last_error' on healthy read-only/cdev connections,
  auto-fallback to /dev/sof-dsp0 in 'auto' mode when SysFS/DebugFS are
  absent, and provide clearer errors when explicit /dev/sof-dsp* fails.
- sof-top-cli & sof-top --render-png: print backend 'last_note' as a
  stderr WARNING and warn explicitly when --wake / --hold-d0 is ignored
  in read-only mode.
- sof-top GTK4 UI: include missing/inaccessible device notices in the
  Local Device dropdown tooltip, disabled PM button tooltips, status bar
  connection banner, and polling status bar Note field.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
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