Repository navigation
Conversation
|
Thank you, @Somnius. The measurement is exactly what this needed: the three steps timed one by one, old and new alternated, and the modeset count to show the lock's own display-on doesn't cause a second one. 180 ms off a double tap is worth having. Main moved under it, though, and in the same functions, so it needs rebuilding rather than a rebase. #577 (shell 0.2.133) gave
One small thing on the test: the new order check depends on two sleeps (0.1 s and 0.4 s). |
…roid switch With OMAMOBILE_POWER_KEY_ANDROID=1, a double tap on a dark screen starts the display first, in the background, and runs the locked check and the lock's wake beside it, then waits for the display and puts the brightness floor back. The display (about 0.25 s of modeset, then the panel's 0.13 s on the Pixel 8 Pro) is the slow part, and neither call into the shell depends on it. I put it behind the switch main already has rather than making it the default, so phones without it (the Pixel 7 Pro today) keep the order they have: the locked check, the lock's wake, then the display. The brightness floor is now one function, brightness_floor, used by both wake_locked definitions, wake_unlocked and the double tap. test/keys.sh checks the double tap's order with the switch on and off. The display stand-in waits on a FIFO that the test opens only after it has seen the lock's wake (or the display's start when unlocked), and with the switch on the locked check waits for the display's start, so the check doesn't depend on sleeps or the runner's clock.
94d0d01 to
34493b2
Compare
|
@derekross rebuilt on main's file instead of rebased, force-pushed as 34493b2:
Still to do, both on the phone: watching a few double taps on a dark, locked phone and unlocked for a flash or a blank beat, and a run of this package with |
@derekross, a small one from the Pixel 8 Pro: a double tap on the dark screen woke it, but it felt slow ("not like a normal phone"). The delay is in omamobile-keys
double-tap, which ran its steps one after another. Timed one by one on the phone, three rounds: the locked check (omarchy-shell lock isLocked) 94 to 99 ms, the lock's own wake (omarchy-shell lock wake) 90 to 96 ms, andomarchy-brightness-display on, which includes the display modeset, 247 to 251 ms. The screen only started lighting when the last of them started, so with the script's own start and the small checks the display came on about 0.3 s after the call and the panel about 0.45 s.The change: start the display first, in the background, run the locked check and the lock's wake beside it, wait for the display, and then do the brightness floor as before (it is now a function,
brightness_floor, which wake_locked and wake_unlocked call too, the same four lines as before). Nothing about what is woken changes: a dark screen only, locked or not, no lock wake when unlocked.Measured on my phone with a 4 ms poll of the DSI
dpmsfile and the backlight'sbl_power, the screen dark and locked, from the call toomamobile-keys double-tapuntil the display is on and until the panel is on, five runs each, alternating the old and the new script:old: display on 298 to 342 ms (about 324), panel on 433 to 467 ms (about 452)
new: display on 127 to 161 ms (about 145), panel on 259 to 297 ms (about 278)
So about 180 ms earlier. That leaves out the doubletap daemon's own detection (it fires on the second tap's release) and its start of the script, and it was one phone, with the SoC at about 55 C and the sensor proxy not running, so the proximity guard added nothing.
I also counted display modesets per wake, since a second DPMS enable is what blanked the panel for a beat before: ten wakes on the phone, five with each script, and each had exactly one
gs-deconmode line and the same sequence of the DSIdpmsandbl_powerstates (Off/4, On/4, On/0), so the lock's own display-on call did not cause a second modeset in the new order.Tests: test/keys.sh passes. The block's locked-check stand-in takes 0.1 s, as on the phone, so the order check doesn't depend on a race between two process starts. The new block uses a display stand-in that takes 0.4 s and logs its start and end, and checks that the lock's wake is logged between them (so it runs beside the display and not after it), that the handler still waits for the display, and that an unlocked tap still has no lock wake. I ran it against the old omamobile-keys and it fails on "the display starts before the lock's wake".
Not tested: how it looks. Running the lock's wake beside the display's modeset is the kind of ordering that gave the flash in #640, and I have only measured times, nobody has watched the screen on a double tap with this change yet, so I'm opening it as a draft and I'll look at it in the morning. The kernel and shell on that phone are the ones from #724 (the shell is 0.2.107 with my copy of this file patched the same way).