Bug 491605 - backlighthelper.brightness display probe fails on Wayland
Summary: backlighthelper.brightness display probe fails on Wayland
Status: REPORTED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.4
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6, regression, wayland
Depends on:
Blocks:
 
Reported: 2024-08-12 05:06 UTC by Debayan Sutradhar
Modified: 2024-09-08 20:52 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
sudo journalctl --boot (after applying delay) (364.62 KB, text/plain)
2024-08-12 05:06 UTC, Debayan Sutradhar
Details
sudo journalctl --boot -2 (after apply 3s delay) (397.14 KB, text/plain)
2024-08-12 05:07 UTC, Debayan Sutradhar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debayan Sutradhar 2024-08-12 05:06:53 UTC
Created attachment 172529 [details]
sudo journalctl --boot (after applying delay)

SUMMARY

Sometimes, the `org.kde.powerdevil.backlighthelper.brightness` display probe fails on Nvidia cards + Wayland, hence preventing the user to set monitor brightness from the plasma taskbar applet.

The frequency is random, which makes me think there is some race condition or similar situation. On X11, however, this issue is non existent and the display brightness feature always works.

I am able to workaround the issue by adding a slight delay of 3 seconds in powerdevil service:

override.conf:

```
    /home/rnayabed/.config/systemd/user/plasma-powerdevil.service.d/.#override.conf7e6e1614f2ba2121             
### Editing /home/rnayabed/.config/systemd/user/plasma-powerdevil.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file

[Service]
ExecStartPre=/bin/sleep 3
Environment="QT_LOGGING_RULES=org.kde.powerdevil=true"

### Edits below this comment will be discarded


### /usr/lib/systemd/user/plasma-powerdevil.service
# [Unit]
# Description=Powerdevil
# PartOf=graphical-session.target
# After=plasma-core.target
# 
# [Service]
# ExecStart=/usr/libexec/org_kde_powerdevil
# Type=dbus
# BusName=org.kde.Solid.PowerManagement
# TimeoutStopSec=5sec
# Slice=background.slice
# Restart=on-failure
```

I have attached full system logs with and without the delay:






STEPS TO REPRODUCE
1. Enable wayland

OBSERVED RESULT
The brightness mod feature is not shown when using wayland at random times.

EXPECTED RESULT
The brightness feature should work in wayland at all times

SOFTWARE/OS VERSIONS
Linux: 6.10.3-1-default
openSUSE snapshot: 20240808
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
GPU: Nvidia RTX 3060 w/ proprietary drivers 550.100

I am using a desktop PC with LG IPS 1080p monitor (22mp68vq) over HDMI.
Comment 1 Debayan Sutradhar 2024-08-12 05:07:38 UTC
Created attachment 172530 [details]
sudo journalctl --boot -2 (after apply 3s delay)
Comment 2 Nate Graham 2024-08-12 17:16:31 UTC
Possibly the same as Bug 482713?
Comment 3 Debayan Sutradhar 2024-08-12 18:29:39 UTC
> Possibly the same as Bug 482713?

Could be.. i am not sure.
Comment 4 Jakob Petsovits 2024-08-12 20:10:35 UTC
Comment #0 is confusing, because backlighthelper is only for internal (i.e. laptop) displays, but the actual bug report is clearly about an external monitor - connected to a desktop PC, which doesn't have an internal backlight display. So backlighthelper failing is entirely expected. We're interested in DDC happenings here.

The attached log from Comment #0 shows that the monitor named "LG IPS FULLHD" is indeed found by PowerDevil with a brightness of 60 out of 100. The log from Comment #1 shows an error instead, the relevant lines are these (removing time, hostname & powerdevil unit prefix):

> busno=2, sleep-multiplier =  2.00. Testing for supported feature 0x10 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_DDC_DATA(10)]
> Library initialization complete.
> org.kde.powerdevil: [DDCutilDetector]: Failed to initialize callback
> org.kde.powerdevil: [DDCutilDetector]: Check for monitors using ddca_get_display_refs()...
> org.kde.powerdevil: [DDCutilDetector]: 0 display(s) were detected

The first line looks the most relevant, it's printed by libddcutil itself and talks about an error involving the brightness feature (0x10) before any other stuff starts failing. I'd have to get more familiar with DDC/CI and this part of libddcutil in order to analyze this any further.

(In reply to Nate Graham from comment #2)
> Possibly the same as Bug 482713?

Possibly. The symptoms look the same, although without a better idea about the root cause it's hard to tell.