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:
Please attach the acpidump output. You can get it using the latest pmtools here: http://www.lesswatts.org/patches/linux_acpi/
Created attachment 17552 [details] acpidump file dumped by command sudo acpidump>acpidump.log
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.
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?
Created attachment 17553 [details] cat /proc/interrupts > interrupt-1
Created attachment 17554 [details] cat /proc/interrupts > interrupt-2
Created attachment 17555 [details] grep . /sys/firmware/acpi/interrupts/* > gpe-1
Created attachment 17556 [details] grep . /sys/firmware/acpi/interrupts/* > gpe-2
(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. :)
(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.
Created attachment 17557 [details] grep . /sys/firmware/acpi/interrupts/* > gpe-2 Re-attached file
(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?
(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.
Created attachment 17558 [details] lsmod log
(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.
$ 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
Created attachment 17559 [details] xrandr --verbose
(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"
> 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!
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.
(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?
(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.
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
(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???
> but the actual brightness is still not changed at this time??? > Brightness is changed after first press and after second press too.
what's the problem then? do they change back automatically? it seems that the brightness hotkey works well so far.
(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.
(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?
> (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.
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.
(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.
please attach the result of "ls /etc/acpi/*/*".
Created attachment 17830 [details] ls /etc/acpi/*/*>acpi ls /etc/acpi/*/*>acpi
I think the problem can be fixed if you "rm -f /etc/acpi/events/*brightness*". of cause you should backup these files first. :)
(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*"
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.
Alexey, any update?
(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.
well, this is weird. :) what if you remove /etc/acpi/event/* before doing the test again?
ping Pechnikov, any update?
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.
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. :)