Skip to content

omamobile-modem-sit 0.3.37, omamobile-modem 0.1.25, device-cheetah 0.1.56: suspend with the modem online (M6) - #556

Closed
ikegam wants to merge 5 commits into
derekross:mainfrom
ikegam:omamobile-modem-screen-state
Closed

ikegam wants to merge 5 commits into
derekross:mainfrom
ikegam:omamobile-modem-screen-state

Conversation

@ikegam

@ikegam ikegam commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What

The userspace half of suspend with the modem online on the Pixel 7 Pro (MODEM-PLAN section 7, M6). The kernel half is derekross/linux-omarchy-mobile#232. Rebased on main of 2026-11-15; versions 0.3.37 (after #701's 0.3.36), 0.1.25 (after #555's 0.1.24) and device-cheetah 0.1.56 (after #730's 0.1.55) can move at merge.

  • omamobile-modem-sit: sitd can tell the modem the screen state (SIT 0x0902 SET_SCREEN_STATE and the 0x0928 indication filter), as stock's RIL does, and a systemd-sleep hook asks for "screen off" before a sleep. Both are off by default now: they run only with [control] follow_screen = yes in modem-sit.conf. Without it sitd sends nothing new, the hook answers "not told", and the 9a's one "screen on" at start is sent as before (its comment now says so).
  • omamobile-modem, device-cheetah: /etc/omamobile/modem-suspend-enable lifts the modem's sleep inhibitor only beside /usr/lib/omamobile-modem/suspend-runbook, a comment-only marker that only device-cheetah ships. The inhibitor unit has two triggering conditions (ConditionPathExists=|! on each file), so it is skipped only when both exist. The start script follows the same two files. On the 9a or the 6 Pro, the owner's file alone changes nothing, and the script says it was ignored.
  • The NR-mode fix moved to its own pull request, omamobile-modem-sit 0.3.36: [network] nr_after_radio_on, the NR mode only after radio on #701.
  • MODEM-PLAN: section 7 and 7.4, with your points.

Your review

  1. Screen state on every phone: behind follow_screen (default off), the hook included. Tests check that with the default no request is sent, and that the hook gets following: false.

  2. Whose phone: 7.4 and both status lines say M6 ran on a second Pixel 7 Pro (mine) and what has run.

  3. After the two runs that lost the modem: the phone was rebooted, with the unit's stop (CP OFFLINE, modem-up removed), and the modem was never restarted within a boot. "No UFS line" was read in that same boot's kernel log, which runs on past the stop (to 855 s and 1387 s), so the stop's CP power-off is covered.

  4. NV checks: 7.4 has a table per M6 boot. Every modem start's RAM copies were 5 of 5 against the backup's sums, and the NV files 3 of 3. One honest correction: no tools/nv-backup --check ran at each boot. One ran on 2026-11-11 after all of them (NV partitions the same, devinfo different as expected). From M6.4 it runs before each boot.

  5. Tests for the inhibitor branch: start-harness cases for:

    • no file and no lock: refuses "Off: no sleep inhibitor" before any driver, no latch;
    • file plus marker and no lock: goes on without waiting;
    • file without the marker and no lock: refuses;
    • file without the marker, with the lock: loads as before.

    test/all also evaluates the unit's conditions with systemd-analyze condition for all four combinations. Inverting the script's check, or dropping the unit's second condition, fails the suite.

  6. Second review, (4), the enable file on other phones: the marker above, with a device-cheetah test that it is staged as a plain, comment-only file.

Smaller points:

  • Eight or seven: eight. The journal holds eight PM: suspend entry/exit pairs and no failure; 7.4's earlier "seven" was one short and is corrected.
  • systemctl suspend in M6.4: noted in 7.3/7.4. The earlier freezes went straight to /sys/power/state, so they skipped the hooks and inhibitors.
  • Enable file 7 Pro only: in the unit comment and enforced by the marker.
  • Carrier name: gone from the 0.3.32 commit body (now "on an LTE network"). The other records keep to RAT, states and counts.

Tested

Pixel 7 Pro (the second one), LTE SIM with data and SMS (no voice), on the charger:

  • Kernel 7.3.0-rc6-omamobile-push1-g33179249011e (omamobile-omarchy 0.1.23: no launch toast for a desktop entry that runs omarchy-shell #232 on today's omamobile), omamobile-modem 0.1.23, omamobile-modem-sit 0.3.36 and device-cheetah with the marker. Over two boots:
    • packet registration 7.5 s and 8.5 s after radio on, then IMS voice and SMS;
    • a ping over rmnet0 3/3;
    • no UFS line;
    • with the enable file and the marker, the inhibitor unit was skipped (ConditionResult=no) and the start script went on.
  • tools/pr-check origin/main, and test/all of omamobile-modem, omamobile-modem-sit (sitd against tools/sit-sim) and omamobile-device-cheetah, pass.

Not run here: no sleep cycles on this kernel yet (M6.4, with systemctl suspend), and the call half of M6.3 (needs your voice SIM).

🤖 Generated with Claude Code

@derekross

Copy link
Copy Markdown
Owner

Thank you for this, it's a big step: nobody had slept a 7 Pro with the
modem up before, and your runbook went about it the right way: attended,
on the charger, NFC stopped, UFS checked after every wake, two cycles per
boot once you found the second sleep behaves differently. The opt-in file
for the inhibitor is the right shape too. I ran both packages' tests
locally (and with #555 merged in), and they pass; CI is waiting on my
approval.

Some things need changing first:

  1. The screen state runs by default on every phone. follow_screen()
    runs whenever sitd runs, not only with modem-suspend-enable, so from
    this release the 7 Pro (where the modem is on by default), and the 9a
    and 6 Pro wherever sitd runs, would tell their modems "screen off" with
    the filter at 0. Until now nothing sent those requests. The SMS test is
    good, but an incoming call with the screen dark hasn't run (your SIM has
    no voice), and on my phone, in a pocket, the screen is dark nearly all
    the time. Could follow_screen() run only when the M6 opt-in is on (the
    same file, or a modem-sit.conf key that defaults off), until I've tested
    calls with it on my 7 Pro? We can then turn it on per phone as other
    owners test it.
  2. Whose phone. MODEM-PLAN is my phone's plan so far. Could 7.4 say
    "on a second Pixel 7 Pro (yours)", and the two status lines (the
    section's "plan, nothing run" and the file's "M6: planned") say what has
    run?
  3. After the two runs that lost the modem (M6.2 run 1 and M6.3 run 1):
    did you reboot, or start the modem again in the same boot? We never
    restart it within a boot (on the 9a that reset the phone). And was "no
    UFS line" read in that boot before the reboot, or from the next boot's
    dmesg? The latter can't show a pass at the stop, since the log is new.
  4. NV checks. 7.3 says each step starts with the NV checksum check;
    could 7.4 record the result for each M6 boot?
  5. A test for the inhibitor branch. If I invert the new condition in
    omamobile-modem-start (drivers load without the lock whenever the file
    is absent), the whole suite stays green, because the new case greps the
    source. Could you add two cases with the start harness: no file and no
    lock refuses with "Off: no sleep inhibitor"; the file and no lock goes
    on?

Smaller:

  • The PR says eight cycles in one boot (success 8); 7.4 adds up to 7. Which
    is right?
  • The 0.3.33 hook was written after the M6.3 runs, and all the freezes went
    straight to /sys/power/state (rtcwake -m freeze), which skips the
    system-sleep hooks and also systemd's inhibitors, so the runs didn't
    exercise the hook or the inhibitor change. When you get to M6.4, could
    some cycles go through systemctl suspend, so the hooks (yours and
    device-cheetah's) and the inhibitor run as they will for users, refused
    without the file and allowed with it?
  • The enable file isn't tied to the 7 Pro; a line in the unit comment that
    it's for this phone's M6 runbook only would keep a 9a owner from trying
    it (suspend with the modem on is unqualified there).
  • Please leave the carrier's name out of the 0.3.32 commit body; our
    modem records keep to the RAT, states and counts.

Versions will move at merge (0.3.33 is also claimed elsewhere), after #555.
Before merging I'll run it on my 7 Pro with #232: first the screen state
awake with calls and SMS while the screen is dark, then the M6.2 freezes,
then the call half of M6.3, which only my SIM can do.

@ikegam

ikegam commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I'll fix all of these.

@derekross

Copy link
Copy Markdown
Owner

Thanks for the reply. Nothing has been pushed yet, so the five points from my last comment stand, and main has moved a good deal under this branch. Here is what the rebase needs, so it's one pass:

  1. Versions. Main is at omamobile-modem-sit 0.3.34 and omamobile-modem 0.1.20. Please take the next free numbers when you push; other open pull requests are ahead in the queue (omamobile-modem 0.1.22, omamobile-modem-sit 0.3.35, device-raven 0.1.36: the modem runtime on the Pixel 6 Pro #389, and your own omamobile-modem 0.1.24, omamobile-shell 0.2.128: turn the modem on or off from the shell #555, which goes first), so I expect 0.3.36 and 0.1.23 and will set them at merge.
  2. omamobile-modem-start. The conflict is two variable blocks in the same place: main's SYSMODULE/SYSTEMCTL and your SUSPEND_ENABLE. Keep both. Main's test harness now fakes those two, which makes the tests I asked for easy to add: no enable file and no lock refuses with "Off: no sleep inhibitor"; the file and no lock goes on.
  3. The screen state, now with a second reason. Main has a Pixel 9a path where sitd tells the modem "screen on" once at start, because that modem only sends signal reports after it hears that, and the comment there says nothing else sends the screen state. With your follow_screen() running on every phone, the 9a's modem would be told "screen off" every time its panel goes dark, which nobody has tried, and on my 7 Pro the incoming-call case with the screen dark still hasn't run. So please put follow_screen() and the sleep hook behind the M6 opt-in (the same file, or a modem-sit.conf key that defaults off), and update that comment.
  4. The enable file on other phones. The inhibitor unit and the start script are shared, and the 9a can now start its modem at boot; its one sleep with the modem up never woke. /etc/omamobile/modem-suspend-enable would lift the inhibitor there too. Could it take effect only on the 7 Pro, for example through a file device-cheetah ships that the unit and the script both require alongside it, with a test that the enable file alone keeps the inhibitor?
  5. MODEM-PLAN. It merges by itself, but please re-read the status line at the top after the rebase (main changed this file too, and the line still says M6 is only planned), and add what I asked for: that 7.4 is a second Pixel 7 Pro's record, what you did after the two runs that lost the modem (a reboot, or a start in the same boot) and where "no UFS line" was read, and the NV check's result for each boot.

Still open from before: eight cycles or seven, some M6.4 cycles through systemctl suspend so the hooks and the inhibitor run as they will for users, and the carrier's name out of the description.

The kernel side (#232) needs a rebase as well, and I'll test the two together on my 7 Pro once both are up to date: the screen state awake with calls and texts first, then the freezes, then the call half of M6.3.

@ikegam
ikegam force-pushed the omamobile-modem-screen-state branch from 40165a6 to d2cf621 Compare November 12, 2026 01:58
ikegam added a commit to ikegam/omarchy-mobile that referenced this pull request Nov 12, 2026
…in for a local build

The M6 series (derekross#556) was cherry-picked onto main c3cfd86, where 0.1.18-0.1.20
and 0.3.33-0.3.34 are already taken. Versions move again at merge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ikegam ikegam changed the title omamobile-modem-sit 0.3.33, omamobile-modem 0.1.18: suspend with the modem online (M6) omamobile-modem-sit 0.3.36, omamobile-modem 0.1.23, device-cheetah 0.1.52: suspend with the modem online (M6) Nov 12, 2026
@ikegam

ikegam commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for both reviews. d2cf621 is rebased on today's main and addresses every point. The PR description has the full list.

  • The screen state and the sleep hook are off by default and run only with follow_screen = yes.
  • The enable file takes effect only beside device-cheetah's suspend-runbook marker. The harness and systemd-analyze condition tests cover it.
  • MODEM-PLAN covers whose phone it was, the reboots, the UFS reads and the NV per boot. One correction: nv-backup --check ran once afterwards, not before each boot. The count is eight.

One question: on #232 rebased onto the current omamobile, the 7 Pro stopped registering. A bisect points at a353a0190: with EAS, sitd loses a race on SET_NR_MODE with the radio off. The fix is the last sitd commit here (set it right after radio on), and it's unrelated to M6. Shall I split it into its own PR so it can land first?

@ikegam
ikegam force-pushed the omamobile-modem-screen-state branch from d2cf621 to e08d92d Compare November 12, 2026 12:30
@ikegam ikegam changed the title omamobile-modem-sit 0.3.36, omamobile-modem 0.1.23, device-cheetah 0.1.52: suspend with the modem online (M6) omamobile-modem-sit 0.3.36, omamobile-modem 0.1.25, device-cheetah 0.1.52: suspend with the modem online (M6) Nov 12, 2026
@derekross

Copy link
Copy Markdown
Owner

Thank you for this push, and for the care in it. Going through my list: the screen state and the sleep hook are behind follow_screen and send nothing by default (I read the path and your test covers both); the enable file works only beside device-cheetah's marker, and I checked the unit's two conditions with systemd-analyze condition for all four combinations myself; the four starter cases are the ones I asked for and more, and when I break the starter's check or drop the unit's second condition the suite fails, as it should; and the plan now says whose phone it was, that you rebooted after the two runs that lost the modem, where the UFS check was read, and the NV table. Thank you too for the plain correction that the full nv-backup --check ran once afterwards and not before each boot. It shows nothing changed, which is what matters; from here on it runs first.

CI is waiting for my approval. I ran the gate and all three packages' tests on a merge with main. Four things before this can go in:

  1. A lint failure. tests/grep-q-pipes (part of tests/all) stops at packages/omamobile-device-cheetah/test/all line 208: the comments-only check pipes into grep -q in a pipefail script. This form passes the lint and I tried it with both kinds of file: [[ $(grep -cv '^#' "$runbook") == 0 ]] || fail "the M6 runbook marker holds comments only".

  2. Yes, please split the NR-mode commit into its own pull request. It is a good find, and the three checks after the bisect (EAS off, sitd on the big cores, the modem's daemons on the big cores) are how I'd want a race shown. But it changes the start order on every phone that runs sitd, with no switch, and it isn't part of M6, so it shouldn't wait for the kernel side and the sleep tests. In the new PR I'd like two things: I'll boot it on my 7 Pro first, and for the 9a and the 6 Pro either a journal line from an owner showing what their modem does with SET_NR_MODE while the radio is off today, or a gate that leaves those phones on the current order until one of them has run it. One thing to correct in the wording: a353a0190151 isn't only on the newer base, it is in kernel-2026.11.08, the kernel of the current release. So I looked at my own 7 Pro, which runs that kernel (7.3.0-rc6-omamobile-g1a9d1d4e9289) with today's sitd: its journal shows SET_NR_MODE refused with the radio off, set again after radio on (main already retries there: "NR mode refused with the radio off … setting it after radio on"), the mode verified, and then home packet registration, at every boot. So on my unit the current order registers, and the new pull request should say what differs on yours (the SIM or carrier, the modem firmware, the timing), with the journal lines from a failing boot.

  3. The runbook doesn't turn on the screen state any more. All of your M6.2 and M6.3 results were taken with sitd following the screen, and that is now off unless [control] follow_screen = yes, but 7.3 only says to create modem-suspend-enable. Someone following it would freeze with the modem still sending its screen-on reports, which nobody has tried. Could 7.3 get a step before M6.2 that sets follow_screen = yes (then a reboot), with what to expect and how to undo it, and say which steps need it? Two sentences elsewhere need the same condition: 7.1's "sitd sends SET_SCREEN_STATE … when the panel goes off or on" (and "this phone" there is your phone), and U2 in 7.2's table ("before every sleep").

  4. Who runs each step. Since your runs, our rules gained a line that a sleep with the modem up on a 7 Pro is my test until it is qualified. Please mark each step in 7.3 with who runs it, and hold M6.4 on your phone until I've answered that here; I'll decide once I've run M6.2 on mine.

Smaller: device-cheetah 0.1.52 was taken on main last night, so I'll set the next number when I merge, nothing for you to do. The sleep hook's 10 s hold is counted on a clock that stops during the freeze, so after a wake the modem can stay on "screen off" a few seconds with the panel lit; a line in the hook's header is enough. And the commit that says "On the 7 Pro (LTE, idle)" means your phone; I'll word the squash that way.

Order: #555 first, then the NR fix on its own, then this one after linux-omarchy-mobile#232 is merged, so the switch never ships ahead of the kernel that makes it work. My run on my 7 Pro will be: the screen state awake with calls and texts while the screen is dark, then two freezes in one boot through systemctl suspend, then the call half of M6.3.

@ikegam
ikegam force-pushed the omamobile-modem-screen-state branch from e08d92d to b9f5827 Compare November 12, 2026 15:14
@ikegam ikegam changed the title omamobile-modem-sit 0.3.36, omamobile-modem 0.1.25, device-cheetah 0.1.52: suspend with the modem online (M6) omamobile-modem-sit 0.3.36, omamobile-modem 0.1.25, device-cheetah 0.1.54: suspend with the modem online (M6) Nov 12, 2026
@ikegam
ikegam force-pushed the omamobile-modem-screen-state branch from b9f5827 to 6047d54 Compare November 12, 2026 15:32
@ikegam ikegam changed the title omamobile-modem-sit 0.3.36, omamobile-modem 0.1.25, device-cheetah 0.1.54: suspend with the modem online (M6) omamobile-modem-sit 0.3.37, omamobile-modem 0.1.25, device-cheetah 0.1.54: suspend with the modem online (M6) Nov 12, 2026
@ikegam
ikegam force-pushed the omamobile-modem-screen-state branch from 6047d54 to fe9349c Compare November 12, 2026 15:35
@derekross

Copy link
Copy Markdown
Owner

@ikegam, I ran #556's omamobile-modem 0.1.25 and omamobile-modem-sit 0.3.37 today with linux-omarchy-mobile#232 on my Pixel 7 Pro; the results are on #232. Screen state and the first two sleeps passed, the refusal run lost data, so this waits for a new #232 head. I didn't install this branch's device-cheetah (on a release install its boot-update hook would have written the packaged kernel over the test kernel); the runbook file was placed by hand and removed afterwards. No more sleeps with the modem up on my phone until there's a new head.

@W4HO-ham

Copy link
Copy Markdown
Contributor

One observation for M6's userspace half, from running kernel #232 on a Pixel 9a today (the full result is on that pull request): with omamobile-sit-data running and Wi-Fi connected, every sleep request was refused, 14 of 14, and with the data service stopped 22 of 23 went in.

What the journal shows at each request, in the same 100 ms:

  1. logind announces the sleep, and NetworkManager deactivates wlan0 at once ("sleep requested", activated -> deactivating), so Wi-Fi's default route goes;
  2. the bearer's metric-700 default route is now the only one, and whatever was talking over Wi-Fi rebinds to rmnet0 and sends (on this palmtop the owner's VPN daemon, within the same second; resolved switches too, and sit-data then logs "Default internet path cellular");
  3. the modem's link comes up for that traffic, and omamobile-omarchy 0.1.23: no launch toast for a desktop entry that runs omarchy-shell #232's notifier finds it up: sleep refused before the freeze: link up, PHY out of isolation.

With the data service stopped there is no route through the bearer, nothing is sent, and the link was idle 5 or 6 s after "screen off".

Nothing here is the 9a's alone, as far as I can see: the fallback route and NetworkManager's sleep handling are the same on the 7 Pro, and how often it bites depends on what is talking when the phone goes to sleep. Refusals did no harm in my runs, but a phone on Wi-Fi with anything chatty would rarely sleep with the modem up.

Two ways I can see, both in omamobile-sit-data, which owns that route:

  • A. It listens for logind's PrepareForSleep: on true it takes the cellular default route away (the bearer's address stays), on false it puts it back if nothing else leads out. Only sleeps change. It has to win a short race with NetworkManager taking Wi-Fi down; a lost race costs one refused sleep.
  • B. The route is no longer there while something else leads out, and comes only after nothing else has for a few seconds. No race, but the fallback then takes those seconds whenever Wi-Fi drops.

I can write and test either on the 9a against #232 if you want it; say which, or that you'd rather handle it in #556.

@W4HO-ham

Copy link
Copy Markdown
Contributor

I went ahead with A so there is something to look at and numbers to weigh: #750 (draft). On the 9a against kernel #232, with Wi-Fi connected and the data service running: 0 of 14 sleeps entered as on main, 20 of 20 with the route stepping aside and coming back only after Wi-Fi. Fold it in here or drop it as you see fit.

@ikegam

ikegam commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on today's main and took @W4HO-ham's #750 in as is (author kept), thanks! device-cheetah is 0.1.56 now, since #554 has 0.1.55.

A/B on my 7 Pro (kernel #232 + 6.1/6.2 on 82f31d3a7, Wi-Fi connected, omamobile-sit-data running, 45 s RTC sleeps):

without #750 with #750
nothing talking 10/10 entered 10/10 entered
ping 1.1.1.1 (default route) running 0/5 (10 refused before the freeze) 5/5

Ping 3/3 and IMS registered after every run, no pcieport line. With nothing talking, the route moved to the bearer too but nothing used it, so how much this matters depends on what's on the phone.

One note for testers: today's sit puts nr_after_radio_on back to its default (off), and my phone then never registered (it's the phone that needs it). Setting it to yes fixed it.

@W4HO-ham

Copy link
Copy Markdown
Contributor

This branch's omamobile-modem-sit on a second phone: the Pixel 9a (tegu, zumapro), 2026-11-14, head 6eddef24. Thanks for taking #750 in; I've closed it.

What ran. The package built from this head merged with #697 (the 9a's daily phone packages are #697's build; the one conflict, in data_network.py's finally, keeps both sides' lines), [control] follow_screen = yes, and the same test kernel as on linux-omarchy-mobile#232 (its four commits, 6.1, 6.2, and sleep_guard on for zumapro: 7.3.0-rc6-omamobile-push1-gc50fd8fdf42a). The 9a's own modem start still holds its inhibitor, so each request was systemctl suspend -i with a 60 s RTC alarm; nothing told the modem the screen state by hand this time. LTE with IMS voice, Wi-Fi connected, omamobile-sit-data running, the panel dark, on the charger. The owner was not at the palmtop; he has told me to run these without him.

  • 30 requests, 30 entered, none refused; suspend_stats success 30, fail 0. 24 ended on the RTC's interrupt (22 of them at 58 to 64 s) and 6 on cp2ap_wakeup (2 to 55 s).
  • sitd followed the panel by itself: one "Screen off told to the modem" 16 s after it started, and nothing more to say for the rest of the boot. The sleep hook logged "screen off before sleep told" 30 of 30 times.
  • The modem was quiet. The link was already idle at 26 of the 30 requests and within 1 to 5 s at the other four. The whole 46-minute boot had 97 link power-ups; on "screen on" reports this modem does about 49 a minute.
  • The route change: omamobile-sit-data logged the announcement 30 times and "The cellular default route is back behind Wi-Fi" 30 times.
  • After every sleep: CP ONLINE, sitd active, no failed poll, Wi-Fi up, no UFS line. At the end ping -I rmnet0 5 of 5, and no pcieport, abort suspend or Can't set D0 line in the boot.

So on the 9a the two halves of this pull request do what the 7 Pro showed: yesterday the same kernel needed "screen off" sent by hand and the route change to get from 0 of 14 to 299 of 300, and with this package it needs neither.

Not covered here. A call or a text arriving with follow_screen on and the screen dark, which the config comment names as the condition for turning it on; I'll run that with the owner when he is at the palmtop and add it. omamobile-modem's part (the inhibitor and modem-suspend-enable) doesn't apply to the 9a, whose start is its own unit.

One small thing from the hook's comment, as you note there already: after a short sleep the modem can stay on "screen off" for the rest of the 10 s hold with the panel lit. I didn't see an effect of it in this run, the panel being dark throughout.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Nov 14, 2026
… nothing by hand (2026-11-14)

30 of 30 requests entered with omarchy-mobile#556's phone-service package and follow_screen on: sitd told the modem the screen state itself, the sleep hook ran each time, and the route change that was derekross#750 is part of derekross#556 now.
@W4HO-ham

Copy link
Copy Markdown
Contributor

The call and text test with follow_screen = yes, as promised above (Pixel 9a, 2026-11-14, the same build and package as the 30-sleep run; the owner called and texted from another phone, the palmtop lay untouched with its panel dark, and nobody answered a call, so this is about waking and ringing, not about call audio). Times are from sitd's journal against the kernel's PM: suspend exit.

Calls into a sleep: 4 of 4 woke the palmtop and rang. The sleeps had lasted 82 s, 3 min 41 s, 5 min 38 s and 6 min 17 s, each after "screen off" was told. Wake source cp2ap_wakeup every time; "Incoming call ringing" came 0.1, 0.4, 0.5 and 0.8 s after the suspend exit, and "Screen on told to the modem" 1.4 to 2 s after the ring. When the caller gave up, three of the four ended normally, with "Screen off told to the modem" about 30 s after the ring.

Texts into a sleep: 2 of 2 woke it (the carrier's missed-call and voicemail notices, 8 s and 15 s into a sleep): "SMS stored and acknowledged" 0.06 and 0.08 s after the suspend exit. A text sent while a call was ringing was stored 11 s into the ring, and the call still ended normally.

Awake, with the screen dark and "screen off" told: three calls rang and four texts were stored.

Sleeps that were called off cost nothing. Six requests this morning didn't go through: three refused before the freeze with the link up, three ended in noirq by CPIF (cp2ap_wakeup work pending, suspend_cp: abort suspend, -16) about 1.5 s in. Calls and texts kept arriving after each, and no poll failed.

One call left a stale ringing-in, and with follow_screen that has a second cost. The first of the four calls into a sleep (ring 0.11 s after the wake, a text stored 25 s into the ring) was never ended in sitd: seven minutes later omamobile-sit status still showed it, AIMS_HANGUP returned error 2, and 12 s after that the hangup deadline stopped sitd. That is #729's failure, here from an ordinary missed call, and #754 is the fix for the part where the user declines. The part that touches this pull request: while sitd holds a call, follow_screen never tells the modem "off" (and the hook's request is refused, "Call in progress"), so the modem stayed on its "screen on" reports, 48 link power-ups a minute, and every sleep request after it was called off, three of three, until a reboot. I couldn't make it happen again in three more calls into a sleep, one of them with a text during the ring, so I have one case and no cause; I'll put the detail on #729.

So on the 9a I'd call the condition in the config comment met for waking and ringing, with that one open point, which isn't this pull request's to fix.

derekross added a commit that referenced this pull request Nov 14, 2026
…m sleep, auto-sleep by default, the charging boot, power off at a critical battery (#730)

* omamobile-device-cheetah 0.1.56: double tap wakes the phone from sleep

With auto-sleep on, the phone really sleeps (suspend-to-idle) 30 s after
the screen goes off, and then only the power key woke it: the touch
driver turned its interrupt off for the whole sleep. linux-omarchy-mobile#248
makes the touchscreen wakeup capable, off by default; this udev rule turns
it on for the 7 Pro's Synaptics S3908. On a kernel without #248 there is no
power/wakeup attribute and the rule does nothing.

Tested on the reference phone on 2026-11-13 with the rule's effect set by
hand (echo enabled > power/wakeup) on a kernel with #248: asleep through
omamobile-sleepd, a double tap woke it on the touchscreen's interrupt and
lit the lock screen. 0.1.54 and 0.1.55 are claimed by open pull requests
(#556, #554).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-device-cheetah: auto-sleep on by default on the Pixel 7 Pro

Ship /usr/share/omamobile/auto-sleep-default, which omamobile-shell 0.2.129's
user setup reads (#737): suspend on this phone is verified
(SUSPEND-PLAN, 2026-11-13), and with this package's touch-wake rule a
double tap wakes it from sleep, so auto-sleep no longer costs double tap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* device-cheetah 0.1.55: off-mode charging instead of starting the phone on its cable

A 7 Pro powered off on its cable is started by the bootloader with
androidboot.mode = "charger", where stock runs only a charging screen.
We started the whole phone (2026-11-09: both boots after a power off on
the cable read "charger").

omamobile-charger-mode-generator makes omamobile-charger.target the
default of such a boot (early folder; /etc/omamobile/charger-mode-disable
turns it off). The target starts no session, modem, Wi-Fi or AoC, and
keeps SSH over USB as on a normal boot (usb-rescue, usb-mac, ufw).
omamobile-charger-mode turns the panel off, restarts into the phone on
Power held for a second, and powers off five seconds after the cable is
out. Needs linux-omarchy-mobile#233: without it, power off restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* NOTES: power off restarted the 7 Pro (the PMIC's WTSR), and the charger boot

On a second 7 Pro, not the reference phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-device-cheetah 0.1.55: power off at a critical battery

upower's default critical action is a suspend; suspended at 2 % the phone
runs flat asleep within about 20 minutes, a brown-out with the root file
system mounted. Power off now works (linux-omarchy-mobile#233, in
kernel-2026.11.13, on the development channel), and an off phone on a
charger starts the dark charging boot (#554's charger target, carried in
this pull request). So the drop-in of SUSPEND-PLAN 6.6: PowerOff at 3 %.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Hiroyuki Ikegami <ikegam@mixallow.net>
ikegam and others added 5 commits November 15, 2026 08:25
…h [control] follow_screen

The screen-state request (SET_SCREEN_STATE, then SET_IND_CMD_FILTER) was
in the service but never sent, so the modem reported as for a lit screen
all the time; each report wakes the AP and the link. With follow_screen =
yes (off by default) sitd follows the panel's bl_power, never "off" during
a call, and a systemd-sleep hook asks for "off" before a sleep. Without it
sitd sends nothing new and the hook answers "not told".

On a second 7 Pro (mine; LTE, idle): 47 indications in 60 s with the screen on, none
with it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only on the Pixel 7 Pro

/etc/omamobile/modem-suspend-enable lifts the modem's sleep inhibitor
for MODEM-PLAN M6, but only beside /usr/lib/omamobile-modem/suspend-runbook,
a comment-only marker that only device-cheetah ships. The inhibitor unit
is skipped only when both exist; the start script follows the same two
files and says when the enable file is ignored. Without both, nothing
changes. The link tests no longer read the machine's own enable file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plan, the runbook and the results so far, on a second Pixel 7 Pro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a system sleep

With the modem up and Wi-Fi connected, a system sleep was refused every time on the Pixel 9a: NetworkManager takes Wi-Fi down at logind's announcement, the bearer's metric-700 default route is then the only one, whatever was talking over Wi-Fi sends through the bearer at once, and the modem's link is up when the kernel looks (linux-omarchy-mobile#232's sleep guard).

omamobile-sit-data now listens for logind's PrepareForSleep (a busctl monitor, no new dependency) and takes its default route away when a sleep is announced; the bearer's address stays. After the sleep the route waits for another default route to be back, or ten seconds without one: put back at once it carried a few seconds of traffic at every wake, and the answers ended the next sleeps early. A route that wasn't there (a silent bearer, roaming) is not brought back, and without busctl nothing changes.
…radio_on on this phone

Asked in derekross#701's review: the plan says which boots each count covers, and
the two journal lines from a boot of the merged option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgnCmDwY8r4r1jCa2SVYLN
@ikegam
ikegam force-pushed the omamobile-modem-screen-state branch from 2cbd403 to fba9cd5 Compare November 14, 2026 23:28
@ikegam ikegam changed the title omamobile-modem-sit 0.3.37, omamobile-modem 0.1.25, device-cheetah 0.1.54: suspend with the modem online (M6) omamobile-modem-sit 0.3.37, omamobile-modem 0.1.25, device-cheetah 0.1.56: suspend with the modem online (M6) Nov 14, 2026
derekross added a commit that referenced this pull request Nov 15, 2026
…gap named (#790)

Auto-sleep is on by default on the development channel since 2026-11-14,
double tap wakes the phone from sleep, standby is about 21 h, power off
and the critical battery work. With the modem up the phone still stays
awake until kernel #232 (with its analysis fix) and #556 land; both passed
every step on the reference phone on 2026-11-14.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thank you. This is carried in #791 with your commits and authorship kept (cherry-picked onto today's main, version files resolved; a few renumbered at the top of #791), together with the change that turns sleep with the modem up on by default on the Pixel 7 Pro. Its tests pass. I'll close this one when #791 merges.

derekross added a commit that referenced this pull request Nov 15, 2026
…1.57, omamobile-shell 0.2.131: sleep with the modem up on by default on the 7 Pro (carries #555 and #556) (#791)

* omamobile-modem 0.1.24, omamobile-shell 0.2.128: turn the modem on or off from the Mobile network page

On the Pixel 7 Pro the modem stack starts at boot through device-cheetah's
vendor wants link, so keeping it off meant `systemctl mask
omamobile-modem-boot.target` over SSH. A phone whose modem drivers have
loaded never sleeps (omamobile-modem-inhibit holds until the reboot) and
runs warm, so the owner needs that switch on the phone.

omamobile-modem-switch (pkexec, org.omamobile.modem.switch, the active
local user without a password) masks the target for "off" and stops
nothing in this boot: a stopped modem can't start again before a reboot,
the sleep inhibitor stays anyway, and every modem power-off costs a UFS
error-handler pass (MODEM-PLAN M2.6). "on" unmasks it and starts the stack
only when this boot's modem never started. Its status reads without root;
props.conf sits in a root-only folder, which counts as provisioned there.

The switch exists only where the target is wanted at boot
(`systemctl show -p WantedBy`, which sees vendor and /etc links) or
masked. On the 9a, with its own modem start, and the 6 Pro, nothing wants
it: status says "available": false, the page hides the switch, and "on"
and "off" refuse, so the shell never starts a modem outside that phone's
own starter.

The Mobile network page shows the switch in its ready and off states,
says when the change takes effect at the next restart, says the phone
can't sleep only while the modem's sleep block is held (a start refused
before any driver releases it), and offers "Restart now".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-shell: the Mobile network page with the modem off, from the 7 Pro test of #555

Found on the reference phone on 2026-11-13, testing #555's modem switch:

- With the modem switched off for the boot, the only way to the page that
  turns it back on (the Mobile data tile's chevron) was hidden, and once
  shown it was greyed out with the tile. tile-state.sh now reports
  data_switch=off from omamobile-modem-switch, the tile says Modem off and
  keeps a working chevron (only in that case).
- Right after switching it on, the page said the modem service isn't
  running and starts once the modem is set up; it now says it is starting
  until the phone service reports.
- The heading was centred on the glyph and clipped when taller than it.
- The page had no back arrow; it now has one, as the Wi-Fi and Bluetooth
  pages do, and Escape goes back to quick settings too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-modem-sit 0.3.37: tell the modem the screen state, only with [control] follow_screen

The screen-state request (SET_SCREEN_STATE, then SET_IND_CMD_FILTER) was
in the service but never sent, so the modem reported as for a lit screen
all the time; each report wakes the AP and the link. With follow_screen =
yes (off by default) sitd follows the panel's bl_power, never "off" during
a call, and a systemd-sleep hook asks for "off" before a sleep. Without it
sitd sends nothing new and the hook answers "not told".

On a second 7 Pro (mine; LTE, idle): 47 indications in 60 s with the screen on, none
with it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-modem 0.1.25, device-cheetah 0.1.56: modem-suspend-enable, only on the Pixel 7 Pro

/etc/omamobile/modem-suspend-enable lifts the modem's sleep inhibitor
for MODEM-PLAN M6, but only beside /usr/lib/omamobile-modem/suspend-runbook,
a comment-only marker that only device-cheetah ships. The inhibitor unit
is skipped only when both exist; the start script follows the same two
files and says when the enable file is ignored. Without both, nothing
changes. The link tests no longer read the machine's own enable file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MODEM-PLAN: M6, suspend with the modem online

The plan, the runbook and the results so far, on a second Pixel 7 Pro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-modem-sit 0.3.37: the cellular default route steps aside for a system sleep

With the modem up and Wi-Fi connected, a system sleep was refused every time on the Pixel 9a: NetworkManager takes Wi-Fi down at logind's announcement, the bearer's metric-700 default route is then the only one, whatever was talking over Wi-Fi sends through the bearer at once, and the modem's link is up when the kernel looks (linux-omarchy-mobile#232's sleep guard).

omamobile-sit-data now listens for logind's PrepareForSleep (a busctl monitor, no new dependency) and takes its default route away when a sleep is announced; the bearer's address stays. After the sleep the route waits for another default route to be back, or ten seconds without one: put back at once it carried a few seconds of traffic at every wake, and the answers ended the next sleeps early. A route that wasn't there (a silent bearer, roaming) is not brought back, and without busctl nothing changes.

* MODEM-PLAN: which boots the NR counts cover, and the merged nr_after_radio_on on this phone

Asked in #701's review: the plan says which boots each count covers, and
the two journal lines from a boot of the merged option.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgnCmDwY8r4r1jCa2SVYLN

* omamobile-modem 0.1.26: one sleep policy for the inhibitor, with a kernel guard and an owner's opt-out

Whether the phone may sleep with the modem up was two path conditions on
omamobile-modem-inhibit.service and the same two files in the start
script. It is now one script, omamobile-modem-sleep-policy, that both ask:
the unit through ExecCondition= (inhibit: exit 0 holds the lock, 1 skips
it) and the start script through check. Yes needs all of:

- the device package's declaration, /usr/lib/omamobile-modem/suspend-verified
  (device-cheetah only, after MODEM-PLAN M6 passed on the reference 7 Pro
  on 2026-11-14), or the attended runbook's pair from before (the owner's
  modem-suspend-enable beside a device's suspend-runbook);
- no /etc/omamobile/modem-suspend-disable, the owner's opt-out;
- a running kernel whose modem link refuses a sleep early, from a
  PM_SUSPEND_PREPARE notifier, while the link is up
  (linux-omarchy-mobile#232, da171eae4cb7). Without it a sleep with the
  link up is refused only at noirq, and a run of those left mobile data
  dead until a reboot on 2026-11-13. The kernel adds no sysfs attribute or
  module parameter for it and development releases don't order, so the
  policy reads the running kernel's pcie-gs201-cp module file (modinfo -n;
  the start script hasn't loaded it yet) for the notifier's log line or
  its function name. kernel-2026.11.13's module has neither; the M6 test
  kernels' modules have both.

Anything else, an error included, keeps the inhibitor. A policy that
can't run skips the unit (systemd counts a failed exec as a skip), but
the start script's call then fails too, it waits for a lock that never
comes and loads no driver: the phone never sleeps with the modem up by
accident. No other device ships the declaration, so the 9a and the 6 Pro
keep the inhibitor. The tests run the policy for every combination and
the start script with it (old kernel, opt-out, missing policy, the old
pair), and the unit check in place of systemd-analyze condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-modem-sit 0.3.40: a device may turn follow_screen on in its drop-in

A device's modem-sit.conf.d file was read for [audio] only. sitd now
also takes [control] follow_screen from it (and nothing else from
[control]: the socket's group stays the owner's), so the Pixel 7 Pro can
tell its modem the screen state by default now that MODEM-PLAN M6 passed
there, with texts and calls arriving and waking the phone with the
screen dark (2026-11-14). A value in /etc/omamobile/modem-sit.conf still
wins, and without a device default it stays off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-device-cheetah 0.1.57: sleep with the modem up on by default (MODEM-PLAN M6)

The maintainer approved it on 2026-11-14 ("approve modem sleep by default
on the 7 Pro"), after the reference phone passed every step of M6: two
sleeps, ten sleeps refused before the freeze with data busy and the ping
unbroken, a text and a call each waking the phone, audio both ways.

The package now ships /usr/lib/omamobile-modem/suspend-verified, the
phone's declaration that omamobile-modem 0.1.26's sleep policy reads, in
place of the runbook marker, and [control] follow_screen = yes in its
modem-sit defaults. No file of the owner's is needed; the policy still
keeps the inhibitor on a kernel without linux-omarchy-mobile#232's early
refusal and where the owner has made /etc/omamobile/modem-suspend-disable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* MODEM-PLAN, SUSPEND-PLAN, DEVICES: M6 done on the 7 Pro, on by default from kernel-2026.11.15

MODEM-PLAN section 7's status says M6 passed on the reference phone on
2026-11-14 and links SUSPEND-PLAN's record of it; 7.5 says what turns it
on by default (the device's declaration, follow_screen, the sleep policy),
the kernel guard and why it reads the module, the owner's opt-out, and the
check after Updates. SUSPEND-PLAN's status line says the same. DEVICES'
Suspend cell stays "partial", now saying the modem-up gap closes with
kernel-2026.11.15 and these packages; it moves to "works" only after the
release is checked on the phone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* AGENTS: sleep with the modem up is on by default on the 7 Pro with kernel-2026.11.15

The maintainer approved it on 2026-11-14. The suspend-and-modem entry now
says that on the Pixel 7 Pro with a kernel carrying
linux-omarchy-mobile#232 and omamobile-modem 0.1.26 with device-cheetah
0.1.57 the phone sleeps with the modem up, that the sleep policy keeps the
inhibitor on an older kernel, and that the owner can opt out. The rest of
the entry, the 9a's rules among it, stands unchanged for every other
phone, and going round a held inhibitor on a 7 Pro stays the maintainer's
attended test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* omamobile-shell 0.2.131: above main's 0.2.129 for #555's Mobile network page

#555's page and the page fixes carried in this branch were numbered
0.2.128, which main has since passed (0.2.129), and 0.2.130 is taken by
an open pull request. No code change here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Hiroyuki Ikegami <ikegam@mixallow.net>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@derekross derekross closed this Nov 15, 2026
ikegam added a commit to ikegam/omarchy-mobile that referenced this pull request Nov 15, 2026
…fault order

A value that isn't yes or no (nr_after_radio_on = ja) stopped the start
with "Not a boolean" after the attach settings were sent. Now it logs the
value and sets the NR mode as by default, as [control] follow_screen does
in derekross#556. Asked in derekross#701's review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgnCmDwY8r4r1jCa2SVYLN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants