Bug 11457 - Hardware screen light control keys don't work from debian but do work in BIOS
Summary: Hardware screen light control keys don't work from debian but do work in BIOS
Status: REJECTED INVALID
Alias: None
Product: ACPI
Classification: Unclassified
Component: ACPICA-Core (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-30 01:02 UTC by Alexey Pechnikov
Modified: 2008-10-30 00:59 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.25-2-686 #1 SMP Fri Jul 18 17:46:56 UTC 2008 i686 GNU/Linux
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
acpidump file (360.65 KB, text/plain)
2008-08-31 23:01 UTC, Alexey Pechnikov
Details
cat /proc/interrupts > interrupt-1 (1.19 KB, text/plain)
2008-08-31 23:21 UTC, Alexey Pechnikov
Details
cat /proc/interrupts > interrupt-2 (1.19 KB, text/plain)
2008-08-31 23:22 UTC, Alexey Pechnikov
Details
grep . /sys/firmware/acpi/interrupts/* > gpe-1 (1.52 KB, text/plain)
2008-08-31 23:22 UTC, Alexey Pechnikov
Details
grep . /sys/firmware/acpi/interrupts/* > gpe-2 (1.19 KB, text/plain)
2008-08-31 23:22 UTC, Alexey Pechnikov
Details
grep . /sys/firmware/acpi/interrupts/* > gpe-2 (1.52 KB, text/plain)
2008-08-31 23:33 UTC, Alexey Pechnikov
Details
lsmod log (3.51 KB, text/x-log)
2008-09-01 00:22 UTC, Alexey Pechnikov
Details
xrandr --verbose (2.44 KB, text/plain)
2008-09-01 01:09 UTC, Alexey Pechnikov
Details
ls /etc/acpi/*/*>acpi (4.15 KB, text/plain)
2008-09-17 00:02 UTC, Alexey Pechnikov
Details

Description Alexey Pechnikov 2008-08-30 01:02:08 UTC
Latest working kernel version: 2.6.21
Earliest failing kernel version:2.6.22 
Distribution: lenny
Hardware Environment:hp compaq 6720s
Software Environment:
Problem Description:hardware screen light control keys don't work from debian but do work in BIOS. After light key is pressed in debian screen light is changed and immediately return to previous value.

Steps to reproduce:
Comment 1 Zhang Rui 2008-08-31 18:42:50 UTC
Please attach the acpidump output.
You can get it using the latest pmtools here:
http://www.lesswatts.org/patches/linux_acpi/
Comment 2 Alexey Pechnikov 2008-08-31 23:01:17 UTC
Created attachment 17552 [details]
acpidump file

dumped by command
sudo acpidump>acpidump.log
Comment 3 Zhang Rui 2008-08-31 23:09:48 UTC
please do this test:
1. cat /proc/interrupts > interrupt-1
2. press the hotkey
2. cat /proc/interrupts > interrupt-2
check if there is an increase of acpi interrupts.
if yes,
1. grep . /sys/firmware/acpi/interrupts/* > gpe-1
2. press the hotkey
3. grep . /sys/firmware/acpi/interrupts/* > gpe-2
and attach all the four files here.
Comment 4 Zhang Rui 2008-08-31 23:20:00 UTC
can you control the backlight using the acpi video driver proc interface(/proc/acpi/video/C098/C1AD/brightness)?
or does the sysfs backlight interface(/sys/class/backlight/acpi_video0/) work for you?
Comment 5 Alexey Pechnikov 2008-08-31 23:21:39 UTC
Created attachment 17553 [details]
cat /proc/interrupts > interrupt-1
Comment 6 Alexey Pechnikov 2008-08-31 23:22:03 UTC
Created attachment 17554 [details]
cat /proc/interrupts > interrupt-2
Comment 7 Alexey Pechnikov 2008-08-31 23:22:31 UTC
Created attachment 17555 [details]
grep . /sys/firmware/acpi/interrupts/* > gpe-1
Comment 8 Alexey Pechnikov 2008-08-31 23:22:46 UTC
Created attachment 17556 [details]
grep . /sys/firmware/acpi/interrupts/* > gpe-2
Comment 9 Zhang Rui 2008-08-31 23:24:02 UTC
(In reply to comment #8)
> Created an attachment (id=17556) [details]
> grep . /sys/firmware/acpi/interrupts/* > gpe-2
> 
you must have attached the wrong file. :)
Comment 10 Alexey Pechnikov 2008-08-31 23:29:37 UTC
(In reply to comment #4)
> can you control the backlight using the acpi video driver proc
> interface(/proc/acpi/video/C098/C1AD/brightness)?
> or does the sysfs backlight interface(/sys/class/backlight/acpi_video0/) work
> for you?
> 

I can control backlight using only the "xbacklight -set N" command where 0<=N<=100

After perform "xbacklight -set N" value in /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness and value in /proc/acpi/video/C098/C1AD/brightness are not changed.
Comment 11 Alexey Pechnikov 2008-08-31 23:33:11 UTC
Created attachment 17557 [details]
grep . /sys/firmware/acpi/interrupts/* > gpe-2

Re-attached file
Comment 12 Zhang Rui 2008-09-01 00:01:08 UTC
(In reply to comment #10)
> I can control backlight using only the "xbacklight -set N" command where
> 0<=N<=100
> 
> After perform "xbacklight -set N" value in
> /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness and value
> in
> /proc/acpi/video/C098/C1AD/brightness are not changed.
> 
so
"echo 1 > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness"
and then 
"echo 10 > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness"
doesn't change anthing?

If this is true, it seems like a BIOS problem and these keys should not work on any previous kernel.
but you said it worked in 2.6.21, could you please make a double check?
Comment 13 Alexey Pechnikov 2008-09-01 00:21:42 UTC
(In reply to comment #12)
> (In reply to comment #10)
> > I can control backlight using only the "xbacklight -set N" command where
> > 0<=N<=100
> > 
> > After perform "xbacklight -set N" value in
> > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness and value
> in
> > /proc/acpi/video/C098/C1AD/brightness are not changed.
> > 
> so
> "echo 1 > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness"
> and then 
> "echo 10 > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness"
> doesn't change anthing?
> 

$ sudo echo 1 > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness
bash: /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness: Access denied.

But after change by xbacklight /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness is not changed.


> If this is true, it seems like a BIOS problem and these keys should not work
> on
> any previous kernel.
> but you said it worked in 2.6.21, could you please make a double check?
> 

I have now old kernel now but with early kernels backligth control keys worked fine. I'm attaching lsmod output file - may be I must load manually any kernel module? I'm using debian default kernel always.
Comment 14 Alexey Pechnikov 2008-09-01 00:22:21 UTC
Created attachment 17558 [details]
lsmod log
Comment 15 Zhang Rui 2008-09-01 01:00:19 UTC
(In reply to comment #13)
> $ sudo echo 1 >
> /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness
> bash: /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness:
> Access
> denied.
> 
please login as root and try again.

> But after change by xbacklight
> /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness is not
> changed.
> 
xbacklight uses another mechanism to control the backlight,
Please attach the result of "xrandr --verbose".
please run "xrandr --output LVDS --set BACKLIGHT_CONTROL kernel", and do this test again.
Comment 16 Alexey Pechnikov 2008-09-01 01:09:11 UTC
$ xrandr --output LVDS --set BACKLIGHT_CONTROL kernel
X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  156 (RANDR)
  Minor opcode of failed request:  11 ()
  Serial number of failed request:  18
  Current serial number in output stream:  18
Comment 17 Alexey Pechnikov 2008-09-01 01:09:57 UTC
Created attachment 17559 [details]
xrandr --verbose
Comment 18 Zhang Rui 2008-09-01 02:14:25 UTC
(In reply to comment #16)
> $ xrandr --output LVDS --set BACKLIGHT_CONTROL kernel
> X Error of failed request:  BadName (named color or font does not exist)
>   Major opcode of failed request:  156 (RANDR)
>   Minor opcode of failed request:  11 ()
>   Serial number of failed request:  18
>   Current serial number in output stream:  18
> 
it seems that the X you're using is quite old, right?
let's ignore this problem and get back to the ACPI issue.

(In reply to comment #15)
> (In reply to comment #13)
> > $ sudo echo 1 >
> > /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness
> > bash: /sys/class/backlight/acpi_video0/subsystem/acpi_video0/brightness:
> Access
> > denied.
> > 
> please login as root and try again.
> 
could you please do this test?
/sys/class/backlight/acpi_video0/brightness can only be written by root USER.
so please run "su" first before
"echo 0 > /sys/class/backlight/acpi_video0/brightness"
and "echo 10 > /sys/class/backlight/acpi_video0/brightness"
Comment 19 Alexey Pechnikov 2008-09-01 02:29:17 UTC
> it seems that the X you're using is quite old, right?
> let's ignore this problem and get back to the ACPI issue.

Xorg version 1:7.3+15

> so please run "su" first before
> "echo 0 > /sys/class/backlight/acpi_video0/brightness"
> and "echo 10 > /sys/class/backlight/acpi_video0/brightness"

Yes, as root user it's work
echo 0 > /sys/class/backlight/acpi_video0/brightness
but not work with sudo (there is string "my_user_name   ALL=(ALL) ALL" in /etc/sudoers).

After "echo 0 > /sys/class/backlight/acpi_video0/brightness;echo 10 > /sys/class/backlight/acpi_video0/brightness;xbacklight -set 50" command "echo 10 > /sys/class/backlight/acpi_video0/brightness;" doesn't change screen light!
Comment 20 Zhang Rui 2008-09-01 18:01:25 UTC
Okay, in order to see if ACPI can control the brightness,
please stop using xbacklight. :)
Can "echo 0 > /sys/class/backlight/acpi_video0/brightness" and "echo 10 > /sys/class/backlight/acpi_video0/brightness" change the brightness level after a fresh boot?
If yes, please kill acpid and run "cat /proc/acpi/event", check if there is something pop up when pressing the hotkey.
If no, which means that the ACPI video driver can receive the event and then tries to change the backlight via ACPI control method, which doesn't work on this laptop.
Comment 21 Alexey Pechnikov 2008-09-02 01:26:04 UTC
(In reply to comment #20)
> Okay, in order to see if ACPI can control the brightness,
> please stop using xbacklight. :)
> Can "echo 0 > /sys/class/backlight/acpi_video0/brightness" and "echo 10 >
> /sys/class/backlight/acpi_video0/brightness" change the brightness level
> after
> a fresh boot?

Yes, it's work.

> If yes, please kill acpid and run "cat /proc/acpi/event", check if there is
> something pop up when pressing the hotkey.

Yes, it's work too.

cat /proc/acpi/event
video C1AD 00000087 00000000
video C1AD 00000086 00000000

> If no, which means that the ACPI video driver can receive the event and then
> tries to change the backlight via ACPI control method, which doesn't work on
> this laptop.
> 

And if yes?
Comment 22 Zhang Rui 2008-09-09 18:46:02 UTC
(In reply to comment #21)
> (In reply to comment #20)
> > Okay, in order to see if ACPI can control the brightness,
> > please stop using xbacklight. :)
> > Can "echo 0 > /sys/class/backlight/acpi_video0/brightness" and "echo 10 >
> > /sys/class/backlight/acpi_video0/brightness" change the brightness level
> after
> > a fresh boot?
> 
> Yes, it's work.
> 
this means that the brightness can be controlled via ACPI methods.

> > If yes, please kill acpid and run "cat /proc/acpi/event", check if there is
> > something pop up when pressing the hotkey.
> 
> Yes, it's work too.
> 
> cat /proc/acpi/event
> video C1AD 00000087 00000000
> video C1AD 00000086 00000000
> 
this means that ACPI video driver can receive the event.

> > If no, which means that the ACPI video driver can receive the event and
> then
> > tries to change the backlight via ACPI control method, which doesn't work
> on
> > this laptop.
> > 
> And if yes?
> 
If yes, the brightness should be changed successfully when pressing the hotkey, but actually it's not...
this could happen only in one case, i.e. video.brightness_switch_enable is cleared.
could you please
1. attach the result of "grep . /proc/acpi/video/*/*/brightness"
2. make sure /sys/modules/video/parameters/brightness_switch_enabled is set.
3. do this test:
   a) grep . /sys/class/backlight/acpi_video0/*
   b) press the hotkey (make sure there is an event at this time using the method in comment#20)
   c) grep . /sys/class/backlight/acpi_video0/*
4. attach the test results here.
Comment 23 Alexey Pechnikov 2008-09-10 11:50:17 UTC
1.grep . /proc/acpi/video/*/*/brightness
/proc/acpi/video/C098/C1AD/brightness:levels:  100 51 30 37 44 51 58 65 72 79 86 93 100
/proc/acpi/video/C098/C1AD/brightness:current: 100
/proc/acpi/video/C098/C1B2/brightness:<not supported>
/proc/acpi/video/C098/C1B3/brightness:<not supported>
/proc/acpi/video/C098/C1B4/brightness:<not supported>
/proc/acpi/video/C098/C1B5/brightness:<not supported>


2. cat /sys/module/video/parameters/brightness_switch_enabled
Y

3.a. grep . /sys/class/backlight/acpi_video0/*
/sys/class/backlight/acpi_video0/actual_brightness:10
/sys/class/backlight/acpi_video0/bl_power:0
/sys/class/backlight/acpi_video0/brightness:10
/sys/class/backlight/acpi_video0/max_brightness:10

3.c. After first press values are saved
grep . /sys/class/backlight/acpi_video0/*
/sys/class/backlight/acpi_video0/actual_brightness:10
/sys/class/backlight/acpi_video0/bl_power:0
/sys/class/backlight/acpi_video0/brightness:10
/sys/class/backlight/acpi_video0/max_brightness:10

but after second press values are changed:
grep . /sys/class/backlight/acpi_video0/*
/sys/class/backlight/acpi_video0/actual_brightness:5
/sys/class/backlight/acpi_video0/bl_power:0
/sys/class/backlight/acpi_video0/brightness:10
/sys/class/backlight/acpi_video0/max_brightness:10
Comment 24 Zhang Rui 2008-09-10 18:42:02 UTC
(In reply to comment #23)
> 
> but after second press values are changed:
> grep . /sys/class/backlight/acpi_video0/*
> /sys/class/backlight/acpi_video0/actual_brightness:5
> /sys/class/backlight/acpi_video0/bl_power:0
> /sys/class/backlight/acpi_video0/brightness:10
> /sys/class/backlight/acpi_video0/max_brightness:10
> 
but the actual brightness is still not changed at this time???
Comment 25 Alexey Pechnikov 2008-09-11 01:06:05 UTC
> but the actual brightness is still not changed at this time???
> 
Brightness is changed after first press and after second press too.
Comment 26 Zhang Rui 2008-09-11 18:20:56 UTC
what's the problem then?
do they change back automatically?
it seems that the brightness hotkey works well so far.
Comment 27 Alexey Pechnikov 2008-09-12 00:25:35 UTC
(In reply to comment #26)
> what's the problem then?
> do they change back automatically?

After press brightness hotkey I can see flicker on screen and brightness not change. May be brightness change back automatically.
Comment 28 Zhang Rui 2008-09-15 19:44:06 UTC
(In reply to comment #27)
> (In reply to comment #26)
> > what's the problem then?
> > do they change back automatically?
> 
> After press brightness hotkey I can see flicker on screen and brightness not
> change. May be brightness change back automatically.
> 
okay, I see.

(In reply to comment #21)
> (In reply to comment #20)
> > Okay, in order to see if ACPI can control the brightness,
> > please stop using xbacklight. :)
> > Can "echo 0 > /sys/class/backlight/acpi_video0/brightness" and "echo 10 >
> > /sys/class/backlight/acpi_video0/brightness" change the brightness level
> after
> > a fresh boot?
> 
> Yes, it's work.
> 

what about this one?
the backlight is not flickering, right?

> > If yes, please kill acpid and run "cat /proc/acpi/event", check if there is
> > something pop up when pressing the hotkey.
> 
> Yes, it's work too.
> 
I guess the backlight is changed without any flicker in this case, right?

(In reply to comment #23)

> 2. cat /sys/module/video/parameters/brightness_switch_enabled
> Y
> 
please run "echo 0 > /sys/module/video/parameters/brightness_switch_enabled" first, can you see the flicker when pressing the hotkey this time?
Comment 29 Alexey Pechnikov 2008-09-16 00:29:58 UTC
> (In reply to comment #21)
> > (In reply to comment #20)
> > > Okay, in order to see if ACPI can control the brightness,
> > > please stop using xbacklight. :)
> > > Can "echo 0 > /sys/class/backlight/acpi_video0/brightness" and "echo 10 >
> > > /sys/class/backlight/acpi_video0/brightness" change the brightness level
> after
> > > a fresh boot?
> > 
> > Yes, it's work.
> > 
> 
> what about this one?
> the backlight is not flickering, right?

Yes, it's right.

> > > If yes, please kill acpid and run "cat /proc/acpi/event", check if there
> is
> > > something pop up when pressing the hotkey.
> > 
> > Yes, it's work too.
> > 
> I guess the backlight is changed without any flicker in this case, right?

Yes, it's right too.

> 
> (In reply to comment #23)
> 
> > 2. cat /sys/module/video/parameters/brightness_switch_enabled
> > Y
> > 
> please run "echo 0 > /sys/module/video/parameters/brightness_switch_enabled"
> first, can you see the flicker when pressing the hotkey this time?
> 

After "echo 0 > /sys/module/video/parameters/brightness_switch_enabled" or "echo N > /sys/module/video/parameters/brightness_switch_enabled" backlight is not changed. There is no any flicker.
Comment 30 Zhang Rui 2008-09-16 00:41:06 UTC
hah, I see
the hotkey works perfectly on this laptop and the ACPI video driver can change the brightness when pressing the hotkey for you.
the problem is that acpid runs another user space script when receiving an ACPI hotkey event, thus changes the brightness back.
please attach /var/log/messages after pressing the hotkey. it tells us which script is evaluated upon the hotkey event and removing that file should fix the problem for you.
Comment 31 Alexey Pechnikov 2008-09-16 03:32:39 UTC
(In reply to comment #30)
> hah, I see
> the hotkey works perfectly on this laptop and the ACPI video driver can
> change
> the brightness when pressing the hotkey for you.
> the problem is that acpid runs another user space script when receiving an
> ACPI
> hotkey event, thus changes the brightness back.
> please attach /var/log/messages after pressing the hotkey. it tells us which
> script is evaluated upon the hotkey event and removing that file should fix
> the
> problem for you.
> 

There are no messages in /var/log/messages after pressing hotkeys.
Comment 32 Zhang Rui 2008-09-16 18:46:51 UTC
please attach the result of "ls /etc/acpi/*/*".
Comment 33 Alexey Pechnikov 2008-09-17 00:02:43 UTC
Created attachment 17830 [details]
ls /etc/acpi/*/*>acpi

ls /etc/acpi/*/*>acpi
Comment 34 Zhang Rui 2008-09-17 00:09:20 UTC
I think the problem can be fixed if you "rm -f /etc/acpi/events/*brightness*".
of cause you should backup these files first. :)
Comment 35 Alexey Pechnikov 2008-09-17 00:59:31 UTC
(In reply to comment #34)
> I think the problem can be fixed if you "rm -f
> /etc/acpi/events/*brightness*".
> of cause you should backup these files first. :)
> 

Problem is not fixed after "rm -f /etc/acpi/events/*brightness*"
Comment 36 Zhang Rui 2008-09-17 01:21:14 UTC
well, please attach the /var/log/messages after pressing the hotkey.
please make sure acpid is running and you can see the flicker when the key is pressed.
Comment 37 Zhang Rui 2008-09-23 20:52:34 UTC
Alexey, any update?
Comment 38 Alexey Pechnikov 2008-09-24 00:03:11 UTC
(In reply to comment #36)
> well, please attach the /var/log/messages after pressing the hotkey.
> please make sure acpid is running and you can see the flicker when the key is
> pressed.
> 

There are no messages in /var/log/messages after pressing the hotkey. acpid is started and I can see flicker when the key is pressed.
Comment 39 Zhang Rui 2008-09-26 19:46:46 UTC
well, this is weird. :)
what if you remove /etc/acpi/event/* before doing the test again?
Comment 40 Zhang Rui 2008-10-29 01:58:20 UTC
ping Pechnikov, any update?
Comment 41 Alexey Pechnikov 2008-10-29 02:25:20 UTC
sudo rm /etc/acpi/events/*

ps aux|grep acpid
root        47  0.0  0.0      0     0 ?        S<   Oct12   1:14 [kacpid]
107       3145  0.0  0.0   2272   708 ?        S    Oct12   0:11 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
root     25871  0.0  0.1   2292  1156 ?        Ss   12:17   0:00 /usr/sbin/acpid -c /etc/acpi/events


There are no messages in /var/log/messages after pressing the hotkey and deleted acpid events scripts. acpid is
started. I did work without acpid and after acpid is started I can't see flicker when the key is pressed.
Comment 42 Zhang Rui 2008-10-30 00:59:01 UTC
well. the problem is quite clear.
when pressing hotkey, Linux kernel video driver tries to control the backlight.
while some userspace scripts listen to the acpid and try to set the backlight as well.
the first solution is that "echo 0 > /sys/.../brightness_switch_enabled", which can prevent the ACPI video driver from changing the backlight.
An alternative is to remove the user space scripts in /etc/acpi/events/.
I think you can easily figure out which script brings the flicker.

Reject it as this is not a kernel bug.

Pechnikov,
please re-open it if you still have any questions. :)

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