add keep_screen_on feature to orbic devices#919
add keep_screen_on feature to orbic devices#919PapiJalopy wants to merge 4 commits intoEFForg:mainfrom
Conversation
…_screen_on enabled While keep_screen_on is enabled, force /sys/power/autosleep to "off" and restore "mem" when disabled. On battery power the device enters rapid suspend/resume cycles, causing the display to visually "blink".
untitaker
left a comment
There was a problem hiding this comment.
If we want this feature I think the code is clean. Seems like if the feature won't work the code is still sufficiently isolated from the rest to make this safe to roll out.
Disabling it fixed a bug where the display colors become corrupted when spamming the on/off button. This is not needed anyways because from monitoring the node I've never seen it change anyways.
|
I'm hesitant to merge this for a couple reasons:
Given these hesitations I'm inclined to close this pull request unless a good case is made for merging it. |
|
Its literally just a toggle that starts a watchdog that monitors 3 sysfs nodes and writes "1" to them if it sees that they have been set to "0". I'm not sure I agree that its complicated. Me personally I find it useful when paired with my other pull request regarding the severity PNG's. It allows the custom images to always be visible. |
|
I get the hesitation, but I think this is a little more useful than it may sound on paper. It is basically just a toggle that starts a small watchdog loop watching a couple sysfs nodes and restoring them if the device turns the display back off. So even though it touches low level stuff, the actual logic is pretty small and self contained. As for the use case, for me this is mainly about visibility. It is useful with the severity image work, but even outside of that it is helpful any time the device is being used as a dedicated display and the person wants to keep the current state visible without having to constantly wake the screen back up. On the Orbic only point, I agree it is device specific, but I dont really see that as a blocker by itself. We already have Orbic specific behavior in other places where the hardware exposes capabilities that other devices dont. I wasnt trying to make a cross-device feature here, just expose something the Orbic can already do in a way that is useful. On battery life, I agree that is the biggest tradeoff, which is why I made it an explicit toggle rather than default behavior. If it helps, I can make that clearer in the UI/config description so people understand that enabling it may increase battery usage if left on while unplugged. |
Summery
Adds a toggleable keep-screen-on feature that prevents the device display from sleeping. When enabled the daemon detects when the display has entered its sleep state and re-enables it by toggling display sysfs nodes.
Addresses #916 #539
Changes
Adds a toggle in the web UI,
Adds keep_screen_on: bool to config (default is false).
Adds a checkbox and tip to the configuration page.
When
keep_screen_onis enabled, spawns a watchdog task that, polls display sysfs state (sleep_mode,bl_gpio,display_on).If display is blanked (
sleep_mode == 0andbl_gpio == 0), writes1todisplay_on,bl_gpio, andsleep_mode.No behavior change unless the option is enabled
Documents the new config option in the
config.toml.intemplate and the configuration docs.Testing
Verified source builds.
Verified binary installs.
Verified toggle is visible in web UI.
With
keep_screen_on = true, the screen no longer stays blanked after the normal timeout.With
keep_screen_on = false, behavior matches current upstream behavior.Pull Request Checklist
cargo fmt.