Bug 486067 - Keyboard brightness no longer showing up until logging out and back in again
Summary: Keyboard brightness no longer showing up until logging out and back in again
Status: ASSIGNED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Power management & brightness (show other bugs)
Version: 6.2.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
: 487743 494720 495476 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-24 11:43 UTC by Mike Lothian
Modified: 2024-12-18 22:28 UTC (History)
13 users (show)

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


Attachments
Full journalctl (270.50 KB, text/plain)
2024-04-24 11:44 UTC, Mike Lothian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2024-04-24 11:43:40 UTC
Using Qt 6.7.0, KF6 from git along with Plasma6 from Git, this certainly used to work

journalctl -b | grep -i "bright\|keyboard"
Apr 24 12:31:12 axion.fireburn.co.uk kernel: atkbd serio0: Failed to deactivate keyboard on isa0060/serio0
Apr 24 12:31:12 axion.fireburn.co.uk kernel: asus 0003:0B05:1866.0002: input,hiddev0,hidraw1: USB HID v1.10 Keyboard [ASUSTek Computer Inc. N-KEY Device] on usb-0000:08:00.3-3/input0
Apr 24 12:31:12 axion.fireburn.co.uk kernel: atkbd serio0: Failed to enable keyboard on isa0060/serio0
Apr 24 12:31:12 axion.fireburn.co.uk kernel: input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
Apr 24 12:31:12 axion.fireburn.co.uk systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:amdgpu_bl1...
Apr 24 12:31:12 axion.fireburn.co.uk systemd[1]: Starting Load/Save Screen Backlight Brightness of leds:asus::kbd_backlight...
Apr 24 12:31:12 axion.fireburn.co.uk systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:amdgpu_bl1.
Apr 24 12:31:12 axion.fireburn.co.uk systemd[1]: Finished Load/Save Screen Backlight Brightness of leds:asus::kbd_backlight.
Apr 24 12:31:12 axion.fireburn.co.uk systemd-logind[436]: Watching system buttons on /dev/input/event10 (Asus Keyboard)
Apr 24 12:31:12 axion.fireburn.co.uk systemd-logind[436]: Watching system buttons on /dev/input/event13 (AT Translated Set 2 keyboard)
Apr 24 12:31:15 axion.fireburn.co.uk kwin_wayland_wrapper[660]: The XKEYBOARD keymap compiler (xkbcomp) reports:
Apr 24 12:31:18 axion.fireburn.co.uk plasmashell[724]: error getting max keyboard brightness via dbus QDBusError("org.freedesktop.DBus.Error.UnknownObject", "No such object path '/org/kde/Solid/PowerManagement/Actions/KeyboardBrightnessControl'")
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]: file:///usr/share/plasma/plasmoids/org.kde.plasma.brightness/contents/ui/PopupDialog.qml:21:18: QML ScrollView: ScrollView only supports Flickable types as its contentItem
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]: QQmlExpression: Expression file:///usr/share/plasma/plasmoids/org.kde.plasma.brightness/contents/ui/KeyboardColorItem.qml:26:5 depends on non-NOTIFYable properties:
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]:     KeyboardColorControl::supported
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]: QQmlExpression: Expression file:///usr/share/plasma/plasmoids/org.kde.plasma.brightness/contents/ui/KeyboardColorItem.qml:77:21 depends on non-NOTIFYable properties:
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]:     KeyboardColorControl::enabled
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]: QQmlExpression: Expression file:///usr/share/plasma/plasmoids/org.kde.plasma.brightness/contents/ui/KeyboardColorItem.qml:64:21 depends on non-NOTIFYable properties:
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]:     KeyboardColorControl::enabled
Apr 24 12:31:24 axion.fireburn.co.uk plasmashell[724]: file:///usr/share/plasma/plasmoids/org.kde.plasma.brightness/contents/ui/KeyboardColorItem.qml:67:21: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
Comment 1 Mike Lothian 2024-04-24 11:44:19 UTC
Created attachment 168864 [details]
Full journalctl
Comment 2 Mike Lothian 2024-04-24 12:09:01 UTC
I'm still able to use https://github.com/wroberts/rogauracore to control the brightness and colours etc
Comment 3 Mike Lothian 2024-05-02 00:58:41 UTC
If I restart sddm everything then works fine, is this some sort of race issue during first boot?
Comment 4 Michael Marley 2024-08-12 15:49:27 UTC
I'm experiencing this too on both a Dell Latitude E7450 and a Framework 13 AMD (with the new keyboard backlight driver in Linux 6.11) using Plasma 6.1.4 and KF6 6.5.0.  It used to work properly in Plasma 5.27.  (I never tried Plasma 6.0.).  The entry for the keyboard backlight is present in /sys/class/leds on both systems.

I'm not starting the KDE session using SDDM; I'm just executing "exec dbus-run-session startplasma-wayland" from a VT.
Comment 5 Aravind 2024-09-02 14:21:14 UTC
Facing same problem.
I am able to get/set the brightness through upower using the dbus-send command.

dbus-send --system --type=method_call  --dest="org.freedesktop.UPower" "/org/freedesktop/UPower/KbdBacklight" "org.freedesktop.UPower.KbdBacklight.SetBrightness" int32:2

Somehow powerdevil is not able to do so
Comment 6 Alex B 2024-10-05 19:25:13 UTC
I have noticed this problem as well. However, in my case occasionally on certain boots the brightness control does show up under the "Brightness and color" panel applet. I am not sure why it shows up sometimes and haven't noticed a pattern with it. Every time I notice this I reboot to see if it will stay, but it goes away and returns to only showing brightness control for the screen. This is on a new install of EndeavourOS ~3 weeks ago currently plasma is on v6.1.5. Model of computer is Asus vivobook f1504vap.
Comment 7 Alex B 2024-10-15 02:06:10 UTC
I found out why this bug appeared to be intermittent for me. The keyboard backlight control doesn't seem to show up upon any reboot at all, but does show up after a reboot > logout > login. Seems to work every time to get the keyboard backlight control to show up. No difference with wayland or x11.
Comment 8 m.kurz 2024-11-20 21:03:11 UTC
I experience this as well, exactly the same behaviour: After restart I can not see the keyboard brightness slider in the "Brightness and Color" widget. However I can set the brightness with dbus-send like described in a previous comment.
However if I log out and back in again, the slider shows up (and works correctly as well).
Comment 9 Bug Janitor Service 2024-11-21 22:31:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/472
Comment 10 Mike Lothian 2024-11-22 00:30:43 UTC
I've just applied that MR, unfortunately it doesn't fix the issue

Killing the powerdevil process gets it working 

Is there some debugging I can do from the first start up Vs the restarted process?
Comment 11 Ismael Asensio 2024-11-26 18:55:02 UTC
Git commit c8f60bbfdefebfc336a1b6c1bda89a904c105fc6 by Ismael Asensio.
Committed on 26/11/2024 at 18:45.
Pushed by iasensio into branch 'master'.

applets/brightness: Improve integration with dbus service availability

Let's only try to initialize the DBus connections when the required
service is available, and then watch for changes in avilability, so
the UI always reflects the current status
FIXED-IN: 6.3.0

M  +37   -4    applets/brightness/plugin/keyboardbrightnesscontrol.cpp
M  +7    -1    applets/brightness/plugin/keyboardbrightnesscontrol.h
M  +49   -8    applets/brightness/plugin/screenbrightnesscontrol.cpp
M  +5    -1    applets/brightness/plugin/screenbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/-/commit/c8f60bbfdefebfc336a1b6c1bda89a904c105fc6
Comment 12 Ismael Asensio 2024-11-26 19:18:46 UTC
(In reply to Mike Lothian from comment #10)
> I've just applied that MR, unfortunately it doesn't fix the issue
> 
> Killing the powerdevil process gets it working 
> 

Oh, I read this comment too late. The MR got some changes afterwards. 
Can you please test again with the latest version and reopen if it's still happening? 

> Is there some debugging I can do from the first start up Vs the restarted
> process?

In case it fails, a similar log to the journal info you provided would be good enough. With the latest changes in the patch, it should show a slightly different error message because now we check the service status before trying to connect to it.
Comment 13 Mike Lothian 2024-11-26 20:46:16 UTC
I can't get the fix to apply cleanly to 6.2.4 and "git mergetool" kdiff3 crashes 

Any chance you could backport it to 6.2?
Comment 14 Mike Lothian 2024-11-26 20:56:59 UTC
I've just compiled powerdevil from source from the main branch, the issue doesn't appear to be fixed I'm afraid

I still had to kill /usr/libexec/org_kde_powerdevil for the keyboard brightness to appear
Comment 15 Ismael Asensio 2024-11-27 00:19:39 UTC
Could you also please check that the compiled version is getting executed at plasma login and not the system one?

One way is to check the path that the systemd unit is actually running:
> cat /run/user/1000/systemd/user.control/plasma-powerdevil.service | grep ExecStart
ExecStart=/home/isma/kde/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdevil

Even on a full self-compiled plasma session, it is sometimes hard to make the compiled powerdevil/dbus stuff work without manually overwriting of some system files (it requires permissions to deal with the hardware and the security to grant those permissions)
Comment 16 Mike Lothian 2024-11-27 07:49:43 UTC
I used the live Gentoo ebuild, it replaced the system files and installed the same way 6.2.4 is
Comment 17 Nate Graham 2024-11-27 20:55:59 UTC
*** Bug 487743 has been marked as a duplicate of this bug. ***
Comment 18 Bug Janitor Service 2024-12-06 19:54:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/476
Comment 19 Jakob Petsovits 2024-12-08 03:20:50 UTC
Git commit 6f668270a389322ccdb8b8cc92eea308d087fca8 by Jakob Petsovits.
Committed on 08/12/2024 at 03:04.
Pushed by jpetso into branch 'master'.

applets/brightness: Never miss a display on brightness service registration

Since commit c8f60bbf, the display list gets updated when the
org.kde.ScreenBrightness service (provided by PowerDevil) starts
or restarts. This exposed a race condition that was already present,
but now gets triggered regularly due to tighter timing.

The sequence of events reproducing this bug goes like this:

1. The D-Bus service appears, `onServiceRegistered()` is invoked.
2. `queryAndUpdateDisplays()` starts retrieving display properties.
3. Soon after the D-Bus service came up, it adds another display.
4. `queryAndUpdateDisplays()` finishes.
5. Only at this point we connect to D-Bus display change signals.

In this sequence, the display from (3) is missed and won't show up
in the applet until another display change happens at a later point.

Now that the display model is robust against duplicate insertions,
we can simply move `queryAndUpdateDisplays()` from the start of
`onServiceRegistered()` to the end of the function, at which point
D-Bus signal connections are already set up. This ensures that
no display additions will be missed, even if they happen immediately
after service startup.
Related: bug 488915

M  +10   -10   applets/brightness/plugin/screenbrightnesscontrol.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/6f668270a389322ccdb8b8cc92eea308d087fca8
Comment 20 Jakob Petsovits 2024-12-08 03:41:22 UTC
My commit above is not actually applicable to the keyboard use case, sorry. However, Ismael's new merge request is: https://invent.kde.org/plasma/powerdevil/-/merge_requests/476
Comment 21 Nate Graham 2024-12-11 17:00:16 UTC
*** Bug 494720 has been marked as a duplicate of this bug. ***
Comment 22 Nate Graham 2024-12-11 17:00:27 UTC
*** Bug 495476 has been marked as a duplicate of this bug. ***
Comment 23 Mike Lothian 2024-12-11 18:13:28 UTC
I've just tested powerdevil build from source with https://invent.kde.org/plasma/powerdevil/-/merge_requests/476 added, and I still have the same issue
Comment 24 Ismael Asensio 2024-12-11 22:08:14 UTC
Git commit fbe83d19e815ca91815b5e09efe64446989bd72a by Ismael Asensio.
Committed on 11/12/2024 at 22:03.
Pushed by iasensio into branch 'master'.

applets/brightness: Check if KeyboardBrightness action is available

Besides reacting to changes in the `Solid.PowerManagement` DBus service,
we also need to track changes in the `KeyboardBrightnessControl` action
(which translates into a specific DBus path) before trying to call or
connect to that path and fail.

This doesn't fix the race conditions on plasma login, but allows the
applet to react live to changes in the action list.

M  +75   -8    applets/brightness/plugin/keyboardbrightnesscontrol.cpp
M  +7    -2    applets/brightness/plugin/keyboardbrightnesscontrol.h

https://invent.kde.org/plasma/powerdevil/-/commit/fbe83d19e815ca91815b5e09efe64446989bd72a