Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mac-manual/content/12-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This is what the first release is qualified against on both reference Macs. <spa
| Battery, lid, power profiles | <span class="status ok">works</span> | |
| External displays | <span class="status ok">works</span> | HDMI on models that have it, USB4 and DisplayPort alt-mode through the Aurora kernel. Five displays on the M2 Max. A third and fourth display rely on an aquamarine fix carried until Hyprland releases it. |
| Variable refresh rate, camera (ISP), always-on processor | <span class="status ok">works</span> | Aurora kernel |
| Hardware video decode | <span class="status wip">in progress</span> | VA-API decoding of H.264, HEVC Main and Main10, and VP9 8 and 10-bit, tested on a 13" M1 MacBook Pro; 8-bit H.264, HEVC and VP9 also on a 16" M2 Max with the Aurora kernel. mpv uses it by default for H.264, HEVC and VP9, at about a quarter of the CPU of software decoding at 1080p; `hwdec=no` in `~/.config/mpv/mpv.conf` turns it off. To change the system default, edit `/etc/mpv/mpv.conf` rather than deleting it, since a deleted copy comes back at the next boot. Browser acceleration is still open. No hardware encoding. |
| Hardware video decode | <span class="status wip">in progress</span> | VA-API decoding of H.264, HEVC Main and Main10, and VP9 8 and 10-bit, tested on a 13" M1 MacBook Pro; 8-bit H.264, HEVC and VP9 also on a 16" M2 Max with the Aurora kernel. mpv uses it by default for H.264, HEVC and VP9, at about a quarter of the CPU of software decoding at 1080p; `hwdec=no` in `~/.config/mpv/mpv.conf` turns it off. To change the system default, edit `/etc/mpv/mpv.conf` rather than deleting it, since a deleted copy comes back at the next boot. An unedited copy from omarchy-mac 0.2.2 or earlier is the one exception: setup replaces it with the current default, which lets mpv play on Macs whose GPU has no driver yet. An upgrade alone does not run setup, so on a Mac installed before 0.2.3 run `sudo omarchy-mac-setup-system`, or rerun hardware setup, to apply it. Browser acceleration is still open. No hardware encoding. |
| Screen recording | <span class="status ok">works</span> | Encoded on the CPU through `wf-recorder`, because the Apple GPU has no supported hardware video encoder |
| Widevine DRM in browsers | <span class="status ok">works</span> | When the package is available from the Asahi repositories |
| Steam | <span class="status ok">works</span> | Optional, through FEX (`omarchy-steam-fex`) |
Expand Down
10 changes: 7 additions & 3 deletions omarchy-mac/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# omarchy-mac

Apple Silicon defaults and support services for Omarchy. Version: `0.2.2` (candidate). This add-on complements `omarchy` and `omarchy-settings`; it selects no kernel and contains no installer or repository trust configuration. It covers what stays on an installed Mac; installing one is the job of the [Omarchy Installer](https://github.com/omacom/omarchy-mac-installer), and boot support is the separate `omarchy-mac-boot` package beside this one.
Apple Silicon defaults and support services for Omarchy. Version: `0.2.3` (candidate). This add-on complements `omarchy` and `omarchy-settings`; it selects no kernel and contains no installer or repository trust configuration. It covers what stays on an installed Mac; installing one is the job of the [Omarchy Installer](https://github.com/omacom/omarchy-mac-installer), and boot support is the separate `omarchy-mac-boot` package beside this one.

## Build and stage

Expand All @@ -12,7 +12,7 @@ Runtime dependencies: `omarchy` (the `omarchy-hw-platform` detector and its Appl

Upgrade the matching runtime, settings and add-on candidates in one pacman transaction. Their transferred commands and user unit must have only one owner. A fresh Apple Silicon install takes two transactions before `omarchy-apply-system`: first one that installs the settings package, then one that installs the platform's default set (`omarchy-pkg-defaults aarch64-apple`: the base, aarch64 and Apple lists, this add-on included). The settings package's pacman platform guard checks only transactions that start after it is installed, so no Apple package may share a transaction with it; the runtime can go in either. The recipe must tag this package with `groups=('omarchy-platform-apple-silicon')`; the desktop's `docs/platform-guard.md` has the contract. The desktop's last hardware leaf runs this package's system setup through the dispatcher, and offline setup never downloads it: a Mac without it keeps Omarchy's generic setup.

Run `omarchy-mac-setup-system` as root on the target hardware (inside its target chroot for offline provisioning). An optional absolute root argument supports staging against the same target hardware without a bus. It exits without changes unless the runtime's Apple predicate `omarchy-hw-apple-silicon` holds (`omarchy-hw-platform` reports `aarch64-apple`, or `apple-silicon` on a runtime from before the platform rename), and fails if the detector does. It removes the Intel Mac Broadcom quirk (`options brcmfmac feature_disable=0x82000`, which breaks Apple Silicon Wi-Fi) from `/etc/modprobe.d/brcmfmac.conf` wherever an unguarded runtime migration appended it: only that exact line, with the comment block and blank line written right above it, goes; the file goes when nothing but blank lines is left, a link is left alone with the manual fix, and the initramfs rebuild it owes is recorded under `/var/lib/omarchy/migrations/1789172112-initramfs-pending`, which the runtime's migration finishes. It enables resume recovery only for BCM4378, BCM4387 and BCM4388 on Apple Silicon; Intel/T2 Macs are excluded. It is the only enabler of `speakersafetyd`, without which the kernel keeps the speakers muted: it applies the package's `80-omarchy-mac-audio.preset` once speakersafetyd is installed, so `/etc` presets that sort before it or replace it by name, masks and later explicit disables win, and image builders that apply presets get the same result. A live run also restarts a speakersafetyd left dead by a start-limit. No NetworkManager restart or driver reload occurs during setup. The backend applies when NetworkManager next starts; notch changes apply when appledrm next loads. A live run gives iwd a profile for each Wi-Fi network NetworkManager saved with its key before the switch, as NetworkManager itself does for a new connection, so saved networks keep connecting instead of reading as a wrong password. The greeter drop-in needs no setup: from the next `sddm` start it holds the greeter, for at most 10 s, until Apple's display controller has replaced the boot framebuffer.
Run `omarchy-mac-setup-system` as root on the target hardware (inside its target chroot for offline provisioning). An optional absolute root argument supports staging against the same target hardware without a bus. It exits without changes unless the runtime's Apple predicate `omarchy-hw-apple-silicon` holds (`omarchy-hw-platform` reports `aarch64-apple`, or `apple-silicon` on a runtime from before the platform rename), and fails if the detector does. It removes the Intel Mac Broadcom quirk (`options brcmfmac feature_disable=0x82000`, which breaks Apple Silicon Wi-Fi) from `/etc/modprobe.d/brcmfmac.conf` wherever an unguarded runtime migration appended it: only that exact line, with the comment block and blank line written right above it, goes; the file goes when nothing but blank lines is left, a link is left alone with the manual fix, and the initramfs rebuild it owes is recorded under `/var/lib/omarchy/migrations/1789172112-initramfs-pending`, which the runtime's migration finishes. It replaces `/etc/mpv/mpv.conf` with the current mpv default only while it is a regular file byte-identical to the copy omarchy-mac 0.2.2 and earlier made, which lacks `gpu-sw=yes`; an edited copy or a link stays. It enables resume recovery only for BCM4378, BCM4387 and BCM4388 on Apple Silicon; Intel/T2 Macs are excluded. It is the only enabler of `speakersafetyd`, without which the kernel keeps the speakers muted: it applies the package's `80-omarchy-mac-audio.preset` once speakersafetyd is installed, so `/etc` presets that sort before it or replace it by name, masks and later explicit disables win, and image builders that apply presets get the same result. A live run also restarts a speakersafetyd left dead by a start-limit. No NetworkManager restart or driver reload occurs during setup. The backend applies when NetworkManager next starts; notch changes apply when appledrm next loads. A live run gives iwd a profile for each Wi-Fi network NetworkManager saved with its key before the switch, as NetworkManager itself does for a new connection, so saved networks keep connecting instead of reading as a wrong password. The greeter drop-in needs no setup: from the next `sddm` start it holds the greeter, for at most 10 s, until Apple's display controller has replaced the boot framebuffer.

Run `omarchy-mac-setup-user` as each target user with their HOME/XDG directories. It enables the vendor unit without a session bus. It writes nothing into the user's Hyprland files; a block an earlier version appended to `input.lua` or `looknfeel.lua` stays, as the user's. With a live bus, reached only through XDG_RUNTIME_DIR (which `sudo -i` clears), it reloads the user manager, reports the effective unit and starts the mapper. The mapper makes the microphone a typed stereo source, `omarchy_asahi_mic` ("MacBook Microphone"): pipewire-pulse's `module-remap-source` records asahi-audio's mono DSP source (its AUX0 or MONO port), which WirePlumber links to the left side and the mapper to the right, or to a single MONO capture port when PipeWire negotiates one, and offers an `Audio/Source` with front-left and front-right, the shape of a stock microphone, so the desktop's audio panel drives its volume, mute and level meter as it does any other. It makes that source the default input only if a brief sample finds signal, and hands a silent one back to the DSP source. A muted mapping is the user's microphone mute and is left alone. On upgrade from 0.1.2 the mapper replaces 0.1.2's virtual source of the same name (an `Audio/Source/Virtual`, which the panel gives no level meter), keeping its gain, mute and selection. pacman restarts no user service, so a running mapper watches its own file: once an upgrade has replaced it and the transaction has ended, it runs the new file in place, within a few seconds, and that reconciles the live session. At session start the mapper subscribes to audio events before its first pass, so a DSP microphone that appears after it starts is mapped and made the default input at once. Provisioning and first run call setup; subsequent session starts only start the enabled unit, without reloading the user manager or repeating setup. The first desktop session does not depend on a bus existing during installation. Custom fragments, masks, activation links and headset or speaker policies are preserved; setup markers preserve explicit disables after initial setup. User gain state remains in `omarchy/asahi-mic-gain.json` under XDG_STATE_HOME. The desktop saves that state before restarting audio.

Expand Down Expand Up @@ -41,10 +41,14 @@ Vendor defaults use NetworkManager's `/usr/lib/NetworkManager/conf.d`, systemd's

## Video decode in mpv

mpv has no vendor configuration directory and decodes in software unless told otherwise. The package ships its Apple default as `/usr/share/omarchy-mac/mpv/mpv.conf` and a systemd-tmpfiles rule that copies it to `/etc/mpv/mpv.conf` only when that file is missing. pacman's systemd hook applies the rule when the package is installed or upgraded, and boot applies it again. An existing `/etc/mpv/mpv.conf` is never overwritten, so edit it rather than delete it to change the system default; each user's `~/.config/mpv/mpv.conf` is read after it and wins, and `hwdec=no` there decodes in software.
mpv has no vendor configuration directory and decodes in software unless told otherwise. The package ships its Apple default as `/usr/share/omarchy-mac/mpv/mpv.conf` and a systemd-tmpfiles rule that copies it to `/etc/mpv/mpv.conf` only when that file is missing. pacman's systemd hook applies the rule when the package is installed or upgraded, and boot applies it again. An existing `/etc/mpv/mpv.conf` is never overwritten, with one exception: `omarchy-mac-setup-system` replaces a regular file byte-identical to the copy omarchy-mac 0.2.2 and earlier made, which lacks `gpu-sw=yes`, with the current default, and leaves an edited copy or a link alone. An upgrade alone does not apply this, because neither `omarchy update` nor a pacman upgrade runs setup: run `sudo omarchy-mac-setup-system`, or rerun hardware setup, to apply it. So edit it rather than delete it to change the system default; each user's `~/.config/mpv/mpv.conf` is read after it and wins, and `hwdec=no` there decodes in software.

The default decodes H.264, HEVC and VP9 on the Apple Video Decoder with copy-back (`hwdec=vaapi-copy`, `hwdec-codecs=h264,hevc,vp9`) and draws with the OpenGL renderer (`vo=gpu`, `gpu-api=opengl`). On an M2 Max, copy-back is bit-exact against software decoding, and 1080p playback falls from about 55% to 13% of a core. Zero-copy (`hwdec=vaapi`) is not used: Asahi's Vulkan driver reads the imported chroma plane from the wrong offset, so gpu-next shows green frames, and `libva-v4l2_request` invalidates the frames of a decoder it closes, which copy-back has already copied out. gpu-next also costs about three times the CPU of OpenGL to upload copied frames. `libva-v4l2_request-avd` and `avd-fw` provide the decoder; without them mpv falls back to software.

On a Mac whose GPU has no driver yet, such as the M3 Max, the only OpenGL renderer is Mesa's software one: llvmpipe, or softpipe where Mesa is built without LLVM. mpv rejects a software renderer while probing, and mpv 0.41 then aborts with `vo_x11_init: Assertion '!vo->x11' failed`: its Wayland context does not clean up after a failed init, and the X11 context it tries next asserts on the leftover (fixed upstream in mpv-player/mpv@a58dd8ac41, not yet in a release). `gpu-sw=yes` lets mpv draw on llvmpipe or softpipe there instead. It changes nothing where the context mpv picks has a hardware renderer.

On an M3 Max, llvmpipe plays video but cannot keep up with it. These figures assume a Mesa built with LLVM (Arch's 26.2.3). Fullscreen on the 3456×2160 panel with mpv 0.41.0, 30-second 30 fps clips cost about 10.7 cores and drop 350 of 900 frames at 1080p H.264, and about 12 cores with 526 dropped at 4K H.264 or HEVC. Decoding goes to software: without a GPU render node libva cannot name its driver, so `vaapi-copy` fails over. Forced with `LIBVA_DRIVER_NAME=v4l2_request`, AVD decodes all three, and decoding alone falls from 0.23 to 0.08 of a core at 1080p H.264 and from 1.1 to 0.24 at 4K HEVC, but as many frames drop, because drawing is the cost. Current mesa-aurora is built without LLVM, so until omacom/omarchy-pkgs#1474 is resolved such a Mac gets softpipe, which draws a fraction of a frame per second: on a 13" M3 Air, about 0.2 fps at 1080p and 720p. mpv still plays rather than aborting.

## Battery charge limit

`omarchy battery charge limit [80|100]` shows or sets the `macsmc-battery` charge thresholds and refuses unless `omarchy-hw-apple-silicon` holds. It writes only the end threshold through `sudo`, since the driver derives the start threshold (80 restarts charging at 75; 100 restores full charging), and checks the SMC's readback. Full charging stays the default.
Expand Down
14 changes: 14 additions & 0 deletions omarchy-mac/bin/omarchy-mac-setup-system
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ elif [[ -f $brcmfmac ]] && grep -Fxq -- "$quirk" "$brcmfmac"; then
echo "Removed the Intel Mac Broadcom quirk from $brcmfmac; it stops applying at the next reboot"
fi

# The mpv default up to 0.2.2 lacks gpu-sw, so mpv aborts where the GPU has no
# driver, and tmpfiles never replaces the copy it made. Only a regular file
# byte-identical to that copy takes the new default; edits and links stay.
mpv="$root/etc/mpv/mpv.conf"
released_mpv_sum=9e186dd88be483b3666795b805e780921adecd1051ae85986857c22152a2d818
if [[ -f $mpv && ! -L $mpv ]] && [[ $(sha256sum <"$mpv") == "$released_mpv_sum -" ]]; then
updated=$(mktemp "$root/etc/mpv/.mpv.conf.XXXXXX")
cp -- "$root/usr/share/omarchy-mac/mpv/mpv.conf" "$updated" || { rm -f -- "$updated"; exit 1; }
chown --reference="$mpv" "$updated"
chmod --reference="$mpv" "$updated"
mv -- "$updated" "$mpv"
echo "Updated $mpv to the current omarchy-mac default, which lets mpv draw in software where the GPU has no driver"
fi

unit=omarchy-wifi-resume-fix.service
marker="$root/var/lib/omarchy-mac/wifi-configured"
if "$root/usr/lib/omarchy-mac/wifi-supported" && [[ ! -f $marker ]]; then
Expand Down
12 changes: 9 additions & 3 deletions omarchy-mac/share/omarchy-mac/mpv/mpv.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
# the copied frames for about a third of the CPU gpu-next needs here.
#
# systemd-tmpfiles copies this file from /usr/share/omarchy-mac/mpv/mpv.conf when
# /etc/mpv/mpv.conf is missing, and never overwrites it. Your own
# ~/.config/mpv/mpv.conf is read after it and wins: hwdec=no decodes in software,
# vo=gpu-next with gpu-api=auto restores mpv's default renderer.
# /etc/mpv/mpv.conf is missing, and never overwrites it. The one exception:
# omarchy-mac-setup-system replaces an unedited copy from omarchy-mac 0.2.2 or
# earlier with this one. Your own ~/.config/mpv/mpv.conf is read after it and
# wins: hwdec=no decodes in software, vo=gpu-next with gpu-api=auto restores
# mpv's default renderer.
hwdec=vaapi-copy
hwdec-codecs=h264,hevc,vp9
vo=gpu
gpu-api=opengl
# A Mac whose GPU has no driver yet renders on llvmpipe or softpipe; mpv 0.41
# rejects either and then aborts in its X11 fallback. Where the context mpv
# picks has a hardware renderer, this changes nothing.
gpu-sw=yes
Loading
Loading