From 46af49cb14205c227b13f3388f7335aa79f8d400 Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Tue, 27 Oct 2026 12:07:18 +0000 Subject: [PATCH 1/3] omamobile-audio 0.5.14: the microphones without speaker protection The AoC sound card waits for both CS35L41 amplifiers as codecs, so while their driver stays blacklisted (no validated speaker limits, as on raven, or protection not yet enabled) there are no microphones either. omamobile-speaker-protection mics loads the driver and mutes both amplifiers, as start does before anything else, and stops there: no DSP firmware, no unmute, the same hang marker. omamobile-audio-mics.service runs it; this package enables nothing, a device package does. The unit conflicts with speaker protection and doesn't run once that is enabled. Co-Authored-By: Claude Opus 5.5 --- packages/omamobile-audio/README.md | 1 + .../bin/omamobile-speaker-protection | 38 ++++++++++++++++++- packages/omamobile-audio/install | 1 + .../systemd/omamobile-audio-mics.service | 28 ++++++++++++++ packages/omamobile-audio/test/all | 29 +++++++++++++- packages/omamobile-audio/version | 2 +- 6 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 packages/omamobile-audio/systemd/omamobile-audio-mics.service diff --git a/packages/omamobile-audio/README.md b/packages/omamobile-audio/README.md index c765f7665..422e56aee 100644 --- a/packages/omamobile-audio/README.md +++ b/packages/omamobile-audio/README.md @@ -10,6 +10,7 @@ protection firmware and the phone's factory calibration, as stock Android does. | File | What | |---|---| | `omamobile-speaker-protection` + `.service` (system, **not enabled by the package**) | loads the amplifier driver (or, when it is already bound, rebinds both amplifiers: a chip reset, so `systemctl restart` recovers a stuck DSP), mutes both at once, holds them out of runtime suspend (hibernation breaks the stock firmware), checks the kernel's volume limits, the stage's ceilings, the firmware and the factory calibration (`persist:/audio/speaker.cal` via debugfs, read-only), loads the protection firmware, writes `CAL_*` into both DSPs and reads it back, routes the DAC through the DSP, checks health (held awake, DSP controls present, no amplifier error in the kernel log), and only then unmutes. Any failure leaves both muted; a hang marker keeps the driver alone on the next boot. `status`, `health`, `monitor` and `verify` read the DSPs' state (coil temperature, CSPL state and errors, heartbeat), never the calibration values; `impedance` (during playback) reads the coil impedance the firmware measures, as a ratio to the factory value; `feedback start|stop|status` runs the amplifiers' VMON/IMON stream to the AoC as stock does (AOC-PLAN C9d-7); `mute` mutes | +| `omamobile-audio-mics.service` (system, **not enabled by the package**) | the microphones without speaker protection: `omamobile-speaker-protection mics` loads the amplifier driver (the card waits for both amplifiers as codecs, so without it there are no microphones either) and mutes both, with no DSP firmware and no unmute, so the speakers stay silent. For a phone whose speaker limits aren't validated; a device package enables it (omamobile-device-raven). It doesn't run once `omamobile-speaker-protection` is enabled, which then owns the amplifiers; same hang marker | | `omamobile-speaker-watch.service` | started with it and bound to it: mutes both amplifiers on an amplifier error in the kernel log (CSPL error, failed wake, failed resume), an amplifier no longer held awake, a level above the ceilings, or, during playback, a DSP not running the protection firmware with the calibration applied, a coil estimate above 80 C, or (stage c9 only, the stage whose analog ceiling is above 10; since 0.5.3) one that rises more than 5 C within a stream; mutes too when it stops. Writes stock's media delta at stream start; with `OMAMOBILE_SPK_FEEDBACK=1` runs the V/I feedback stream with every speaker stream | | `udev.rules` | holds the amplifiers awake from the moment the driver binds | | `verified-firmware` (`/usr/share/omamobile-audio/`, 0.5.10) | the speaker protection firmware verified on the reference phone: one `SYSTEM DIGEST NOTE` line per firmware, the digest over Google's protection firmware and both tunings that a C9a stamp records (`omamobile-speaker-protection digest` prints the installed one as such a line). Stage auto runs c9 on a phone with `speaker_protection=1` when **this phone's own stamp** matches the firmware, or when the firmware's digest is **in this list**, so a fresh install (the stamp lives on `userdata` and is lost on every install) gets the louder levels too; media otherwise. The start logs which ("stage c9 chosen by the verified firmware list" or "by this phone's stamp"), and so does `status`. A listed digest means the same files byte for byte, not the same phone: on c9 from the list the watchdog checks this phone at its first speaker stream after each start, about 3 s in (CSPL_ENABLE 1 on both, the model on the resistance written from this phone's persist, the heartbeat moving, both coil estimates within 10-65 C); c9 from the list is capped at the levels verified with music (817, analog top 11, bottom 14: a configured level above is lowered, with a log line, and the watchdog holds the same ceilings; 17 needs this phone's own stamp). A failure mutes, records the firmware in `/var/lib/omamobile/speaker-protection-c9-refused` (a coil estimate out of the band alone, or a `/var/lib` that can't be written: in `/run/omamobile/` for this boot only; if neither can be written it stays muted, without a restart) and restarts the service, which then picks media. The list's path and the check's band are fixed outside the tests. The phone's own stamp (an attended `verify`) wins over a refusal. It lists the reference phone's firmware from factory image cp2a.260705.006 (C9a verify 2026-11-02; AOC-PLAN, "C9 for every phone with verified firmware") | diff --git a/packages/omamobile-audio/bin/omamobile-speaker-protection b/packages/omamobile-audio/bin/omamobile-speaker-protection index 0b7be9398..ff62a716c 100755 --- a/packages/omamobile-audio/bin/omamobile-speaker-protection +++ b/packages/omamobile-audio/bin/omamobile-speaker-protection @@ -39,6 +39,10 @@ # here, the next one finds it, leaves the amplifier driver alone and fails. # # omamobile-speaker-protection start [--retry] (the service) +# omamobile-speaker-protection mics [--retry] (omamobile-audio-mics.service) +# the microphones without protection: steps 1 and 2 +# only, so the card (which waits for both amplifiers) +# comes up and both stay muted; the speakers are silent # omamobile-speaker-protection watch (omamobile-speaker-watch.service) # omamobile-speaker-protection status | monitor [SECONDS] | health # omamobile-speaker-protection verify (during playback; C9a) @@ -638,6 +642,35 @@ set_status_ok() { } # Read-only report. Prints the DSP state but never the calibration values. +# The microphones without the speakers. The AoC sound card waits for both +# amplifiers as codecs, so with their driver unloaded there are no microphones +# either. Load the driver and mute both, as start does before anything else, +# and stop there: no DSP firmware, no unmute. Hang-safe through the same marker. +mics() { + local i + if [[ -e $marker ]]; then + log "the last start ($(cat "$marker" 2>/dev/null)) never finished; the amplifiers stay off this boot." + log "after checking the previous boot's log, retry with: omamobile-speaker-protection mics --retry" + find_card && mute + set_status "off: the last start never finished" + exit 1 + fi + mkdir -p "$STATE" + date -Is > "$marker" + sync -f "$marker" 2>/dev/null || sync + if compgen -G "$SPIDRV/spi*" >/dev/null; then + find_card && mute + else + modprobe snd_soc_cs35l41_spi || fail "snd_soc_cs35l41_spi failed to load" + fi + for ((i = 0; i < CARD_WAIT * 5; i++)); do find_card && break; sleep 0.2; done + find_card || fail "no AoC sound card after ${CARD_WAIT} s (both amplifiers probed? the AoC up?)" + mute || fail "muting failed" + finish + set_status "muted: microphones only, speakers off (no protection)" + log "AoC sound card $card: microphones only, both amplifiers muted (no speaker protection)" +} + status() { local p i c v name d cat "$status_file" 2>/dev/null || echo "no state ($status_file)" @@ -924,6 +957,9 @@ case ${1:-} in start|restart|recover) [[ ${2:-} == --retry ]] && rm -f "$marker" start ;; + mics) + [[ ${2:-} == --retry ]] && rm -f "$marker" + mics ;; watch) find_card || { log "watchdog: no AoC sound card"; exit 1; }; dsp --card "$card" watch ;; status) status ;; earpiece) earpiece "${2:-}" ;; @@ -950,7 +986,7 @@ case ${1:-} in exit 1 fi ;; *) - echo "Usage: omamobile-speaker-protection start [--retry] | watch | status | health | monitor [SECONDS [INTERVAL]]" >&2 + echo "Usage: omamobile-speaker-protection start [--retry] | mics [--retry] | watch | status | health | monitor [SECONDS [INTERVAL]]" >&2 echo " | earpiece on|off|status (the top amplifier alone as the earpiece, AOC-PLAN C9k)" >&2 echo " | digest (the installed firmware's digest, as a line of the verified list)" >&2 echo " | verify | signal tone|multitone FILE [--level DBFS --seconds S --channels both|left|right] | mute [--reason TEXT]" >&2 diff --git a/packages/omamobile-audio/install b/packages/omamobile-audio/install index 165e4f4f6..05ea84638 100755 --- a/packages/omamobile-audio/install +++ b/packages/omamobile-audio/install @@ -12,6 +12,7 @@ install -Dm644 systemd/omamobile-speaker-protection.service "$d/usr/lib/systemd/ install -Dm644 systemd/omamobile-speaker-watch.service "$d/usr/lib/systemd/system/omamobile-speaker-watch.service" install -Dm644 systemd/omamobile-earpiece@.service "$d/usr/lib/systemd/system/omamobile-earpiece@.service" install -Dm644 polkit/50-omamobile-earpiece.rules "$d/usr/share/polkit-1/rules.d/50-omamobile-earpiece.rules" +install -Dm644 systemd/omamobile-audio-mics.service "$d/usr/lib/systemd/system/omamobile-audio-mics.service" install -Dm644 lib/speaker_dsp.py "$d/usr/lib/omamobile-audio/speaker_dsp.py" install -Dm644 lib/speaker_response.py "$d/usr/lib/omamobile-audio/speaker_response.py" install -Dm644 verified-firmware "$d/usr/share/omamobile-audio/verified-firmware" diff --git a/packages/omamobile-audio/systemd/omamobile-audio-mics.service b/packages/omamobile-audio/systemd/omamobile-audio-mics.service new file mode 100644 index 000000000..758071929 --- /dev/null +++ b/packages/omamobile-audio/systemd/omamobile-audio-mics.service @@ -0,0 +1,28 @@ +# SPDX-License-Identifier: MIT +# The AoC microphones without speaker protection. The sound card waits for +# both CS35L41 amplifiers as codecs, so with their driver blacklisted there +# are no microphones either. This loads the driver and keeps both amplifiers +# muted (Digital PCM Volume 0, no DSP firmware): the microphones work, the +# speakers stay silent. For a phone whose speaker limits aren't validated +# (raven: device/raven/AUDIO-PLAN.md). Not enabled by this package: a device +# package enables it. Once omamobile-speaker-protection is enabled, it owns the +# amplifiers and this one doesn't run. Hang-safe through the same marker. +[Unit] +Description=AoC microphones with both speaker amplifiers muted (no speaker protection) +Requires=omamobile-aoc.service +After=omamobile-aoc.service +Before=systemd-user-sessions.service +Conflicts=omamobile-speaker-protection.service +ConditionPathExists=!/etc/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service +ConditionPathExists=|/sys/bus/platform/devices/181d0000.aoc +ConditionPathExists=|/sys/bus/platform/devices/175d0000.aoc + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/omamobile-speaker-protection mics +ExecStop=/usr/bin/omamobile-speaker-protection mute --reason "microphones service stopped" +TimeoutStartSec=60 + +[Install] +WantedBy=multi-user.target diff --git a/packages/omamobile-audio/test/all b/packages/omamobile-audio/test/all index 7d7efc9a6..62403a83b 100755 --- a/packages/omamobile-audio/test/all +++ b/packages/omamobile-audio/test/all @@ -339,6 +339,33 @@ rc=0; prep=(OMAMOBILE_ASOUND=$r/none); sp start > "$r/out" 2>&1 || rc=$?; prep=( [[ -e $r/state/speaker-protection-started ]] || fail "marker: kept for the human" pass "a hang marker from the last boot keeps the amplifiers off" +# --- microphones only: the driver for the card, both amplifiers muted, nothing else +mktree mics; rc=0; sp mics > "$r/out" 2>&1 || rc=$? +((rc == 0)) || { cat "$r/out" >&2; fail "mics succeeds"; } +grep -c '^snd_soc_cs35l41_spi$' "$r/modprobe.log" >/dev/null || fail "mics: loads the amplifier driver" +muted || fail "mics: both amplifiers muted" +[[ -z $(grep -v 'Digital PCM Volume=0$' "$r/cset.log") ]] || fail "mics: sets nothing but the mute (no DSP, no source, no unmute)" +[[ ! -e $r/state/speaker-protection-started ]] || fail "mics: removes the hang marker" +[[ $(cat "$r/run/speaker-protection") == "muted: microphones only"* ]] || fail "mics: status says microphones only" +pass "mics: the amplifier driver loaded, both amplifiers muted, nothing else set" + +mktree mics-nocard; rc=0; prep=(OMAMOBILE_ASOUND=$r/none); sp mics > "$r/out" 2>&1 || rc=$?; prep=() +((rc == 1)) || fail "mics without a card fails" +[[ ! -e $r/state/speaker-protection-started ]] || fail "mics without a card: marker removed after a clean failure" +mktree mics-marker; echo 2026-01-01T00:00:00 > "$r/state/speaker-protection-started" +rc=0; prep=(OMAMOBILE_ASOUND=$r/none); sp mics > "$r/out" 2>&1 || rc=$?; prep=() +((rc == 1)) && [[ ! -e $r/modprobe.log && -e $r/state/speaker-protection-started ]] || fail "mics: a hang marker keeps the driver unloaded" +rc=0; sp mics --retry > "$r/out" 2>&1 || rc=$? +((rc == 0)) && muted || fail "mics --retry clears the marker and comes up muted" +pass "mics: fails cleanly without a card, honours the hang marker, --retry clears it" + +u=systemd/omamobile-audio-mics.service +grep -qx 'Conflicts=omamobile-speaker-protection.service' $u || fail "the mics unit conflicts with protection" +grep -qx 'ConditionPathExists=!/etc/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service' $u || fail "the mics unit stands down once protection is enabled" +grep -qx 'ConditionPathExists=|/sys/bus/platform/devices/175d0000.aoc' $u && grep -qx 'ConditionPathExists=|/sys/bus/platform/devices/181d0000.aoc' $u || fail "the mics unit runs on gs101 and gs201 AoCs" +grep -qx 'ExecStart=/usr/bin/omamobile-speaker-protection mics' $u || fail "the mics unit runs mics" +pass "the mics unit: never with protection, on both AoCs" + # --- the watchdog ---------------------------------------------------------------- watchrun() { # run the watchdog briefly on a healthy started tree, with the events of at() prep=(OMAMOBILE_WATCH_INTERVAL=0.05 OMAMOBILE_WATCH_GRACE=0.1 OMAMOBILE_WATCH_HB_TIMEOUT=0.3 @@ -1128,7 +1155,7 @@ pass "follow: the speakers' left and right from the sensor proxy's orientation" # --- install --------------------------------------------------------------------- ./install "$tmp/root" for f in usr/bin/omamobile-speaker-protection usr/lib/systemd/system/omamobile-speaker-protection.service \ - usr/lib/systemd/system/omamobile-speaker-watch.service usr/lib/omamobile-audio/speaker_dsp.py \ + usr/lib/systemd/system/omamobile-speaker-watch.service usr/lib/systemd/system/omamobile-audio-mics.service usr/lib/omamobile-audio/speaker_dsp.py \ usr/lib/udev/rules.d/70-omamobile-cs35l41.rules \ usr/lib/modprobe.d/omamobile-audio.conf etc/omamobile/speaker.conf \ usr/share/alsa/ucm2/conf.d/aoc-snd-card/aoc-snd-card.conf usr/share/alsa/ucm2/Google/cheetah/HiFi.conf \ diff --git a/packages/omamobile-audio/version b/packages/omamobile-audio/version index 964783a81..83ac1cc02 100644 --- a/packages/omamobile-audio/version +++ b/packages/omamobile-audio/version @@ -1 +1 @@ -0.5.13 +0.5.14 From cc440035d5c74f651cfa3a7ee0b30dde683d7d76 Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Tue, 27 Oct 2026 12:07:18 +0000 Subject: [PATCH 2/3] device-raven 0.1.31: the microphones at boot, speakers muted Enables omamobile-audio-mics.service (omamobile-audio 0.5.14), so raven's microphones work while speaker protection stays off. Checked on raven after a reboot: the card up, both amplifiers at Digital PCM Volume 0, the microphone at -64.5 dBFS in a quiet room and -48 to -56 dBFS with speech. AUDIO-PLAN has the run; the matrix row says microphones only. Co-Authored-By: Claude Opus 5.5 --- device/raven/AUDIO-PLAN.md | 17 +++++++++++++++++ device/raven/device.conf | 10 ++++++---- docs/DEVICES.md | 2 +- packages/omamobile-device-raven/README.md | 1 + packages/omamobile-device-raven/test/all | 6 ++++++ .../omamobile-audio-mics.service | 1 + packages/omamobile-device-raven/version | 2 +- 7 files changed, 33 insertions(+), 6 deletions(-) create mode 120000 packages/omamobile-device-raven/vendor/systemd/system/multi-user.target.wants/omamobile-audio-mics.service diff --git a/device/raven/AUDIO-PLAN.md b/device/raven/AUDIO-PLAN.md index 77fdaa449..c159d612d 100644 --- a/device/raven/AUDIO-PLAN.md +++ b/device/raven/AUDIO-PLAN.md @@ -423,3 +423,20 @@ clash Derek pointed out. Ways forward, not decided: give the card a speaker-less link set when the amplifiers are absent, or load the amplifier driver muted with no protection firmware, so the card and the microphones come up while the speakers stay off. + +**Microphones without protection (2026-10-27, `gb3d6253b0d61`, +omamobile-audio 0.5.3, device-raven 0.1.25; branch +`omamobile-raven-mics`):** the second way. `omamobile-speaker-protection +mics` (run by `omamobile-audio-mics.service`, which device-raven enables) +loads `snd_soc_cs35l41_spi` and mutes both amplifiers, as `start` does +before anything else, and stops there: no DSP firmware, no unmute. The +unit doesn't run once speaker protection is enabled, and uses the same +hang marker. On raven, after a reboot: the unit finished at 12:01:45, the +card came up, both amplifiers read `Digital PCM Volume` 0, speaker +protection inactive, and PipeWire's default source was "Built-in Audio +Microphone". A 4 s recording in a quiet room read -64.5 dBFS RMS (not +digital silence); with the human counting out loud, -48 to -56 dBFS per +half second, falling to about -71 dBFS between words. So the microphones +work with the speakers muted. Not tested: a call (the modem doesn't start +at boot with this package set), and the speaker sink, which PipeWire still +lists but which plays into muted amplifiers. diff --git a/device/raven/device.conf b/device/raven/device.conf index 648a756b9..81be1df0a 100644 --- a/device/raven/device.conf +++ b/device/raven/device.conf @@ -15,10 +15,12 @@ SOC=gs101 COMPATIBLE="google,gs101-raven" PACKAGE=omamobile-device-raven # This phone's other packages in the root image, on top of the shared -# rootfs/packages.omamobile: the sensors through the AoC, and GNSS (off -# until `omamobile-gnss on`). Audio waits on the amplifiers' limits, the -# modem on its kernel. -ROOTFS_PACKAGES="omamobile-sensors omamobile-gnss" +# rootfs/packages.omamobile: the sensors through the AoC, GNSS (off until +# `omamobile-gnss on`), and the audio package for the microphones (its +# blacklist keeps the amplifiers' driver from loading on its own; device- +# raven's omamobile-audio-mics loads it muted). Speaker protection stays +# off until raven's limits are in a package; the modem waits on its kernel. +ROOTFS_PACKAGES="omamobile-sensors omamobile-gnss omamobile-audio" # --- Kernel and device tree --- DTB=exynos/google/gs101-raven.dtb diff --git a/docs/DEVICES.md b/docs/DEVICES.md index bf8ed50ab..26252952f 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -20,7 +20,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | Pixel 7 Pro | cheetah | gs201 (Tensor G2) | works | works | works (120 Hz) | works (DVFS) | works | works | works | works | works (audio) | works | works | works | works | works | works | works | works | works (calls, texts and mobile data on a Verizon-network SIM, 2026-11-03; see below) | works | works (telephoto fixed-focus) | WIP | works | | Pixel Fold | felix | gs201 (Tensor G2) | WIP ([#3](https://github.com/derekross/omarchy-mobile/issues/3)) | WIP (UFS behind the read-only guard, checked on the phone) | WIP (cover: simplefb console; inner: simpledrm output listed by Hyprland, its splash reserved by [kernel #72](https://github.com/derekross/linux-omarchy-mobile/pull/72); both panels' display triggers set by the descriptor, [#82](https://github.com/derekross/omarchy-mobile/pull/82)) | testing (Panthor; glmark2 on the cover, not up on every image yet; [notes](../device/felix/NOTES.md#2026-10-26-the-power-key-and-the-gpu-in-the-published-kernel)) | WIP (cover: chip id read, no touches yet; the driver's touch reports are merged, [kernel #48](https://github.com/derekross/linux-omarchy-mobile/pull/48), untested on the Fold; [notes](../device/felix/NOTES.md#2026-10-23-cover-touch-id)) | works (volume and power; [notes](../device/felix/NOTES.md#2026-10-26-the-power-key-and-the-gpu-in-the-published-kernel)) | works | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | -| Pixel 6 Pro ([notes](../device/raven/NOTES.md)) | raven | gs101 (Tensor) | works ([#2](https://github.com/derekross/omarchy-mobile/issues/2)) | works | works (120 Hz through gs-decon and the S6E3HC3 driver; unpublished kernel, `omamobile-gs101-display`, in review as [kernel #116](https://github.com/derekross/linux-omarchy-mobile/pull/116), [plan](../device/raven/DISPLAY-PLAN.md)); the published kernel has the boot console only | partial (Panfrost; DVFS on an unpublished kernel, [plan](../device/raven/GPU-PLAN.md)) | works ([kernel #8](https://github.com/derekross/linux-omarchy-mobile/pull/8)) | works | works (a NOT FOR MERGE DT change; [plan](../device/raven/USB-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-wifi`; [plan](../device/raven/WIFI-PLAN.md)) | partial ([kernel #6](https://github.com/derekross/linux-omarchy-mobile/pull/6); own address; pairing untested; start-up after a warm reboot is [#77](https://github.com/derekross/omarchy-mobile/issues/77)) | works (the gauge; unpublished kernel) | works (the MAX77759 charger at stock's limits with its temperature guard, loaded at boot by device-raven 0.1.26; a full charge to 100 %; the battery node is in the published kernel, [kernel #112](https://github.com/derekross/linux-omarchy-mobile/pull/112), tested on an unpublished kernel; [plan](../device/raven/USB-PLAN.md#4-charging-the-max77759-charger-ravens-b3-after-cheetahs)) | works (CS40L25A through feedbackd, device-raven 0.1.27, with the phone's own firmware from `tools/extract-vendor-firmware -d raven`; the driver and node are merged, [kernel #114](https://github.com/derekross/linux-omarchy-mobile/pull/114); [plan](../device/raven/HAPTICS-TORCH-PLAN.md)) | works (tested on `omamobile-gs101-torch`; the LED's node is now in the published kernel, [kernel #113](https://github.com/derekross/linux-omarchy-mobile/pull/113), not yet run from it; [plan](../device/raven/HAPTICS-TORCH-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-gnss`; [plan](../device/raven/GNSS-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-aoc`; [plan](../device/raven/AUDIO-PLAN.md)) | no (the amplifiers stay off until raven's own limits are validated, and without them the card doesn't probe, so no mics either; [plan](../device/raven/AUDIO-PLAN.md#without-the-amplifiers-2026-10-27-gb3d6253b0d61-device-raven-0123)) | works (accelerometer, light, proximity, compass through the AoC; unpublished kernel) | WIP (calls, texts and data on an unpublished kernel, `omamobile-gs101-cpif`; the package doesn't enable it; [plan](../device/raven/MODEM-PLAN.md)) | no | no | no | no | +| Pixel 6 Pro ([notes](../device/raven/NOTES.md)) | raven | gs101 (Tensor) | works ([#2](https://github.com/derekross/omarchy-mobile/issues/2)) | works | works (120 Hz through gs-decon and the S6E3HC3 driver; unpublished kernel, `omamobile-gs101-display`, in review as [kernel #116](https://github.com/derekross/linux-omarchy-mobile/pull/116), [plan](../device/raven/DISPLAY-PLAN.md)); the published kernel has the boot console only | partial (Panfrost; DVFS on an unpublished kernel, [plan](../device/raven/GPU-PLAN.md)) | works ([kernel #8](https://github.com/derekross/linux-omarchy-mobile/pull/8)) | works | works (a NOT FOR MERGE DT change; [plan](../device/raven/USB-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-wifi`; [plan](../device/raven/WIFI-PLAN.md)) | partial ([kernel #6](https://github.com/derekross/linux-omarchy-mobile/pull/6); own address; pairing untested; start-up after a warm reboot is [#77](https://github.com/derekross/omarchy-mobile/issues/77)) | works (the gauge; unpublished kernel) | works (the MAX77759 charger at stock's limits with its temperature guard, loaded at boot by device-raven 0.1.26; a full charge to 100 %; the battery node is in the published kernel, [kernel #112](https://github.com/derekross/linux-omarchy-mobile/pull/112), tested on an unpublished kernel; [plan](../device/raven/USB-PLAN.md#4-charging-the-max77759-charger-ravens-b3-after-cheetahs)) | works (CS40L25A through feedbackd, device-raven 0.1.27, with the phone's own firmware from `tools/extract-vendor-firmware -d raven`; the driver and node are merged, [kernel #114](https://github.com/derekross/linux-omarchy-mobile/pull/114); [plan](../device/raven/HAPTICS-TORCH-PLAN.md)) | works (tested on `omamobile-gs101-torch`; the LED's node is now in the published kernel, [kernel #113](https://github.com/derekross/linux-omarchy-mobile/pull/113), not yet run from it; [plan](../device/raven/HAPTICS-TORCH-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-gnss`; [plan](../device/raven/GNSS-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-aoc`; [plan](../device/raven/AUDIO-PLAN.md)) | partial (microphones only, speakers muted until raven's own limits are validated; unpublished kernel, `omamobile-gs101-aoc`; [plan](../device/raven/AUDIO-PLAN.md#without-the-amplifiers-2026-10-27-gb3d6253b0d61-device-raven-0123)) | works (accelerometer, light, proximity, compass through the AoC; unpublished kernel) | WIP (calls, texts and data on an unpublished kernel, `omamobile-gs101-cpif`; the package doesn't enable it; [plan](../device/raven/MODEM-PLAN.md)) | no | no | no | no | | Pixel 7a ([notes](../device/lynx/NOTES.md)) | lynx | gs201 (Tensor G2) | WIP ([#36](https://github.com/derekross/omarchy-mobile/issues/36): Arch root on `userdata` from slot B, SSH; the device package marks the slot successful) | WIP (UFS behind the read-only guard, in the published kernel, [kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91); [notes](../device/lynx/NOTES.md#2026-10-24-on-screen-console-and-ufs)) | WIP (simpledrm console only, [notes](../device/lynx/NOTES.md)) | no | WIP (GT9895 touches in the session, in the published kernel, [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93); [notes](../device/lynx/NOTES.md#2026-10-24-touchscreen-rtc-and-slot-retries)) | no | works | no (parked at the chip's boot ROM; [plan](../device/lynx/WIFI-PLAN.md)) | WIP (same chip as Wi-Fi; scans through its own UART; the device tree is in review, [kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98), and the package side, [#98](https://github.com/derekross/omarchy-mobile/pull/98); [plan](../device/lynx/WIFI-PLAN.md)) | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | diff --git a/packages/omamobile-device-raven/README.md b/packages/omamobile-device-raven/README.md index 1bfbfa964..a6eefac5c 100644 --- a/packages/omamobile-device-raven/README.md +++ b/packages/omamobile-device-raven/README.md @@ -17,6 +17,7 @@ the counterpart of `omamobile-device-cheetah`. Bring-up and results: | Sleep (s2idle) once locked with the panel off, behind `omarchy-toggle omamobile-sleep on` (the watcher, `omamobile-sleepd`, is omamobile-shell's); Wi-Fi stays connected across sleep (unloaded instead after a D3 failure, or with `/etc/omamobile/wifi-unload-for-sleep`) | `omamobile-sleep` (`system-sleep/omamobile`), `sleep.conf.d/10-omamobile.conf` | | Modem bring-up only: its PCIe driver and CPIF never load at boot, and the modem's units aren't enabled (as on main; `systemctl enable --now omamobile-modem omamobile-sitd` to use it, MODEM-PLAN) | `modprobe.d/omamobile-raven-modem.conf` | | Bluetooth on at boot; the session waits (at most 15 s) for the adapter | `bluetooth.service` (enabled), `sddm.service.d/`, `omamobile-wait-bluetooth` | +| The microphones at boot, with both speaker amplifiers muted (speaker protection stays off: its limits are cheetah's, AUDIO-PLAN) | `omamobile-audio-mics.service` from omamobile-audio 0.5.3 (enabled) | `reboot-to.c` and `omamobile-bootctl.c` are cheetah's, unchanged: both are the same on every gs101/gs201 Pixel (raven's `devinfo` is `DEVI` 3.15, as diff --git a/packages/omamobile-device-raven/test/all b/packages/omamobile-device-raven/test/all index 0203a74ee..4af4987ad 100755 --- a/packages/omamobile-device-raven/test/all +++ b/packages/omamobile-device-raven/test/all @@ -95,6 +95,12 @@ grep -q 'modprobe -r brcmfmac_wcc brcmfmac pcie_gs201' bin/omamobile-sleep || fa grep -q 'wifi_pci=0000:01:00.0' bin/omamobile-sleep || fail "a Wi-Fi D3 failure falls back to unload mode" pass "sleep policy" +[[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-audio-mics.service") == ../omamobile-audio-mics.service ]] \ + || fail "the microphones unit (omamobile-audio 0.5.14) is enabled by a vendor wants link" +[ ! -e vendor/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service ] \ + || fail "speaker protection is not enabled on raven (its limits are cheetah's)" +pass "the microphones come up with the speakers muted; protection stays off" + # Policy that keeps the phone safe at boot for m in tcpci_maxim gpio_max77759; do grep -qx "blacklist $m" vendor/modprobe.d/omamobile-raven.conf || fail "$m stays blacklisted" diff --git a/packages/omamobile-device-raven/vendor/systemd/system/multi-user.target.wants/omamobile-audio-mics.service b/packages/omamobile-device-raven/vendor/systemd/system/multi-user.target.wants/omamobile-audio-mics.service new file mode 120000 index 000000000..0c4f38901 --- /dev/null +++ b/packages/omamobile-device-raven/vendor/systemd/system/multi-user.target.wants/omamobile-audio-mics.service @@ -0,0 +1 @@ +../omamobile-audio-mics.service \ No newline at end of file diff --git a/packages/omamobile-device-raven/version b/packages/omamobile-device-raven/version index 013adb716..db7a48047 100644 --- a/packages/omamobile-device-raven/version +++ b/packages/omamobile-device-raven/version @@ -1 +1 @@ -0.1.30 +0.1.31 From 507f17aa31081e4f7e3d05e9e7c54b0ad2063040 Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Wed, 4 Nov 2026 07:23:59 +0000 Subject: [PATCH 3/3] omamobile-audio 0.5.14, device-raven 0.1.31: review fixes for the microphones Review on #400: - device-raven depends on omamobile-audio>=0.5.14 and blacklists snd_soc_cs35l41_spi itself, so a raven that updates gets the unit its wants link names, and the amplifier driver never autoloads unmuted whatever the audio package ships; mics and start still modprobe it. - mics waits for udev to settle (alsa-utils' restore runs when the card appears) before it mutes, then reads both amplifiers again a second later and fails, muting again, if either isn't at 0. - The unit also stands down when protection is enabled by a /usr/lib wants link (a device package, as #401 does), and is ordered before protection, so its mute on stop ends before protection starts. - mics() moved above the "Read-only report" comment that belongs to status(); device-raven's README names omamobile-audio 0.5.14. Co-Authored-By: Claude Opus 5.5 --- .../omamobile-audio/bin/omamobile-speaker-protection | 11 +++++++++-- .../systemd/omamobile-audio-mics.service | 5 ++++- packages/omamobile-audio/test/all | 2 ++ packages/omamobile-device-raven/PKGBUILD | 2 +- packages/omamobile-device-raven/README.md | 2 +- packages/omamobile-device-raven/test/all | 3 +++ .../vendor/modprobe.d/omamobile-raven.conf | 4 ++++ 7 files changed, 24 insertions(+), 5 deletions(-) diff --git a/packages/omamobile-audio/bin/omamobile-speaker-protection b/packages/omamobile-audio/bin/omamobile-speaker-protection index ff62a716c..cdcf90e4a 100755 --- a/packages/omamobile-audio/bin/omamobile-speaker-protection +++ b/packages/omamobile-audio/bin/omamobile-speaker-protection @@ -641,13 +641,12 @@ set_status_ok() { set_status "ok: stage $STAGE, protection firmware with factory calibration, PCM Source DSP, held awake, digital/analog $(levels_text), $(cat "$boost_file" 2>/dev/null)$(stage_from)" } -# Read-only report. Prints the DSP state but never the calibration values. # The microphones without the speakers. The AoC sound card waits for both # amplifiers as codecs, so with their driver unloaded there are no microphones # either. Load the driver and mute both, as start does before anything else, # and stop there: no DSP firmware, no unmute. Hang-safe through the same marker. mics() { - local i + local i p if [[ -e $marker ]]; then log "the last start ($(cat "$marker" 2>/dev/null)) never finished; the amplifiers stay off this boot." log "after checking the previous boot's log, retry with: omamobile-speaker-protection mics --retry" @@ -665,12 +664,20 @@ mics() { fi for ((i = 0; i < CARD_WAIT * 5; i++)); do find_card && break; sleep 0.2; done find_card || fail "no AoC sound card after ${CARD_WAIT} s (both amplifiers probed? the AoC up?)" + # alsa-utils restores the saved mixer state from udev when the card + # appears; let that run first, then check again that it didn't undo the mute. + udevadm settle -t 10 2>/dev/null || true mute || fail "muting failed" + sleep 1 + for p in "${AMPS[@]}"; do + [[ $(ctl_values "$p Digital PCM Volume") == 0 ]] || fail "the $p amplifier was unmuted after the mute" + done finish set_status "muted: microphones only, speakers off (no protection)" log "AoC sound card $card: microphones only, both amplifiers muted (no speaker protection)" } +# Read-only report. Prints the DSP state but never the calibration values. status() { local p i c v name d cat "$status_file" 2>/dev/null || echo "no state ($status_file)" diff --git a/packages/omamobile-audio/systemd/omamobile-audio-mics.service b/packages/omamobile-audio/systemd/omamobile-audio-mics.service index 758071929..039cc6d20 100644 --- a/packages/omamobile-audio/systemd/omamobile-audio-mics.service +++ b/packages/omamobile-audio/systemd/omamobile-audio-mics.service @@ -6,14 +6,17 @@ # speakers stay silent. For a phone whose speaker limits aren't validated # (raven: device/raven/AUDIO-PLAN.md). Not enabled by this package: a device # package enables it. Once omamobile-speaker-protection is enabled, it owns the -# amplifiers and this one doesn't run. Hang-safe through the same marker. +# amplifiers and this one doesn't run (enabled in /etc, or by a device +# package's wants link in /usr/lib). Hang-safe through the same marker. [Unit] Description=AoC microphones with both speaker amplifiers muted (no speaker protection) Requires=omamobile-aoc.service After=omamobile-aoc.service Before=systemd-user-sessions.service Conflicts=omamobile-speaker-protection.service +Before=omamobile-speaker-protection.service ConditionPathExists=!/etc/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service +ConditionPathExists=!/usr/lib/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service ConditionPathExists=|/sys/bus/platform/devices/181d0000.aoc ConditionPathExists=|/sys/bus/platform/devices/175d0000.aoc diff --git a/packages/omamobile-audio/test/all b/packages/omamobile-audio/test/all index 62403a83b..524081c31 100755 --- a/packages/omamobile-audio/test/all +++ b/packages/omamobile-audio/test/all @@ -362,6 +362,8 @@ pass "mics: fails cleanly without a card, honours the hang marker, --retry clear u=systemd/omamobile-audio-mics.service grep -qx 'Conflicts=omamobile-speaker-protection.service' $u || fail "the mics unit conflicts with protection" grep -qx 'ConditionPathExists=!/etc/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service' $u || fail "the mics unit stands down once protection is enabled" +grep -qx 'ConditionPathExists=!/usr/lib/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service' $u || fail "the mics unit stands down once a device package enables protection" +grep -qx 'Before=omamobile-speaker-protection.service' $u || fail "the mics unit's mute on stop finishes before protection starts" grep -qx 'ConditionPathExists=|/sys/bus/platform/devices/175d0000.aoc' $u && grep -qx 'ConditionPathExists=|/sys/bus/platform/devices/181d0000.aoc' $u || fail "the mics unit runs on gs101 and gs201 AoCs" grep -qx 'ExecStart=/usr/bin/omamobile-speaker-protection mics' $u || fail "the mics unit runs mics" pass "the mics unit: never with protection, on both AoCs" diff --git a/packages/omamobile-device-raven/PKGBUILD b/packages/omamobile-device-raven/PKGBUILD index 3ab38fb4d..60f7935eb 100644 --- a/packages/omamobile-device-raven/PKGBUILD +++ b/packages/omamobile-device-raven/PKGBUILD @@ -6,7 +6,7 @@ pkgdesc="Omarchy Mobile support for the Google Pixel 6 Pro (raven): boot-slot su arch=(aarch64) url="https://github.com/derekross/omarchy-mobile" license=(MIT Apache-2.0) -depends=(bash iproute2 jq systemd util-linux i2c-tools) +depends=(bash iproute2 jq systemd util-linux i2c-tools 'omamobile-audio>=0.5.14') # The modem's drivers stay blacklisted until its runtime loads them provides=(omamobile-modem-policy) # The [omamobile] entry in pacman.conf and its mirror list, as cheetah's diff --git a/packages/omamobile-device-raven/README.md b/packages/omamobile-device-raven/README.md index a6eefac5c..3ae1b37fe 100644 --- a/packages/omamobile-device-raven/README.md +++ b/packages/omamobile-device-raven/README.md @@ -17,7 +17,7 @@ the counterpart of `omamobile-device-cheetah`. Bring-up and results: | Sleep (s2idle) once locked with the panel off, behind `omarchy-toggle omamobile-sleep on` (the watcher, `omamobile-sleepd`, is omamobile-shell's); Wi-Fi stays connected across sleep (unloaded instead after a D3 failure, or with `/etc/omamobile/wifi-unload-for-sleep`) | `omamobile-sleep` (`system-sleep/omamobile`), `sleep.conf.d/10-omamobile.conf` | | Modem bring-up only: its PCIe driver and CPIF never load at boot, and the modem's units aren't enabled (as on main; `systemctl enable --now omamobile-modem omamobile-sitd` to use it, MODEM-PLAN) | `modprobe.d/omamobile-raven-modem.conf` | | Bluetooth on at boot; the session waits (at most 15 s) for the adapter | `bluetooth.service` (enabled), `sddm.service.d/`, `omamobile-wait-bluetooth` | -| The microphones at boot, with both speaker amplifiers muted (speaker protection stays off: its limits are cheetah's, AUDIO-PLAN) | `omamobile-audio-mics.service` from omamobile-audio 0.5.3 (enabled) | +| The microphones at boot, with both speaker amplifiers muted (speaker protection stays off: its limits are cheetah's, AUDIO-PLAN) | `omamobile-audio-mics.service` from omamobile-audio 0.5.14 (enabled); `snd_soc_cs35l41_spi` blacklisted here too, so it never autoloads unmuted | `omamobile-raven.conf` | `reboot-to.c` and `omamobile-bootctl.c` are cheetah's, unchanged: both are the same on every gs101/gs201 Pixel (raven's `devinfo` is `DEVI` 3.15, as diff --git a/packages/omamobile-device-raven/test/all b/packages/omamobile-device-raven/test/all index 4af4987ad..ef3b1b672 100755 --- a/packages/omamobile-device-raven/test/all +++ b/packages/omamobile-device-raven/test/all @@ -99,6 +99,9 @@ pass "sleep policy" || fail "the microphones unit (omamobile-audio 0.5.14) is enabled by a vendor wants link" [ ! -e vendor/systemd/system/multi-user.target.wants/omamobile-speaker-protection.service ] \ || fail "speaker protection is not enabled on raven (its limits are cheetah's)" +grep -qx 'blacklist snd_soc_cs35l41_spi' vendor/modprobe.d/omamobile-raven.conf \ + || fail "the amplifier driver never autoloads (device-raven's own blacklist)" +grep -q "'omamobile-audio>=0.5.14'" PKGBUILD || fail "device-raven depends on omamobile-audio>=0.5.14 (the microphones unit)" pass "the microphones come up with the speakers muted; protection stays off" # Policy that keeps the phone safe at boot diff --git a/packages/omamobile-device-raven/vendor/modprobe.d/omamobile-raven.conf b/packages/omamobile-device-raven/vendor/modprobe.d/omamobile-raven.conf index f1dceea28..52bb8e8c1 100644 --- a/packages/omamobile-device-raven/vendor/modprobe.d/omamobile-raven.conf +++ b/packages/omamobile-device-raven/vendor/modprobe.d/omamobile-raven.conf @@ -25,3 +25,7 @@ options gs_dsim_cmd allow_tx=1 # record (the stock HAL's fast download), so stream the patch and wait only # for Launch RAM. options btbcm patchram_nowait=1 +# The speaker amplifiers (AUDIO-PLAN.md): only omamobile-speaker-protection +# loads their driver (mics or start), and mutes both first; never autoload it +# unmuted, whatever omamobile-audio's own blacklist says. +blacklist snd_soc_cs35l41_spi