Skip to content

J616s speakers: the J616 UCM and graph, a speakersafetyd profile, warm restarts - #23

Merged
RyanTheTide merged 5 commits into
mainfrom
feat/j616s-speakers-20261024
Oct 25, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
feat/j616s-speakers-20261024

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The J616s (MacBook Pro 16" M4 Pro) speakers need two userspace pieces that the Fedora images don't have yet: the J616 UCM and a speakersafetyd profile. Without them the speaker PCM can't be routed, and the volumes stay locked.

alsa-ucm-conf-aurora 10-2 moves the pin to alsa-ucm-conf-asahi 777d704. That adds the J616s speaker and jack cards (aurora-silicon/alsa-ucm-conf-asahi#5) and the J700 microphone jack change (#4). The J616 speaker card's "Speaker Playback Mux" defaults to Primary, a front-end with no stream on that card. Until the HiFi verb moves it to Secondary, opening the speaker PCM (device 1) fails with EINVAL. ASoC's DPCM open logs that only once per boot, so it looked like a driver bug in our earlier tests.

speakersafetyd-aurora-profiles 1-1 (new, noarch) ships apple/j616.conf and a udev rule that starts speakersafetyd for the AppleJ616 card, as speakersafetyd's own rule does for the machines it lists. Its sense-PCM ACP_IGNORE rule already covers every macaudio card.

  • j616.conf is speakersafetyd 2.0.1's j316.conf with every model value unchanged. The J616 speakers are in the J316's tuning family, and these are the values speakersafetyd runs on the J316 with its model, which works from measured V*I power. Newer macOS constants for the family go with macOS's own feed-forward model and aren't mixed in.
  • Only the sense channels move. The J616 amps report in their listed order (LW1, RW1, LW2, RW2, LT, RT), current on channel 2n and voltage on 2n+1. The J316 puts its tweeters before the second woofers. This is the map Jonathan Goyvaerts tested amp by amp on his J616s.
  • A speakersafetyd.service drop-in fixes warm restarts on every Mac. speakersafetyd writes its flag in /run/speakersafetyd on its first start after boot, and a start that finds it assumes the speakers are at their temperature limit. systemd removes that RuntimeDirectory whenever the unit stops, so every restart within a boot, crashes included, started cold. RuntimeDirectoryPreserve=yes breaks this unit: with DynamicUser and its CAP_SYS_NICE-only bounding set, systemd moves the directory to /run/private and then can't set it up again, and the daemon never comes back. So the drop-in leaves a root-owned marker in /run on any stop, and gives the next start the daemon's own flag back. /run is a tmpfs, so the first start after a reboot stays cold.
  • j616.conf notes one thing we saw on our J616s. Left woofer 1's current sense reads about half of the other woofers' at the same drive, while its voltage reads the same; our J316 reads its four woofers alike. The woofer group shares one gain, and the J616 graph feeds both left woofers the same signal.
  • The package is added to the images' common package list.

Tested on our J616s (7.3.0-aurora-73v, Fedora 45, SELinux enforcing), with both packages built from this branch and installed with dnf. Fedora's alsa-ucm-asahi is replaced through the existing Provides/Conflicts.

  • Without the verb, aplay -D hw:AppleJ616,1 gives EINVAL. With it, the mux is Secondary and the PCM opens as S24_LE, 6 channels, 48 kHz.
  • speakersafetyd loads apple/j616.conf and unlocks the volumes to 0 dB. A stopped or SIGSTOPped daemon locks them again within a second ("Speaker volumes locked: Lock timeout"), and a restart unlocks them. No AVC denials.
  • Band noise on one amp channel at a time raises the modelled V*I power of only that speaker's section, never below zero.
  • With the drop-in, the daemon starts cold after a reboot. After a SIGKILL, and after a stop and start, it starts warm: both groups start about 14 dB down and come back to nominal as the model cools. No AVC denials.
  • Quiet playback straight to the speaker PCM with the daemon holding the lock: -40, -34 and -28 dBFS steps read -52.8, -46.8 and -40.9 dBFS at the built-in microphones (+6.0 and +5.9 dB per +6 dB step). No gain limiting, no daemon restarts, no kernel messages.
  • python3 -m unittest passes here apart from two tests that need a Linux host (kernel headers, gpg). CI covers those.

aurora-audio 4.1-4 moves the pin to asahi-audio 78803e1. That's the J616s speaker graph and headphone jack priorities (aurora-silicon/asahi-audio#8), plus #7's J700 graph change (+3 dB make-up gain ending in a brick-wall limiter), which the Neo picks up too. The UCM alone isn't enough: without the graph, Fedora's asahi-audio leaves the raw speaker device as the default sink, and its volume script holds that route at 100 %. aurora-audio and bankstown 1.1.0-2 now provide and conflict with asahi-audio and lv2-bankstown, which ship the same files. That lets a Fedora Asahi install move to them in one dnf transaction, the way alsa-ucm-conf-aurora already replaces alsa-ucm-asahi. The images never carry the Fedora packages, so nothing changes there.

On our J616s with this PR's CI RPMs (aurora-audio 4.1-4, bankstown 1.1.0-2, speakerguardd 0.1.0-3, alsa-ucm-conf-aurora 10-2; dnf removed asahi-audio, lv2-bankstown and alsa-ucm-asahi, and asahi-platform-metapackage-audio stays satisfied):

  • The greeter's WirePlumber makes audio_effect.j616-convolver the default sink and hides the raw speaker device.
  • -40, -34 and -28 dBFS band noise into that sink at 100 % reads -61.0, -55.1 and -49.1 dBFS at the microphones. At 50 % the -28 dBFS step drops another 25.5 dB, so the volume control works.
  • speakersafetyd still starts with both drop-ins (its own warm restart and speakerguardd's J700 guard), and stays unlocked. speakerguardd stays disabled on the J616s.
  • rpm -V and dnf check are clean. No AVC denials, no kernel messages.
  • Not checked: the jack priorities (they need a headset) and the graph's pause/seek pop fix by ear.

🤖 Generated with Claude Code

RyanTheTide and others added 2 commits October 24, 2026 20:00
alsa-ucm-conf-asahi 777d704 adds the J616s speaker and headphone jack
cards (aurora-silicon/alsa-ucm-conf-asahi#5) and makes the J700 internal
microphone follow its jack (#4). Without the J616 verb nothing routes the
J616s speakers: "Speaker Playback Mux" stays on Primary, a front-end with
no stream on that card, and opening the speaker PCM (device 1) fails with
EINVAL in ASoC's DPCM open.

Tested on a J616s (7.3.0-aurora-73v, Fedora 45): the verb moves the mux to
Secondary and the speaker PCM opens as S24_LE, 6 channels, 48 kHz. The
J616 conf files match the tip (sha256 28759ae4ee7a633d...,
57446c187605e870...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
speakersafetyd has no J616 profile, so on a J616s the daemon never starts
and the kernel keeps the speaker volumes locked at about -100 dB. Add
speakersafetyd-aurora-profiles with apple/j616.conf and a udev rule that
starts speakersafetyd for the AppleJ616 card, as speakersafetyd's own rule
does for the machines it lists.

j616.conf is speakersafetyd's j316.conf with every model value unchanged:
the J616 speakers are the J316's tuning family, and those are the values
speakersafetyd runs on the J316 with its measured V*I power model. Only
the sense channels move. The J616 amps report in their listed order
(LW1, RW1, LW2, RW2, LT, RT), current on channel 2n and voltage on 2n+1,
where the J316 puts its tweeters before the second woofers. This is the
map Jonathan Goyvaerts tested amp by amp on his J616s.

Tested on a J616s (7.3.0-aurora-73v, SELinux enforcing). The daemon loads
the profile and unlocks the volumes. Stopping or freezing it (SIGSTOP)
while a stream plays locks them again within a second ("Speaker volumes
locked: Lock timeout"). Band noise on one amp channel at a time raises the
modelled power of only that speaker's section, and never below zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RyanTheTide and others added 2 commits October 24, 2026 20:48
speakersafetyd writes /run/speakersafetyd/speakersafetyd.flag on its first
start after boot, and a start that finds it assumes the speakers are at
their temperature limit until its model has cooled them. The flag lives in
the unit's RuntimeDirectory, which systemd removes whenever the unit stops,
so every restart within a boot, crashes included, started cold. That is
true on every Mac running speakersafetyd, not just the J616s.

RuntimeDirectoryPreserve=yes can't fix it for this unit: with DynamicUser=
and its CAP_SYS_NICE-only bounding set, systemd moves the directory to
/run/private on the first stop and then fails to set it up again
("Failed to set up special execution directory in /run: Permission
denied"), so the daemon never comes back. Instead a drop-in leaves a
root-owned marker in /run when the daemon stops for any reason, and gives
a start that finds it the daemon's own flag back before it runs. /run is
a tmpfs, so the first start after a reboot is still a cold one.

Tested on a J616s (7.3.0-aurora-73v, SELinux enforcing): after a reboot the
daemon starts cold. After SIGKILL, and after a stop and start, it starts
warm, limits both groups by about 14 dB, and releases them as its model
cools (about 1 s for the tweeters and 8 s for the woofers on silence).
No AVC denials.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sense

On our J616s, left woofer 1's current sense reads about half of what the
other woofers' do at the same drive, while its voltage reads the same
(checked by pairing its current with left woofer 2's voltage and the other
way round). Our J316 reads its four woofers alike. Group 1 shares one gain,
and the J616 speaker graph feeds both left woofers the same signal, so the
group stays limited by a woofer whose sense reads true. Say so in j616.conf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide RyanTheTide changed the title J616s speakers: pin the J616 UCM and add a speakersafetyd profile J616s speakers: pin the J616 UCM, add a speakersafetyd profile, keep its restart flag Oct 24, 2026
asahi-audio 78803e1 adds the J616s speaker graph and headphone jack
priorities (aurora-silicon/asahi-audio#8), and brings in #7's J700 speaker
graph changes (+3 dB make-up gain ending in a brick-wall limiter).

The J616 UCM routes the speakers, but without a graph Fedora's asahi-audio
leaves the raw speaker device as the default sink, and its volume script
holds that route at 100 %. The J616 graph puts its filter sink in front,
with a working volume, and hides the raw device.

aurora-audio and bankstown now provide and conflict with asahi-audio and
lv2-bankstown, which install the same files, so a Fedora Asahi install can
move to them (alsa-ucm-conf-aurora already does this for alsa-ucm-asahi).
The images never carry the Fedora packages, so nothing changes there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide RyanTheTide changed the title J616s speakers: pin the J616 UCM, add a speakersafetyd profile, keep its restart flag J616s speakers: the J616 UCM and graph, a speakersafetyd profile, warm restarts Oct 24, 2026
@RyanTheTide
RyanTheTide merged commit 4328ea1 into main Oct 25, 2026
28 checks passed
@RyanTheTide
RyanTheTide deleted the feat/j616s-speakers-20261024 branch October 25, 2026 09:02
DjDeveloperr added a commit that referenced this pull request Nov 20, 2026
…pd bridge)

kernel-aurora 7.3.0-44 registers apple-clpc's power modes as a platform
profile class device on the M5 Pro and Max (T6050) and the M4 Max
(T6041). tuned-ppd drives only /sys/firmware/acpi/platform_profile,
which a device tree boot never has. aurora-power-budget at ddf5285e
stands aside as soon as the class device exists. Together, Power Saver
on those Macs would cap nothing.

Pin aurora-platform 625caef7 (aurora-silicon/aurora-platform#35).
aurora-power-budget now hands each profile to the class device, by the
names its choices file lists. It caps the CPU itself only while the
kernel does not hold power-saver. Without a class device nothing
changes. The pin also brings aurora-platform #28 (the budget waits on
D-Bus instead of a timer) and #23 (secboot's execute-window chip ranges
as a table, same values).

make install-power now also installs aurora-power-modes. Shipping and
enabling that is #404's job, so %install removes its two files here.

Signed-off-by: Diljit Singh <hey@djdev.me>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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