Bug 487743 - No keyboard light control and always on by default
Summary: No keyboard light control and always on by default
Status: RESOLVED DUPLICATE of bug 486067
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-05-29 13:50 UTC by Iyán Méndez Veiga
Modified: 2024-11-27 20:55 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Iyán Méndez Veiga 2024-05-29 13:50:53 UTC
SUMMARY

After upgrading to Plasma 6.1 Beta there are three issues with the the keyboard light:

1. The slider is missing in the power and battery plasmoid
2. Changing the brightness level with the keyboard shortcut (Fn + Space on my laptop) does not produce the visual animation that was visible in 6.0 (as when changing the screen brightness or the volume)
3. The keyboard light is always on by default when booting the laptop or after resuming from sleep, no matter previous state.

STEPS TO REPRODUCE
1. Close lid, open lid -> Issue 3
2. Open power and battery plasmoid from system tray -> Issue 1
3. Use the laptop built-in keyboard shortcut to change brightness level -> Issue 2

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.90
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.1
Kernel Version: 6.9.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 21 × Intel® Core™ Ultra 7 155H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Arc
Manufacturer: LENOVO
Product Name: 21KDS00600
System Version: ThinkPad X1 Carbon Gen 12
Comment 1 Iyán Méndez Veiga 2024-05-29 15:10:13 UTC
There was a typo in my report: I meant the Brightness and Color plasmoid.
Comment 2 Iyán Méndez Veiga 2024-05-29 15:40:21 UTC
I did a git bisect from tags 6.0.4 to 6.0.90 and this is what I found:

fe9e90f51728c8ba16aa5597f909018e213191a8 is the first bad commit
commit fe9e90f51728c8ba16aa5597f909018e213191a8 (HEAD)
Author: Bogdan Onofriichuk <bogdan.onofriuchuk@gmail.com>
Date:   Tue Dec 19 12:02:56 2023 +0200

    Extract keyboard brightness into separate class.

 daemon/CMakeLists.txt                                |   9 +++++++++
 daemon/actions/bundled/dimdisplay.cpp                |   5 +++--
 daemon/actions/bundled/dpms.cpp                      |   5 ++---
 daemon/actions/bundled/handlebuttonevents.cpp        |   8 ++++----
 daemon/actions/bundled/keyboardbrightnesscontrol.cpp |  27 ++++++++++++--------------
 daemon/actions/bundled/keyboardbrightnesscontrol.h   |   2 +-
 daemon/backends/upower/CMakeLists.txt                |   5 -----
 daemon/backends/upower/powerdevilupowerbackend.cpp   | 101 +------------------------------------------------------------------------------------------------
 daemon/backends/upower/powerdevilupowerbackend.h     |  13 -------------
 daemon/controllers/keyboardbrightnesscontroller.cpp  | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 daemon/controllers/keyboardbrightnesscontroller.h    |  51 +++++++++++++++++++++++++++++++++++++++++++++++++
 daemon/powerdevilaction.cpp                          |   2 +-
 daemon/powerdevilaction.h                            |   2 +-
 daemon/powerdevilbackendinterface.cpp                |  27 --------------------------
 daemon/powerdevilbackendinterface.h                  |  20 --------------------
 daemon/powerdevilcore.cpp                            |  12 ++++++++++++
 daemon/powerdevilcore.h                              |   6 ++++++
 17 files changed, 252 insertions(+), 192 deletions(-)
 create mode 100644 daemon/controllers/keyboardbrightnesscontroller.cpp
 create mode 100644 daemon/controllers/keyboardbrightnesscontroller.h
Comment 3 David Edmundson 2024-05-30 12:17:46 UTC Comment hidden (spam)
Comment 4 David Edmundson 2024-05-30 12:18:44 UTC
>1. The slider is missing in the power and battery plasmoid

Note that this moved to a new brightness applet
Comment 5 David Edmundson 2024-05-30 12:19:37 UTC
When you did the bisect which one of the 3 things above are you referring to?
Comment 6 Iyán Méndez Veiga 2024-05-30 12:26:22 UTC
Hi David,

Regarding point one I already added a comment because I couldn't update the original description. Indeed, when it works, the slides is in the "Brightness and Color" applet.

I first noticed the issues with the package provided by Arch Linux in the [kde-unstable] repo, which if I do `pacman -Ql powerdevil | grep plugins` lists the following:

powerdevil /usr/lib/qt6/plugins/
powerdevil /usr/lib/qt6/plugins/plasma/
powerdevil /usr/lib/qt6/plugins/plasma/kcms/
powerdevil /usr/lib/qt6/plugins/plasma/kcms/systemsettings/
powerdevil /usr/lib/qt6/plugins/plasma/kcms/systemsettings/kcm_powerdevilprofilesconfig.so
powerdevil /usr/lib/qt6/plugins/powerdevil/
powerdevil /usr/lib/qt6/plugins/powerdevil/action/
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_brightnesscontrolaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_dimdisplayaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_dpmsaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_handlebuttoneventsaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_keyboardbrightnesscontrolaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_powerprofileaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_runscriptaction.so
powerdevil /usr/lib/qt6/plugins/powerdevil/action/powerdevil_suspendsessionaction.so

For the git bisect I used the exact same PKGBUILD just changing the source to use the git repo and forcing the commit given by git bisect. Each build was done in a clean env using the [kde-unstable] repo (with kde-unstable-x86_64-build). And I was checking for the three issues.
Comment 7 Bug Janitor Service 2024-05-30 13:33:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4378
Comment 8 Bug Janitor Service 2024-05-30 13:33:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4378
Comment 9 Fushan Wen 2024-05-30 16:07:54 UTC
Does `qdbus6 --system org.freedesktop.UPower /org/freedesktop/UPower/KbdBacklight org.freedesktop.UPower.KbdBacklight.GetBrightness` return anything?
Comment 10 Iyán Méndez Veiga 2024-05-31 14:35:06 UTC
(In reply to Fushan Wen from comment #9)
> Does `qdbus6 --system org.freedesktop.UPower
> /org/freedesktop/UPower/KbdBacklight
> org.freedesktop.UPower.KbdBacklight.GetBrightness` return anything?

It returns a 0.
Comment 11 Iyán Méndez Veiga 2024-05-31 14:35:52 UTC
And a 1 and a 2 in the two other two brightness modes.
Comment 12 Iyán Méndez Veiga 2024-06-02 13:15:55 UTC
On more thing I just discover. If I run `systemctl --user restart plasma-powerdevil.service`, everything works again. So the problem is that after that commit, and after a system reboot, it doesn´t work. The service has to be manually restarted.
Comment 13 Bug Janitor Service 2024-06-08 04:35:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/377
Comment 14 Fushan Wen 2024-06-12 04:12:37 UTC
Git commit 14f4cf0158d8565365dae1c5c55c2fac5801ef08 by Fushan Wen.
Committed on 12/06/2024 at 03:58.
Pushed by fusionfuture into branch 'master'.

applets/brightness: test setting keyboard brightness

This adds a test to make sure the keyboard brightness slider works as
expected.

M  +6    -0    appiumtests/applets/CMakeLists.txt
A  +153  -0    appiumtests/applets/brightnesstest.py
M  +30   -0    appiumtests/utils/OrgFreedesktopUPower.py
M  +4    -2    applets/brightness/package/contents/ui/BrightnessItem.qml

https://invent.kde.org/plasma/plasma-workspace/-/commit/14f4cf0158d8565365dae1c5c55c2fac5801ef08
Comment 15 Thomas Baag 2024-08-07 20:45:02 UTC
Hi,

I'm also encountering this bug and can confirm it's rooted in the UPower service being stopped when PowerDevil tries to access it.

So `systemctl --user restart plasma-powerdevil.service` works.

To reproduce try:
systemctl --user stop plasma-powerdevil.service
sudo systemctl stop upower
systemctl --user start plasma-powerdevil.service

I'm running Plasma 6.1.3 (on NixOS unstable).

Best
Comment 16 Thomas Baag 2024-08-07 21:43:48 UTC
As a workaround I let the service ping the dbus address in ExecStartPre. WorksForMe.

cat .config/systemd/user/plasma-powerdevil.service.d/override.conf
[Service]
ExecStartPre=qdbus --system org.freedesktop.UPower /
Comment 17 Iyán Méndez Veiga 2024-09-13 18:27:57 UTC
This is still an issue in 6.1.90.
Comment 18 Nate Graham 2024-11-27 20:55:59 UTC

*** This bug has been marked as a duplicate of bug 486067 ***