Skip to content

soc: apple: sep: boot the enclave without the xART store and autoload it (fixes the M1 microphones, #141) - #180

Open
ludagoo wants to merge 15 commits into
omacom:integration/aurorafrom
ludagoo:fix/sep-boot-microphones
Open

ludagoo wants to merge 15 commits into
omacom:integration/aurorafrom
ludagoo:fix/sep-boot-microphones

Conversation

@ludagoo

@ludagoo ludagoo commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #141.

Summary

The built-in microphones of the M1 laptops only work once the Secure Enclave has been booted: it sits in the path of the microphone data lines (Asahi Linux, 6.14 progress report: "If SEP is unhappy, you don't get mic access"). Since the SEP driver was replaced by the Touch ID driver, the enclave is no longer booted on a plain install: the driver fails its probe at the xART store when it is built in and probes early, and as a module it exports no alias (36ebdee), so only the aurora-touchid loader units load it. Omarchy does not ship those units. The AOP's PDM capture then runs on a constant input and every recording is a null stream. This PR fixes that on the M1 family, where the device tree enables the SEP node and udev now autoloads the driver. It changes nothing for the M2, M2 Pro/Max or M3 Air microphones: those nodes stay disabled, so the driver does not load there without a loader.

This is also what blocks Touch ID on Omarchy Mac: omacom/omarchy-mac-pkgs#12 (draft) lists "a kernel whose apple_sep binds on a normal boot: built in, it probes before the iBoot partition link exists and fails" and "the owner's agreement before the driver is loaded or bound: with its defaults it provisions a keybag ... so this package does not load it" as its first two open items. The commits below address those points, and a later commit corrects the "changes nothing" claim.

soc: apple: sep: boot the SEP even when the xART store is unavailable: an unavailable or invalid store no longer aborts the probe; the enclave is booted and the xARM path keeps refusing its store requests (Touch ID and trusted keys stay off for that boot). No xART write happens.

soc: apple: sep: autoload the driver and wait for the iBoot container: the module alias is exported again; a cold boot whose store open fails with ENODEV waits for the container's partition link (500 ms steps, up to 30 s) before booting; xart_writes and provision_keybag default to 0, and aurora-touchid ships /usr/lib/modprobe.d/apple-sep.conf enabling both. A load the owner did not ask for does not write xART or provision a keybag. It does create /var/lib/aurora-sep-host-state.bin (2359296 bytes) the first time that Linux-only store is opened. The existing apple-sep.service/.path stay harmless where the device tree already enables the SEP node.

Machine and build

  • MacBook Air 13" (M1, 2020), board apple,j313, SoC apple,t8103, Omarchy Mac (Arch Linux ARM)
  • Last known good: linux-aurora 7.1.12.aurora2-12 (7.1.12-2-12-ARCH, aurora-silicon/linux 2439016d, CONFIG_APPLE_SEP=y with the earlier stub driver that only boots the enclave).
  • Broken: 7.1.12.aurora7-2 (issue J313 (MacBook Air M1): built-in mic capture returns a fixed looping pattern instead of audio #141), the Oct 8 release build 7.1.12.aurora2-12.6 (CONFIG_APPLE_SEP=m, no alias), 7.1.12.aurora8-1 (CONFIG_APPLE_SEP=y, probe fails at the xART store at 0.55 s), 7.2.10.aurora1-2 (7.2.10-1-2-ARCH, 1b4997b, =m, no alias, module never loaded).
  • m1n1-aurora 1.6.1.aurora1-3, uboot-asahi 2026.07.asahi2-4, omarchy-mac-boot 20261020-2, asahi-audio 4.1-1, alsa-ucm-conf-asahi 10-1, pipewire 1.6.9, wireplumber 0.5.18
  • asahi,os-fw-version: 13.5 (22G74). No Touch ID units or aurora-touchid package installed.

Reproduction, expected result, actual result

  1. Boot a broken build. The AOP card AppleJ313HPAI is present and PipeWire can open it. lsmod shows no apple_sep, or (aurora8) dmesg shows apple_sep 242400000.sep: xART gigalocker in the iBoot container is unavailable or invalid: ENODEV and nothing after it.
  2. arecord -D hw:AppleJ313HPAI,0 -f FLOAT_LE -c 3 -r 48000 -d 3 -t raw cap.raw while talking.

Expected: three live channels (rms about 5e-4, half the samples negative).

Actual on every broken build, every capture, every boot: the capture completes at the right rate but, after a power-on ramp, every word is 0 or at the float flush-to-zero floor (exponent 1 to 2), none negative, channel 0 bit-identical to channel 1: a constant PDM input. asahi-audio's effect_output.j313-mic and omarchy-mac's omarchy_asahi_mic carry silence.

Confirmation that the SEP boot is the missing piece, on the same boot of 7.1.12.aurora2-12.6 rebuilt with the Oct 8 tree (7.1.12-2-12.7-bisect1-ARCH):

$ arecord ... -> null stream (as above)
$ sudo modprobe apple_sep
apple_sep 242400000.sep: SEP platform profile: T8103/J313
apple_sep 242400000.sep: xART: APFS-resolved .gl extent (base 0x4d4000); 170 slots, 13 live records, max revision 28288, 0 malformed, 0 duplicate, 0 repaired; writes ENABLED
apple_sep 242400000.sep: boot: first TZ0 acknowledgement
apple_sep 242400000.sep: boot: TZ0 accepted; handing over firmware and shared memory
apple_sep 242400000.sep: boot: IMG4 acknowledged; the SEP owns the shared-memory table
apple_sep 242400000.sep: attach: 7 endpoints advertised in 20 messages
$ arecord ... -> live audio, rms 4.6e-4 on all three channels

The AOP's own log is identical on working and broken boots (PDMDev<pdm0> off ->xi0 , 0->2400000 AP state 1, ===( AOP IS READY )===); no ADMAC, DART or aop_audio error. Excluded by tests before the cause was found: the device tree (SPI2/Mesa and ANE overlays), the AOP core rewrite (the Oct 8 tree rebuilt with the earlier aop.rs is still silent), the ADMAC DMA mask, and the audio DMA path (the captured stream is real-time paced and starts with the same power-on ramp as a live capture).

Test of the earlier commits

linux-aurora 7.2.10.aurora1-3 test build = 1b4997b (the Omarchy 7.2.10 pin; its SEP sources are identical to the current integration/aurora head) + the two commits, Omarchy configuration, clang 22 / rustc 1.93.1. No loader units installed. Three boots so far, all the same:

$ lsmod | grep apple_sep
apple_sep             360448  0
$ modinfo apple-sep | grep alias
alias:          of:N*T*Capple,sep
alias:          of:N*T*Capple,sepC*
[   17.185856] apple_sep 242400000.sep: SEP platform profile: T8103/J313
[   17.189722] apple_sep 242400000.sep: xART: APFS-resolved .gl extent (base 0x4d4000); 170 slots, 14 live records, max revision 28303, 0 malformed, 0 duplicate, 0 repaired; writes disabled
[   17.196928] apple_sep 242400000.sep: trusted-keys: registering "trusted" key type backed by the SEP ref-key seal
[   17.200690] apple_sep 242400000.sep: boot: first TZ0 acknowledgement
[   17.227897] apple_sep 242400000.sep: boot: TZ0 accepted; handing over firmware and shared memory
[   17.306010] apple_sep 242400000.sep: boot: IMG4 acknowledged; the SEP owns the shared-memory table
[   17.920448] apple_sep 242400000.sep: attach: 7 endpoints advertised in 20 messages
[   20.624112] apple_sep 242400000.sep: sks: capability word 2, IPC header version 2
[   21.057123] apple_sep 242400000.sep: hwrng: registered after ready-phase survey (attempt 1)

On this boot udev loaded the driver after the partition link existed, so the store opened at probe (read-only, the new default) and the wait path was not exercised; the wait path is what the earlier built-in configuration (aurora8, probe at 0.55 s, ENODEV) would take.

  • arecord -D hw:AppleJ313HPAI,0 -f FLOAT_LE -c 3 -r 48000 -d 3: live audio on all three channels (rms 4.4e-5 to 4.8e-5 in a quiet room, 48 % negative samples, no flush-to-zero words). About 106 AOP ADMAC interrupts per 3 s capture, as on the last good build.
  • PipeWire: pw-record --target omarchy_asahi_mic (omarchy-mac's mapped mic, fed by asahi-audio's effect_output.j313-mic): live signal, rms 9e-4, peaks 5e-2 while speaking.
  • The only kernel warning of the boot (WARNING: drivers/clk/clk-devres.c:316 at devm_clk_match, dcp_comp_unbind of 271c00000.dcp in appledrm) is the T8103 display DMA-window regression of J313: oversized T8103 external display DMA windows force simpledrm fallback #178 / arm64: dts: apple: constrain T8103 external display DMA windows #179, also present on stock 7.2.10.aurora1-2 and unrelated to this change.

Session build on the running kernel

Monday 26 Oct 2026 05:02 PM -03: linux-aurora 7.2.11-6-2-ARCH (package 7.2.11.aurora6-2), branch local/j313-test at 7638df0. makepkg exited 0. rustc 1.85.0, LLVM/clang 18.1.8. This machine is running that kernel. The two stacked commits compiled in were 56fa018 (boot the SEP even when the xART store is unavailable) and 90fbe1e (autoload the driver and wait for the iBoot container). This pull request's earlier head commits are c1c1299 and 0dfa5ae, which are not the commits that were built.

lsmod shows apple_sep loaded. On the previous kernel, 7.2.11-6-1-ARCH, effect_output.j313-mic recorded a peak of 0. On this kernel that source peaked at 12779 on the 18:46 boot and 1451 on the 19:23 boot. omarchy_asahi_mic peaked at 23831 and 2058 on those same boots. The raw three-channel arecord check was not repeated on this kernel.

Follow-up, not hardware-tested

21d2c815fef977ca73ca23afdbab5f4e59ba87fc (soc: apple: sep: refresh deferred boot and drop a failed keybag):

  • Kconfig asks for a module so modprobe.d options reach the driver. Built-in, xart_writes and provision_keybag arrive only on the kernel command line. In-tree release16, release18, and release19 configs are already CONFIG_APPLE_SEP=m. The Omarchy packaging files kernel-fixes/pkg/config and kernel-fixes/pkg/recipe/config are also CONFIG_APPLE_SEP=m. They are not in this repository, so they are not part of this pull request.
  • After the iBoot container opens late, the cached xART diag facts are refreshed before attach. Settle is armed after that deferred attach. The store-wait work is joined after shutdown starts and before the mailbox is dropped. A tick blocked in the store open does not attach or publish the boot marker once shutdown has started.
  • A keybag create that is not sent, or that the enclave answers with a non-zero status, removes the 52-byte uncommitted /var/lib/aurora-sep-keybag.bin header. A create that was sent and not answered keeps the intent. A committed bag is left in place.
  • The README says the loader is no longer required only where the device tree already enables the SEP node (M1 family and J700). M2, M2 Pro/Max, and M3 Air nodes stay disabled in the device tree and are enabled by module init, so those machines still need the loader. A default load, including xart_writes=0, still creates the 2359296-byte host-state file. That is not an xART write.
  • load-driver writes /usr/lib/modprobe.d/apple-sep.conf only when that file is absent, then modprobes without inline options so the file applies. If apple_sep is already loaded without xart_writes=1 and provision_keybag=1, the script exits and asks for a reboot. An existing conf is not overwritten.

This commit was not compiled here. The SEP checkout does not include include/ or fs/, so store_shim.c was not built. It is not hardware-tested.

What was not tested

  • Touch ID enrol/verify with the new defaults (no aurora-touchid here; this board has no Touch ID support under Linux yet), the MacBook Neo (T8140) warm-attach profile, M2/M3 boards, and the microphone under macOS on this unit.
  • The 30 s wait path itself (udev created the partition link before the driver loaded on the earlier test boots); suspend/resume with the autoloaded driver.
  • The deferred-attach diag refresh, the shutdown join, the keybag unlink, and the module-option path in 21d2c815fef9.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches SEP startup and related services across supported Apple Silicon Macs.

Fix the documented manual loader setup before merging; automatic loading can leave those users without working Touch ID.

Findings

  1. P1 Service options arrive too late ▶
  2. P2 Store status stays stale ▶

Summary

Boots the SEP without a usable xART store so microphones can work without Touch ID setup.

  • Apple Silicon microphones get an automatically started Secure Enclave.
  • Shared xART writes now require an explicit Touch ID opt-in.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Driver probe] --> B{Open xART store}
  B -->|Success| C[Attach SEP]
  B -->|ENODEV| D[Wait 500 ms]
  D --> E{Retry store open}
  E -->|ENODEV and fewer than 60 tries| D
  E -->|Success| C
  E -->|Other error or limit reached| F[Attach without store]
  B -->|Other error| F
  C --> G[Serve store requests]
  F --> H[Refuse store requests]
Loading

Reviews (1) · Last reviewed commit: "soc: apple: sep: autoload the driver and..." · Reviewed by Greptile

Comment thread drivers/soc/apple/sep.rs
Comment on lines +2713 to +2718
kernel::of_device_table!(
OF_TABLE,
MODULE_OF_TABLE,
(),
[(of::DeviceId::new(c"apple,sep"), ())]
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Service options arrive too late

If udev loads apple_sep before the documented aurora-sep.service setup runs, the driver keeps its new read-only defaults. That setup supplies xart_writes=1 provision_keybag=1 through load-driver, not a configuration file. A later modprobe does not change the already-loaded module's options, so Touch ID cannot save its state and first-boot provisioning stays off.

Install those options before automatic loading for this supported setup, or update its installation steps to require the configuration and a reboot.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. aurora-sep now ships the write options as a modprobe.d file before the first load (ad5b7a1, 411e32b), so a udev load gets them too. The read-only override is /etc/modprobe.d/apple-sep.conf; an old aurora-sep.conf is migrated.

Comment thread drivers/soc/apple/sep.rs Outdated
let steps = this.store_wait_steps.load(Relaxed) + 1;
this.store_wait_steps.store(steps, Relaxed);
match Self::open_xart_store(&this.dev, this.profile) {
Ok(store) => *this.store.lock() = Some(store),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Store status stays stale

When the delayed open succeeds with writes enabled, the diagnostics still report writes as disabled and matching as blocked. diag::register cached those values while the store was absent, and this branch installs the store without refreshing them. The driver can then write while its diagnostics say it cannot; aurora-sep-ready also uses the stale matching value to reject readiness.

Refresh the reported write and guard settings when the delayed open succeeds.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5cd816a: after the late open, diag::refresh_store(writable, guard) runs before the attach.

scottjones added a commit to omacom/omarchy-mac-pkgs that referenced this pull request Oct 23, 2026
Turning Touch ID on now also writes /etc/modprobe.d/omarchy-mac-touchid.conf
with "options apple_sep xart_writes=1 provision_keybag=1" before the driver
loads, and a failure or turning it off removes it with the agreement record.
A Mac turned on before this gets the file the next time setup finds it
ready.

Today's kernels already default to both, so this changes nothing yet. It
starts the path omacom/linux-aurora#180 needs: there apple_sep autoloads on
every Mac read-only by default, for the M1 and M2 microphones, and these
options are what lets Touch ID enrol and match. A driver already running
keeps the options it loaded with, so when one loaded before the options
existed doesn't become ready, the agreement stands and the owner is told
Touch ID turns on after a restart, instead of the agreement being taken
back on every attempt.

This doesn't yet cover #180 fully. Its read-only driver always reports
matching as blocked, and the activation reads that wherever a key store
exists, so a Mac with a key store but no options file, including one whose
owner turned Touch ID off, records blocked and isn't offered Touch ID; and
the backfill above never runs there, since such a Mac never reads ready.
The README names both, to close once #180 lands.

The options file sorts after apple-sep.conf, so it wins over any
apple-sep.conf; apple_sep.xart_writes=0 on the kernel command line still
wins over both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scottjones added a commit to omacom/omarchy-mac-pkgs that referenced this pull request Oct 23, 2026
…ngs it

Answers Greptile's review of #12:
- The pacman hook starts the status unit before the activation. On the
  update that first installs the package, the boot-time status hasn't
  run and the activation skips without /dev/sep-bio, so nothing offered
  Touch ID until a reboot.
- disable-fingerprint fails when it can't remove the agreement, and
  touchid-enable and enable-fingerprint fail when they can't record it or
  write the driver's options, instead of reporting success.
- The options and the carved calibration are written to .new and renamed,
  so a failed write never leaves a partial file under the real name. A
  truncated options file would load a read-only driver at every boot on a
  kernel with omacom/linux-aurora#180.
- The wait unit follows the boot-time load, so it never looks for the
  device before the driver has one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scottjones added a commit to omacom/omarchy-mac-pkgs that referenced this pull request Oct 23, 2026
…artition

Answers the maintainer review of #12:
- enable-fingerprint lets the setup go on wherever Touch ID can't be set
  up, so a USB reader enrols on a Mac mini, a Studio or an M1 Mac. A Mac
  without a sensor writes no status, and a status service can fail, so a
  missing status is worked out again. An owner who agreed already is never
  asked again: the Mac gets any missing driver options and, unless Touch ID
  is ready, is told to restart.
- The load unit waits for the iBoot System Container's link with udevadm
  once its condition holds, instead of depending on the device: systemd
  waits for a unit's devices before checking its condition, so every boot
  waited on the partition, agreed or not, and a machine without one held
  the greeter until the device timed out.
- The activation runs only on the owner's agreement, so on a kernel that
  loads the driver itself (omacom/linux-aurora#180) a Mac whose owner
  hasn't agreed keeps being offered Touch ID.
- The consent text drops a reassurance nobody can check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scottjones added a commit to omacom/omarchy-mac-pkgs that referenced this pull request Oct 23, 2026
A MacBook Neo's Touch ID needs its device-private sensor root key. Instead
of an installer copying it before anyone has agreed, and Linux keeping it,
touchid-root-key rebuilds it only after the owner says yes, from this Mac's
factory records in asahi/all_firmware.tar.gz, which asahi-installer writes
to the ESP on every install. It rebuilds the key as the installer's
factory_root_key() does on macOS, checks its envelope, and refuses records
that aren't all found byte for byte in this Mac's own iBoot System
Container, so another Mac's archive, or one swapped on the ESP, gives no
key. It writes the key root-only, to a temporary name it created itself,
synced and renamed.

- Eligibility needs an installed key, or the archive and python.
- The boot status no longer moves a staged key, and nothing is kept in
  /var/lib/omarchy-mac; a yes that then fails takes the rebuilt key back.
- Turning Touch ID off deletes the key; the next yes rebuilds it.
- A factory reset carries no key: the ESP survives it, so the next owner's
  yes rebuilds it. factory-reset.sh is back to its state before 104c496.
- Neos installed before the installer staged anything are covered too.

The README also notes that fprintd opens /dev/sep-bio when it probes, so
a kernel that loads apple_sep on its own (omacom/linux-aurora#180) needs
fprintd's allowance gated on the agreement as well.

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

Copy link
Copy Markdown

Additional confirmation on a MacBook Air M1 (2020), J313, running linux-aurora 7.2.11.aurora1-1.

apple_sep was initially unloaded. Loading the installed module with xart_writes=0 provision_keybag=0 successfully booted SEP; the kernel logged writes disabled.

We also found a separate userspace issue: aurora-audio 4.1.aurora3-1 references the Triforce LV2 plugin, but triforce-lv2 was missing. WirePlumber failed to create the microphone filter until we installed it and restarted WirePlumber.

After both changes, omarchy_asahi_mic provides live audio and Superwhisper works. A three-second capture measured RMS 0.00199 and peak 0.01247.

This supports the SEP startup diagnosis and read-only operation. We tested the existing kernel with a manual module load, not this PR’s patched kernel.

@joshuaswarren

Copy link
Copy Markdown

Lab laptop qualification of this PR at head 5a80718.

What was built: a hand-built linux-aurora package (no pacman signature; sha256 checked before install), release 7.2.11-pr180-ARCH+, made from the PR 187 tree plus this PR's sep.rs and Kconfig hunk, so the build also contains the PR 187 GPU port. It was installed as a one-shot Limine entry on each laptop, and each laptop returned to its stock kernel afterwards. The boot ids below are the stock boot, the candidate boot and the stock return boot.

Laptop (model) | boots (stock -> candidate -> stock) | result
13-inch M1 MacBook Pro | 69486439 (7.1.12-2-20261013.18-sep-ARCH) -> d9a1370a (7.2.11-pr180-ARCH+) -> bf356a6a (7.1.12-2-20261013.18-sep-ARCH) | PASS. Smoke 7 PASS, 2 FAIL, 1 SKIP (the same two FAILs as its own stock baseline); SEP booted the enclave; microphone not measurable in that laptop's login session (UNKNOWN)
16-inch M1 Max MacBook Pro | 415bfc0e (7.1.12-2-12.6-sep-ARCH) -> 304241ab (7.2.11-pr180-ARCH+) -> 22ccf6cc (7.1.12-2-12.6-sep-ARCH) | PASS. Smoke 11 PASS, 1 FAIL, 2 SKIP; SEP booted the enclave; mic band moves with the tone
14-inch M2 Max MacBook Pro | 2cfa8fa6 (candidate) -> b52dbe75 (stock) | PASS. Smoke 8 PASS; SEP up; mic alive

Smoke detail on the 16-inch M1 Max: 11 PASS (boot, wifi, input, input-errors, display, audio, ane, battery, gpu-dmesg, audio-card, gpu-vulkan), 1 FAIL (the gpu check that looks for a Vulkan device or a renderD node, which fails the same way on the stock baseline of that laptop), 2 SKIP (suspend not requested, mlx-omarchy not installed). glmark2 built on the candidate scored 4308 against 2399 on the stock baseline of the same laptop.

Smoke detail on the 13-inch M1: 7 PASS (boot, wifi, input, input-errors, display, ane, battery), 2 FAIL (audio: the seat-less login session sees no ALSA card; gpu: no Vulkan device or renderD node), 1 SKIP (suspend). Both failures are identical on that laptop's stock baseline, and the root-level check in the same run finds 3 ALSA playback devices. The Honeykrisp compute check passes on both boots with the same max absolute error, 0.000595.

SEP on the candidate: apple_sep is loaded and the kernel log shows the enclave actually booting - on the 16-inch M1 Max "SEP platform profile: T6000/J316s", on the 13-inch M1 "SEP platform profile: T8103/J313", then "boot: TZ0 accepted; handing over firmware and shared memory" and "boot: IMG4 acknowledged; the SEP owns the shared-memory table", followed by endpoint discovery.

Microphone: on the 16-inch M1 Max the raw hw:0,0 capture shows the 1 kHz band rising from about -20 dB with the room silent to about -14 dB while a 1 kHz tone plays, and the raw capture behaves the same on the stock kernel of that laptop, so the microphone is live on the candidate and this is a no-regression result, not a microphone fix. The band move is about 5.5 dB, smaller than the roughly 13 dB reference measured on the 14-inch M2 Max. The processed omarchy_asahi_mic source differs between the two kernels on that laptop (stock: rms rises 15 dB with the tone but the 1 kHz fraction drops, -19.1 -> -28.7 dB; candidate: rms flat and the 1 kHz fraction rises, -18.5 -> -11.4 dB). Reporting that as an observation, since this PR changes the SEP boot path.

On the 13-inch M1 the microphone could not be measured at all: that laptop's login session exposes no ALSA card (the same "no soundcards" failure appears on its stock baseline), a direct raw capture returns 150 bytes where 1,152,000 are expected, and the processed source returns no data in both the silent and the tone case - identically on the stock boot and on the candidate. The microphone is therefore UNKNOWN on that laptop, not confirmed.

CI on this head: 1 check is reported (Greptile Review, pass). No kernel CI jobs are attached to this pull request's head, unlike #182 which carries the kernel CI.

Regressions: none found. Three notes for the author:

  • One message class appears on the candidates and not on the 7.1.12 stock baselines: tas2764_i2c_probe: Failed to parse devicetree - 30 times on the 16-inch M1 Max (6 I2C addresses x 5 retries) and 6 times on the 13-inch M1 (one per address). The same message is present in the earlier 7.2.11 candidate logs on the 16-inch M1 Max (3 times for the PR 187 build, 2 times for 7.2.11-1-1) and 0 times on 7.1.12, so it arrives with the 7.2.11 base tree rather than with this PR. The audio codec cs42l84 probes successfully right after it, audio playback passes and the microphone is live on the 16-inch M1 Max.
  • On the 13-inch M1 the candidate also shows 4 PCI resource warnings (xhci_hcd/pcieport ...: of_irq_parse_pci: failed with rc=-N) that its 7.1.12 baseline does not - that baseline's dmesg error list was empty. These come with the newer kernel base.
  • Known flakes, present on the stock baselines as well, not regressions: apple-dcp .dcp: Failed to get dp-xbar: -517 and a brcmf roam message that differs from case to case.

What this does not test:

  • These laptops load apple_sep through apple-sep.service, so the module alias autoload path is UNKNOWN here. The alias itself is present in the module (of:N*T*Capple,sep).
  • On the 16-inch M1 Max and the 14-inch M2 Max the microphone already works on stock, so those runs show no regression rather than a fix; on the 13-inch M1 it could not be measured at all, so it is UNKNOWN there.
  • The build also contains the PR 187 GPU port, so a failure in the GPU area here would belong to that PR, not to this one.
  • No laptop in this fleet runs without the loader units, so the loader-unit-free path is not covered.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ludagoo. The diagnosis matches what we see: on the release pin (CONFIG_APPLE_SEP=y), the probe runs before the iBoot container's link exists, returns the store error and is never retried. The cold-boot M1s never get their enclave booted, so the mics record the null stream from #141. Booting without the store and exporting the alias is the right fix, and read-only by default is the safer default.

I'd ship this with CONFIG_APPLE_SEP=m in the Omarchy package, not =y. With the alias, udev then loads it only where the device tree enables the SEP node: the M1 family, which needs it for the mics. M2, M2 Pro/Max and M3 Air keep disabled nodes, so nothing changes there unless the owner turns Touch ID on, and our loader reads the options from modprobe.d after the container's link exists. Built in, every one of those Macs would attach the SEP on every boot, and the options could only come from the kernel command line.

Before merge (all small, no hardware needed):

  1. Refresh the diag facts when the late open succeeds (Greptile's P2). diag::register cached xart_writable=false and no guard at probe, and store_wait_tick only swaps the store in. Our touchid-activate refuses matching=blocked, so on that path Touch ID never reports ready. Please update both the Rust facts and the C-side write/guard fields before the attach can generate traffic.
  2. Arm the settle timer after a deferred attach. The probe arms it only when the attach ran synchronously. After store_wait_tick attaches, only RX re-arms it, so a silent warm attach never hits the first-response failure path and diag stays pending. A failed deferred attach should also be marked failed rather than only logged.
  3. Serialise the deferred attach against remove(). remove() clears the mailbox before it cancels the wait work, and store_wait_tick checks shutting_down only on entry. A tick blocked in the store open can resume, write the warm registration marker and then fail to ring, after which the next probe returns EBUSY with no handoff done. Join the wait work before tearing down the mailbox, and make the attach and marker publication respect shutdown.
  4. Kconfig help: with the alias design, recommend M (also the existing default) rather than "Say Y".
  5. Greptile's P1 (load-driver passes the options too late once udev autoloads): have the service install a modprobe.d file before the first load and say a reboot is needed when the driver is already up. In the README, "no longer required" holds only for the M1 family: disabled warm-attach nodes still need an explicit loader.

Not needed here: 8eb00bb from #7. The tree deliberately keeps suspending after the drain timeout, and that's a separate call.

Hardware before we pin it (packaged =m build, no loader units):

  • J313 and one M1 Pro/Max: the driver autoloads with writes disabled; raw and processed mic are live; 3× suspend/resume; idle and s2idle power vs today's kernel, since the enclave now runs on every M1 boot.
  • One M1 iMac (J456/J457): autoload and mic smoke.
  • M2 Air and M3 Air (J613): apple_sep not loaded without Touch ID. With Touch ID on (M2 Air): writes enabled after restart, enrol, verify, reboot persistence.
  • On one cold and one warm Mac: a delayed link, an absent link, and remove() during the wait.

Comment thread drivers/soc/apple/sep.rs Outdated
let steps = this.store_wait_steps.load(Relaxed) + 1;
this.store_wait_steps.store(steps, Relaxed);
match Self::open_xart_store(&this.dev, this.profile) {
Ok(store) => *this.store.lock() = Some(store),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The late open installs the store, but diag::register cached xart_writable=false and no guard at probe, so diag keeps reporting writes off and matching=blocked (Omarchy's touchid-activate refuses that). Please refresh the Rust facts and the C-side write/guard fields here, before the attach below.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5cd816a: the late open refreshes the Rust facts and the C-side write/guard fields (diag::refresh_store) before the attach, so diag no longer reports writes off or matching=blocked.

Comment thread drivers/soc/apple/sep.rs
dev_err!(this.dev, "the SEP node is gone; not booting the SEP\n");
return;
};
if let Err(e) = this.attach(&sep_node) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The probe arms settle only for a synchronous attach. After a deferred one, only RX re-arms it, so a silent warm attach never reaches the first-response failure path. Arm it here, and mark a failed attach as failed in diag rather than only logging it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5cd816a/4dfa5584: the deferred attach now arms settle, and a failed attach goes to diag::attach(false) + bringup_ended instead of only being logged.

Comment thread drivers/soc/apple/sep.rs
@@ -2385,7 +2471,7 @@ impl SepData {

*self.mbox.lock() = None;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mailbox goes before the wait work is cancelled, and store_wait_tick checks shutting_down only on entry. A tick blocked in the store open can still write the warm registration marker, after which the next probe returns EBUSY. Join store_wait_work first and serialise the attach and marker against shutdown.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: remove() now cancels store_wait_work synchronously before it drops the mailbox, and the tick checks shutting_down again before it attaches and writes the marker.

Comment thread drivers/soc/apple/Kconfig Outdated
still attaches, but refuses Touch ID enrol and verify: the enclave
saves anti-replay state after every match.

Say Y here if you have an Apple silicon Mac.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the alias design this wants M (also the default here); built in, modprobe.d options never reach the driver.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. APPLE_SEP is tristate, default m if ARCH_APPLE.

Comment thread tools/aurora-sep/README.md Outdated
microphones only work once it runs. If udev loads the driver before the iBoot
system container's partition link exists, the boot waits up to 30 s for it and
then runs without the xART store (Touch ID and trusted keys stay unavailable
until the next boot). The service above remains harmless and is no longer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"No longer required" is true only where the DT enables the SEP node (M1 family, J700). The M2, M2 Pro/Max and M3 Air nodes are enabled by module init, so they still need the loader. load-driver should also install its options before the first load (Greptile P1).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 858f864/5b518de1: the README now says udev autoload covers only nodes the DT enables (M1 family, J700), and M2, M2 Pro/Max and M3 Air still need the loader. load-driver installs its options before the first load.

@ludagoo
ludagoo force-pushed the fix/sep-boot-microphones branch from 5a80718 to 0dfa5ae Compare October 26, 2026 18:16
@malik-na

Copy link
Copy Markdown
Member

Tested on a J313 (M1 Air), merged with #223 on 937b727ef9a3 (#180's own files only; no conflicts):

without this PR (7.2.11-6-1-ARCH) with this PR
apple_sep loaded at boot no yes, via udev
enclave boot – TZ0 accepted, IMG4 acknowledged, 7 endpoints
3 s capture from omarchy_asahi_mic, peak 77, then 0 4931
xART writes at default options – writes disabled

The microphone fix works on M1. Two notes:

  1. A default (read-only) load isn't quite "changes nothing on the Mac". It created /var/lib/aurora-sep-host-state.bin (2,359,296 bytes, created a new host-state store) on the Linux root. That's harmless, but now every M1/M2 install gets it on first boot, which the Kconfig help and README don't mention.
  2. With xart_writes=1 provision_keybag=1, keybag provisioning on M1 fails at the xART guard (see soc: apple: sep: keep a held J313 patch and its data-ready line #223). It leaves a 52-byte /var/lib/aurora-sep-keybag.bin that holds only the APPLE-SEP-KBAG01 header and zeros. A failed provisioning probably shouldn't leave a keybag file behind.

Lucas Goossen and others added 3 commits October 28, 2026 12:38
The driver refused to probe when the xART gigalocker could not be opened
from the iBoot system container, so the SEP was never booted. On the M1
and M2 laptops the Secure Enclave sits in the path of the microphone
data lines: without the boot, the AOP's PDM capture runs on a constant
input and every recording is a null stream (omacom#141).

This is what broke the built-in microphones between 7.1.12.aurora2-12
(CONFIG_APPLE_SEP=y with the earlier stub driver, which only booted the
enclave) and every later build: the rewritten driver either failed its
probe at the xART store before udev had created the partition-label
link (CONFIG_APPLE_SEP=y, 7.1.12.aurora8-1), or was a module that is
never loaded without the Touch ID loader units (7.2.10.aurora1-2).

Treat an unavailable or invalid store like xart_writes=0 taken one step
further: warn, keep `store` empty and boot the enclave anyway. The xARM
path already answers the enclave's requests with a failure when there
is no store, so Touch ID and trusted keys stay unavailable until a boot
where the store opens; nothing is written.

Verified on a MacBook Air (M1, 2020) J313 / t8103, macOS 13.5 firmware,
on 7.1.12.aurora2-12.6: with the driver loaded by hand after boot the
microphones record live audio; with no SEP driver running the capture
is the null stream.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The built-in microphones of the M1 and M2 laptops depend on a booted
Secure Enclave, so the SEP driver has to run on every such Mac, not only
where the Touch ID loader units are installed. Export the OF table as a
module alias again, so udev loads the driver on every board whose device
tree enables the SEP, and resolve the two problems that made commit
36ebdee ("soc: apple: sep: Do not autoload the driver through a
module alias") remove the alias:

 - A udev load runs before udev has created the iBoot system container's
   partition-label link, through which the xART store is opened, and
   nothing retried the open. Now a cold boot whose store open fails with
   ENODEV waits for the link in 500 ms steps, up to 30 s, opens the store
   once it exists and boots the enclave then; after the last step it boots
   without the store. The boot never waits forever: the microphones
   depend on it.

 - A load the owner did not ask for provisioned an identity keybag and
   wrote to the shared xART store. xart_writes and provision_keybag now
   default to 0: read-only operation boots the enclave and refuses Touch
   ID enrol and verify, as before. The aurora-touchid package, installed
   when the owner opts in, carries a modprobe.d file that enables both;
   a --read-only install overrides it from /etc/modprobe.d. Its
   apple-sep.service and .path stay harmless (modprobe of a loaded
   module).

The diag sysfs group keeps the xART facts seen at probe; when the store
is opened later its "writable" value stays at probe's.

Verified on a MacBook Air (M1, 2020) J313 / t8103: the driver autoloads
at boot, the TZ0 handshake completes, the store opens with writes
disabled, and the microphones record live audio.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A default load still creates /var/lib/aurora-sep-host-state.bin
(2359296 bytes). That is a Linux-only file, not an xART write.

After the iBoot container opens late, refresh the cached xART diag
facts before attach. Arm settle after that attach. Cold boot sets
registered only on the IMG4 ack, so the timer is not gated on it.
Join the store wait before dropping the mailbox, and do not publish
the boot marker once shutdown has started.

A keybag create that is not sent, or that the enclave answers with a
non-zero status, removes the 52-byte uncommitted header. A create
that was sent and not answered keeps the intent. A committed bag is
left in place.

Kconfig asks for a module so modprobe.d options reach the driver.
load-driver writes /usr/lib/modprobe.d/apple-sep.conf only when that
file is absent. The loader is no longer required only where the
device tree enables the SEP node: the M1 family and J700.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
@ludagoo
ludagoo force-pushed the fix/sep-boot-microphones branch from 21d2c81 to 5cd816a Compare October 28, 2026 15:44

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ludagoo. 5cd816a is a rebase of 21d2c81 onto the current integration/aurora with the same three patches, so everything below still applies, including the nine items under Still open. This round closes most of Marcelo's list: the diag refresh, the settle timer, the remove() ordering and the Kconfig text all look right to us now. The new keybag cleanup only removes the record the same call just wrote, and keeps it after a timeout, which we agree with. Three things still block it: a --read-only Mac can no longer load the driver, the new load-driver check can never pass on a Mac where the driver is already loaded, and the packaging test still fails.

Fixed

  • Diag after a late store open (sep.rs:2201-2205, diag.rs:121): the Rust facts and the C xart and guard words are refreshed before the attach.
  • Deferred attach (sep.rs:2229-2236): settle is armed after it, and a failure sets attach to failed.
  • remove() (sep.rs:2495-2506): it now joins store_wait_work before it drops the mailbox, and both attach paths check shutting_down before they write the marker (sep.rs:1057, sep.rs:1084). A tick either finishes its ring with the mailbox still there or stops before the marker. We think this is right.
  • Kconfig now says M, which matches default m if ARCH_APPLE.
  • The README now says the alias only covers the M1 family and J700, and that the M2, M2 Pro/Max and M3 Air still need the loader.

Still open

  1. /usr/lib/modprobe.d/apple-sep.conf (new in aurora-touchid 3 and load-driver:45-49) sets xart_writes=1 provision_keybag=1, and a --read-only install writes xart_writes=0 provision_keybag=0 to /etc/modprobe.d/aurora-sep.conf (install-aurora-sep.sh:301). The names differ, so modprobe passes both: xart_writes=1 provision_keybag=1 xart_writes=0 provision_keybag=0 (checked with modprobe -C <dir> --show-depends). Rust params are set-once (rust/kernel/module_param.rs:80-83 returns EEXIST) and parse_args failing aborts the load (kernel/module/main.c:3561-3566), so apple_sep doesn't load at all and the M1 microphones stay off. The same happens to anyone who follows the apple-sep.conf comment and puts an override in /etc/modprobe.d under another name. Only /etc/modprobe.d/apple-sep.conf works, since it hides the /usr/lib file. Please have --read-only write that name, fix the comment and README.md:67-70, and fix the load-driver:42-44 comment, which assumes --read-only already wrote this path.
  2. tools/aurora-sep/load-driver:50-56 exits 1 on every Mac where the driver is already loaded, including after the reboot it asks for. Rust module params are registered with perm: 0 (rust/macros/module.rs:169), so /sys/module/apple_sep/parameters/xart_writes and provision_keybag never exist. writes and bag come back empty, and the script logs xart_writes=missing ... reboot and stops before the trusted-key and /dev/sep-bio checks. On an M1 or J700 that is every boot, since udev loads the driver first. It also fails on an M2 if apple-sep.service won the race. Because aurora-sep-ready.service has Requires=aurora-sep.service, Touch ID activation and fingerprint restore are skipped too. The xart diag attribute covers writes, but nothing exports provision_keybag. Please read the options from somewhere the driver actually exports, or skip the check.
  3. load-driver:45-49 writes /usr/lib/modprobe.d/apple-sep.conf, which is the path the aurora-touchid package owns (tools/aurora-sep/aurora-touchid/PKGBUILD:34). On a Mac that ran aurora-sep first, installing aurora-touchid later fails with a pacman file conflict. Removing aurora-sep also leaves an unowned file behind that keeps writes on. One package should own this file. Writing it under another name in /etc/modprobe.d would hit the duplicate-option failure above.
  4. Packaging (tests/test_packaging.py): it still fails, and now for two files. tools/aurora-sep/packaging/arch/aurora-sep/PKGBUILD:34 (load-driver, abea60bb, now 3f0bb8ab) and :43 (README.md, dbcf59ce, now 86c530a4) are both stale. Please run updpkgsums.
  5. A failed deferred attach (sep.rs:2228-2231) only sets attach. Unlike the failure in tick_attach (sep.rs:2276-2278) it doesn't call diag::bringup_ended() or finish_bringup(), so touchid and keystore read unknown instead of failed/closed, and every trusted-key call waits the full 90 s in wait_for_trusted_ready. The the SEP node is gone return at sep.rs:2221-2223 sets nothing at all. Please end the bring-up on both paths.
  6. M2 wording: Kconfig:158-159 and the PR title still say this fixes the M2 microphones. The README is right now. Please match the other two to it.
  7. tools/aurora-sep/XART-SAFETY.md:5-8 still says xart_writes=1 and provision_keybag=1 are the defaults.
  8. Upgrade order (from our last pass): the release that carries this kernel needs aurora-touchid 3, or the bare modprobe in apple-sep.service loads read-only.
  9. Tests: there's still nothing for the store wait against remove(), the keybag cleanup or load-driver. We put back the old sep.rs, sks.rs and keybag.rs, and the tests that read the driver sources still passed. A small load-driver test against a fake /sys would have caught item 2.

Keybag cleanup

discard_uncommitted (keybag.rs:246) only runs on a record that write_intent wrote earlier in the same call, because provisioning starts only when keybag::read returns Absent (sks.rs:631-641). So an older state-0 record never gets this far. The cleanup touches only /var/lib/aurora-sep-keybag.bin, never xART. The retry rule is the same as before: a non-zero answer used to write state 2, which read already treats as absent, so the only change is that no file is left behind.

Two small things:

  • Some unsent creates still keep the record. intent.sending() is at sks.rs:692, but sks_exchange_patient can return None before anything is sent (sks.rs:151, 155, 159-163, 182), for example when an earlier exchange this boot left the key store wedged. That leaves a state-0 record, and every later boot then stops with EEXIST, even though the enclave never saw the create. It was the same on the base, but the commit message says an unsent create is removed. Moving sending() into the exchange, just before self.send, would make that true.
  • The unlink isn't followed by a sync of /var/lib (store_shim.c:244). After a crash the state-0 record can come back, which is the safe side but blocks setup for good. sep_store_unlink already has the parent path, so it could fsync it the way sep_store_sync_parent does.

What we ran (before the rebase): built drivers/soc/apple/ at 21d2c81 with the release19 config (LLVM=1 W=1, rustc 1.93.1). It builds clean, and the only warnings are in files this PR doesn't touch. We also ran the tools/aurora-sep/tests suite. The only failure this PR adds is test_packaging. Since then we've booted 5cd816a on our M3 Air in a test kernel with no problems, but none of our Macs can show the #141 microphone fix itself: our M2 Max already starts the enclave through the Touch ID loader and its mics work, and the Air is an M3.

load-driver and README.md moved on after the sums in the PKGBUILD.
updpkgsums records the tree that packaging test compares against.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
A --read-only install wrote /etc/modprobe.d/aurora-sep.conf while the
Touch ID package owns /usr/lib/modprobe.d/apple-sep.conf. modprobe passes
both, the set-once parameters return EEXIST, and apple_sep does not load.
The override has to use the same name so it hides the packaged file.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
Rust parameters are registered with perm 0, so xart_writes and
provision_keybag never appear in sysfs. Treating that as a bad load
exited 1 on every M1 and J700 boot, and aurora-sep-ready never ran.
The packaged modprobe file stays owned by aurora-touchid; this script
no longer writes it.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
A missing SEP node or a failed attach after the store wait only logged
the error. touchid and keystore stayed unknown, so trusted-key callers
waited out the full bring-up timeout. Mark the attach failed and publish
bring-up completion on both paths, as tick_attach already does.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
The alias covers boards whose device tree enables the SEP node: the M1
family and J700. M2, M2 Pro/Max and M3 Air nodes stay disabled and still
need the loader. The Kconfig help now matches that.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
xart_writes and provision_keybag both default to 0. Writes and keybag
provisioning come from the Touch ID package's modprobe file, which a
read-only install hides.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
A fake sysfs with no parameter files used to make load-driver stop
before the trusted-key probe. The store-wait test checks that a missing
node or a failed attach ends bring-up, and that remove() joins that wait
before it drops the mailbox. Refresh the Arch checksums for the loader
and the docs those checks sit next to.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
Without that package's modprobe file, udev or an older apple-sep.service
loads apple_sep read-only. The release that ships this driver has to
install aurora-touchid 3 first.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>

@scottjones scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For: #180 (ludagoo), review at head e5e9831 (v4; last reviewed 5cd816a)


Thanks. The first three patches are unchanged, and this round closes most of our list: items 1 to 5 and 7 are fixed, and the kernel side looks right to us. Two new install problems remain, both from the option-file change, plus the title. Neither touches a stock Omarchy install.

Fixed

  1. --read-only now writes /etc/modprobe.d/apple-sep.conf, which hides the packaged file, and the comments and README match.
  2. load-driver no longer stops when the driver is already loaded.
  3. load-driver no longer writes the file aurora-touchid owns.
  4. Packaging test passes, and it now covers aurora-touchid too.
  5. Both deferred-attach failures end the bring-up (sep.rs:2222-2227, 2234-2237).
  6. XART-SAFETY.md is right.

Still open, new with this round

  • aurora-sep alone can no longer get writes. The base load-driver ran modprobe apple_sep xart_writes=1 provision_keybag=1. It now runs a bare modprobe, and the aurora-sep package (packaging/arch/aurora-sep/PKGBUILD:15) neither ships the option file nor depends on aurora-touchid. The Fedora spec has no option file either, though its description and README.md:192-193 still say writes are on. On this kernel a new Mac stays read-only and never gets a keybag, so load-driver times out at the trusted-key check after 120 s and exits 1. aurora-sep-ready is skipped, and fprintd doesn't start because it requires aurora-sep.service. A Mac that already has a keybag comes up but can't match. Please ship the option file with aurora-sep on both. The same path as aurora-touchid needs a package conflict, and another name brings back the duplicate-option failure. pkgrel and Release need a bump too.
  • An earlier --read-only install keeps the old name. /etc/modprobe.d/aurora-sep.conf isn't migrated or removed. A --read-only re-run writes the new name beside it, which is the duplicate-option failure again, so apple_sep doesn't load and an M1's mics stay off. aurora-touchid 3 does the same. A plain re-run no longer sees the Mac as read-only, --reset-touchid no longer refuses it (:4690), and --uninstall leaves the old file behind. Please rename it on install and remove both on uninstall.

Still open from last time

    1. Kconfig is fixed, but the title still says "on every Mac" and "M1/M2 microphones", and the Summary says the same. With no loader the driver doesn't load on an M2, so this can't change its mics.
    1. Upgrade order is documented. install-aurora-sep.sh:278 still pins aurora-touchid-20261003-1, which has no option file. That's fine while its kernel pin is older, but those two have to move together. An Omarchy Mac with Touch ID on already has /etc/modprobe.d/omarchy-mac-touchid.conf, so once the pin moves, aurora-touchid 3 or --read-only on that Mac is the duplicate-option failure too.
    1. load-driver and the store wait now have tests, and they fail against the old code when we put it back. The store-wait ones read the source rather than run anything. The keybag cleanup still has none. Not blocking.

The two smaller keybag notes from last time are unchanged and not blocking. One small thing: with the check gone, a driver already loaded read-only gets no hint about the reboot it needs. Without a keybag it ends on the 120 s trusted-key timeout.

Safety

No xART write path changed this round. A load nobody opted into stays read-only and only creates the Linux host-state file. The auto-load only reaches boards whose device tree enables the node. Our M2 Max, M3 Air and Neo all have /etc/modprobe.d/omarchy-mac-touchid.conf, so they keep writes on, and the M2 Max and M3 Air don't change. On the Neo udev now loads the driver first. That looks harmless where the file exists: it's on root, and the store wait covers a late partition link. We booted integration/aurora 789cc71 plus this PR on our Neo, as it's set up today with Touch ID on: attached, xart=enabled, Touch ID ready, /dev/sep-bio there, fprintd active, no refused xART writes, and the store wait didn't run. That's one boot of our clang 22 build. A Neo with Touch ID off changes more: it now attaches read-only at every boot, which the PR lists as untested, and turning Touch ID on takes an extra restart. Is there a reason to auto-load J700? The microphone report is from an M1. Not blocking. Could you also run a suspend and resume on your J313, since every M1 now gets the driver? The PR lists that as untested.

For the RC: this fixes the M1 mics and neither install problem reaches stock Omarchy. Both fixes are small, so we'd rather take them here. If the RC can't wait, tell us and we'll track them as a follow-up.

@ludagoo

ludagoo commented Oct 31, 2026

Copy link
Copy Markdown
Author

@scottjones Your Oct 29 notes are in the commits after 5cd816a: ad5b7a1 (the read-only override uses /etc/modprobe.d/apple-sep.conf), 04b58e6 (an already-loaded module is not a failure, and load-driver does not write the packaged modprobe file), a97d2d4 (checksums), 4dfa558 (a deferred attach that cannot start ends bring-up), 858f864 (Kconfig M2 wording), 5b518de (read-only defaults), df0a807 (load-driver and store-wait tests, including remove() joining that wait), and e5e9831 (aurora-touchid 3). I have not changed the keybag unsent-create or parent-fsync notes. Could you take another look at the rest?

… from breaking the load

aurora-sep ran a bare modprobe and did not ship
/usr/lib/modprobe.d/apple-sep.conf, so a machine without aurora-touchid
stayed read-only and never got a keybag. Ship that file from aurora-sep
on Arch and Fedora, with the same options aurora-touchid installs
(xart_writes=1 provision_keybag=1). The two packages conflict: another
name, or a second copy of this path, passes both lines and the set-once
parameters refuse to load.

An earlier --read-only install wrote /etc/modprobe.d/aurora-sep.conf.
Rename it to apple-sep.conf on install, treat either name as read-only
for the notice and --reset-touchid, and remove both on --uninstall.
aurora-touchid 3 does the same rename from its install script.

A driver udev already loaded read-only does not show its parameters in
sysfs. Keep going, and when the trusted-key wait then fails because
diag xart is disabled, say that the option file needs a reboot.

Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
@ludagoo ludagoo changed the title soc: apple: sep: boot the enclave on every Mac (fixes the M1/M2 microphones, #141) soc: apple: sep: boot the enclave without the xART store and autoload it (fixes the M1 microphones, #141) Nov 1, 2026
…sted

The installer pinned aurora-touchid 2026100-1, which ships no
/usr/lib/modprobe.d/apple-sep.conf; this kernel needs the -3 package
that does (Scott's review item 8). The sha256 is of a package built
from this branch's PKGBUILD; it has to be uploaded to the release
named by TAG.

Note: TAG=sep-7.1.12.aurora2-12.4 has no published release yet.
Retarget the installer from sep-7.1.12.aurora2-12.4, which has no
published release, to sep-7.1.12.aurora2-12.6-stable: VERSION
7.1.12.aurora2-12.6, and the linux-aurora, linux-aurora-headers and
m1n1-aurora 1.6.1.aurora14-1 sums (and M1N1_BIN_SHA) from that
release's assets. libfprint is unchanged.

aurora-touchid stays pinned at 2026100-3 (the build with apple-sep.conf
this kernel needs). That release only carries 2026100-2, so the -3
package built from this branch (sha256 6cadb783...170a) has to be
uploaded to sep-7.1.12.aurora2-12.6-stable before the installer works.

Refresh the aurora-sep PKGBUILD sums for the README change.
@malik-na

malik-na commented Nov 1, 2026

Copy link
Copy Markdown
Member

Retested 64e37ee on the J313 (M1 Air). This time it's the PR head on its own (no #223), built from the Air's config and booted twice as a one-shot entry. There are no modprobe.d options and no aurora-sep/aurora-touchid packages on this Mac, so this is the plain udev autoload path.

stock 7.2.11-12-1-ARCH this PR
apple_sep at boot not loaded loaded by udev, both boots
enclave boot - writes disabled, TZ0 accepted, IMG4 acknowledged, attach: 7 endpoints advertised in 20 messages, hwrng: registered
3 s capture from omarchy_asahi_mic, peak 317, then 0 2209 and 2502
same, after a suspend/resume check 73, then 0 496 and 726

The mic fix still holds on M1. My earlier peak was 4931; that was a different room and different noise. Stock is still the same blip-then-silence.

Suspend/resume on J313 (Scott asked for a J313 check): on both boots, with the enclave up, a pm_test=devices suspend through systemd and a pm_test=platform s2idle cycle both went through. There were no new SEP lines in dmesg after resume, Wi-Fi came back 5/5, and the mic was still live afterwards. These are test-mode cycles, not a real lid-close sleep, and idle/s2idle power is still untested on my side.

Same note as before: the first boot created /var/lib/aurora-sep-host-state.bin (2,359,296 bytes), and the second boot reused it.

The flow harness overrode MODPROBE_CONF but left MODPROBE_CONF_OLD at the
host's /etc/modprobe.d/aurora-sep.conf, so uninstall_all removed a real
file and the old-release command-log comparisons failed on the extra
argument. Point it into the temp tree and drop that argument when
comparing with releases that predate the rename.
@ludagoo

ludagoo commented Nov 4, 2026

Copy link
Copy Markdown
Author

@scottjones Your Oct 31 review is covered by 411e32b, which ships the write options from aurora-sep, adds the conflicts, migrates the old /etc/modprobe.d/aurora-sep.conf, and removes both names on uninstall. 1d0b531 pins aurora-touchid 20261003-3, and 64e37ee installs from sep-7.1.12.aurora2-12.6-stable. 08fc0a2 fixes a test-only problem: the flow harness left MODPROBE_CONF_OLD pointing at the host path, so uninstall touched the real /etc and the old-release log comparisons failed. tools/aurora-sep/tests now pass. Still blocked: a maintainer needs to upload the aurora-touchid 20261003-3 package (sha256 6cadb783…170a) to the sep-7.1.12.aurora2-12.6-stable release.

@ram2600

ram2600 commented Nov 9, 2026

Copy link
Copy Markdown

Data point from an M1 Max (J314c), in case it helps with the M1 keybag blocker. The testing so far has been on the J313.

Machine: MacBook Pro 14" (M1 Max, 2021), apple,j314c / apple,t6001, asahi,os-fw-version 13.5. Omarchy dev channel (omarchy-dev 4.0.0.r7634.gcbd0029-1), omarchy-mac 0.2.3-2, m1n1-aurora 1.6.1.aurora22-1, uboot-aurora 2026.07.aurora6-1. Stock kernels, without this PR applied: 7.2.11.aurora14-1, then 7.2.11.aurora15-1.

Device tree: soc/sep@396400000 is okay, and soc/spi@39b108000/fingerprint@0 (apple,mesa-fingerprint) is okay. modinfo apple_sep shows no alias: line, so nothing loads the driver at boot. touchid-status records unsupported:m1-family.

Manual sudo modprobe apple_sep (stock defaults, so writes are enabled), on two separate boots:

aurora14, 2026-11-03:

apple_sep 396400000.sep: SEP platform profile: T6000/J316s
apple_sep: xART guard level 1: 11 session records exist, 0 created by Linux; the other 11 are protected
apple_sep 396400000.sep: xART: APFS-resolved .gl extent (base 0x4d4000); 170 slots, 13 live records, max revision 24143, 0 malformed, 0 duplicate, 0 repaired; writes ENABLED
apple_sep: created a new host-state store
apple_sep 396400000.sep: boot: TZ0 accepted; handing over firmware and shared memory
apple_sep 396400000.sep: boot: IMG4 acknowledged; the SEP owns the shared-memory table
apple_sep 396400000.sep: attach: 7 endpoints advertised in 21 messages
apple_sep 396400000.sep: xART: using /chosen/apfs-preboot-uuid
apple_sep 396400000.sep: sks: capability word 2, IPC header version 2
apple_sep: xART guard: refused to rewrite a kind-4 record this Linux install did not create
apple_sep 396400000.sep: sks: CREATE_KEYBAG reply carried no parsable body: mailbox status -1, response 0 bytes, response_size 0
apple_sep 396400000.sep: bringup: identity-keybag provisioning failed; no retry this boot
apple_sep 396400000.sep: hwrng: registered after ready-phase survey (attempt 1)

diag afterwards: attach=attached xart=enabled touchid=failed matching=blocked keystore=open sensor_attach=unknown restore=unknown, with no /dev/sep-bio.

aurora15, 2026-11-06: the same sequence and the same guard refusal, but the store summary had changed:

apple_sep: xART guard level 1: 12 session records exist, 1 created by Linux; the other 11 are protected
apple_sep 396400000.sep: xART: APFS-resolved .gl extent (base 0x4d4000); 170 slots, 14 live records, max revision 24147, ...; writes ENABLED

Notes:

  1. The first load wrote a new xART record. Between the two boots, live records went from 13 to 14, Linux-created session records from 0 to 1, and max revision from 24143 to 24147. The kernel log has no line for that write, only the refusal. The guard kept the 11 macOS records unchanged. This differs from the J313 retest above, where the store summary was the same before and after. It supports making xart_writes=0 provision_keybag=0 the default, since a bare modprobe on a stock kernel writes to the shared store.
  2. The J314c uses the T6000/J316s profile. If that's intended as the profile for the whole t600x family, ignore this; if there should be a J314c profile, it's worth checking.
  3. Each failed provisioning leaves /var/lib/aurora-sep-keybag.bin behind at 52 bytes, matching the earlier report of a header-only file. The second load still tried to provision again, so here it didn't block the retry.
  4. The kind-4 refusal is the same as on the J313, so the M1 blocker isn't specific to the Air. It applies to t6001 as well.

I haven't tested this PR's kernel or xart_guard=0 on this machine. I'm happy to boot a test build if that would help.

malik-na added a commit to omacom/omarchy-mac-pkgs that referenced this pull request Nov 12, 2026
README line 29 now says the module also loads through the read-only
microphone load on M1-family Macs. The unit and sep-load headers are three
lines, as AGENTS.md asks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@endymoonz

Copy link
Copy Markdown

Data point from userspace: the recipe this PR automates (SEP boot without the xART store, xart_writes=0 provision_keybag=0) works today when loaded manually via modprobe options + a systemd unit on a J293-class MacBook Pro 13" M1 2020 — mic capture is normal with it, silent without it (see omarchy#17602). Confirms the approach; can run integration/aurora tests on this hardware when available.

scottjones added a commit to omacom/omarchy-mac-pkgs that referenced this pull request Nov 15, 2026
The driver's parameters can be set only once, so an
/etc/modprobe.d/apple-sep.conf next to omarchy-mac-touchid.conf passes
them twice and every load fails with EEXIST; with omacom/linux-aurora#180
loading the driver at boot, that also silences M1-family microphones.
touchid-enable now names the file, says to remove it, and changes
nothing. The README no longer claims the options file wins by sorting
after apple-sep.conf.

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.

J313 (MacBook Air M1): built-in mic capture returns a fixed looping pattern instead of audio

8 participants