Repository navigation
omamobile-shell 0.2.33: NFC polls only while the screen is lit - #99
Conversation
A poll loop is the NFC radio searching for cards. On the Pixel 9a it costs about 60 mA with the screen off (252 mA against 315 mA, awake, 10-27), and stock Android polls only while the screen is on. omamobile-nfc-open now stops neard's poll loop once every display connector has been DPMS off for 4 s, and starts it again when the screen lights, unless the NFC switch is off. Tested on the 9a: no controller interrupts with the screen off, polling again within 2 s of it lighting.
|
Thanks, @W4HO-ham. Stopping the poll loop with the screen off is what stock does, 60 mA is a lot to spend on searching for cards nobody can tap, and reading DPMS from sysfs keeps the service out of the session. I'd like this on the 7 Pro too. That also means it changes the reference phone: One change first. The stop only happens on the lit-to-dark transition, so anything that starts polling again while the screen is dark wins until the next screen-on/off cycle. I can see three ways that happens:
Making it level-triggered fixes all three: while the screen has been dark for 4 s, stop whenever an adapter reports It doesn't conflict with the tile: when NFC is switched off, screen-on doesn't start polling, as it should. |
…ays dark The stop was a single shot on the lit-to-dark transition, so anything that started polling afterwards kept it on until the next screen cycle: the unblock path's start_polling retries, the 9a's sleep hook after a wake, or neard restarted by systemd. Now every 2 s check stops any poll loop once the screen has been dark for 4 s, and start_polling powers the adapter but leaves the loop off while it's dark. The one-shot stop after an unblock is gone. test/nfc-screen.py checks screen_lit() against temporary sysfs trees.
cd88daf to
24d50df
Compare
|
Thanks, @W4HO-ham, the level-triggered stop is exactly right: every tick now stops a poll loop that anything started while the screen is dark, One more thing, which I should have caught last time. Has the new head run on the 9a? A line from a dark RTC wake (the sleep-hook case) showing "screen off: polling stopped" within a tick would be enough. The plan for the 7 Pro is the same as before: I'll run it on my phone before it merges, and I'll add one step for the new code: #115 and #117 are both ready: everything I asked for there is done. They merge right after this one, in order. |
… not raised start_polling runs from follow_screen's GLib timeout since the screen-off change, and a timeout callback that raises is removed by GLib for good. Wrap the adapter's Powered Set in try/except GLib.Error, log it and retry on the next tick, as set_powered does.
|
Pushed b24a2b3: the `Powered` Set in `start_polling` is now in `try/except GLib.Error`. It logs the error and returns `True`, so the next tick retries and the timer stays alive. I ran that head on the 9a (omamobile-shell 0.2.36 with this branch's `omamobile-nfc-open` copied over it), with the screen dark (DPMS off, connector `dpms` = Off):
|
|
Thanks, @W4HO-ham. The One small thing before it merges. The new comment and your reply say the next tick retries the power-on, but that's only true for the timer There's also a smaller side effect of the new Something like this fixes both. The package tests pass with it, and with the fake neard the adapter powers up and starts polling on the next tick: def start_polling(bus):
"""Power the first adapter and start a poll loop (neard's ConstantPoll
- keeps it going after each tag)."""
+ keeps it going after each tag). True means "try again": neard isn't
+ answering, has no adapter yet, or refused the power-on."""
+ if rfkill["blocked"]:
+ return False # switched off meanwhile; the next unblock restarts neard
try:
@@
rfkill = {"blocked": None}
-screen = {"lit": True, "dark_for": 0}
+screen = {"lit": True, "dark_for": 0, "start": False}
@@
screen["dark_for"] = 0
if not screen["lit"]:
screen["lit"] = True
- if not rfkill["blocked"]:
+ screen["start"] = not rfkill["blocked"]
+ if screen["start"]:
log("screen on: polling again")
- start_polling(bus)
+ if screen["start"]:
+ screen["start"] = start_polling(bus)
return TrueA failed On my side, I'll run this head on the Pixel 7 Pro before it merges, as planned. Because of what you saw after Merge order stays the same: this one, then #115 and #117 with their own commits cherry-picked onto main, as we discussed on those PRs. |
L-279 to L-293: the 9a's slot B hold and what made devinfo writable (#125), per-device flags checked by building both command lines (#101), env defaults in the shared build library and CI waiting for approval (#79), GLib retry paths and radio stops checked at the controller (#99), silent re-pushes and stacks with several tops (the tegu stack), and two of our own: merge only after every check has finished (#126), and an empty diff is checked for empty inputs (kernel #123). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wenty-sixth rounds (#127) * docs/review: 19 lessons and 3 corrections from the twenty-fifth round The confirmed candidates from round 25 (L-260 to L-278): the 9a slot B marking as a devinfo question, cross-repository links, squash-merged stacks and version files, stale hand-built prebuilts, and before-merge Pixel 7 Pro runs on omamobile-int. C-16 to C-18 correct our own earlier comments on kernel #98, kernel #80 and #74; L-241 is corrected in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs/review: 15 lessons from the twenty-sixth round L-279 to L-293: the 9a's slot B hold and what made devinfo writable (#125), per-device flags checked by building both command lines (#101), env defaults in the shared build library and CI waiting for approval (#79), GLib retry paths and radio stops checked at the controller (#99), silent re-pushes and stacks with several tops (the tegu stack), and two of our own: merge only after every check has finished (#126), and an empty diff is checked for empty inputs (kernel #123). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…works or NFC is switched off
|
Applied your change as 56d6005: screen-on keeps calling |
|
Thanks, 56d6005 is exactly the change I asked for, line for line. I haven't forgotten it: what's left is my run on the 7 Pro, and the phone is off my desk at the moment. I'll do it as the first step of the next shell session, together with #124 and the other shell PRs behind this one, and merge #99 right after it passes. |
# Conflicts: # packages/omamobile-shell/version
|
Merged tonight's main and took the version to 0.2.48 (main is 0.2.45; my #183 holds 0.2.46 and #197 0.2.47). Nothing dropped: the screen-aware poll loop isn't in main in any form. pr-check passes and the package suite passes; the one failure I saw was test/owl-idle's timing assertion flipping while this machine was busy, and it passes four times in a row on this branch and three on plain main, so it isn't from here. |
|
The failing Tests job here is the paused-tick check in test/owl-idle, not anything in this branch: it is false for one second in every ten by construction. #207 fixes it, and this should go green once that is in. |
…is lit Restores this pull request's change: the merge at b3ceaf1 resolved to main's tree and dropped it. 0.2.46 and 0.2.47 are held by derekross#183 and derekross#197. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Heads-up on the last merge: b3ceaf1 resolved to main's tree, so the branch ended up identical to main and the screen-aware poll loop was gone (the diff against main was empty). I've pushed 574c76e on top of your head, a fast-forward with nothing rewritten. It puts back Tested on the 7 Pro last night with this exact change: with the screen off for 4 s, neard's poll loop stops and the adapter stays powered; it starts again when the screen comes on, and rfkill block/unblock still behaves. I'll merge once CI is green. |
…is loaded (#197) Omarchy's hyprland.lua loads the look-and-feel rules from looknfeel.lua, so the phone rules go to whichever file the loaded config actually requires; on the Pixel 7 Pro (Omarchy 4.0.6) that is still looknfeel.lua, so nothing changes there. Renumbered to 0.2.49 at merge, after #99 took 0.2.48. Closes #197 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The home screen's OWL host answered every device and system query with the Pixel 7 Pro's fixed values. The model and codename now come from the device tree (model and the first compatible), with a small table for what the device tree doesn't say about the two Pixels we run on (panel size, top refresh rate, density); any other board reports display: null rather than a guess. On the Pixel 7 Pro the answers are unchanged. Rebuilt on main by the maintainer from the pull request's own three files, since the branch carried an older #99 underneath; renumbered to 0.2.50. Closes #115 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rounds L-348 to L-361: shared drivers judged against every int-line user (#150), board pins against every stock user (#151), ownership flags under the consumer's lock (#152), /chosen children and Google's panel constants (#154), same-day notes PRs on one device (#208/#209), merge simulations for DEVICES rows, ours included (#165), stacked PRs that merged main (#115/#117), titles behind renumbered versions, a contributor merge that dropped the PR (#99), smoke package lists as provenance and "owner-authorized" writes (#200), promised fixes and named tags checked on the remote (#153/#157/#158), and file swaps into old packages (#193). C-23 (usbc-deadman's device scope, kernel #107) and C-24 (BNEP in a lynx-only fragment, #98). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing (#307) The 9a's row after today's merges, with a NOTES entry for the evening's boots that the new cells link to. - **Wi-Fi, testing to works.** `omamobile-device-tegu` 0.2.4 (#238) starts it at boot now, through the shared gs201 host and zuma PHY (kernel #178 on #156, both in review) and brcmfmac (kernel #56, in review), with only the extractor's firmware. The NOTES entry has the boot, and the three rebinds with Bluetooth up after #178's FLR commit. The kernel parts are still in review, and the cell says so, as the display cells did. - **Suspend, WIP to testing.** The power key now lights the lock screen on the first press (#268, #275). Thirty attended sleeps and a day of real use with auto-sleep on all woke (SLEEP-PLAN, #284). The cell still says that three test sleeps on 10-28 to 10-30 never woke and that sleep tests stay attended. If you'd rather keep WIP until that hang is understood, I'll revert just the word. - **Display:** the display DT is merged, and brightness, DPMS off and on and the 60/120 Hz switch now have a dated record (kernel #125's boot, which also checks the panel ID). - **Charging, Haptics, Torch, NFC:** kernel #161, #96, #104 and #105 are merged. - **USB net:** the rescue also handles a replug the gadget didn't see (#280). The NOTES entry lists each boot with its release: Wi-Fi from the package, the power-key wake, the replug, storage idle (kernel #99), the panel ID (kernel #125), the RTC without the PMIC interrupt (kernel #55), and the auto-sleep day. GNSS and Modem stay as they are until the SIM test on Tuesday. Docs only; `tools/pr-check` passes, and the diff has no identifiers. Closes #307 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 6-hour auto-sleep series clean, and derekross#100 The shell's own auto-sleep behind the lock, with the fixed kernel: the power-key wake, 30-minute and one-hour sleeps, then a series of twelve half-hour sleeps woken by the RTC, all clean, 15 wakes in the boot with no UFS error. The two scripts arm the alarms and watch from the laptop. derekross#100 adds the modem fixes the test tree had lacked; the sleep path is unchanged.
… 6-hour auto-sleep series clean, and derekross#100 The shell's own auto-sleep behind the lock, with the fixed kernel: the power-key wake, 30-minute and one-hour sleeps, then a series of twelve half-hour sleeps woken by the RTC, all clean, 15 wakes in the boot with no UFS error. The two scripts arm the alarms and watch from the laptop. derekross#100 adds the modem fixes the test tree had lacked; the sleep path is unchanged.
…ross#99) omamobile-nfc-open stops neard's poll loop once every display connector has been off for 4 s and starts it again when the screen comes on, as stock Android does; a poll loop costs the Pixel 9a about 60 mA. The adapter stays powered, and the rfkill handling is unchanged. Tested on the Pixel 7 Pro (2026-10-30): polling stops with the screen off and resumes on wake.
…is loaded (derekross#197) Omarchy's hyprland.lua loads the look-and-feel rules from looknfeel.lua, so the phone rules go to whichever file the loaded config actually requires; on the Pixel 7 Pro (Omarchy 4.0.6) that is still looknfeel.lua, so nothing changes there. Renumbered to 0.2.49 at merge, after derekross#99 took 0.2.48. Closes derekross#197 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ross#115) The home screen's OWL host answered every device and system query with the Pixel 7 Pro's fixed values. The model and codename now come from the device tree (model and the first compatible), with a small table for what the device tree doesn't say about the two Pixels we run on (panel size, top refresh rate, density); any other board reports display: null rather than a guess. On the Pixel 7 Pro the answers are unchanged. Rebuilt on main by the maintainer from the pull request's own three files, since the branch carried an older derekross#99 underneath; renumbered to 0.2.50. Closes derekross#115 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rounds L-348 to L-361: shared drivers judged against every int-line user (derekross#150), board pins against every stock user (derekross#151), ownership flags under the consumer's lock (derekross#152), /chosen children and Google's panel constants (derekross#154), same-day notes PRs on one device (derekross#208/derekross#209), merge simulations for DEVICES rows, ours included (derekross#165), stacked PRs that merged main (derekross#115/derekross#117), titles behind renumbered versions, a contributor merge that dropped the PR (derekross#99), smoke package lists as provenance and "owner-authorized" writes (derekross#200), promised fixes and named tags checked on the remote (derekross#153/derekross#157/derekross#158), and file swaps into old packages (derekross#193). C-23 (usbc-deadman's device scope, kernel derekross#107) and C-24 (BNEP in a lynx-only fragment, derekross#98). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing (derekross#307) The 9a's row after today's merges, with a NOTES entry for the evening's boots that the new cells link to. - **Wi-Fi, testing to works.** `omamobile-device-tegu` 0.2.4 (derekross#238) starts it at boot now, through the shared gs201 host and zuma PHY (kernel derekross#178 on derekross#156, both in review) and brcmfmac (kernel derekross#56, in review), with only the extractor's firmware. The NOTES entry has the boot, and the three rebinds with Bluetooth up after derekross#178's FLR commit. The kernel parts are still in review, and the cell says so, as the display cells did. - **Suspend, WIP to testing.** The power key now lights the lock screen on the first press (derekross#268, derekross#275). Thirty attended sleeps and a day of real use with auto-sleep on all woke (SLEEP-PLAN, derekross#284). The cell still says that three test sleeps on 10-28 to 10-30 never woke and that sleep tests stay attended. If you'd rather keep WIP until that hang is understood, I'll revert just the word. - **Display:** the display DT is merged, and brightness, DPMS off and on and the 60/120 Hz switch now have a dated record (kernel derekross#125's boot, which also checks the panel ID). - **Charging, Haptics, Torch, NFC:** kernel derekross#161, derekross#96, derekross#104 and derekross#105 are merged. - **USB net:** the rescue also handles a replug the gadget didn't see (derekross#280). The NOTES entry lists each boot with its release: Wi-Fi from the package, the power-key wake, the replug, storage idle (kernel derekross#99), the panel ID (kernel derekross#125), the RTC without the PMIC interrupt (kernel derekross#55), and the auto-sleep day. GNSS and Modem stay as they are until the SIM test on Tuesday. Docs only; `tools/pr-check` passes, and the diff has no identifiers. Closes derekross#307 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A poll loop is the NFC radio searching for cards. On the Pixel 9a it costs about 60 mA awake with the screen off: 252 mA with NFC off against 315 mA with it on, in a cable-out drain test today. Stock Android polls only while the screen is on.
omamobile-nfc-open now stops neard's poll loop once every display connector has been DPMS off for 4 s, and starts it again when the screen lights. If the NFC switch is off, it stays off. It reads the connectors'
dpmsin sysfs, so it needs no session access.Tested on the 9a: no controller interrupts in 10 s with the screen off, 102 in the first 6 s after it came on, and the journal shows the stop and the restart. The package tests (217) and pr-check pass. The 7 Pro should behave the same, since it uses the same neard path.