Bug 19592 - brightness is changed by double steps
brightness is changed by double steps
Product: ACPI
Classification: Unclassified
Component: Power-Video
All Linux
: P1 normal
Assigned To: Aaron Lu
: 25482 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2010-10-02 20:18 UTC by Pavol Klačanský
Modified: 2013-03-28 08:21 UTC (History)
7 users (show)

See Also:
Kernel Version: 3.2.1
Tree: Mainline
Regression: No


Description Pavol Klačanský 2010-10-02 20:18:43 UTC
Hallo, regulation of brightness after X loading is twice

see this bug

Intel driver not work properly, ati open source driver works well
Comment 1 Zhang Rui 2010-10-08 06:24:20 UTC
comment #63 in https://bugs.launchpad.net/ubuntu/+source/linux/+bug/257827?comments=all suggests that one step is done by kernel and another is done by userspace.

If this is true, why we don't have such bug report before? This problem should happen on all the laptops.

it seems that X STARTs to handle KEY_BRIGHTNESSUP/KEY_BRIGHTNESSDOWN input event recently, right?
Comment 2 Pavol Klačanský 2010-10-08 13:52:41 UTC
No, not at all laptops

Probably, I can be fixed by workaround in gnome-power-manager

some datas
Comment 3 Matthew Garrett 2010-10-08 13:56:53 UTC
Try setting /sys/module/video/parameters/brightness_switch_enabled to N.
Comment 4 Pavol Klačanský 2010-10-08 14:06:50 UTC
I have tried it, but it disables brightness regulation in TTY (where no X running)
Comment 5 Matthew Garrett 2010-10-08 14:27:54 UTC
Yes, you'll need some userspace package running in tty sessions as well (which may involve you writing one)
Comment 6 Pavol Klačanský 2010-10-08 14:35:24 UTC
hmm, so reg. of brightness in TTY is bug or feature?
Comment 7 Pavol Klačanský 2010-10-09 12:51:14 UTC
and brightness switch should be disabled by default
Comment 8 Pavol Klačanský 2010-10-11 16:57:11 UTC
so, how will it be fixed?
Comment 9 Pavol Klačanský 2010-10-12 13:10:52 UTC
Why some intel machines don't have this problem?
Comment 10 Zhang Rui 2010-10-13 00:49:53 UTC
(In reply to comment #7)
> and brightness switch should be disabled by default

well, /sys/module/video/parameters/brightness_switch_enabled is introduced because we want X to disable the kernel backlight regulation, when X knows it CAN handle the backlight switching.

the default value is N, because we don't want to lost the backlight control in console mode.

So IMO, the future work is to help x play well with this switch.
Matthew, what do you think?
Comment 11 Pavol Klačanský 2010-10-13 13:12:30 UTC
Hmm, is it already inplemented in X?
Comment 12 Zhang Rui 2010-12-30 05:37:11 UTC
*** Bug 25482 has been marked as a duplicate of this bug. ***
Comment 13 Michal Zatloukal 2011-01-21 14:46:04 UTC
Hello, coming in from bug 25482 - the problem in my case is likely unrelated to X, as it occurs in ubuntu's recovery mode as well - without X running.

What INFO is needed, as per this bug's status?
Comment 14 Zhang Rui 2012-01-18 02:19:49 UTC
It's great that kernel bugzilla is back.

can you please verify if the problem still exists in the latest upstream
Comment 15 Pavol Klačanský 2012-01-18 14:43:07 UTC
Tried with this kernel

uname -r

There some investigation

But, I think, it works like this, when you press key, kernel changes brightness and also report that key was pressed, so gnome-power-manager also changes brightness (2 steps then, because 1 by kernel + 1 by GPM).

We need to get kernel detecting that GPM is running or so, or just support computers and remove function from GPM.

Or just simply patch GPM to watch, if kernel already changed brightness, if so, then GPM will just report it was changed and do not change again
Comment 16 Michal Zatloukal 2012-01-19 18:03:09 UTC
Testing now with Kubuntu precise + mainline from ppa [1]:

Still the same behaviour:
- down by steps of 2, up not at all
- echo N > ...switch_enabled fixes everything
- regular or recovery mode (single user, no X) boot, X or vty makes no difference

[1] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.2.1-precise/
Comment 17 Pavol Klačanský 2012-04-06 19:50:03 UTC
same for me, I have tried my crappy patch to GPM, but they refused it and said it is kernel problem. I have seen speech from kernel dev, so I am encouraged to get it fixed.

Comment 18 Zhang Rui 2012-11-13 07:24:33 UTC
so, we are clear what the problem is.
for one hotkey press,
1) kernel changes the backlight
2) kernel send notification to userspace
2) userspace changes the backlight based on the kernel notification

And kernel has a module parameter to disable step 1) and do step2) only, and this parameter is designed to be used by X to disable step 1) when X starts.
but this is not the proper solution that X guys want?
Comment 19 Aaron Lu 2013-03-11 07:47:46 UTC
Hi Rui,

I just proposed your idea to the gnome bugzilla page, let's see what do they think.
Comment 20 Aaron Lu 2013-03-28 08:21:17 UTC
The video module parameter brightness_switch_enabled can be used to enable/disable this feature; to avoid the level changing twice, please set it to 0. I would very much like to set the value default to 0, but then perhaps other people would request this set to 1. Let's leave it as it is now.

Note You need to log in before you can comment on or make changes to this bug.