https://bugs.kde.org/show_bug.cgi?id=528077
Bug ID: 528077
Summary: powerdevil permanently drops a DDC/CI monitor after
one failed brightness write (monitor on another input,
or not yet responsive after resume)
Classification: Plasma
Product: plasmashell
Version First 6.8.2
Reported In:
Platform: Arch Linux
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: Power management & brightness
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: 1.0
SUMMARY
When a DDC/CI brightness write fails after powerdevil's built-in retries,
DDCutilDisplay marks the display as not supporting brightness and
DDCutilPrivateSingleton removes it. The display is only re-added on a
libddcutil DDCA_EVENT_DISPLAY_CONNECTED or DDCA_EVENT_DPMS_AWAKE event. If the
monitor stays physically connected but temporarily does not answer DDC/CI, no
such event arrives, and brightness control is gone for the rest of the session.
Restarting plasma-powerdevil.service restores it.
Two triggers observed (LG UltraGear on DisplayPort, amdgpu, no internal panel):
1. Monitor input switched to another computer (HDMI1) while this PC keeps
running. While the input is on HDMI1, the monitor does not answer DDC/CI on the
DP I2C bus (`ddcutil getvcp 10` -> "No displays implementing DDC/CI found"),
but the DRM connector stays `status=connected`, `dpms=On`, and no
udev/DRM/libddcutil event is generated. When idle dimming
(DimDisplayIdleTimeoutSec=600) wrote brightness 600 s after I switched away,
the write failed with libddcutil status -3007 (DDCRC_RETRIES), was retried 3
times (1 s, 2 s, 3 s), and the display was removed.
2. A brightness write 2 seconds after resume from suspend-then-hibernate,
before the monitor answers DDC/CI again. Same -3007, same retries, same
removal.
Relevant code (v6.8.2, daemon/controllers/ddcutildisplay.cpp,
DDCutilDisplay::ddcBrightnessChangeFinished):
qCWarning(POWERDEVIL) << "[DDCutilDisplay]:" << m_label << "failed to set
DDC/CI brightness";
m_pendingBrightness.reset();
m_supportsBrightness = false;
Q_EMIT supportsBrightnessChanged(false);
In daemon/controllers/ddcutildetector.cpp, supportsBrightnessChanged(false)
calls removeDisplay(id); re-adding only happens in displayStatusChanged() on
DDCA_EVENT_DISPLAY_CONNECTED / DDCA_EVENT_DPMS_AWAKE.
A transient DDC/CI communication failure is not evidence that the display is
gone: a real disconnect is reported separately by libddcutil as
DDCA_EVENT_DISPLAY_DISCONNECTED and already handled by removeDisplay().
STEPS TO REPRODUCE
1. Monitor with several inputs connected via DisplayPort, brightness controlled
via DDC/CI.
2. Switch the monitor's input to another source and leave this PC running until
the dim-on-idle timeout triggers a brightness write (or press the brightness
keys meanwhile).
3. Switch the input back.
OBSERVED RESULT
Brightness slider and keys no longer work. Journal: `Adjust screen brightness
step failed: no displays available to adjust`. `busctl --user introspect
org.kde.ScreenBrightness /org/kde/ScreenBrightness` shows an empty
DisplaysDBusNames. `ddcutil getvcp 10` works at the same time. `systemctl
--user restart plasma-powerdevil.service` fixes it.
EXPECTED RESULT
powerdevil keeps the display and retries on the next brightness request (or
re-probes it), as long as libddcutil has not reported the display as
disconnected. A minimal change with that effect is to drop
`m_supportsBrightness = false; Q_EMIT supportsBrightnessChanged(false);` from
the final-failure branch; setBrightness() already resets m_retryCounter, so the
next request retries from scratch. Trade-off: while the monitor does not
answer, the slider moves without effect and each attempt costs ~20 s of retries
in the worker thread.
SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.8.2
powerdevil: 6.8.2
ddcutil / libddcutil: 3.0.2
Kernel: 7.2.11-arch1-1
GPU/driver: AMD, amdgpu
Monitor: LG UltraGear, DisplayPort, /dev/i2c-7, card1-DP-2
Session: Wayland
ADDITIONAL INFORMATION
Journal excerpt (trigger 1, input switched away at 13:07, idle-dim write at
13:17):
13:17:06 [DDCutilDisplay]: ddca_get_non_table_vcp_value -3007
13:17:08 [DDCutilDisplay]: ddca_set_non_table_vcp_value -3007
13:17:08 [DDCutilDisplay]: "LG ULTRAGEAR" retrying to set DDC/CI brightness
in 1000 milliseconds - attempt no. 1
...
13:17:27 [DDCutilDisplay]: ddca_set_non_table_vcp_value -3007
13:17:27 [DDCutilDisplay]: "LG ULTRAGEAR" failed to set DDC/CI brightness
13:36:04 Adjust screen brightness step failed: no displays available to
adjust
Verification that the input switch produces no event: a loop running `ddcutil
getvcp 10` every 10 s while switching the input to HDMI1 and back showed "No
displays implementing DDC/CI found" the whole time on HDMI1 and normal values
immediately after switching back; /sys/class/drm/card1-DP-2/status stayed
"connected" and dpms "On" throughout, and the powerdevil/libddcutil journal
(watch mode Watch_Mode_Udev) logged nothing in that window.
DPMS standby is not a trigger: with `kscreen-doctor --dpms off` the monitor
still answers `ddcutil getvcp 10`.
Related reports ending in the same "failed to set DDC/CI brightness" followed
by missing brightness controls, without a root cause identified there:
- Bug 512820 (resolved as UPSTREAM)
-
https://discuss.kde.org/t/brightness-slider-missing-in-plasma-when-powerdevil-has-no-ddc-or-backlight-backend/48004
- The retry-then-remove logic comes from bug 482713 / MR !393 (commit
44e6922a).
--
You are receiving this mail because:
You are watching all bug changes.