diff --git a/device/cheetah/AOC-PLAN.md b/device/cheetah/AOC-PLAN.md index fdda1356a..4b4f6a1bd 100644 --- a/device/cheetah/AOC-PLAN.md +++ b/device/cheetah/AOC-PLAN.md @@ -28,7 +28,10 @@ watchdog in earpiece mode) and a "Voice Call" UCM verb with an Earpiece sink; the gated runbook is C9k. A first look on the phone found the speaker filter following the default sink into the earpiece once Voice Call was active; its output now never falls back (`node.dont-fallback`, -`node.linger`; C9k "The route"). +`node.linger`; C9k "The route"). **2026-11-03 (omamobile-audio 0.5.13):** +earpiece mode works at every stage: with the boost converter on, as the +louder stage c9 leaves it, the earpiece at 657/6 was clean by ear on a VoLTE +call, so `on` no longer refuses it (C9k "Refusals"). **Earlier plan (2026-10-13, before C9j):** the speakers sounded thin; the ranked plan and three runbooks follow C9d-6: C9g (omamobile-audio 0.4.0's speaker filter, by ear and measured, risk low), C9d-7/C9d-8 (the V/I feedback stream stock runs @@ -2308,7 +2311,10 @@ merges cleanly into int; `make modules dtbs` passes in `out-aoc`): listener: "so much better and much louder and much more clear without static". Reading: at the everyday level the converter sits in its light-load regime, where it droops and distorts; stock's 817/17 - never runs it there. Its registers (peak 2.5 A as stock's speaker + never runs it there. (2026-11-03: this finding was under music on the + speakers and doesn't apply to the voice path: the earpiece at 657/6 + with the boost on was clean by ear on a VoLTE call at stage c9, as + stock's handset path runs it; C9k.) Its registers (peak 2.5 A as stock's speaker path, coefficients, DCM, class-H 0x000b0405, WKFET 0x111, VCTRL1 0 as the chip default, VCTRL2 class-H) match Google's driver, which also never writes the boost target unless the DT gives one (stock's does @@ -2412,13 +2418,23 @@ merges cleanly into int; `make modules dtbs` passes in `out-aoc`): values. The status line is the speaker one again. - **Refusals (nothing changes):** status not "ok:", a hang marker, no card, a failed health check, configured levels that fail the limits - check, earpiece levels outside the ceilings, and a boost converter the - last start left on. The converter follows the earpiece's own analog - gain as it follows the speakers' (C9j): off at 10 and below, so off - for the earpiece; it is set when the amplifiers probe, so a start that - left it on (stage c9, `OMAMOBILE_SPK_BOOST=1`, a kernel without - `boost_en`) cannot serve the earpiece without a rebind, and earpiece - mode refuses unless `OMAMOBILE_SPK_BOOST=1` says the owner wants it on. + check, and earpiece levels outside the ceilings. The boost converter + stays as the last start left it: it is set when the amplifiers probe + (C9j: off when every speaker analog gain is 10 or below, on at stage + c9, under `OMAMOBILE_SPK_BOOST=1` or on a kernel without `boost_en`), + and the earpiece works either way. Until omamobile-audio 0.5.13 `on` + refused with the converter on (the earpiece's analog 6 is in C9j's + light-load range), which left every call at stage c9, the louder + default on verified firmware since 0.5.8, with no earpiece audio. + **2026-11-03: earpiece at 657/6 with the boost on, verified clean by + ear on a VoLTE call at stage c9** (`OMAMOBILE_SPK_BOOST=1`, earpiece + on through `omamobile-earpiece@on.service`: Top 657/6 through ASP, the + bottom muted; no static, no hum); **C9j's light-load finding was under + music on the speakers and doesn't apply to the voice path.** Stock's + own handset path runs the top amplifier with the boost on too + (`mixer_paths.xml` handset: analog 7). So 0.5.13 accepts the converter + on and records its state in the status line; `OMAMOBILE_SPK_BOOST` + stays the start's, for the speakers. Both requests are idempotent (a repeat writes nothing and only checks that the watchdog answers); a service start removes the mode and ends in speaker mode, so a restart is the rollback. diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 60ca1d76b..370030cf6 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -52,7 +52,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | AoC | works | The audio and sensor DSP starts at boot (`omamobile-aoc.service`) through the GSA and Trusty, with 82 services; sensors and the sound card use it | [AOC-PLAN](../device/cheetah/AOC-PLAN.md) | | Speakers/mics | works | Through the AoC sound card and PipeWire (`omamobile-audio`): "Built-in Audio Speaker" (both speakers in stereo, stock channel map) and "Built-in Audio Microphone", the volume keys and quick settings. The amplifiers run Google's speaker protection firmware with the phone's factory calibration, and a watchdog mutes them on any fault. Since C9j (2026-10-27, omamobile-audio 0.5.3-0.5.4) both speakers play clean and loud: the amplifiers' boost converter is off at the everyday level (stage `media`, digital 737, analog 10), which removed the static under music, and the speaker filter is flat with 6 dB of limiter drive, which brings streamed music up while the limiters hold peaks at -3 dBFS. Since omamobile-audio 0.5.8 (2026-10-31) the default is louder on a phone with verified protection: digital 817 on both, analog 14 bottom and 11 top, with the protection firmware measuring the coils as they play (3.5 minutes of loud music held both at 60-65 °C, under the 80 °C backstop). Stock's analog 17 on both still trips the coil temperature (C9d-3..6), so the maximum stays a little below stock's. The bottom speaker's static was a word-length bug, fixed in the kernel (C9d-6, 2026-10-13); stock's Waves processing on the AoC (`omamobile-speaker-tuning`, off by default) is research (T3b/T4) | [AOC-PLAN](../device/cheetah/AOC-PLAN.md) C7-C9, [AOC-TUNING-RESEARCH](../device/cheetah/AOC-TUNING-RESEARCH.md), [AUDIO-PLAN](../device/cheetah/AUDIO-PLAN.md) | | Sensors | works | `omamobile-sensors`: an iio-sensor-proxy D-Bus service from the AoC's USF, started at boot. Accelerometer, light, proximity and compass at every boot (the sensor rails are power-cycled before the AoC starts); auto-rotate, switched from the rotation lock tile | [AOC-PLAN](../device/cheetah/AOC-PLAN.md) C6, [USF-PROTOCOL](../device/cheetah/USF-PROTOCOL.md) | -| Modem | works | Calls, texts and mobile data on Verizon's network since 2026-11-03 (a Tracfone SIM; VoLTE and SMS over IMS; registration 3 s after radio on; data as a fallback route behind Wi-Fi). What made it: the modem's carrier profile answered from the owner's image, stock's bearer order (IMS first on CID 2, the internet on CID 3, CID 1 left to the attach), and the earpiece through the protection service's earpiece mode. Today: the stack starts at boot through the opt-in `omamobile-modem-boot.target` (#386), the APNs and the carrier manifest are set by hand in `modem-sit.conf` until #373 makes them automatic, call audio needs the speakers at stage `media` (the boost converter off; the louder stage and the earpiece exclude each other for now), and suspend with the modem up is unqualified (the stack holds a sleep inhibitor). Phone and Messages use it through `omamobile-mmd`. Tested from the Pixel 7 Pro: an SMS each way, a VoLTE call answered on another phone, a call with the earpiece route to voicemail | [MODEM-PLAN](../device/cheetah/MODEM-PLAN.md), [IMS-SHANNON](../device/cheetah/IMS-SHANNON.md), [NOTES](../device/cheetah/NOTES.md#2026-11-03-ims-registered-and-an-sms-sent-on-a-verizon-network-sim-once-the-bearers-took-stocks-cids) | +| Modem | works | Calls, texts and mobile data on Verizon's network since 2026-11-03 (a Tracfone SIM; VoLTE and SMS over IMS; registration 3 s after radio on; data as a fallback route behind Wi-Fi). What made it: the modem's carrier profile answered from the owner's image, stock's bearer order (IMS first on CID 2, the internet on CID 3, CID 1 left to the attach), and the earpiece through the protection service's earpiece mode. Today: the stack starts at boot through the opt-in `omamobile-modem-boot.target` (#386), the APNs and the carrier manifest are set by hand in `modem-sit.conf` until #373 makes them automatic, the earpiece works at every speaker stage (since omamobile-audio 0.5.13 it takes the boost converter as the louder stage leaves it: clean by ear on a VoLTE call at stage `c9`, 2026-11-03), and suspend with the modem up is unqualified (the stack holds a sleep inhibitor). Phone and Messages use it through `omamobile-mmd`. Tested from the Pixel 7 Pro: an SMS each way, a VoLTE call answered on another phone, a call with the earpiece route to voicemail | [MODEM-PLAN](../device/cheetah/MODEM-PLAN.md), [IMS-SHANNON](../device/cheetah/IMS-SHANNON.md), [NOTES](../device/cheetah/NOTES.md#2026-11-03-ims-registered-and-an-sms-sent-on-a-verizon-network-sim-once-the-bearers-took-stocks-cids) | | NFC | works | ST54J over I2C through st-nci with our plain-NCI link, loaded at boot; neard (patched for empty Type 4 tags) reads and writes tags, and tapping a tag with a web link opens it (`omamobile-nfc-open`): writing a tag and opening its link tested on the phone (N3). Card emulation and the secure element are not used | [RADIOS-CAMERA-PLAN](../device/cheetah/RADIOS-CAMERA-PLAN.md) §3 | | Cameras | works (telephoto fixed-focus) | Ultrawide (Sony IMX386, D-PHY link 2): works end to end through our CSIS/WDMA driver and libcamera's software ISP (CAM5), basic quality (no Google ISP or tuning); a libcamera build with autofocus and low-light patches is installed, not yet evaluated (CAM5.3). Front (Samsung S5K3J1, D-PHY link 0): real images, raw and through libcamera (`cam -c1`, 30 fps, no WDMA errors; F.5-F.7, 2026-10-13). Main (Samsung S5KGN1, C-PHY link 1): 2016x1136 at 30 fps through libcamera with no WDMA errors. Telephoto (S5KGM5, C-PHY): 26 fps through libcamera, colour bars correct; its lens (SEM1215) isn't driven yet, so it stays at its resting focus: distant subjects are sharp (outdoors, 2026-10-26), close ones soft, and tap to focus does nothing. The CSIS write DMA (not the link) loses lines that arrive faster than about 400 MB/s within a line, so the sensors lengthen their lines to stay under `samsung,max-line-throughput` (360 in cheetah's DT for the main, telephoto and front cameras; the front's full 3840x2736 mode runs at 26 fps). The ultrawide (imx386) follows the same rule, so its full 4032x3016 mode streams (23 fps; one run in several still showed WDMA errors), and with 384 MiB of CMA `cam` without options runs every camera at full size (main 12 MP at 9.4 fps). The telephoto's lens (SEM1215) answers on a 950 kHz bus but holds the bus when driven longer, so the telephoto runs at fixed focus. Sensor and DC-PHY settings come from the user's own camera software (`tools/extract-camera-data`), never shipped. Since omamobile-device-cheetah 0.1.30 the camera modules load after boot (`omamobile-camera.timer`), the DMA-BUF heaps are open to the session (libcamera's software ISP), WirePlumber names them Main, Ultrawide, Telephoto and Front camera (0.1.31). The default camera app is omacam ("Camera", omamobile-apps 0.2.0; [CAMERA-APP-PLAN](CAMERA-APP-PLAN.md)): libcamera directly, zoom across the three back lenses, full-resolution photos. GNOME Snapshot is optional, named "Snapshot", for video until omacam records it; browsers and video calls use the cameras through PipeWire (`pipewire-libcamera`). Picture quality: libcamera 0.7.2-4.21 adds chroma noise reduction and defective pixel correction, and omacam 0.3.3 has Night mode and an HDR chip, bursts of raw frames aligned, merged and finished on the phone (Night: 12 frames in about 4.6 s, Q5.3 on 2026-10-21); single shots are still well below stock's | [CAMERA-PLAN](../device/cheetah/CAMERA-PLAN.md), [CAMERA-QUALITY-PLAN](CAMERA-QUALITY-PLAN.md) | | Suspend | WIP | s2idle works when asked for (`systemctl suspend`, `rtcwake`): `pm_test` dry runs, wakes on a volume key and on the RTC alarm, 20 of 20 unattended cycles (S3b, S4); UFS powers down in suspend by default (`spm_lvl` 5). Wi-Fi stays connected across sleep: 31 of 31 freezes with the D3 handshake (S5b-3, S5c, 2026-10-19), and the sleep hook keeps it loaded. The AoC and sensors work across sleep, and a running sensor stream doesn't wake the phone (S6, 2026-10-19). Screen off, with Wi-Fi up, it draws 434 mA awake and 312 mA in s2idle: about 16 h of standby on the 4986 mAh battery (S7, 2026-10-19), against 32-50 mA in stock's deep sleep. Auto-sleep is in the packages and off by default ([#64](https://github.com/derekross/omarchy-mobile/pull/64), omamobile-shell 0.2.29): with the `omamobile-sleep` toggle on, the phone sleeps 30 s after the screen goes off behind a secure lock and at once on Power, and Power wakes it to the PIN pad; 13 cycles in one boot with 0 failures (P0-P5, 2026-10-26). P5 stopped that day on a speaker trip that turned out not to come from sleep ([NOTES](../device/cheetah/NOTES.md#2026-10-27-the-muted-speakers-were-the-open-loop-coil-estimate-not-sleep-the-static-was-the-boost-converter-the-earpiece-is-the-top-speaker)); resumed on 2026-11-01, it passed with 11 suspends and 0 failures, the speakers fine across each sleep. After its power-key test Hyprland ran neither power-key bind until `hyprctl reload`; the on-screen keyboard's virtual keyboard was reaching the hardware-key binds, which now ignore it ([#312](https://github.com/derekross/omarchy-mobile/pull/312), omamobile-shell 0.2.75; re-tested on the phone 2026-11-01, [SUSPEND-PLAN](../device/cheetah/SUSPEND-PLAN.md) P5 test h). Still open: NetworkManager drops Wi-Fi for each sleep and reconnects about 5 s after the wake. The toggle stays off by default until a day of use (P6) and a power-off from Linux (P7) have run. Wi-Fi traffic and a USB plug can't wake it, a few RTC cycles wake early on a PMIC interrupt not yet identified, and the modem has never run across a suspend. Deep sleep (SYS_SLEEP), which stock's standby numbers need, is research and not started | [SUSPEND-PLAN](../device/cheetah/SUSPEND-PLAN.md) | diff --git a/packages/omamobile-audio/README.md b/packages/omamobile-audio/README.md index 5c77f4e7a..c765f7665 100644 --- a/packages/omamobile-audio/README.md +++ b/packages/omamobile-audio/README.md @@ -14,7 +14,7 @@ protection firmware and the phone's factory calibration, as stock Android does. | `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") | | `/etc/omamobile/speaker.conf` | stage (media, the default at 737 / 10; c8 bring-up; c9 stock under verified protection), the amplifiers' levels (per amplifier too), the media delta switch (on by default when installed), DRE (on by default), the boost converter (since 0.5.3 off at analog 10 and below when the kernel's cs35l41 module has `boost_en`: in its light-load regime it droops and distorts both speakers and takes 8-11 dB off the output, AOC-PLAN C9j; `OMAMOBILE_SPK_BOOST=1|0` forces it, module-wide) | -| `omamobile-speaker-protection earpiece on\|off\|status`, `omamobile-earpiece@on\|off.service`, polkit `50-omamobile-earpiece.rules` (0.5.5) | **earpiece mode** (AOC-PLAN C9k), stock's handset path: `on` mutes both amplifiers, lowers the top one's analog gain to 6, waits until the watchdog enforces earpiece mode, bypasses the top DSP (PCM Source ASP), sets its DRE and unmutes the top alone at 657 (`OMAMOBILE_SPK_EARPIECE_DIGITAL`, at most 737 and the stage's ceiling; 20 dB under stock's handset gain); the bottom stays at Digital PCM Volume 0. `off` mutes, puts the top back through its DSP, waits for speaker mode, restores every control to the stage's value, health-checks, unmutes both and reads every control back. Both refuse unless the protection runs (status ok, health, a hang marker absent, the watchdog answering) and refuse while the last start left the boost converter on (earpiece analog 6 wants it off, C9j); a failure half-way mutes both; both are idempotent; a service restart always ends in speaker mode. In earpiece mode the watchdog checks the top within 737/6 (ASP or DSP), the bottom muted and both runtime-held, and no DSP rule, since neither DSP is audible. The unit is the request path for PipeWire (the polkit rule lets the active local user start those two instances only) | +| `omamobile-speaker-protection earpiece on\|off\|status`, `omamobile-earpiece@on\|off.service`, polkit `50-omamobile-earpiece.rules` (0.5.5) | **earpiece mode** (AOC-PLAN C9k), stock's handset path: `on` mutes both amplifiers, lowers the top one's analog gain to 6, waits until the watchdog enforces earpiece mode, bypasses the top DSP (PCM Source ASP), sets its DRE and unmutes the top alone at 657 (`OMAMOBILE_SPK_EARPIECE_DIGITAL`, at most 737 and the stage's ceiling; 20 dB under stock's handset gain); the bottom stays at Digital PCM Volume 0. `off` mutes, puts the top back through its DSP, waits for speaker mode, restores every control to the stage's value, health-checks, unmutes both and reads every control back. Both refuse unless the protection runs (status ok, health, a hang marker absent, the watchdog answering); the boost converter stays as the last start left it (on at stage c9, off at media), since the earpiece works either way, as stock's handset path does with it on (clean by ear on a VoLTE call at stage c9, 2026-11-03; until 0.5.13 `on` refused with the converter on, so every call at the louder stage was silent); a failure half-way mutes both; both are idempotent; a service restart always ends in speaker mode. In earpiece mode the watchdog checks the top within 737/6 (ASP or DSP), the bottom muted and both runtime-held, and no DSP rule, since neither DSP is audible. The unit is the request path for PipeWire (the polkit rule lets the active local user start those two instances only) | | UCM2 `Google/cheetah/VoiceCall.conf` (0.5.5) | the "Voice Call" verb, ranked below HiFi so never the default: an `Earpiece` device on the speaker's PCM (EP6) whose enable sequence starts `omamobile-earpiece@on` and whose disable sequence starts `omamobile-earpiece@off`. Its sink ("Built-in Audio Earpiece") is not the speaker filter's target, and the filter never falls back to it (below), so the filter's limiter drive never reaches the earpiece. Only the left channel (the top amplifier) is heard. The call's own audio stays between the AoC and the modem; speakerphone, headset and call mic are later T4 work | | `modprobe.d/omamobile-audio.conf` | blacklists `snd_soc_cs35l41_spi`, so the card only comes up through the service | | UCM2 `conf.d/aoc-snd-card`, `Google/cheetah/HiFi.conf` | HiFi verb: Speaker = AoC EP6 to TDM 0 (the amplifiers), Mic = AoC EP1 from the built-in microphones; PCMs found by id. Touches no amplifier control, so PipeWire uses software volume | diff --git a/packages/omamobile-audio/bin/omamobile-speaker-protection b/packages/omamobile-audio/bin/omamobile-speaker-protection index f3830af3c..0b7be9398 100755 --- a/packages/omamobile-audio/bin/omamobile-speaker-protection +++ b/packages/omamobile-audio/bin/omamobile-speaker-protection @@ -138,6 +138,9 @@ analog_ceil() { [[ $1 == Top ]] && echo "$ANALOG_CEIL_TOP" || echo "$ANALOG_CEIL # The default 657 is 20 dB under stock's handset gain, AUDIO-PLAN section 4's # first-sound level: the earpiece is held at the ear, and unlike stock's path # nothing in front of it (no AoC handset processing) lowers the signal. +# The boost converter stays as the last start left it (on at stage c9, off at +# media): the earpiece works either way, as stock's handset path does with it +# on (clean by ear on a VoLTE call at stage c9, 2026-11-03; C9k). EAR_DIGITAL=${OMAMOBILE_SPK_EARPIECE_DIGITAL:-657} EAR_ANALOG=${OMAMOBILE_SPK_EARPIECE_ANALOG:-6} # DRE as in speaker mode unless set: stock runs it on the handset path too @@ -819,18 +822,17 @@ earpiece() { ear_refuse on "earpiece digital level $EAR_DIGITAL is outside 1..$EAR_DIGITAL_CEIL (stage $STAGE)" ((EAR_ANALOG <= EAR_ANALOG_CEIL)) || ear_refuse on "earpiece analog level $EAR_ANALOG is above $EAR_ANALOG_CEIL" [[ $EAR_DRE == [01] ]] || ear_refuse on "OMAMOBILE_SPK_EARPIECE_DRE=$EAR_DRE: 1 (on) or 0 (off)" - # The boost converter follows the earpiece's own analog gain, as start - # makes it follow the speakers' (C9j): off at 10 and below, so off for - # the earpiece unless OMAMOBILE_SPK_BOOST forces it. It is set when the - # amplifiers probe, so a start that left it on (stage c9, or a kernel - # without boost_en) cannot serve the earpiece without a rebind: refuse. + # The boost converter stays as the last start left it: it is a + # module-wide parameter set when the amplifiers probe (off at analog 10 + # and below, on at stage c9 or under OMAMOBILE_SPK_BOOST=1, which only + # start reads: C9j), and the earpiece works either way. C9j's light-load + # distortion was measured under music on the speakers; stock's handset + # path runs the top amplifier with the converter on (analog 7), and on + # 2026-11-03 the earpiece at 657/6 with it on was clean by ear on a + # VoLTE call at stage c9 (AOC-PLAN C9k). Until 0.5.13 this refused + # with the converter on, which left every call at stage c9 silent. b=$(cat "$boost_file" 2>/dev/null) - if [[ ${OMAMOBILE_SPK_BOOST:-0} == 1 ]]; then - [[ $b == "boost converter on"* ]] || ear_refuse on "OMAMOBILE_SPK_BOOST=1 but the last start left: ${b:-nothing recorded}" - else - [[ $b == "boost converter off"* ]] || - ear_refuse on "the earpiece (analog $EAR_ANALOG) needs the boost converter off (AOC-PLAN C9j), and the last start left: ${b:-nothing recorded} (stage $STAGE)" - fi + b=${b:-boost converter state not recorded by the last start} if [[ $(cur_mode) == earpiece ]] && earpiece_state >/dev/null; then rm -f "$ack_file" wait_ack earpiece || ear_fail "the watchdog did not answer within ${OMAMOBILE_SPK_ACK_WAIT:-5} s (omamobile-speaker-watch running?)" diff --git a/packages/omamobile-audio/speaker.conf b/packages/omamobile-audio/speaker.conf index ab4a998ad..20e0484f4 100644 --- a/packages/omamobile-audio/speaker.conf +++ b/packages/omamobile-audio/speaker.conf @@ -35,8 +35,9 @@ # its DSP bypassed, as stock's handset path, the bottom one muted. At most # 737 (and the stage's digital ceiling) / 6 in every stage; the default is # 20 dB under stock's handset gain (817 / 6). DRE follows OMAMOBILE_SPK_DRE -# unless set here. Needs the boost converter off, as at every analog gain of -# 10 and below (OMAMOBILE_SPK_BOOST=1 accepts it on). +# unless set here. Works in every stage, with the boost converter as the last +# start left it: on at stage c9, as on stock's own handset path (clean by ear +# on a VoLTE call, 2026-11-03), off at media. #OMAMOBILE_SPK_EARPIECE_DIGITAL=657 #OMAMOBILE_SPK_EARPIECE_ANALOG=6 #OMAMOBILE_SPK_EARPIECE_DRE= @@ -58,7 +59,8 @@ # configured analog level is 10 or below, on when one is above (stage c9), # when the kernel offers the cs35l41 boost_en parameter; older kernels keep # it on. The parameter is module-wide: one amplifier at 17 keeps it on for -# both. 1 = on, 0 = off, anything else is refused (AOC-PLAN C9j). +# both. 1 = on, 0 = off, anything else is refused (AOC-PLAN C9j). It is read +# by the start only; earpiece mode takes the converter as it is. #OMAMOBILE_SPK_BOOST= # The amplifiers' hardware noise gate (stock enables it): 1 = on. #OMAMOBILE_SPK_NOISE_GATE=1 diff --git a/packages/omamobile-audio/test/all b/packages/omamobile-audio/test/all index 73a3b76cd..7d7efc9a6 100755 --- a/packages/omamobile-audio/test/all +++ b/packages/omamobile-audio/test/all @@ -835,14 +835,34 @@ eprep=(OMAMOBILE_SPK_EARPIECE_ANALOG=7); ear on; refused "analog above 6" eprep=(OMAMOBILE_SPK_EARPIECE_DIGITAL=6x); ear on; refused "a level that is no number" eprep=(OMAMOBILE_SPK_EARPIECE_DRE=yes); ear on; refused "a DRE that is not 0 or 1" eprep=(OMAMOBILE_SPK_DIGITAL=800); ear on; refused "speaker levels above the stage's" -eprep=(OMAMOBILE_SPK_BOOST=1); ear on; refused "OMAMOBILE_SPK_BOOST=1 with the converter off" ear sideways; ((rc == 2)) || fail "earpiece: an unknown request" +# OMAMOBILE_SPK_BOOST is the start's: with the converter off it changes nothing for the earpiece +: > "$r/cset.log"; eprep=(OMAMOBILE_SPK_BOOST=1); ear on +((rc == 0)) && [[ $(val "Top PCM Source") == 0 && $(cat "$r/run/speaker-protection") == *"mode earpiece"*"boost converter off"* ]] || { cat "$r/ear.out" >&2; fail "earpiece: OMAMOBILE_SPK_BOOST=1 with the converter off is accepted (the variable is the start's)"; } +ear off; ((rc == 0)) || { cat "$r/ear.out" >&2; fail "earpiece off after that"; } stopwatch +# the converter left on by the start (stage media forced, or stage c9): the earpiece takes it as it is (C9k, 2026-11-03) prep=(OMAMOBILE_SPK_STAGE=media OMAMOBILE_SPK_BOOST=1); run e-boost; bgwatch; : > "$r/cset.log" -ear on; refused "the boost converter left on (needs a rebind)" -grep -c 'needs the boost converter off' "$r/ear.out" >/dev/null || fail "earpiece: says why the boost refuses" -eprep=(OMAMOBILE_SPK_BOOST=1); ear on; ((rc == 0)) && [[ $(val "Top PCM Source") == 0 ]] || { cat "$r/ear.out" >&2; fail "earpiece: OMAMOBILE_SPK_BOOST=1 accepts the converter on"; } +ear on +((rc == 0)) && [[ $(val "Top PCM Source") == 0 && $(val "Top Digital PCM Volume") == 657 && $(val "Top Analog PCM Volume") == 6 && $(val "Bottom Digital PCM Volume") == 0 && + $(cat "$r/module/snd_soc_cs35l41/parameters/boost_en") == Y && + $(cat "$r/run/speaker-protection") == "ok: stage media, mode earpiece: Top 657/6 through PCM Source ASP"*"Bottom muted"*"boost converter on"* ]] || { cat "$r/ear.out" "$r/run/speaker-protection" >&2; fail "earpiece on with the boost converter left on: accepted, the status says the converter is on"; } +grep -c 'boost converter' "$r/ear.out" >/dev/null && fail "earpiece: no boost refusal any more" +ear off; ((rc == 0)) && [[ $(val "Top PCM Source") == 1 && $(val "Top Digital PCM Volume") == 737 ]] || { cat "$r/ear.out" >&2; fail "earpiece off with the converter on"; } +stopwatch +c9 e-c9; ((rc == 0)) || { cat "$r/out" >&2; fail "earpiece: a stage c9 start"; } +ampstate > "$r/speaker-state" +wprep=(OMAMOBILE_SPK_STAGE=c9 OMAMOBILE_SPK_DIGITAL=817 OMAMOBILE_SPK_ANALOG=17 FAKE_ANALOG_MAX=17); bgwatch; : > "$r/cset.log" +rc=0; prep=(OMAMOBILE_SPK_STAGE=c9 OMAMOBILE_SPK_DIGITAL=817 OMAMOBILE_SPK_ANALOG=17 FAKE_ANALOG_MAX=17 OMAMOBILE_SPK_ACK_WAIT=2); sp earpiece on > "$r/ear.out" 2>&1 || rc=$?; prep=() +((rc == 0)) && [[ $(val "Top PCM Source") == 0 && $(val "Top Digital PCM Volume") == 657 && $(val "Top Analog PCM Volume") == 6 && $(val "Bottom Digital PCM Volume") == 0 && $(val "Bottom Analog PCM Volume") == 17 && + $(cat "$r/module/snd_soc_cs35l41/parameters/boost_en") == Y && + $(cat "$r/run/speaker-protection") == "ok: stage c9, mode earpiece: Top 657/6 through PCM Source ASP"*"Bottom muted"*"boost converter on"* ]] || { cat "$r/ear.out" "$r/run/speaker-protection" "$r/bgwatch.out" >&2; fail "earpiece on at stage c9 (the boost converter on): the top at 657/6 through ASP, the bottom muted at its analog 17"; } +sleep 0.3; [[ $(val "Top Digital PCM Volume") == 657 ]] || { cat "$r/bgwatch.out" >&2; fail "earpiece on at stage c9: the watchdog accepts it"; } +rc=0; prep=(OMAMOBILE_SPK_STAGE=c9 OMAMOBILE_SPK_DIGITAL=817 OMAMOBILE_SPK_ANALOG=17 FAKE_ANALOG_MAX=17 OMAMOBILE_SPK_ACK_WAIT=2); sp earpiece off > "$r/ear.out" 2>&1 || rc=$?; prep=() +((rc == 0)) && [[ $(ampstate) == "$(cat "$r/speaker-state")" && $(val "Top Digital PCM Volume") == 817 && $(val "Bottom Analog PCM Volume") == 17 && + $(cat "$r/run/speaker-protection") == "ok: stage c9, protection firmware"*"boost converter on"* ]] || { diff <(ampstate) "$r/speaker-state" >&2; cat "$r/ear.out" "$r/run/speaker-protection" >&2; fail "earpiece off at stage c9: every control back at the stage's value (817, top 11 / bottom 17), the converter still on"; } stopwatch +pass "earpiece at the louder stage: the boost converter left on by the start is taken as it is (stage c9, or OMAMOBILE_SPK_BOOST=1 at media), the status line says so, off restores the stage (C9k, 2026-11-03)" prep=(OMAMOBILE_SPK_STAGE=c8 OMAMOBILE_SPK_EARPIECE_DIGITAL=658); run e-c8; : > "$r/cset.log" rc=0; prep=(OMAMOBILE_SPK_EARPIECE_DIGITAL=658); sp earpiece on > "$r/ear.out" 2>&1 || rc=$?; prep=() refused "stage c8: digital above 657" @@ -853,7 +873,7 @@ grep -c 'CSPL Error Detected' "$r/ear.out" >/dev/null || fail "earpiece: names t media; run e-off-muted; sp mute >/dev/null; : > "$r/cset.log"; ear off; refused "off after a mute" media; run e-nowatch; : > "$r/cset.log"; ear on ((rc == 1)) && muted && [[ $(cat "$r/run/speaker-protection") == "muted: earpiece: the watchdog did not take earpiece mode"* && $(val "Top PCM Source") == 1 ]] || { cat "$r/ear.out" >&2; fail "earpiece on without a watchdog: both muted, the DSP never bypassed"; } -pass "earpiece: refuses levels above the ceilings, a boost converter left on, a stopped, unhealthy or half-started protection; without a watchdog both stay muted" +pass "earpiece: refuses levels above the ceilings, a stopped, unhealthy or half-started protection; without a watchdog both stay muted" # status, health and mute r=$tmp/run.ok diff --git a/packages/omamobile-audio/version b/packages/omamobile-audio/version index 50c76ef87..964783a81 100644 --- a/packages/omamobile-audio/version +++ b/packages/omamobile-audio/version @@ -1 +1 @@ -0.5.10 +0.5.13