You are not logged in.

#1 2012-04-14 10:33:09

spikeh
Member
Registered: 2012-04-14
Posts: 33

Thinkpad T420/GNOME3 - Changing brightness steps

Hello!

I'm running Thinkpad T420 with GNOME 3. The Fn buttons that control brightness work out-of-the-box, but I would like to change the steppings such that they are more granular (dare I say like my previous Windows install). GNOME currently gives me 5 steps for brightness; I'd like that to be 15 steps for brightness since `cat /sys/class/backlight/acpi_video0/max_brightness` returns 15.

My rc.conf:
MODULES=(acpi-cpufreq thinkpad_acpi acpi_call tp_smapi)
DAEMONS=(dbus acpid @syslog-ng @crond @network gdm)

First of all, press the brightness up/down buttons generates two acpi actions. I've set acpid's handler.sh to log the button presses:

Apr 14 18:00:35 localhost logger: BrightnessDown pressed: BRTDN
Apr 14 18:00:35 localhost logger: BrightnessDown pressed: BRTDN
Apr 14 18:00:37 localhost logger: BrightnessUp pressed: BRTUP
Apr 14 18:00:37 localhost logger: BrightnessUp pressed: BRTUP

Secondly, I have two entries in /sys/class/backlight:

$ ls /sys/class/backlight/
acpi_video0  intel_backlight

Mid-post edit: While writing this, I had a feeling that since each press triggered two acpi actions, brightness under acpi_video0 and intel_backlight were both being modified causing each press to change the brightness by 3. After some Googling, I found out I can disable the Intel video drivers from intervening by `echo -n 0 > /sys/module/video/parameters/brightness_switch_enabled`. This reduced the steps to two!

My questions are: can I only let the Intel video drivers act on the brightness acpi actions? Is there something I can do to make each brightness button press generate just a single action - or is it out of my hands in the depths of the BIOS? Can I make whatever currently changing acpi_video0 to only step once if it receives two brightness acpi actions?

Last edited by spikeh (2012-04-14 15:18:08)


Thinkpad T420

Offline

#2 2012-04-14 11:28:32

spikeh
Member
Registered: 2012-04-14
Posts: 33

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I fixed the issue by adding acpi_backlight=vendor to the kernel options, so that thinkpad_acpi handles the brightness settings; instead of a generic acpi_video0, I now have /sys/class/backlight/thinkpad_screen.

However, the GNOME 3 brightness OSD is now no longer working, but that's another issue for another time...


Thinkpad T420

Offline

#3 2012-04-14 15:22:48

spikeh
Member
Registered: 2012-04-14
Posts: 33

Re: Thinkpad T420/GNOME3 - Changing brightness steps

This turned out to be more complicated than I thought. I can't actually control the backlight using sysfs - the values are all dummies - and this is why the GNOME OSD doesn't work. ThinkWiki says that kernel versions beyond 2.6.26 should use vanilla ACPI backlight control. The lack of sysfs control with thinkpad_acpi means I can't use acpid or laptop-mode-tools to manage the backlight on ACPI events such as AC in or out.

I've contacted the developers for thinkpad_acpi. Does anyone have any ideas as to fixing the brightness steps? Should I just suck it up and accept the lack of granularity for brightness, like I've done for volume?


Thinkpad T420

Offline

#4 2012-05-20 17:35:39

jdahm
Member
Registered: 2008-12-23
Posts: 11
Website

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I recently purchased a thinkpad T420 as well and have this problem.  I've simply accepted the lack of granularity so far, but it is annoying.  Have you made progress on the issue?

If it ever bothers me enough I'll look for a trick and post it here...

Offline

#5 2012-05-21 00:40:08

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I have the same problem on the x121e. Most annoyingly, I cannot get back to my default brightness using the buttons once I've switched it. My solution so far is never to use the brightness buttons and just still to terminal commands but this is a bit inconvenient.

(It is, however, a lot better than my older laptop which has no brightness control under linux whatsoever via any means. It is either on or off and if anything switches it off, you have to reboot to switch it back on!)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-05-23 02:21:41

jdahm
Member
Registered: 2008-12-23
Posts: 11
Website

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I tweaked a number of settings recently and one or a combination of them seems to have partially fixed the problem.  Now I have the full granularity, but the "progress bar" that comes up when I change brightness doesn't report the correct brightness - which is something I can live with.  The settings I added which could have contributed are:

1) tp_smapi, thinkpad-acpi, acpi-cpufreq, and cpufrequserspace to MODULES in rc.conf
2) i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 acpi_backlight=vendor acpi_osi=Linux to kernel boot options in grub.cfg.

I believe that the fix probably was adding acpi_backlight=vendor to the kernel boot options as well as thinkpad-acpi to the MODULES array.

Last edited by jdahm (2012-08-26 16:31:44)

Offline

#7 2012-05-23 22:31:40

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Thinkpad T420/GNOME3 - Changing brightness steps

Is everyone here a GNOME user? Under Windows, the backlight has a 15-step brightness scale, and this is the case with all the stand-alone WMs I've used.  Consider filing a bug with the GNOME devs.

Offline

#8 2012-05-24 00:02:58

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I'm not a GNOME user.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-06-02 11:57:01

spikeh
Member
Registered: 2012-04-14
Posts: 33

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I am a GNOME user, but I don't think it's exclusive to GNOME.

Since I need sysfs control, I'm settled with 8.5 steps by disabling Intel's backlight control via:
echo -n 0 > /sys/module/video/parameters/brightness_switch_enabled

Put it in your rc.local.

I still get two acpi events through acpi_listen per keypress:
video/brightnessdown BRTDN 00000087 00000000 K
video/brightnessdown BRTDN 00000087 00000000
video/brightnessup BRTUP 00000086 00000000 K
video/brightnessup BRTUP 00000086 00000000

I'd like to know what the K is. Kernel? Is each acpi event being parsed twice, once by the kernel and again by something in userspace?

As with many Linux problems (and medicine in general), the diagnosis is the most difficult part. Where do I file the bug report!?

This-is-bothering-me-enough-to-make-me-seek-answers Edit:

OK, the duplicate acpi events is definitely a problem with the ACPI parts of the Linux kernel - whether vanilla or thinkpad-acpi I'm not exactly sure. I found this posted on thinkpad-acpi's mailing list:
http://sourceforge.net/mailarchive/foru … acpi-devel

Someone (Alex Hung) has written a patch to fix the duplicate acpi events, and after being checked it has been merged for linux-next. I'm really hoping it'll make an appearance in 3.4.

Kernel people are really clever!!

Last edited by spikeh (2012-06-02 14:13:52)


Thinkpad T420

Offline

#10 2012-06-11 01:59:17

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Thinkpad T420/GNOME3 - Changing brightness steps

Adding acpi_backlight=vendor has resulted in my having no control over brightness at all.

They multiple events are still triggered as above but there's nothing for the attempted brightness changes to affect... Also, it laptop-mode can no longer set my brightness at all.

How come this does the trick for everyone else?! I must be missing the blindingly obvious...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2012-07-23 03:48:19

dmelo87
Member
Registered: 2012-07-23
Posts: 1

Re: Thinkpad T420/GNOME3 - Changing brightness steps

The echo on /sys/module/video/parameters/brightness_switch_enabled worked for me smile  [http://diogomelo.net/blog/12/linux-lost … how-fix-it]

Offline

#12 2012-07-25 20:23:17

spikeh
Member
Registered: 2012-04-14
Posts: 33

Re: Thinkpad T420/GNOME3 - Changing brightness steps

Somewhere between 3.4 and 3.5, the steps are now working properly! Hoorah.


Thinkpad T420

Offline

#13 2012-07-25 23:38:45

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Thinkpad T420/GNOME3 - Changing brightness steps

spikeh wrote:

Somewhere between 3.4 and 3.5, the steps are now working properly! Hoorah.

It still isn't working right here. I have some control but the steps aren't correct when I use the brightness buttons. So laptop-mode tools can give me a brightness of 12 but if I increase and then decrease brightness, I can never get back. I can get 11, say, but never 12...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#14 2013-05-26 15:23:11

korg91
Member
Registered: 2013-05-26
Posts: 4

Re: Thinkpad T420/GNOME3 - Changing brightness steps

Hi guys, I am on Ubuntu 13.04 (yeah, I know, this is the arch forum, but...come on) and I have the same issue (kernel 3.8.0).

I was thinking about a possible solution and maybe this is not an elegant one, but...would it be possible to write a script that, when you use the brightness-DOWN key, _increases_ brightness by 1 and when you use the brightness-UP key, _decreases_ brightness by 1? Because the problem is that brightness gets increased/decreased by *2* using brightness hotkeys...with this script it should finally get increased/decreased by 1 instead... 2 - 1 = 1 and -2 + 1 = -1  wink

I am not able to write such a script...but maybe you are able to write it within minutes...

PS: cat /sys/module/video/parameters/brightness to see what's going on

Last edited by korg91 (2013-05-26 15:26:06)

Offline

#15 2013-05-26 16:32:48

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Thinkpad T420/GNOME3 - Changing brightness steps

korg91 wrote:

Hi guys, I am on Ubuntu 13.04 (yeah, I know, this is the arch forum, but...come on) and I have the same issue (kernel 3.8.0).

I was thinking about a possible solution and maybe this is not an elegant one, but...would it be possible to write a script that, when you use the brightness-DOWN key, _increases_ brightness by 1 and when you use the brightness-UP key, _decreases_ brightness by 1? Because the problem is that brightness gets increased/decreased by *2* using brightness hotkeys...with this script it should finally get increased/decreased by 1 instead... 2 - 1 = 1 and -2 + 1 = -1  wink

I am not able to write such a script...but maybe you are able to write it within minutes...

PS: cat /sys/module/video/parameters/brightness to see what's going on

Suggested solution: install Arch Linux. It is fixed here. No idea why it is not fixed in Ubuntu and can only suggest you ask on their forums. For your information /sys/module/video/parameters/brightness does not exist on my system.

Last edited by cfr (2013-05-26 16:33:27)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#16 2013-05-26 17:12:00

korg91
Member
Registered: 2013-05-26
Posts: 4

Re: Thinkpad T420/GNOME3 - Changing brightness steps

cfr wrote:

Suggested solution: install Arch Linux. It is fixed here. No idea why it is not fixed in Ubuntu and can only suggest you ask on their forums. For your information /sys/module/video/parameters/brightness does not exist on my system.

I am sorry. I thought it was still an issue on arch too because of your last message:

cfr wrote:

It still isn't working right here.

and the fact that there is no "solved" in the thread object.

Furthermore, I like arch community more than the ubuntu one smile

Thanks anyway

Last edited by korg91 (2013-05-26 17:12:18)

Offline

#17 2013-05-26 17:23:13

korg91
Member
Registered: 2013-05-26
Posts: 4

Re: Thinkpad T420/GNOME3 - Changing brightness steps

THIS is the reason why I *love* the Arch community: I tried "echo N | sudo tee /sys/module/video/parameters/brightness_switch_enabled" (still on ubuntu) as suggested in the first post and now it's working perfectly big_smile

most and better solutions for linux problems are on arch forums and wiki

thank you guys and sorry again

Offline

#18 2013-05-26 17:53:58

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,209

Re: Thinkpad T420/GNOME3 - Changing brightness steps

No worries.  We do only provide direct support for Arch Linux, but we have no problem with people looking here for answers.  Provided there is nothing in the threads that might cause confusion to Arch users, I am generally okay with input from other distributions.  You stated you were a Ubuntu user up front; thank you for that.

Why not join Arch?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#19 2013-05-26 18:17:25

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,148

Re: Thinkpad T420/GNOME3 - Changing brightness steps

korg91 wrote:

I thought it was still an issue on arch too because of your last message:

cfr wrote:

It still isn't working right here.

Because it wasn't working, I have lost the habit of using the brightness buttons at all so I only discovered it is fixed here when I read your message and re-tested.

and the fact that there is no "solved" in the thread object.

People forget or leave them open because others still have the issue even if they have found a solution...

Interesting you still have that brightness file there in Ubuntu. Then again, my kernel is now 3.9.3.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#20 2013-05-27 10:41:01

korg91
Member
Registered: 2013-05-26
Posts: 4

Re: Thinkpad T420/GNOME3 - Changing brightness steps

ewaller wrote:

No worries.  We do only provide direct support for Arch Linux, but we have no problem with people looking here for answers.  Provided there is nothing in the threads that might cause confusion to Arch users, I am generally okay with input from other distributions.  You stated you were a Ubuntu user up front; thank you for that.

thanks...I think that's the best thing to do

ewaller wrote:

Why not join Arch?

I would love that, mainly because of the community and because I would love a rolling distro. Here are the reasons why I don't do the switch:

- many friends of mine use Arch. They love it, but I see they have problems (maybe small ones) pretty often...unfortunately I can't read documentation before every update
- ubuntu is not rolling, but with the latest release software is pretty up to date...if I need the last version, 90% of times there is a PPA, and PPAs are awesome...and programs are quite stable (don't know on Arch)
- at the moment I don't have too much time to learn a new distro, especially considered the fact that ubuntu runs very well
- maybe you'll be disgusted by that, but...I love Unity...it's perfect, especially if you prefer keyboard on mouse (yeah I'm serious...try it)...I know, Unity can be installed on Arch, but...

Anyway, I hope sooner or later I will switch to Arch smile

Offline

#21 2014-01-21 05:13:02

mkllnk
Member
Registered: 2014-01-21
Posts: 2

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I have the same issue under Debian 7 wheezy with Gnome 3 running on a X200s. If I use the fn keys I have only five steps. But I found two ways of using the full 15 steps (16 levels):

1. Gnome brightness settings has a slider which works with all 16 levels.
2. Switching to a terminal (ctrl+alt+f1) and then use the fn keys.

Therefore I conclude for my system that the usage of the fn keys is interpreted multiple times or Gnome 3 has a weired setting and I don't know how to change it.
Changing /sys/module/video/parameters/brightness_switch_enabled deactivates the fn keys completely on my system.

Offline

#22 2014-01-21 12:19:13

akspecs
Member
Registered: 2012-02-11
Posts: 179

Re: Thinkpad T420/GNOME3 - Changing brightness steps

I hate to post in a thread was dead only to be resurrected, but I'm not the one who resurrected it tongue

I'll make a quick note for a few of you guys trying to get up to date on this issue.  It seems that there was a regression that caused this issue to reappear as described.  Gnome / gnome based DEs are experiencing it because their brightness button adjustment is being doubled and sometimes tripled by the standard generic acpi module, and then their laptops dedicated acpi module e.g. thinkpad_acpi driver.  The third adjustment will come in from the gnome-settings-daemon.

A workaround would be to set the proper kernel parameter for your machine, and then set the graphics brightness value to 0.  Here is an example that has worked for me since this issue has re-occurred:

acpi_osi='!Windows 2012' video.brightness_switch_enabled=0

Offline

Board footer

Powered by FluxBB