Repository navigation
Conversation
…ery 30 s, not every 2 s With the screen off behind the lock, omamobile-sleepd ran its full checks every 2 s: the toggle, the screen through omarchy-hw-display and Hyprland, the lock's state from the shell (omarchy-shell, socat), SSH, logind's inhibitors and the sinks, about 20 processes each time, and the shell answered every lock question. On a Pixel 9a whose modem holds its sleep inhibitor for the whole boot that never ends: in a minute with the screen off the daemon used 4.9 s of CPU, 52 processes a second were started, and the system as a whole used 25 s. Now, once a check finds sleep refused, the next full check comes OMAMOBILE_SLEEP_RECHECK seconds (30) later; the 2 s polls in between read the backlight with no process started, and a lit screen, the power key or a resume brings the full check at once. A released inhibitor is seen within 30 s. With no panel to read, every poll is a full one, as before. On the palmtop, screen off, modem up: the daemon used 0.72 s in a minute, and the system 14.7 s. test/sleepd.sh counts the shell's lock questions over 330 s with an inhibitor held (at most 40; 315 before the change), and checks a release, a lit screen between checks and the no-panel case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the screen off behind the lock,
omamobile-sleepdruns its full checks every 2 s: the toggle (omarchy-toggle-enabled), the screen (omarchy-hw-display, then Hyprland), the lock's state from the shell (omarchy-shell lock status, which goes throughtimeoutandsocatto the shell), SSH (ss), logind's inhibitors (busctl,jq) and the sinks (pactl). That is about 20 processes a time, and the shell answers every lock question. Where sleep is refused for a long time, that never stops. On a Pixel 9a the modem's boot unit holds a sleep inhibitor for the whole boot, so with the modem up it runs all day in a pocket.Measured on my palmtop (a Pixel 9a, daily kernel, modem up, screen off, cgroup
cpu.statover a minute):omamobile-sleepd.serviceBefore, 1,573 processes were started in 30 s, mostly by the daemon.
The change: once a check finds sleep refused, the next full check comes
OMAMOBILE_SLEEP_RECHECKseconds (30) later. The 2 s polls in between read the backlight'sbl_powerwith bash's ownreadand start no process. A lit screen there, the power key (USR1) or a resume (USR2) brings the full check at once, so a screen turned on and off again starts the after-off wait again as before. A released inhibitor is seen within 30 s. Where no panel can be read (omarchy-hw-displaygives nothing, orbl_powercan't be read or reads 0), every poll is a full one, as now; that includes a screen that only Hyprland reports off.Tests:
test/sleepd.shcounts the shell's lock questions over 330 s with an inhibitor held: at most 40 allowed, 315 without the change. It also checks that an inhibitor released between checks lets it sleep within 30 s, that a screen lit and dark again between checks is seen (the refusal is logged again after the new wait), and that with no panel known every poll is a full one. The package'stest/all,tests/allandtools/pr-check origin/mainpass.This is the 9a's case for the auto-sleep default in #912: with the modem up it never sleeps, so the daemon's polling is what the default costs there.