fp6-img/aports/device/soc-fairphone-fp6-audio/APKBUILD
Jorijn van der Graaf 01ee20ddba
aports: extract vendor blobs before udev coldplug so first-boot audio fully works
The preset fix (6ecc1dc) makes the unit run, but multi-user is too late: the
sound card probes at ~21 s, hard-fails (-2, no retry) on the missing ACF, and
the extractor's amp rebind at ~60 s cannot re-form a card whose machine
driver already failed. Re-probing the machine driver does re-form it, but a
late-formed card has a dead capture path - the wcd9378 TX sequencer refuses
PS0 (act_ps 0x3) until the next boot. So rebinding after the fact can never
fully win; extraction has to happen before the drivers probe.

- fp6-vendor-blobs.service: DefaultDependencies=no, run after remount-fs and
  before systemd-udev-trigger, so blobs exist before module coldplug.
  multi-user stays a second Wants as a post-udev retry if the early run
  failed (by-partlabel/make-dynpart-mappings fallbacks need udev).
- aw88261-acf.manifest: add 'rebind platform sound' so the fallback path at
  least recovers playback the same boot (capture then heals on reboot).
- fp6-vendor-blobs.post-upgrade (pkgrel 1): systemctl preset + immediate
  extract, so installs of the 2026-08-24 image (unit shipped disabled, no
  version bump to deliver the preset) finally heal via plain apk upgrade.
- soc-fairphone-fp6-audio pkgrel 1: carries the manifest change.

Verified on the dev phone with the exact staged bytes (sha256-compared):
simulated fresh install (ACF removed, reboot) extracts at 13.3 s, coldplug
probes the amps at 15.1 s, card init at 20.9 s loads the ACF cleanly, and a
1 kHz speaker-to-mic loopback passes on that same first boot with zero TX
sequencer warnings; next boot takes the all-dests-present fast path in 25 ms.
Evidence: fp6 repo journal/blobs/, 2026-08-29.

Assisted-by: Claude:claude-fable-5
2026-09-15 22:36:12 +02:00

54 lines
2.7 KiB
Text

# Audio userspace files for the Fairphone 6 that no upstream package ships
# yet: the AudioReach topology (built from Catcrafts/audioreach-topology
# branch fp6), the UCM profile, and pipewire config. Files are
# byte-identical to the ones deployed and tested on the development FP6.
# The tplg/UCM target filenames contain spaces, hence the safe source names.
#
# The proprietary AW88261 amp config blob (aw88261_acf.bin) is NOT shipped
# since pkgver 4: fp6-vendor-blobs extracts it from the stock vendor
# partition on-device (manifest fragment below), so nothing proprietary is
# distributed. Provenance/design: fp6 repo journal/blobs/.
maintainer="Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>"
pkgname=soc-fairphone-fp6-audio
pkgver=4
pkgrel=1
pkgdesc="Fairphone 6 audio topology and UCM profile"
url="https://forgejo.catcrafts.net/Catcrafts/audioreach-topology"
arch="noarch"
license="BSD-3-Clause"
depends="fp6-vendor-blobs"
install="$pkgname.post-install $pkgname.post-upgrade"
options="!check"
source="
fp6-tplg.bin
aw88261-acf.manifest
ucm-milos-fp6.conf
HiFi.conf
50-echo-cancel.conf
"
package() {
install -Dm644 "$srcdir"/fp6-tplg.bin \
"$pkgdir/usr/lib/firmware/qcom/milos/Fairphone (Gen. 6)-tplg.bin"
install -Dm644 "$srcdir"/aw88261-acf.manifest \
"$pkgdir"/usr/share/fp6-vendor-blobs/manifest.d/10-aw88261-acf.manifest
install -Dm644 "$srcdir"/ucm-milos-fp6.conf \
"$pkgdir/usr/share/alsa/ucm2/conf.d/milos/Fairphone (Gen. 6).conf"
install -Dm644 "$srcdir"/HiFi.conf \
"$pkgdir"/usr/share/alsa/ucm2/Fairphone/fp6/HiFi.conf
# NOTE deliberately NO wireplumber fragment: the old dev-phone's
# 51-fp6-ucm.conf (api.alsa.use-acp=false) kills node creation outright
# on a virgin wireplumber state - ACP reads the UCM verbs natively and
# produces correct ports (verified 2026-08-09 on a from-scratch install).
# AEC pair (ec_sink/ec_source) for VoLTE speakerphone calls
install -Dm644 "$srcdir"/50-echo-cancel.conf \
"$pkgdir"/etc/pipewire/pipewire.conf.d/50-echo-cancel.conf
}
sha512sums="
51071c574b9f5899c78ba9fe1b6f3bbda2195e6d274014a05869ae56ed0ff18e15678bd7d78cd68846900d3c579556328e229842152cffd943186d43344ed33c fp6-tplg.bin
0240a36e6fae76f6df576c5ffc93241f6d59e03db429811d61c746561743ddb4690cb925028546a6c3d69dcc867aead5ddf1c85b12a0065195ea9c6621fa847f aw88261-acf.manifest
3bb268f9fcb8d1c0b42741b67da42b6361bab259e7211d9930919995ebe7dcf67826e6d4f00ff5e4fe5b52067fe90d00212158c3b4879d1bee481e87f0623206 ucm-milos-fp6.conf
2a189c3141fedc43f8eb19f4df1e43487223d524e27da3f948556d224cca1f493f6815ada191953fb79a19d5c5abadb21de7b3ece7b74b0929338c216e21e84a HiFi.conf
ec63fa5363738a43c9eee4b1be70201e2d2076ec817031fda087e61d781e81dc67351be44faf8b056a2939875a139cd909f7c311115bb1150e17ad4493846606 50-echo-cancel.conf
"