Skip to content

Debounce unforced lock wake calls immediately following display blanking - #8896

Open
Sword-Saint69 wants to merge 2 commits into
omacom:quattrofrom
Sword-Saint69:fix/lock-post-blank-debounce
Open

Sword-Saint69 wants to merge 2 commits into
omacom:quattrofrom
Sword-Saint69:fix/lock-post-blank-debounce

Conversation

@Sword-Saint69

Copy link
Copy Markdown

Problem (#8863)

On AMD APU setups with Radeon HDMI audio codecs (snd_hda_codec_hdmi), disabling DPMS (omarchy-brightness-display off) causes the kernel driver to emit SW_VIDEOOUT_INSERT evdev switch events on /dev/input/eventX ("HD-Audio Generic HDMI/DP").

The input subsystem treats this hardware switch event as user activity, firing runWake() (omarchy-system-wake) and re-enabling DPMS in a continuous 5–8 second flap loop.


Fix

  1. Post-Blanking Debounce: Added a 1.5s post-blanking window (Date.now() - lastBlankedAt < 1500) in Service.qml. Unforced/automated wake calls occurring within 1.5s of runBlank() are ignored to swallow hardware HPD/audio switch events.
  2. Explicit User Interaction Unchanged: User interaction (LockView mouse click, typing, password submission) passes force = true (runWake(true)), waking the screen immediately without delay.
  3. Automated Tests: Updated test/shell.d/lock-blank-fingerprint-test.sh to assert runWake post-blanking debounce logic.

Fixes #8863

On AMD APUs with Radeon HDMI audio codecs, turning off DPMS drops the HDMI link and causes the kernel codec driver to emit SW_VIDEOOUT_INSERT evdev switch events. The input subsystem interprets this as user activity, firing runWake() and re-enabling DPMS in a continuous 5-8s flap loop.

Ignore unforced wake events during a 1.5s post-blanking window in Service.qml while keeping explicit user interactions (mouse clicks, typing, password submission) forcing immediate wake.

Fixes omacom#8863
Copilot AI balanced review requested due to automatic review settings August 29, 2026 06:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds post-blanking wake debouncing to prevent AMD HDMI/DP switch events from immediately re-enabling displays.

Changes:

  • Tracks display blanking time and suppresses unforced wakes for 1.5 seconds.
  • Forces wake requests originating from LockView.
  • Adds a source-level debounce assertion.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
shell/plugins/lock/Service.qml Implements wake debouncing and forced interaction wakes.
test/shell.d/lock-blank-fingerprint-test.sh Checks the debounce guard exists.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shell/plugins/lock/Service.qml Outdated
onSubmitPassword: function(password) { root.submitPassword(password) }
onClearFailureRequested: root.failureMessage = ""
onWakeRequested: root.runWake()
onWakeRequested: root.runWake(true)
…ignals

Differentiate deliberate user interaction (mouse clicks, typing, password submission) from generic motion/switch activity. LockView's wakeRequested signal now passes a force boolean parameter, ensuring mouse clicks and keyboard entry force an immediate wake while pointer motion (onPositionChanged) remains subject to the 1.5s post-blanking debounce.
@Sword-Saint69

Copy link
Copy Markdown
Author

Updated the implementation to differentiate deliberate user input from generic motion:

  • signal wakeRequested(bool force) in LockView.qml now passes force = true for deliberate user actions (onClicked, Keys.onPressed, onTextChanged).
  • onPositionChanged passes force = false, ensuring pointer motion and synthetic layout events remain subject to the 1.5s post-blanking debounce.
  • Service.qml forwards onWakeRequested: function(force) { root.runWake(force) }.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

property double lastBlankedAt: 0

function runWake(force) {
if (!force && locked && (Date.now() - lastBlankedAt) < 1500) return
Comment on lines +34 to +36
assert(
/function runWake\(force\) \{\s*if \(!force && locked && \(Date\.now\(\) - lastBlankedAt\) < 1500\) return/.test(serviceQml),
'runWake ignores unforced wake events during the 1.5s post-blanking debounce window'
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed against quattro by reading it alongside #8863 and the other open fixes for that bug. Nothing was run on a worker, because of the conclusion below.

Another open pull request is the better fix for #8863: #13129. This pull request ignores pointer-motion wakes for 1.5s after the lock blanks the displays. The reporters on #8863 measured the display relighting about 3s, 11s and 19s after DPMS-off, so a wake arriving that late passes the window and the loop carries on as before. The window also covers only one wake path. In shell/plugins/services/idle/Service.qml, cancelIdleCycle runs omarchy-system-wake when the idle monitor reports activity, and that never goes through the lock's runWake. A monitor that drops hotplug-detect is re-added by Hyprland already powered on, so it relights without any wake call at all. The HDMI-audio switch events in the original report are most likely another effect of that same hotplug drop. #13129 works one layer down: it enables amdgpu's HDMI HPD debounce, so the output is never removed and re-added and nothing relights. Every reporter on #8863 is on amdgpu, so all of them are covered. #13129 does not reach non-AMD GPUs, and no #8863 reporter has confirmed it on their machine yet.

The test this pull request adds only matches the new source text with regular expressions, so it would pass whether or not the debounce stopped anything. The branch also conflicts with quattro, which is about 520 commits ahead. runWake there now clears displaysBlank and the per-monitor DPMS state, so rebasing would need rework rather than a mechanical merge.

The other open fixes aimed at parts of this cluster are #8581, #9152, #10130 and #10343. They all act on the lock or idle service after the output has already come back.

The bug and compatibility labels come from an earlier pass where two models classified it the same way; the second was deepseek-v4p1-flash. The choice between the fixes is Claude Opus 5.5's alone. The second opinion, Codex Medium, was reachable, but today's review budget was spent, so it did not review this.

Waiting on the maintainer to choose between this and #13129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display flickers off/on repeatedly after idle lock on AMD APU + HDMI/DP (DPMS flap loop)

3 participants