Skip to content

omamobile-shell 0.2.41: a touch wake lights the lock screen as the power key does - #183

Closed
W4HO-ham wants to merge 5 commits into
derekross:mainfrom
W4HO-ham:shell-touch-wake
Closed

W4HO-ham wants to merge 5 commits into
derekross:mainfrom
W4HO-ham:shell-touch-wake

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

Symptom, on the palmtop this morning: the power key turns the screen off and the phone sleeps a few seconds later; a tap wakes it and the lock screen shows, but hyprctl monitors -j still says dpmsStatus: false and the panel's backlight device reads bl_power 4, so the panel driver refuses local_hbm_mode with EPERM and the fingerprint circle never appears on that lock screen. A power-key press in that state runs omamobile-keys' wake and everything is right at once (DPMS true, bl_power 0, circle, unlock).

Cause: omamobile-sleepd lights the lock screen through omamobile-keys wake only after a KEY_POWER wake. A touch wake got nothing: Hyprland never saw a wake action, so its DPMS state and the backlight power stayed as the sleep left them while the panel showed the lock.

Change: sleepd treats a wake from the touchscreen's interrupt like the power key's. The interrupt is matched by name: the touch driver requests it under its device's name (the SPI device, spi3.0 on the 9a), found as the parent of the input device that has INPUT_PROP_DIRECT, so nothing is device-specific. An unknown interrupt is still a dark resume. Tests cover both.

Test on a phone: power key off, wait for the sleep, tap to wake; hyprctl monitors -j shows dpmsStatus true and bl_power reads 0, and with the fingerprint stack up the circle appears on the lock screen without a power-key press.

Not run on the palmtop yet (it is in a drain test with the cable out); the package tests pass and tools/pr-check is clean.

…wer key does

After the power key put the palmtop to sleep, a tap woke it and the panel showed the lock screen, but Hyprland still reported DPMS off and the panel's backlight device stayed powered down, so the panel driver refused the fingerprint circle (EPERM) until a power-key press ran the proper wake. omamobile-sleepd lit the lock screen only for a KEY_POWER wake; it now does the same for a wake from the touchscreen's interrupt (found as the parent device of the input device with INPUT_PROP_DIRECT), through omamobile-keys wake: the lock's wake, Hyprland's DPMS enable and the backlight. A test covers the touch wake and an unknown interrupt.
@derekross

Copy link
Copy Markdown
Owner

Thanks, nicely found, and the name match through INPUT_PROP_DIRECT keeps it generic. The tests pass here on top of today's main.

Two things. First, main's shell is already at 0.2.44 (#184), so this needs the next free version; I'll set it at merge. Second, our published touch driver doesn't arm its interrupt for wake, so I'd like to see the touch interrupt really is the wake reason: once the 9a is off its drain test, could you tap-wake it and paste sleepd's resumed, woken by IRQ … line from the journal, plus whether the lock screen then has DPMS on and the circle? If the wake turns out to come from something else, the match needs changing. A small robustness idea: skip input devices with no device link, so a virtual touch device can't mask the real one.

# Conflicts:
#	packages/omamobile-shell/version
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 30, 2026
…d H5's wording

The clock pad entry says what tegu-nfc-clkpad is and that it writes PMU 0x3e84 once through the kernel's SMC-backed regmap, never /dev/mem, with the boot unit's order and hang marker. The fingerprint-circle paragraph names the tap wake and points at omamobile-shell derekross#183. The USB-HOST-PLAN link has its target, and H5 reads Expect not met, within the stop window.
… with a parent

A direct-touch input device without a device link (uinput, a test tool) listed before the real touchscreen would have given an empty name and masked it; such devices are skipped now, with a test for the case.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Rebased onto today's main (merge commit 24bc277, the version conflict resolved to 0.2.45) and the robustness idea is in at 77fd96d: touch_irq_name skips a direct-touch input device that has no device link, so a virtual device (uinput, a test tool) listed before the real touchscreen can't mask it, with a test for that case in test/sleepd.sh; the package's 237 checks and tools/pr-check pass. The tap-wake proof you asked for comes as soon as the owner can tap the palmtop, which is on its drain test right now: this change is already installed there as 0.2.41 with the sleep daemon restarted, so the "resumed, woken by IRQ …" line, Hyprland's DPMS state and the circle will come from that build, and if the wake IRQ turns out not to be the touchscreen's, the match gets changed.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Main took 0.2.45 with #161 meanwhile, so this is 0.2.46 now (f6fa429, main merged in, tests and the gate clean).

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

The proof run, with the fixed sleepd on the palmtop (hand-copied from this branch; the package build had installed a stale script): a forced systemctl suspend with a 10-minute RTC backstop, then the owner tapped the screen and pressed the power key during the sleep. Neither woke it. The kernel shows the CPUs came up once at about 112 s (Timekeeping suspended for 112.557 seconds, then 486.817 seconds) and went straight back to s2idle, and the only exit was the RTC: PM: Triggering wakeup from IRQ 56, sleepd resumed, woken by IRQ 56: … s2mpg14-pmic. After that dark resume the lock screen stayed off with bl_power 4 and dpmsStatus false, which is the intended dark-resume behaviour.

So on this kernel a tap can't wake s2idle at all: the touchscreen's interrupt (IRQ 58, gpn0 … spi20.0) has no wake arming, as you said, and /sys/class/input/event0/device/power/wakeup is empty. The tap-wake this change handles can only happen once the touch driver arms its interrupt; until then the code path is unreachable and harmless. Two notes for the record: the morning's "tap woke it to the PIN pad" was a screen-on without a suspend (the auto-sleep toggle was off), which is why the state was stale then; and the power key not waking this sleep is new (it woke s2idle on 10-27) and goes to SLEEP-PLAN, since tegu-mif-sleep was still loaded from the drain run. Your call whether to merge this now as groundwork or hold it until the driver arms the interrupt.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Two lock-side observations from this afternoon on the palmtop, for whoever picks the shell up next (not changes to this PR):

  1. After the day's forced sleeps and wakes, with the owner on the desktop, omarchy-shell lock status reported locked:true, sessionLocked:true, fingerprint:true; the lock's PAM fingerprint verify restarted every few seconds, fprintd stayed claimed (fprintd-verify got AlreadyInUse), and omarchy-restart-shell refused to run "while the session is locked". A fresh omarchy-shell lock lock and a PIN unlock resynced it. So a resume can leave the lock's state machine believing it is still locked after the user has unlocked.
  2. The lock draws no fingerprint marker over the sensor (only the PIN pad's small icon next to "Enter PIN"), although omamobile.fingerprint's comment says a faint fingerprint should sit over the sensor while pam_fprintd waits. The circle lights only on a touch inside the sensor's circle (centre 540,1756, radius 101), so without the marker the owner aims blind; the morning's unlocks worked once the circle had shown the spot, the afternoon's attempts never produced a finger-down.

derekross added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 31, 2026
…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>
@derekross

Copy link
Copy Markdown
Owner

Thanks for the proof run; it settled it. On today's kernels a tap can't wake s2idle on either phone, and the morning's state came from a screen-on without a suspend. I'd rather hold this until a touch driver arms its interrupt for wake. When that comes we'll also need to decide whether a touch should light the screen at all (stock doesn't, apart from AOD gestures), and it'll take the next free version then. The stale-DPMS-without-suspend case you found is worth its own issue.

@derekross

Copy link
Copy Markdown
Owner

Closing for now. It was held until a touch driver can wake the phone, it conflicts with the shell since, and #420 now covers double-tap wake. If that path doesn't work out, this can be reopened and rebased. Thank you for it.

@derekross derekross closed this Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants