feat: Add DDC power mode (VCP 0xD6) support for HDMI display on/off#194
Open
caraar12345 wants to merge 1 commit intoleukipp:mainfrom
Open
feat: Add DDC power mode (VCP 0xD6) support for HDMI display on/off#194caraar12345 wants to merge 1 commit intoleukipp:mainfrom
caraar12345 wants to merge 1 commit intoleukipp:mainfrom
Conversation
HDMI-connected touchscreens without a sysfs backlight respond to DPMS commands by showing "No signal" rather than actually turning the panel off. Many of these displays support DDC/CI power mode control via VCP feature 0xD6, which properly turns the panel off/on without losing the HDMI link. This adds ddcutil setvcp/getvcp 0xD6 as a display status command: - Preferred when ddcutil is already used for brightness (no sysfs backlight), since that is the exact failure scenario for DPMS - Falls back to ddcutil when no DPMS tool is available - Uses --noverify on setvcp because many monitors return a verification error on power-on despite the command succeeding - Tracks status changes via a Status.vcp cache file (same pattern as brightness) to avoid slow ddcutil polling in the update loop Closes leukipp#187 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
argh I did not mean to allow Claude to PR it straight away; I wanted to check through it first 😅 changes may be incoming - sorry for the possible slop 🙇 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ddcutil setvcp/getvcp 0xD6as a display status command for HDMI touchscreens that support DDC/CI power mode controlProblem
On HDMI-connected touchscreens without a sysfs backlight, the existing DPMS-based display on/off (wlopm/kscreen-doctor/xset) kills the HDMI signal rather than turning the panel off. The monitor shows "No signal" instead of actually powering down. TouchKio already uses
ddcutilfor brightness control on these screens — the same infrastructure can control power mode.Solution
DDC/CI VCP feature
0xD6(Power mode) properly turns HDMI panels off (0x04) and on (0x01) without losing the HDMI link. This PR:getDisplayBrightnessCommand()init (which already callsddcutil capabilities), storing the result inHARDWARE.display.status.ddcPowerModeddcutil getvcp d6 --brief(parsesx01=ON,x04=OFF)ddcutil setvcp --noverify d6 <value>with cache file trackingStatus.vcpcache file (same pattern asBrightness.vcp) to avoid slow ddcutil polling in the 1s update loopNote on
--noverifyThe
--noverifyflag is required because many monitors return a DDC verification error on power-on even though the command succeeds. This is a well-known ddcutil behaviour (see ddcutil#36). Without it, successful power commands would be reported as failures.Init reorder
Brightness detection is moved before status command detection in
init()becausegetDisplayStatusCommand()now checks whether ddcutil is already being used for brightness to decide whether to prefer DDC power mode over DPMS.Closes #187
Test plan
Supported: {...}output at startup showsdisplayStatus: trueon an HDMI touchscreen with ddcutil and D6 supportDisplay Status [ddc://vcp/feature/0xD6]: ON (ddcutil)light.turn_off) → screen turns off properly (no "No signal")light.turn_on) → screen turns back ongetDisplayStatus()correctly reports ON/OFF based onddcutil getvcp d6🤖 Generated with Claude Code