Install the Apple Video Decoder stack on Apple Silicon - #298
Conversation
Adds install/hardware/apple/video-decode.sh, which installs avd-fw and libva-v4l2_request-avd from the omarchy-aarch64 repo. The kernel already ships the apple-avd driver and it autoprobes, but no distro packages its firmware, so the decoder sits idle on every boot. On the stock kernel this gives HEVC and VP9 hardware decode, both bit-exact against libavcodec. H.264 needs three driver fixes going upstream separately; without them it falls back to software and the rest still works. Roughly 84% less decode CPU time; the battery saving is a more modest ~0.2 W of ~7.8 W. The leaf is a no-op on non-Apple-Silicon hardware and warns rather than fails if the packages are unavailable, since hardware setup runs under set -e and video decoding in software is a degradation rather than a broken install. Includes a migration so existing installs pick it up, and a shell test alongside the asahi-audio one. Depends on omarchy-mac/omarchy-pkgs-aarch64#3, which adds the packages; this cannot merge until those are published.
scottjones
left a comment
There was a problem hiding this comment.
This is in good shape. I checked the sourcing semantics rather than trusting them: run_logged runs leaves as bash -eE -c 'source "$1"', so the top-level return 0 gates work, and omarchy-migrate runs each migration as bash -euo pipefail "$file", so the exit 0 in the migration is fine too. apple-video-decode-test.sh passes and is a real test — it drives both the leaf and the migration through stubbed package helpers, including idempotency and the x86 and non-Apple skips.
Approving. It lands once omarchy-mac/omarchy-pkgs-aarch64#3 publishes; until then the leaf just warns, which is the behaviour you designed for.
Two nits, neither blocking:
nit: the header comment runs about thirty lines. The rationale is great, but it belongs in the commit message; three or four lines in the file is plenty.
nit: when omarchy-pkg-add fails you print two warnings, one from the || and one from the omarchy-pkg-present check below it. One is enough.
suggestion (follow-up, not for this PR): #331 is adding omarchy-hw-apple-silicon; once it lands, the uname plus device-tree gate here and in audio.sh can collapse onto that helper.
|
Field report from an M2 Max ( 1. The gate is broader than the hardware that can use itThe leaf gates on So the packages are inert here. Harmless, but the comment in the leaf — "The kernel already has the driver: CONFIG_VIDEO_APPLE_AVD=m, and it autoloads and autoprobes on its own" — holds on the M1 this was tested on, not on t6021. Gating on an actual AVD device rather than on Apple hardware would install it only where it can work. Something like a DT check for a node whose compatible ends in 2. It triggers a visible mkinitcpio failure on ISO-installed hosts
The failure is cosmetically alarming and functionally harmless: the booted initramfs is the static The underlying fault is the orphan preset rather than anything here — it also explains why the initramfs on ISO installs hasn't regenerated since install day. Worth fixing installer-side, and worth knowing that this migration is what surfaces it. |
Adds an install leaf that pulls in the Apple Video Decoder packages on Apple
Silicon, plus a migration so existing installs get it and a shell test alongside
the asahi-audio one.
Without this the kernel's
apple-avddriver fails to probe on every boot forwant of firmware, and video decodes in software. With it, HEVC and VP9 decode on
the hardware — including in Chromium, which reaches the decoder through V4L2 once
the firmware exists. H.264 still falls back to software; that's a Chromium
limitation I'm chasing separately.
The leaf is a no-op on non-Apple hardware and warns rather than fails if the
packages aren't available, since hardware setup runs under
set -eand softwaredecode is a degradation rather than a broken install.
Depends on omarchy-mac/omarchy-pkgs-aarch64#3 — that has to land and publish
first or the leaf just warns.