Bug 62941

Summary: Backlight control doesn't work with Acer Aspire 5733Z-P623G32Mikk
Product: ACPI Reporter: sov.info (sov.info)
Component: Power-VideoAssignee: drivers_platform (drivers_platform)
Status: CLOSED DUPLICATE    
Severity: normal CC: aaron.lu, alex94puchades, dpt, lenb, softexpert, sov.info
Priority: P1    
Hardware: All   
OS: Linux   
URL: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1242292
Kernel Version: 2.6.32.61 - 3.12-rc6-saucy Subsystem:
Regression: No Bisected commit-id:
Attachments: syslog
acpidump.txt
dmi.txt
acpidump from HP Revolve 810 G1
acpidump from HP EliteBook 8770w
lspci -vv result for HP8770w

Description sov.info@mail.ru 2013-10-13 16:18:46 UTC
In this notebook i cannot regulate brightness by any methods.
PS
I try to edit /etc/default/grub and edit line. so it looks this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
(sudo update-grub && sudo reboot, of cource),
but it has NO effect. Hotkeys Fn + brightness keys (left & right) didn't work.
Comment 1 sov.info@mail.ru 2013-10-17 19:09:05 UTC
Update(In reply to sov.info@mail.ru from comment #0)
> I try to edit /etc/default/grub and edit line
> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"
> (sudo update-grub && sudo reboot, of cource),
> but it has NO effect. Hotkeys Fn + brightness keys (left & right) didn't
> work.

But these hotkeys start to work with parameter acpi=off while booting the kernel (in /etc/default/grub line should looks like that=
GRUB_CMDLINE_LINUX="acpi=off")


But after that - stop working Wi-Fi and mobile broadband.
So it is not a real solution :/
Comment 2 sov.info@mail.ru 2013-10-20 09:39:46 UTC
With parameter 

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"

hotkeys works well. But screen don't show visual *something* when brightness changes (as usually should do). But this is a minor bug.

Also, still hoping for that aspect working out-of-the-box.
Comment 3 Aaron Lu 2013-10-21 02:03:45 UTC
Please list /sys/class/backlight after you boot the system without using any cmdline option, and then use echo to set brightness level, see if any of the interfaces work.
Comment 4 sov.info@mail.ru 2013-10-21 03:33:33 UTC
(In reply to Aaron Lu from comment #3)
> list /sys/class/backlight
> then use echo

How can i do that?
Comment 5 Aaron Lu 2013-10-21 03:38:59 UTC
For list:
$ ls /sys/class/backlight

For echo:
Suppose acpi_video0 is there, then:
1 check max_brightness value by
$ cat /sys/class/backlight/acpi_video0/max_brightness
20
2 check current brightness level by
$ cat /sys/calss/backlight/acpi_video0/brightness
10
3 set different levels
# echo 5 > /sys/class/backlight/acpi_video0/brightness
# echo 10 > /sys/class/backlight/acpi_video0/brightness
See if brightness level changes.

You can test other interfaces under /sys/class/backlight too.
Comment 6 sov.info@mail.ru 2013-10-21 07:49:34 UTC
(In reply to Aaron Lu from comment #5)
> For list:
> $ ls /sys/class/backlight

here it is

isshin@kurosaki:~$ ls /sys/class/backlight
acpi_video0  intel_backlight
isshin@kurosaki:~$ ls /sys/class/backlight --all
.  ..  acpi_video0  intel_backlight
isshin@kurosaki:~$ 




> For echo:
> Suppose acpi_video0 is there, then:
> 1 check max_brightness value by
> $ cat /sys/class/backlight/acpi_video0/max_brightness
> 20

isshin@kurosaki:~$ cat /sys/class/backlight/acpi_video0/max_brightness
10

> 2 check current brightness level by
> $ cat /sys/calss/backlight/acpi_video0/brightness
> 10

isshin@kurosaki:~$ cat /sys/calss/backlight/acpi_video0/brightness
cat: /sys/calss/backlight/acpi_video0/brightness: No such file or directory


> 3 set different levels
> # echo 5 > /sys/class/backlight/acpi_video0/brightness

isshin@kurosaki:~$ echo 5 > /sys/class/backlight/acpi_video0/brightness
bash: /sys/class/backlight/acpi_video0/brightness: Permission denied
isshin@kurosaki:~$ sudo echo 5 > /sys/class/backlight/acpi_video0/brightness
bash: /sys/class/backlight/acpi_video0/brightness: Permission denied


> # echo 10 > /sys/class/backlight/acpi_video0/brightness

isshin@kurosaki:~$ sudo echo 10 > /sys/class/backlight/acpi_video0/brightness
bash: /sys/class/backlight/acpi_video0/brightness: Permission denied

> See if brightness level changes.

No.

> You can test other interfaces under /sys/class/backlight too.



Ok, let's go.

isshin@kurosaki:/sys/class/backlight/intel_backlight$ ls --all
.   actual_brightness  brightness  max_brightness  subsystem  uevent
..  bl_power           device      power           type
isshin@kurosaki:/sys/class/backlight/intel_backlight$ 


isshin@kurosaki:~$ cat /sys/class/backlight/intel_backlight/max_brightness
976


isshin@kurosaki:~$ cat /sys/calss/backlight/intel_backlight/brightness
cat: /sys/calss/backlight/intel_backlight/brightness: No such file or directory

isshin@kurosaki:~$ sudo echo 5 > /sys/class/backlight/intel_backlight/brightness
bash: /sys/class/backlight/intel_backlight/brightness: Permission denied


As you can see, everywhere permission is denied.
With Gedit:

Could not create a backup file while saving /sys/class/backlight/intel_backlight/brightness
gedit could not back up the old copy of the file before saving the new one. You can ignore this warning and save the file anyway, but if an error occurs while saving, you could lose the old copy of the file. Save anyway?

--nothing happen even after 'save anyway'--
Comment 7 Aaron Lu 2013-10-22 02:34:22 UTC
The document:
https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-backlight
explains the interface, please take a look.

Also, when you write some value to a file under the /sys directory, you need root priviledge or you will get permission denied. All files under /sys are presented by kernel, they are not real files so you can not edit them like you do with other files in a text editor program like gedit.

Notice the '#' prompt I've used in my previous comment, it means this command needs to be executed as root.


> isshin@kurosaki:~$ cat /sys/calss/backlight/acpi_video0/brightness
> cat: /sys/calss/backlight/acpi_video0/brightness: No such file or directory
Please list /sys/class/backlight/acpi_video0
$ ls /sys/class/backlight/acpi_video0
Comment 8 sov.info@mail.ru 2013-10-24 17:37:33 UTC
Created attachment 112221 [details]
syslog

(In reply to Aaron Lu from comment #7)
> The document:
> https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-backlight
> explains the interface, please take a look.
> 
> Also, when you write some value to a file under the /sys directory, you need
> root priviledge or you will get permission denied. All files under /sys are
> presented by kernel, they are not real files so you can not edit them like
> you do with other files in a text editor program like gedit.
> 
> Notice the '#' prompt I've used in my previous comment, it means this
> command needs to be executed as root.
> 
> 
> > isshin@kurosaki:~$ cat /sys/calss/backlight/acpi_video0/brightness
> > cat: /sys/calss/backlight/acpi_video0/brightness: No such file or directory
> Please list /sys/class/backlight/acpi_video0
> $ ls /sys/class/backlight/acpi_video0

Thank you.
I rerun this test - for this time under the real root user. And get actual results!
I can change brightness accurately in the interface /sys/class/backlight/intel_backlight/brightness

Minimun brightness 0, maximum 976. See the log attached.
Comment 9 Aaron Lu 2013-11-05 05:05:59 UTC
What about the acpi_video interface, does it work?
Comment 10 sov.info@mail.ru 2013-11-05 07:30:42 UTC
(In reply to Aaron Lu from comment #9)
> What about the acpi_video interface, does it work?

Interface acpi_video0 don't (min 0, max 10 brightness) work at all.
Interface intel_backlight (min 0, max 976) works well.

I don't understand well, but what if the simpliest way to work backlight in notebook - just switch these two devices?
Also, i wan't to mention - i have integrated Intel HD Graphics video, so it's going without saying, that INTEL_backlight interface works :))))
Comment 11 Aaron Lu 2013-11-05 07:37:36 UTC
Please attach acpidump:
# acpidump > acpidump.txt
Run as root, acpidump should be packaged by your distribution
Comment 12 sov.info@mail.ru 2013-11-05 11:08:59 UTC
Created attachment 113461 [details]
acpidump.txt

Here it is
Comment 13 Aaron Lu 2013-11-07 01:49:36 UTC
Edit /etc/xorg.conf and put the following into that file. Restart X(or system), see if everything works. Do not add any kernel cmdline option for this test. If you already have /etc/xorg.conf, you can insert these lines into appropriate place.

Section "Device"
        Option     "Backlight"	"intel_backlight"
	Identifier  "Card0"
	Driver      "intel"
	BusID       "PCI:0:2:0"
EndSection
Comment 14 Aaron Lu 2013-11-07 02:06:55 UTC
Alternatively, since this is a Win8 laptop, if building kernel is OK to you, please try Rafael's linux-next branch:
http://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next

There are patches for Win8 laptop to skip registering acpi_video backlight interface. When testing the above tree, please use video.use_native_backlight=1 cmdline option and no need to tweak xorg.conf file.
Comment 15 sov.info@mail.ru 2013-11-08 14:34:08 UTC
(In reply to Aaron Lu from comment #13)
> Edit /etc/xorg.conf and put the following into that file. Restart X(or
> system), see if everything works. Do not add any kernel cmdline option for
> this test. If you already have /etc/xorg.conf, you can insert these lines
> into appropriate place.
> 
> Section "Device"
>         Option     "Backlight"        "intel_backlight"
>       Identifier  "Card0"
>       Driver      "intel"
>       BusID       "PCI:0:2:0"
> EndSection

None of /etc/xorg.conf or /etc/X11/xorg.conf are present in my system.
Comment 16 sov.info@mail.ru 2013-11-08 14:37:19 UTC
(In reply to Aaron Lu from comment #14)
> Alternatively, since this is a Win8 laptop, if building kernel is OK to you,
> please try Rafael's linux-next branch:
> http://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
> 
> There are patches for Win8 laptop to skip registering acpi_video backlight
> interface. When testing the above tree, please use
> video.use_native_backlight=1 cmdline option and no need to tweak xorg.conf
> file.

Building kernel is not so well OK, as you think. I don't understand what cmdline option (i can get this via 'make config' option?) and what i should do with git, because i never used it before,...
Comment 17 Aaron Lu 2013-11-11 08:30:39 UTC
Please attach dmi.txt after you run dmidecode:
# dmidecode > dmi.txt

BTW, you can edit /etc/xorg.conf as root to make it look like:
Section "Device"
        Option     "Backlight"	"intel_backlight"
	Identifier  "Card0"
	Driver      "intel"
	BusID       "PCI:0:2:0"
EndSection

So that X will use the working intel_backlight interface. If any problem occured, just remove that file.
Comment 18 sov.info@mail.ru 2013-11-11 18:58:38 UTC
Created attachment 114251 [details]
dmi.txt
Comment 19 sov.info@mail.ru 2013-11-11 19:38:41 UTC
(In reply to Aaron Lu from comment #17)
> Section "Device"
>         Option     "Backlight"        "intel_backlight"
>       Identifier  "Card0"
>       Driver      "intel"
>       BusID       "PCI:0:2:0"
> EndSection

I create file with this text. Now backlight works as aspected :)
No problems at all. But what about working out-of-the-kernel? :)
Especially when Wayland/Mir/both are coming to replace Xorg.
Comment 20 sov.info@mail.ru 2013-11-11 19:40:26 UTC
> Especially when Wayland/Mir/both are coming to replace Xorg.

And when it happened, this answer will be useless.
But. thank you!
Comment 21 Aaron Lu 2013-11-12 03:32:35 UTC
Right, I'll add your system to a DMI table so that intel_backlight is the only exposed interface. Stay tuned.
Comment 22 sov.info@mail.ru 2013-11-23 09:40:20 UTC
Just install latest 3.13-rc1 kernel build from kernel.ubuntu.com and it doesn't work.
Comment 23 Aaron Lu 2013-11-25 00:27:34 UTC
That's because those patches aren't merged yet.
Comment 24 Dylan Thurston 2013-12-27 14:16:30 UTC
I see identical behaviour on a HP Revolve 810 G1: on Debian kernel version 3.12-1-686-pae, xbacklight doesn't do anything. In /sys/class/backlight/ I see two directories, "acpi_video0" and "intel_backlight". Controlling the brightness manually in /sys/class/backlight/intel_backlight works, as does adding the stanza listed above to /etc/X11/xorg.conf.

I have not yet tried the linux-next kernel, but I can do that after fixing some other problems with this install. (Eg, this is an amd64 laptop, but I installed the x86 distribution by mistake.)

I've attached the output of acpidump, as you requested of the other submitter.

What more information would you like? I didn't know if you wanted a new bug report or not.
Comment 25 Dylan Thurston 2013-12-27 14:18:03 UTC
Created attachment 119711 [details]
acpidump from HP Revolve 810 G1
Comment 26 Dylan Thurston 2014-01-03 04:38:02 UTC
For me (on an HP Revolve 810 G1), upgrading to linux-next does indeed fix this issue.
Comment 27 Marian 2014-01-18 10:22:57 UTC
Created attachment 122491 [details]
acpidump from HP EliteBook 8770w

Here is the acpidump for my HP EliteBook 8770w.

Running ls /sys/class/backlight will give only acpi_video0
Comment 28 Marian 2014-01-18 10:36:21 UTC
I run Ubuntu x64 with kernel 3.13.0-031300rc8-generic, installed from kernel.ubuntu.com/~kernel-ppa/mainline/v3.13-rc8-trusty/

GRUB_CMD_LINE_DEFAULT="quiet splash video.use_native_backlight=1"

There is no xorg.conf file

The graphics card is NVIDIA Quadro K3000M
The graphics driver is proprietary 331.38


1. cat /sys/class/backlight/acpi_video0/max_brightness 
20

2. cat /sys/class/backlight/acpi_video0/brightness
13

3. issuing echo 5 > /sys/class/backlight/acpi_video0/brightness has no effect

4. booting with or without video.use_native_backlight=1 does not allow to change backlight levels

With kernel 3.12.x everything is just fine.
Comment 29 Aaron Lu 2014-01-27 08:02:56 UTC
Hi Marian,
Do you have only one graphics card or two?
Comment 30 Marian 2014-01-27 09:22:34 UTC
Created attachment 123521 [details]
lspci -vv result for HP8770w

Hi Aaron,

Only one video card. I attached the results of lspci -vv command.
Comment 31 Aaron Lu 2014-01-28 07:09:45 UTC
(In reply to Marian from comment #27)
> Here is the acpidump for my HP EliteBook 8770w.
> 
> Running ls /sys/class/backlight will give only acpi_video0

OK, your case is different. The GPU driver doesn't create an usable backlight control interface - the video.use_native_backlight param means only have the gpu's backlight control interface left for user space to use. Since your GPU driver doesn't create one that wouldn't work for you.

There is nothing I can do for your laptop - the ACPI's interface is broken for some unknown reason and the GPU driver doesn't create one. You can try using acpi_backlight=vendor, see if that would make the GPU driver creates the backlight control interface under /sys/class/backlight. But that all depends on the proprietary driver.
Comment 32 Aaron Lu 2014-01-28 07:10:38 UTC
The problem for the original reporter is the same as bug #51231 - Win8 compatible problem, so I'll mark it as a duplicate.

*** This bug has been marked as a duplicate of bug 51231 ***
Comment 33 sov.info@mail.ru 2014-01-31 15:43:57 UTC
How i can update to the linux-next?
Comment 34 sov.info@mail.ru 2014-01-31 19:19:03 UTC
(In reply to Aaron Lu from comment #32)
> The problem for the original reporter is the same as bug #51231 - Win8
> compatible problem, so I'll mark it as a duplicate.
> 
> *** This bug has been marked as a duplicate of bug 51231 ***

Ok, just compile and install latest linux-next kernel. use make oldconfig.
Brightness don't work. I can't see my notebok's name in /drivers/acpi/video.c file...
Comment 35 Aaron Lu 2014-02-07 02:04:55 UTC
It's not there yet, once we solved it, I'll let you know.
Comment 36 sov.info@mail.ru 2014-03-01 12:40:35 UTC
Kernel 3.14-rc4 fix this problem, thank you!