Skip to content

Report audio nodes to libsystemd - #68

Merged
JohnAmadis merged 1 commit into
mainfrom
ccr-0ed2b297-4zti6v
Oct 11, 2026
Merged

JohnAmadis merged 1 commit into
mainfrom
ccr-0ed2b297-4zti6v

Conversation

@JohnAmadis

Copy link
Copy Markdown
Contributor

Summary

dmdevfs now also probes every node with DMDRVI_IOCTL_AUDIO_GET_INFO (dmdrvi 2.6). When the driver answers, the node is reported to libsystemd under the audio class, the same way display and input nodes are.

This lets any driver that implements the standard audio ioctls get its services started by device rules without reporting anything itself. Example: the WM8994 codec node from dmwm8994, /dev/wm8994:

[class=audio]
start=player@%name

Changes

  • src/dmdevfs.c:
    • new DMDEVFS_REPORT_AUDIO bit, probed in probe_node_classes()
    • reported in report_node_added(), removed in report_node_removed()
    • accepted by report= and included in all
  • include/dmdevfs.h: public DMDEVFS_CLASS_AUDIO ("audio").
  • README.md: the reporting table and report= values.
  • CMakeLists.txt: requires dmdrvi >= 2.6, the first release with the DMDRVI_IOCTL_AUDIO_* commands (the test modules too).

Nodes that don't answer the ioctl are not reported as audio, e.g. the dmsai stream node.

Tests

  • The mock driver answers DMDRVI_IOCTL_AUDIO_GET_INFO when configured with audio=true.
  • New fixture nodes mock6 (audio) and mock7 (audio, report=block), a [class=audio] rule and an aud@ unit.
  • New step dmdevfs_reports_audio_nodes:
    • an audio node starts aud@<name> only under its own class
    • report=block suppresses it
    • display and plain nodes are not reported as audio
    • unmounting stops the unit

ctest: 9/9 passed locally, including test_dmdevfs 9/9 steps.

Related: choco-technologies/dmwm8994#3, choco-technologies/dmsai#7, choco-technologies/dmod-boot#122

🤖 Generated with Claude Code

https://claude.ai/code/session_01Nr1HhezRY951yBxxTm1b65


Generated by Claude Code

dmdevfs now also probes every node with DMDRVI_IOCTL_AUDIO_GET_INFO
(dmdrvi 2.6) and reports it to libsystemd as "audio" when the driver
answers - e.g. the WM8994 codec node (dmwm8994), so a rule like
[class=audio] start=player@%name can start services for it without the
driver reporting anything itself. report= accepts "audio" too, and the
class name is public as DMDEVFS_CLASS_AUDIO.

Tests: the test driver answers the audio ioctl with audio=true; a new
step checks that an audio node starts aud@<name> only under its own
class, that report= limits it and that unmounting stops it.

Requires dmdrvi 2.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nr1HhezRY951yBxxTm1b65
@JohnAmadis
JohnAmadis merged commit 540e6d0 into main Oct 11, 2026
1 check passed
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