Mobile battery: measure phone energy with the pendant connected and set a battery budget
Why
Heavy background drain is a recurring complaint (#5491, #11307, #7358). Several fixes that should reduce it have merged, but no phone energy has ever been measured for them. This issue is to measure first, then rank the remaining consumers by measured energy, then set an explicit budget. Do not weaken background recovery or audio continuity to improve an idle number.
What landed on main
- #14843: fence retired websocket connection attempts (duplicate/zombie sockets). Included in mobile builds v1.0.552 (Android and iOS) and v1.0.560 (iOS).
- #19482: pendant RSSI reads every 10s instead of every 3s. Merged 09-27; probably not yet in a tagged build.
- #18858: capture watchdog that checks every 30s while connected. New periodic work, included in v1.0.560 iOS.
- #14296: keep Android sync alive with the screen off.
- Still unchanged on
mainand worth measuring:- the WAL flush rewrites its manifest even when nothing was flushed;
- Android Home starts the location foreground service whenever location permission is granted;
- the connectivity check runs every 10s.
- Related open PRs: #19538 (iOS BLE readiness after a restored connection); #14156 and #12943 (firmware idle/AAD, out of scope here).
Acceptance criteria
Paired measurement of the build just before #14843 against current
main. Same phone, same pendant, same firmware, 3 × 30-minute runs per state, across six states:- disconnected idle
- connected and muted
- live speech
- connected with silence
- offline catch-up
- weak or flapping network
For each run, report phone discharge per hour (or energy), CPU wakeups, bytes sent, and recovery latency.
Socket hygiene: zero surviving retired sockets after 10 stop-during-handshake cycles, checked by connection counts on a dev endpoint.
Ranked consumer list by measured energy, not configured cadence. Include the location foreground service, connectivity probes, idle WAL writes, the 30s watchdog, RSSI polling and the silence-audio path.
At most one PR per consumer, and only for the top consumers. Each must show no regression in frame retention, time to first transcript, or backlog drain.
Proposed battery budget per state, with pass/fail thresholds, for a maintainer to ratify. Measure pendant battery separately from phone battery.
Platform order: iOS first (the #11307 report is iOS), then Android.
Prerequisites
- A dedicated test iPhone and Android phone (not a personal device), and an Omi pendant on pinned firmware. Ask a maintainer for loaners.
- Xcode Instruments (Power Profiler);
adb, batterystats and Perfetto; an external power meter if available. - Matched base and fix dev builds made with the same toolchain; a dedicated test account on the dev backend. Never production.
Scope notes
- The Android location foreground service is in scope for measurement. Any change to it must be coordinated, because it is tied to the Home foreground-service ownership handoff.
- Firmware power work is out of scope.
For the handoffee to decide
The fixture design and run order; statistical thresholds; whether the watchdog and connectivity probes should run only while capturing; how to attribute silence-frame cost between phone and firmware; whether idle WAL writes get their own PR.
Source: BasedHardware/omi