Bug 323516 - When using fn brightness keys, KDE does not "know" that brightness has changed
Summary: When using fn brightness keys, KDE does not "know" that brightness has changed
Status: RESOLVED UPSTREAM
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement (show other bugs)
Version: 4.11.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
: 324025 340037 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-14 21:54 UTC by Brandon Watkins
Modified: 2015-02-16 12:45 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brandon Watkins 2013-08-14 21:54:08 UTC
Both KDE's automatic brightness changing and my laptops fn keys work to change my brightness.

However I have one major problem: When using the fn keys, my brightness changes, but KDE does not "realize" that it changed. The battery applet continues to show the old brightness no matter what, and when I use the fn keys I don't get the visual notification either. When KDE automatically changes the brightness when I am on battery the visual notification does show up and the brightness does change, the problem only appears when changing brightness with the fn keys.

The laptop is a system 76 lemur ultra (lemu4, ivybridge). Running kubuntu 13.04 with kernel 3.8.x and kde 4.11 final (however I saw the same issue in KDE 4.10, and I've seen it on various distros.)

The problem *only* happens in KDE. With gnome 3 my brightness always workes as expected. When I use my brightness keys gnome shows notifications and it knows the brightness has changed. Same with XFCE.

Reproducible: Always

Steps to Reproduce:
1. Change brightness using fn keys
Actual Results:  
Brightness changes, but no notification and KDE does not reflect that brightness has changed in battery applet

Expected Results:  
Brightness should change with notification, and KDE should reflect that brightness has changed.
Comment 1 Brandon Watkins 2013-08-19 18:49:50 UTC
They both seem to be controlling the same interface: 

cat /sys/class/backlight/acpi_video0/brightness is the value that changes regardless of whether I use kde to change the brightness or the fn keys. The only other interface that shows is /sys/class/backlight/intel_backlight/brightness and this one always shows 0

Why doesn't this work properly in KDE when it works fine in every single other DE i've tried? It even works fine in gnome 2/mate.
Comment 2 Brandon Watkins 2013-08-19 18:51:28 UTC
I was going to be content with just letting KDE handle the brightness automatically, but there's also annoying random issues like the following: Sometimes when I plug my laptop back in the brightness stays dimmed instead of going to 100%, other times it works fine. When it happens if I unplug and replug it will work properly. KDE's brightness control seems to be quite buggy and inconsistant :/
Comment 3 Yassine SAKOUM 2013-08-19 20:53:48 UTC
I confirm this bug, using Arch Linux packages.
Comment 4 Stephan Burkhardt 2013-08-19 21:08:36 UTC
I have the same problem with KDE 4.11 on Arch linux (kernel 3.10.7) on a Lenovo T420. The only way to actually make KDE show the brightness indicator in any way is pressing the brightness up and down button at the same time.
Comment 5 Brandon Watkins 2013-08-19 21:58:52 UTC
YES!!! I found a workaround that seems to work (at least for me).

Add: acpi_backlight=vendor acpi_osi=Linux to your grub commandline. Now KDE shows notifications and realizes when my brightness changes!!!
Comment 6 Brandon Watkins 2013-08-19 22:00:37 UTC
Nevermind, I jumped the gun on that :( Notifications show but now the brightness does not change at all.
Comment 7 Brandon Watkins 2013-08-19 22:12:56 UTC
@Stephan Burkhardt, I get the exact same behavior. If I push both brightness keys at the same time a notification does pop up, very strange :/
Comment 8 Brandon Watkins 2013-08-21 19:22:29 UTC
I can confirm this on my other laptop too, totally different brand/model:

Asus U52F, exact same problem. this laptop also works totally fine with gnome, but for some reason KDE doesn't see when the brightness changes. Tested it with kde 4.10 and 4.11, does it in both.
Comment 9 Brandon Watkins 2013-08-24 12:51:14 UTC
Update: The acpi_backlight=vendor DOES work on the asus laptop. I can now change brightness via both the fn keys and battery applet, and they both show notifications.

It doesn't work on the system76 laptop though :( No matter what I try on the system76 machine kde will not realize when the fn keys change the brightness.
Comment 10 AnAkkk 2013-09-09 09:38:21 UTC
I have the same issue on both Kubuntu and openSUSE.

I have to use acpi_osi=Linux acpi_backlight=vendor for the Fn keys to work.
I have to blacklist acer_wmi in /etc/modprobe.d/blacklist.conf for the KDE display brightness to work.

But even after doing that, both are still out of sync. They don't know when a brightness change happened.
Comment 11 AnAkkk 2013-09-09 09:38:34 UTC
*** This bug has been confirmed by popular vote. ***
Comment 12 AnAkkk 2013-09-09 09:45:10 UTC
I forgot to add that I need to blacklist acer_wmi because KDE tries to change the brightness in:
/sys/class/backlight/acer-wmi/
instead of
/sys/class/backlight/intel_backlight/

It has no effect in acer-wmi.
Comment 13 Yassine SAKOUM 2013-09-19 00:35:33 UTC
I resolved this bug by using the radeon driver insted of catalyst (legacy), mabe this will help you.
Comment 14 AnAkkk 2013-09-19 09:32:04 UTC
I have a nvidia card.
Comment 15 Eugenio 2013-10-09 09:45:53 UTC
I have the same issue using a intel card, I can change brightness form tty and from kde but without notification..
I fixed it writing "video.brightness_switch_enabled=0" in the kernel command line. This way i can no longer change brightness from a tty but i can see the notification in kde (and the brighness change obviously)..
So kde does not support this (new?) feature of kernel (https://www.kernel.org/doc/Documentation/kernel-parameters.txt and search for video.brightness_switch_enabled).
Comment 16 Eugenio 2013-10-09 09:47:00 UTC
*** Bug 324025 has been marked as a duplicate of this bug. ***
Comment 17 AnAkkk 2013-10-09 12:01:15 UTC
This might actually be related to this kernel bug:
https://bugzilla.kernel.org/show_bug.cgi?id=35622

There is a patch available in the bug.
Comment 18 AnAkkk 2013-10-09 12:02:39 UTC
Sorry for double posting. I used to blacklist acer_wmi to fix this issue, but this is not a solution as it causes issues with my Fn wireless key.
Comment 19 Andrew 2013-11-30 20:41:08 UTC
Hello Guys!

I had the same issue. I have fixed it by creating the following file:
====================================================
> cat /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
        Identifier      "HD 4000"
        Driver          "Intel"
        Option "Backlight" "intel_backlight"
EndSection
====================================================

Also, I don't have any options regarding 'acpi' in boot parameters for my kernel.
Comment 20 ash.summers 2013-12-05 01:28:40 UTC
@Andrew - I tried this on my Lenovo T440s. I set the Identifier to HD 4400 (as this is what my thinkpad has) and it did nothing. When I set it to HD 4000 I did see the widget appear with the Fn keys but the changing of the brightness was sporadic. I.e. I would get to 40% and  it would suddenly jump down to 11% even when I was pressing the increase brightness button.
Comment 21 AnAkkk 2014-01-26 15:55:44 UTC
Booting with "video.use_native_backlight=1" fixed all my backlight issues ! I just found out about this kernel parameter. Using it successfully remove acpi_video0 and acpi_video1, so KDE only read/writes from/to intel_backlight, which is correct.
Comment 23 AnAkkk 2014-01-26 16:23:45 UTC
Please note that "video.use_native_backlight=1" is only available in Linux 3.13 AFAIK.
Comment 24 Laurent 2014-01-26 16:26:43 UTC
Fixed it for me!

Thanks to AnAkk and Eugenio!

Boot params: video.use_native_backlight=1 video.brightness_switch_enabled=0
(Note: no acpi_osi !)

Lenovo T440p

Many thanks,
Regards
Comment 25 Laurent 2014-01-26 16:26:59 UTC
Fixed it for me!

Thanks to AnAkk and Eugenio!

Boot params: video.use_native_backlight=1 video.brightness_switch_enabled=0
(Note: no acpi_osi !)

Lenovo T440p

Many thanks,
Regards
Comment 26 AnAkkk 2014-01-26 16:29:11 UTC
Glad I could help :) Are you sure you need video.brightness_switch_enabled=0 though?
Comment 27 Laurent 2014-01-26 16:41:56 UTC
Just booted again without that param, and: Yes, I need it.
Without that option: I have to press 10+ times to increase brightness by one level, and there's no OSD again.
Futhermore: Never change a  running system ;)
Comment 28 Laurent 2014-01-26 21:31:19 UTC
Update: I need video.brightness_switch_enabled=0, but not  video.use_native_backlight=1. Furthermore, I could not find 'use_native_backlight' in the kernel documentation mentioned in comment 15 ...does it even exist, then?

However, I ran into another problem: after suspend, the screen brightness is at 100% again. I solved it with a resume hook as mentioned here: https://bbs.archlinux.org/viewtopic.php?id=172526&p=2#p1375181
Is this behaviour normal, or is it another bug (= KDE not keeping the previous brightness after suspend)?
Has someone found a more elegant solution to this?
Comment 29 ariasuni 2014-03-27 21:53:50 UTC
Bug still here in KDE 4.12.3, «fixed» with the boot parameters `video.brightness_switch_enabled=0`. Now when I change the backlight level with the hardware keys, OSD appear but the backlight slider in the battery monitor doesn’t change and still say «0%».

I want to add that it works perfectly fine with GNOME without configuring anything.

There are many bug reports about that problem: in addition to the ones linked [here](https://bugs.kde.org/show_bug.cgi?id=323516#c22), there are two others: https://bugs.kde.org/show_bug.cgi?id=295982 and https://bugs.kde.org/show_bug.cgi?id=310591.
Comment 30 AnAkkk 2014-05-11 10:03:16 UTC
This will be fixed in Linux 3.15 with the default video.brightness_switch_enabled being changed to 0.

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/acpi/video.c?id=886129a8eebebec260165741fe31421482371006
Comment 31 ariasuni 2014-08-23 23:00:10 UTC
It works a bit better: I still need to add the `video.brightness_switch_enabled=0` boot parameters, but now the power management plasmoid shows every time the correct level of brightness.

When I don’t use the boot parameter, using fn keys add or subtract 20% of brightness instead 10%.
Comment 32 ariasuni 2014-08-23 23:01:17 UTC
BTW, I’m on Arch Linux, Linux 3.16.1, KDE 4.14.0.
Comment 33 AnAkkk 2014-08-23 23:16:56 UTC
video.brightness_switch_enabled was changed back to 1 in 3.16, another fix went into 3.17 which remove the need to set it to 0.
Comment 34 ariasuni 2014-08-24 00:35:40 UTC
Great, i hope it will really work this time.
Comment 35 AnAkkk 2014-08-24 10:36:21 UTC
This bug can probably be closed, it's a kernel bug, and it was fixed in linux 3.16 by changing video.use_native_backlight to 1 by default.
Comment 36 Dmitry Nezhevenko 2014-10-07 06:54:26 UTC
On Lenovo t440p it doesn't work after upgrading to 3.17 kernel. With 3.16 everything seems to be ok. Changing brightness via KDE slider works. I have only intel_backlight in /sys/class/backlight. 

I don't understand how it should work, so I can't create kernel bugreport right now. Any suggestions?
Comment 37 AnAkkk 2014-10-07 09:23:44 UTC
(In reply to Dmitry Nezhevenko from comment #36)
> On Lenovo t440p it doesn't work after upgrading to 3.17 kernel. With 3.16
> everything seems to be ok. Changing brightness via KDE slider works. I have
> only intel_backlight in /sys/class/backlight. 
> 
> I don't understand how it should work, so I can't create kernel bugreport
> right now. Any suggestions?

You should still create a kernel bug report, the kernel developers will help you as the bug is in the kernel.
Comment 38 Christoph Feck 2014-10-26 20:50:22 UTC
*** Bug 340037 has been marked as a duplicate of this bug. ***
Comment 39 Kai Uwe Broulik 2015-02-16 12:45:03 UTC
Kernel/driver issue, sorry.