Skip to content

Keep a silent Asahi mic mapping from staying the default input - #610

Merged
maralcbr merged 3 commits into
quattro-upstreamfrom
mac/99-builtin-mic-silent
Sep 27, 2026
Merged

maralcbr merged 3 commits into
quattro-upstreamfrom
mac/99-builtin-mic-silent

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Ticket 99. On the M2 Max the hardware tester found the default input was the mic mapper's null-sink monitor carrying digital silence. The kernel mic was fine; WirePlumber 0.5.17 had left asahi-audio's J416 mic filter half-built (no effect_output.j416-mic), and the mapper bailed out without touching the defaults, so its silent monitor stayed the default input and its null sink the default output. The WirePlumber side is reproducible by switching the mic card profile and is being reported upstream; this PR contains the damage in Omarchy.

What changed (mapper only):

  • When the array's DSP is gone: playback moves off the null sink; capture moves to a plugged-in real input (never another monitor, the raw array, an unplugged port, or over the user's mute), and that handover is remembered so the mapping is selected again when the array returns and carries signal. Picking another real input ends it.
  • A loss lasting 10 s shows one "Built-in microphone unavailable" notice; clicking it runs omarchy-restart-audio, which recovers the filter.
  • pactl list short modules output with multi-line module arguments (asahi-audio's module-rt) no longer breaks rollback of a failed mapping.
  • No automatic graph repair: switching the card profile wedged WirePlumber at 100% CPU in testing.

Tests: packages/omarchy-mac/test/mic-test.sh covers loss, handover, mute, ignored switch, user choices during loss/return, unplugged fallback, audio restart mid-loss, silent/unsampled return, notice timing and the watcher wake. Package suites and test/shell.d audio suites pass on the M2 (keyboard-test fails there on the base too, host-related). Live on the M2 with a stand-in array: loss handed capture to a real input, return reselected the mapping with live signal, one notice shown.

Second review: two rounds; fixed claim loss on unplug, stale claim after restart, muted fallback on return, notice wait held under the lock, and a fast wake loop after a restart mid-loss. Known limits are in the ticket.

…ay's DSP is lost

WirePlumber can leave asahi-audio's mic filter half-built, which left the
mapper's null-sink monitor as the default input (and its sink as the default
output) carrying silence. Move playback off the mapping sink, hand capture to a
plugged-in real input and restore the mapping when the array returns, notify
once with a click to restart audio, and parse multi-line module arguments so
rollback can unload the mapping.
Only a choice of another real input ends the claim; a claimed input that goes
away hands over again or lets the returning array take over from the monitor
left behind; a muted fallback waits for unmute. The lost-array notice is now
timed by the watcher instead of blocking under the mapping lock.
…pping

Otherwise the watcher woke every 100 ms until the array returned.
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.

1 participant