Repository navigation
omamobile-keys: the power key as Android's on the Pixel 7, behind OMAMOBILE_POWER_KEY_ANDROID - #577
Conversation
|
Thank you, this is careful work, and the commit messages with the measured timings make each change easy to follow. I checked that the switch really leaves every other phone alone: I sourced main's and your Three things before merge:
Smaller things, none blocking: please note in the |
A short press on an unlocked phone dims the panel to 0, locks behind it, turns the display off and puts the brightness back for the next wake. On a Pixel 7 the panel goes off about 0.4 s after the DPMS dispatch (bl_power then reads 4), and the brightness came back before that, lighting the lock screen for a moment before the screen went dark. It now waits for bl_power to read 4 (at most 1.5 s). Measured on the phone every 20 ms: brightness 0 at 0.62 s, panel off at 1.99 s, brightness back at 2.02 s; before, back at 1.61 s with the panel still on until 1.97 s. I used AI help (Claude) to work on this.
The backlight at 0 only dimmed a Pixel 7's OLED: the screen went dim, the lock showed through it, and only then did the screen go off. The press now powers the panel off first (DPMS), with the backlight at 0 for a panel DPMS doesn't reach, and takes the lock behind it, as Android goes dark at once. I used AI help (Claude) to work on this.
A shell with omamobile.home's screenOff call (the Pixel layer's 200 ms fade) gets it before the panel goes off; without it the call fails and the panel goes off at once, as before. I used AI help (Claude) to work on this.
Android wakes on the key's press, not its release, so the screen answers the press itself; the release then does nothing. I used AI help (Claude) to work on this.
Repeated presses ran over each other (a wake under a going-to-sleep), and a held press woke the phone on the way down and again at the long-press mark, then left its mark behind so the next short press within 5 s was swallowed. Each press's work now waits for the one before (flock, at most 4 s), a long press neither wakes a lit screen nor a phone its press woke, and its release clears the mark. I used AI help (Claude) to work on this.
Measured on the phone with a timing log: a press that woke the phone took about 100 ms to decide (screen_off and locked ask Hyprland and the shell) and asked for the panel some 170 ms after the press, behind the lock's wake and the reveal. It now decides by the panel's bl_power (a file read, with screen_off as the fallback where bl_power stays 0) and asks for the panel first, the rest happening while it comes on (about 270 ms): the wake starts 30 ms after the press and asks for the panel at 44 ms. I used AI help (Claude) to work on this.
The watcher noticed a resume only on its next poll, and the phone freezes it mid-pause while asleep with the pause's clock not counting the sleep: up to 2 s (5 s idle) between the press that woke the phone and the lit lock screen (Ángel, 6-nov: the power key's quicker wake didn't show after a while off). Asked to sleep and not yet seen to wake, it now polls every 0.2 s, until a retry is due. omamobile-keys' wake from sleep uses the quick bl_power check as the press's own wake does. test/sleepd.sh's fake clock moves a whole second for a sub-second pause. I used AI help (Claude) to work on this.
Measured with a timing log on the phone: of 13 quick presses, 3 were thrown away as bounces. A press that had woken the phone wrote its time once its wake was done (half a second later), and the next press came within the 0.8 s debounce of that. Presses are now timed from the key's release, and the debounce is 0.3 s, enough for a bounce now that presses run one at a time. Measured again: 33 presses, every one acted on. I used AI help (Claude) to work on this.
Measured with a timing log on the phone: turning an unlocked phone off takes about 2 s (the reveal, the lock, the panel going off), and a press in that time was queued behind it and lost (Ángel, 6-nov: slow to light). As Android's, such a press now wakes the phone back at once, locked: the press marks it, and each step of the turning off looks and stops, puts the brightness back, takes the lock if it isn't yet, and wakes. I used AI help (Claude) to work on this.
…KEY_ANDROID=1 The commits before change shared code every phone runs. Off, the shared default, omamobile-keys puts back the three functions they changed (wake_locked, long_press, short_press) word for word from before, a press doesn't wait for the one before, the press doesn't wake on the way down, and omamobile-sleepd keeps its poll. device-panther turns it on through environment.d, as OMAMOBILE_ROTATION_HOLD. test/keys.sh and test/sleepd.sh run both ways; a new check tells them apart (the fade to black before the lock), and fails with the switch forced either way. device-panther's test fails without the file or with the switch at 0.
54d6c94 to
48ec440
Compare
|
Thanks. #508 landed first, so this is rebased onto it:
The run on the Pixel 7 is still to come: the phone is away from me today. I'll post it here with everything you asked for. |
|
Thank you, Ángel, the rebase is exactly what I asked for. I repeated the comparison on today's main, which now has #508: with the variable unset, the function definitions are identical apart from the unused So the only thing left is the run on your Pixel 7 with this branch's packages, whenever the phone is back with you:
Three small things you could look at in the same run, none of them blocking:
I'll set the versions (omamobile-shell and device-panther 0.1.14) and the title when I merge. |
|
The run on my Pixel 7 with this branch's packages (head 48ec440), built on the phone with After restarting the session (18:04 local), the variable is in both places:
Presses, in this order, a few seconds apart: a short press with the screen lit and unlocked, a short press with it dark, a quick double press, a press while it was going off, a double tap on the screen during those two seconds (your point 1), and a press with the screen dark but not locked yet (your point 2). I reported that every one behaved as expected: lit → locked and dark, dark → awake on the lock screen, and no stuck or doubled state in the quick cases. Point 2 comes up as I expect: it wakes to the lock screen. While I pressed, a recorder on the phone logged the panel state every 150 ms, and the journal has the presses. A short excerpt (local time): Every press has one action in the shell's log, and there are no errors or warnings from the keys or the lock in the journal for the whole run, only Omarchy's existing Your point 3 ( phone-smoke: pantherKernel
Packages: hyprland 0.57.0-3.3, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.2-1, omamobile-audio 0.5.16-1, omamobile-device-panther 0.1.13-1, omamobile-firstboot 0.1.3-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-omarchy 1:0.1.32-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.113-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1 I used AI help (Claude) to work on this. |
|
Thank you, Ángel. The run is what I asked for: the two package versions, the variable in both environments, the presses with their Main moved under this in the meantime: #640 (the brightness comes back only once the panel is off, measured on the Pixel 8 Pro) and #642 (
After the rebase, a short check on the phone is enough, no second smoke report: I'll set the versions and the title when I merge. Thanks for the patience with a moving base. |
…ey-as-android One panel_dark, main's, with the backlight device, defined with wait_screen_off above the switch so both modes share them; the Android short_press waits with wait_screen_off instead of its own loop on the real /sys, so main's flash check passes with the switch on too. The quick wake check falls back to screen_off, as the Android press's did. test/all keeps main's new lines and runs keys.sh with the switch off and on. I used AI help (Claude) to work on this.
|
Thank you for doing the merge by hand and laying it out. Updated (87b444a; a merge of today's main into the branch, since I couldn't force-push from here):
On my PC: I used AI help (Claude) to work on this. |
|
Thank you, Ángel. I went through the merged head (87b444a) against today's main, with the switch off and on:
So what's left is what you already named: the 0.2 s poll in One nit while you're in the file: the comment above that wait still says "At most 1.5 s". I'll set the versions (omamobile-shell and device-panther) and the title when I merge. No hurry; whenever the phone is back in your hands. |
I used AI help (Claude) to work on this.
|
Thank you for going through it, and for the two-press check. The comment is fixed in 2c075e9: it now says at most 1 s, from I used AI help (Claude) to work on this. |
Measured on the Pixel 7 (12 Nov), power-key wake from a real s2idle sleep to the lit lock screen (bl_power 0), the press timed from the key's evdev event: with the 0.2 s poll 0.66 s (1 wake), without it 0.70 s and 0.76 s (2 wakes). Without the poll it could have taken up to 2 s more; it didn't, because logind's PrepareForSleep(false) already ends the watcher's pause at once (test/sleepd.sh checks that). The poll added nothing, so omamobile-sleepd, its test and test/all's sleepd line are back to main's. I used AI help (Claude) to work on this.
|
Thank you, Ángel. I went through the two new commits:
Two lines are left from the short check I asked for, and then I'll merge:
Two leftovers while you're there, only if you push again: the I'll put the two version numbers on your branch as one commit on top just before I merge, and write the commit message from your commits, with the measurements. |
omamobile-sleepd no longer reads OMAMOBILE_POWER_KEY_ANDROID since its 0.2 s poll went (2a3658f): the environment.d file's comment and the README named it still. I used AI help (Claude) to work on this.
|
Thank you, Derek. Both checks, on the Pixel 7 that made the sleep measurements:
The two leftovers (the I used AI help (Claude) to work on this. |
|
For the squash message: these commits were written with Claude Opus 5.5, so the trailer CONTRIBUTING asks for is |
|
Thank you, Ángel, and thank you for the care in that last check. The One thing I have to ask of you after all: I said I'd put the version numbers on your branch myself, but I can't push to your fork from here. Could you push one commit on top (no rebase or amend needed) that sets:
Those are the next free numbers on main today. If another shell pull request takes 0.2.132 before I merge, I'll tell you the next one. Once CI has run on that push I'll merge and write the commit message from your commits and measurements, with the trailer you gave. Thank you also for the honest note about |
The version numbers for this pull request. omamobile-shell takes 0.2.133 because derekross#425 took 0.2.132 on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Done: |
|
Thank you, Ángel, and thank you for catching that #425 had taken 0.2.132 in the meantime. 0.2.133 and 0.1.16 are both free, your merge of main changed nothing of the pull request itself, and CI is green on the merged head, so I'm merging it now, with the commit message written from your commits and measurements and the trailer you gave. |
derekross#577 takes 0.1.16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
The power key as Android's, behind a switch:
OMAMOBILE_POWER_KEY_ANDROID=1, which only device-panther sets (environment.d, asOMAMOBILE_ROTATION_HOLD). This is shared code, so with the switch off (every other phone)omamobile-keysputs back the three functions it changes,wake_locked,long_pressandshort_press, word for word frommain.With the switch on, these changes, each with its measurement in its commit message:
bl_powerreads 4 (the lock screen lit for a moment before going dark).screenOffcall (a 200 ms fade), it gets it first; without it the panel goes off at once.flock, at most 4 s); a held press wakes once and its release clears the long-press mark.bl_power(a file read,screen_offas the fallback) and asks for the panel first: the wake starts 30 ms after the press and asks for the panel at 44 ms (about 100 ms and 170 ms before).The last commit adds the switch.
Tested
test/allonmain(4130e51) with this branch: omamobile-shell 332 ok, 0 not ok; omamobile-device-panther 19 ok.omamobile-sleepdpoll is dropped (2a3658f). Measured on the Pixel 7, power-key wake from a real s2idle sleep to the lit lock: 0.66 s with it, 0.70 s and 0.76 s without it. logind's resume signal already ends the watcher's pause, soomamobile-sleepdis back tomain's.test/keys.shnow runs twice, switch off and on. A new check tells the two apart (the fade to black comes before the lock only with the switch on); forcing the switch the wrong way insideomamobile-keysmakes it fail both ways. device-panther's test fails without the file and with the switch at 0.omamobile-sleepdthere readenvironment.d(both haveOMAMOBILE_ROTATION_HOLD=1).Not checked
I used AI help (Claude) to work on this.