Skip to content

Keep the Apple speaker DSP graph running between streams - #616

Closed
oliverlukschander wants to merge 1 commit into
omacom:quattro-upstreamfrom
oliverlukschander:fix/asahi-dsp-graph-no-suspend
Closed

oliverlukschander wants to merge 1 commit into
omacom:quattro-upstreamfrom
oliverlukschander:fix/asahi-dsp-graph-no-suspend

Conversation

@oliverlukschander

Copy link
Copy Markdown

Summary

Closes #351

Testing

  • The match patterns were checked against every speaker and mic chain name in the installed asahi-audio 4.1-1 (/usr/share/asahi-audio): all speaker chains are named <model>-convolver, all mic chains <model>-mic.

  • Parsed offline with pw-config --name pipewire.conf merge node.rules against a temporary XDG_CONFIG_HOME containing only this file; it returns the rule unchanged. PipeWire 1.6.9.

  • New case in packages/omarchy-mac/test/setup-test.sh: the file ships, sets node.always-process, matches audio_effect.j416-convolver, effect_output.j416-convolver, audio_effect.mini-convolver and effect_output.j274-convolver, and does not match audio_effect.j413-mic, effect_output.j413-mic, the headphone sink or effect_output.rnnoise. packages/omarchy-mac/test/all passes.

  • Tested live on a J416 (Mac14,10, M2 Pro 16"; asahi-audio 4.1-1, PipeWire 1.6.9, WirePlumber 0.5.17). Each half was installed as a user drop-in and the user audio services restarted. Then I listened (starting fresh YouTube videos in Chromium, seeking) and checked node state after 12 s of silence:

    Setup Starting a fresh video Seeking *-convolver after 12 s idle
    Neither half occasional small clicks/crackles clean suspended / idle
    WirePlumber half only (50788cc) about the same, not better clean suspended / idle
    Both halves (this PR) clean clean running, node.always-process = true

    The mic chains (*-mic) stayed suspended with both halves active. rtkit 0.14 was installed and rtkit-daemon active throughout, so missing realtime scheduling (the crackling cause noted in install/hardware/apple/audio.sh) doesn't explain the difference. One tester and one model; on this J416 a test tone started from idle did not pop even at baseline.

  • Cost: idle CPU time of pipewire, pipewire-pulse and wireplumber, from /proc/<pid>/stat over 30 s of silence, three alternating runs per setup: neither half 0.13%, 0.93%, 0.07% of one core; both halves 2.00%, 1.93%, 1.83%. The difference is almost all in wireplumber (1.63–1.77% with both halves), which hosts the filter chain. That's higher than the 0.3% in the Internal speakers pop on playback start and click when seeking YouTube (J414/M2 Pro) — two WirePlumber/PipeWire drop-ins fix it #351 report (J414).


Investigated, fixed and tested with Claude Code; the listening test and hardware checks were done by me on the Mac. Happy to walk through any of it in review.

🤖 Generated with Claude Code

@oliverlukschander

Copy link
Copy Markdown
Author

Note on the test environment, for completeness: the listening test and CPU measurements ran on a non-stock setup: a linux-aurora build (7.1.12-2.5-1-ARCH) instead of the linux-asahi package, and aquamarine 0.15.1 with two local patches. The change itself is PipeWire configuration only. I haven't repeated the test on a stock kernel.

The WirePlumber no-suspend policy keeps the speaker PCM open, but the
asahi-audio filter chain still pauses when idle. The omacom#351 report traced
the clicks that remain on playback start and browser seeks to the chain
restarting (see also AsahiLinux/asahi-audio#84).

Ship a PipeWire node.rules drop-in that keeps each model's *-convolver
chain processing. These nodes come from module-filter-chain, so the
WirePlumber ALSA rules cannot reach them. Mic chains still suspend.

Tested by ear on a J416 (Mac14,10): clicks when starting a fresh video
were unchanged with the WirePlumber half alone and gone with this
drop-in added. Idle CPU of the audio stack went from about 0.1% to
1.8-2.0% of one core (three alternating 30 s runs), almost all of it in
wireplumber, which hosts the filter chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oliverlukschander
oliverlukschander force-pushed the fix/asahi-dsp-graph-no-suspend branch from 3649453 to e308d7a Compare September 28, 2026 11:03
@maralcbr

Copy link
Copy Markdown
Member

Thanks, this is still wanted. This week the Mac code moved into the omarchy-mac package (packages/omarchy-mac/) and the platform files moved to the /usr/share/omarchy-platform root (#660), so could you rebase onto quattro-upstream? Only packages/omarchy-mac/README.md conflicts.

@oliverlukschander

Copy link
Copy Markdown
Author

Thanks, happy to hear, rebase is done.

@ssalentin

Copy link
Copy Markdown

Confirming this on J293 (MacBook Pro 13" M1 2020, MacBookPro17,1), which I don't think was in the test matrix — so the -convolver match pattern covers it too.

Setup (stock):

omarchy 4.0.4-1
linux-asahi 7.1.13-3-2-ARCH
pipewire 1:1.6.9-1   wireplumber 0.5.18-1
asahi-audio 4.1-1    speakersafetyd 2.0.1-1

Symptom: default sink audio_effect.j293-convolver, playback (YouTube) crackles continuously, worse on volume-key changes.

Applied both halves as user drop-ins (the exact files from the report) and restarted the user audio services. Result matches yours — the crackle is gone and the convolver node stops suspending:

before:  audio_effect.j293-convolver  State: SUSPENDED  (idle)
after:   audio_effect.j293-convolver  State: RUNNING    (idle, node.always-process = true)

Both properties took:

audio_effect.j293-convolver   | always-process=True  | suspend-timeout=0
effect_output.j293-convolver  | always-process=True  | suspend-timeout=0

Two things worth noting for the test matrix:

  • Pinning the graph to 48 kHz alone did not remove the crackle — so on J293 the suspend/restart of the chain is the whole cause, not rate churn.
  • On this unit alsa_output.platform-sound.RawSpeakers (hw:AppleJ293,1) is not exposed as a node at all (only alsa_output.platform-sound.HiFi__Headphones__sink at hw:AppleJ293,0). The crackle is unrelated to that — these drop-ins fix it regardless — but flagging it in case it matters for the ACP/software-dsp path on other models.

Happy to re-test on stock after a rebase if useful.

@oliverlukschander

Copy link
Copy Markdown
Author

Closing in favour of omacom/omarchy-mac-pkgs#2, where @maralcbr ported this and the review continues. quattro-upstream is frozen.

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.

4 participants