You are not logged in.

#1 2013-06-17 23:49:00

tobit
Member
Registered: 2012-02-05
Posts: 34
Website

[SOLVED] ASUS Screen Brightness Not Working

I have been trying for a few hours to get my screen brightness to work properly. I'm on an ASUS Zenbook Prime UX31A with kernel 3.9.6-1. I'm using efibootmgr to boot.

According to the wiki page and numerous posts, I need to use the acpi_osi="!Windows 2012" boot parameter. When I set it using efibootmgr, the keyboard backlight keys work (Fn+F[34]), but the screen brightness keys (Fn+F[56]) do not work. I have tried the following in efibootmgr:

# efibootmgr -c -w -d /dev/sda -p 1 -L "Arch Linux" -l '\EFI\arch\vmlinuz-arch.efi' -u initrd=EFI/arch/initramfs-arch.img root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi=Linux add_efi_memmap
# efibootmgr -c -w -d /dev/sda -p 1 -L "Arch Linux" -l '\EFI\arch\vmlinuz-arch.efi' -u initrd=EFI/arch/initramfs-arch.img root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi=intel add_efi_memmap
# efibootmgr -c -w -d /dev/sda -p 1 -L "Arch Linux" -l '\EFI\arch\vmlinuz-arch.efi' -u initrd=EFI/arch/initramfs-arch.img root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi= add_efi_memmap

and a few others. The particularly peculiar thing is when I use a UEFI shell to boot with my script:

echo -on
\EFI\arch\vmlinuz-arch.efi root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 add_efi_memmap efi_no_storage_paranoia initrd=EFI/arch/initramfs-arch.img elevator=noop acpi_osi="!Windows 2012"

it works fine (both keyboard backlight and screen brightness).

What am I doing wrong? My hunch is that I'm doing something wrong with the formatting of acpi_osi="!Windows 2012" but I'm pretty sure I've tried every combination of different quotes and escaping different things. It's also worth nothing that the "!" gets interpreted by bash in some of these permutations making efibootmgr not actually run.

Last edited by tobit (2013-06-30 02:37:30)

Offline

#2 2013-06-18 00:11:40

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ASUS Screen Brightness Not Working

Because you are entering it in a shell, you need to escape some of the things in the acpi_osi="!Windows 2012" string.  So for example, the double quotes are intended to be entered exactly as is in the resulting efibootmgr entry, so these should be esacped since they would otherwise have a special meaning in the command line.  The same is true for the exclamation point.  So I think you would have to do:

efibootmgr -c -w -d /dev/sda -p 1 -L "Arch Linux" -l '\EFI\arch\vmlinuz-arch.efi' -u "initrd=/EFI/arch/initramfs-arch.img root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi=\"\!Windows 2012\" add_efi_memmap"

BTW, this is just a copy/paste of one of the entries above (slightly fixed).  I added a '/' to your initrd entry, as it is supposed to be an absolute path, not a relative one.

Edit: I too started out with a direct efibootmgr entry when getting to know UEFI.  But I think that a better solution is to use a boot manager.  I like gummiboot, but I also keep rEFInd set up as well.  By doing this, if you ever want to chane something on your kernel command line, you can just edit the config before reboot.  But I think that were it is really useful is if you need to modify the kernel command line before you boot, as it is not possible with a direct efibootmgr entry.  If you want to make it seem seamless, just set the timeout to zero in efibootmgr, and then if you want to get to the menu, you just hold the spacebar while booting. 

The reason I wanted to use a direct efibootmgr entry was because I thought it would be faster.  But because gummiboot and systemd will actually give you the time it takes to boot which includes the time in the firmware (POST) as well as the time it takes to get through the boot manager, I have actually found that my system takes a whole 14ms from the end of POST to starting to load the kernel.

Edit2: BTW, I also quoted the entire srting of arguments on the kernel command line, which it need in order to be fed to the '-u' option as a single string.

Last edited by WonderWoofy (2013-06-18 00:17:27)

Offline

#3 2013-06-18 00:13:12

count0
Member
Registered: 2011-09-28
Posts: 20

Re: [SOLVED] ASUS Screen Brightness Not Working

On my Asus X201E, the screen brightness keys only work when I add "acpi_osi=" to my kernel parameters, with no arguments. You could try that.

Offline

#4 2013-06-18 00:54:00

tobit
Member
Registered: 2012-02-05
Posts: 34
Website

Re: [SOLVED] ASUS Screen Brightness Not Working

WonderWoofy wrote:

Because you are entering it in a shell, you need to escape some of the things in the acpi_osi="!Windows 2012" string.  So for example, the double quotes are intended to be entered exactly as is in the resulting efibootmgr entry, so these should be esacped since they would otherwise have a special meaning in the command line.  The same is true for the exclamation point.  So I think you would have to do:

efibootmgr -c -w -d /dev/sda -p 1 -L "Arch Linux" -l '\EFI\arch\vmlinuz-arch.efi' -u "initrd=/EFI/arch/initramfs-arch.img root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi=\"\!Windows 2012\" add_efi_memmap"

BTW, this is just a copy/paste of one of the entries above (slightly fixed).  I added a '/' to your initrd entry, as it is supposed to be an absolute path, not a relative one.

Edit: I too started out with a direct efibootmgr entry when getting to know UEFI.  But I think that a better solution is to use a boot manager.  I like gummiboot, but I also keep rEFInd set up as well.  By doing this, if you ever want to chane something on your kernel command line, you can just edit the config before reboot.  But I think that were it is really useful is if you need to modify the kernel command line before you boot, as it is not possible with a direct efibootmgr entry.  If you want to make it seem seamless, just set the timeout to zero in efibootmgr, and then if you want to get to the menu, you just hold the spacebar while booting. 

The reason I wanted to use a direct efibootmgr entry was because I thought it would be faster.  But because gummiboot and systemd will actually give you the time it takes to boot which includes the time in the firmware (POST) as well as the time it takes to get through the boot manager, I have actually found that my system takes a whole 14ms from the end of POST to starting to load the kernel.

Edit2: BTW, I also quoted the entire srting of arguments on the kernel command line, which it need in order to be fed to the '-u' option as a single string.


I'm afraid that still doesn't work. I've tried similar things and tried that specifically.  In case you're wondering, the command you listed gives me the following output:

$ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000
Boot0000* Arch Linux    HD(1,800,96000,bee2185e-de97-4dc0-9614-830639991bc3)File(\EFI\arch\vmlinuz-arch.efi)i.n.i.t.r.d.=./.E.F.I./.a.r.c.h./.i.n.i.t.r.a.m.f.s.-.a.r.c.h...i.m.g. .r.o.o.t.=.U.U.I.D.=.d.0.b.3.2.0.8.0.-.8.4.f.0.-.4.c.6.b.-.9.3.3.b.-.f.6.2.b.8.8.0.a.f.c.0.9. .r.o. .r.o.o.t.f.s.t.y.p.e.=.e.x.t.4. .e.f.i._.n.o._.s.t.o.r.a.g.e._.p.a.r.a.n.o.i.a. .e.l.e.v.a.t.o.r.=.n.o.o.p. .a.c.p.i._.o.s.i.=.".\.!.W.i.n.d.o.w.s. .2.0.1.2.". .a.d.d._.e.f.i._.m.e.m.m.a.p...

I also tried putting the -u argument in single quotes so that I don't have to escape the double quotes or the !. That also didn't work. Thanks for your suggestions, I'd be happy to try more, I've tried a lot already to no avail :-(


count0 wrote:

On my Asus X201E, the screen brightness keys only work when I add "acpi_osi=" to my kernel parameters, with no arguments. You could try that.

That's the third option I say that I tried in my original post.

Offline

#5 2013-06-18 01:24:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ASUS Screen Brightness Not Working

Interesting, so it added the escape character to the acpi_osi string.  Then in taht case, only escape the double quotes.  So it would be like this (shortened for simplicity):

# efibootmgr .... -u "initrd=\EFI\arch\initramfs-arch.img ... acpi_osi=\"!Windows 2012\" " 

You can also try using the piping method, in which you convert from ascii to unicode.  So just as an example, I am going to take out all the extra crap and make it simple:

# echo "initrd=\\EFI\\arch\\initramfs-arch.img root=/dev/disk/by-uuid/xxxxxx-xxxxx-xxxxx-xxxxxxxxx acpi_osi=\'!Windows 2012\'" | iconv -f ascii -t ucs2 | efibootmgr --create --disk /dev/sda --part 1 --label "Arch Linux" --loader '\EFI\arch\vmlinuz-linux.efi' --append-binary-args -

Keep in mind that just because you single quote the argument string does not mean that you won't still need to escape the double quotes.  It is intended to be passed to the command as characters, not holding the special meaning that double quotes have in a command.  So escaping is absolutely necessary in this case.  Though I could have sworn that I had to escape the exclamation as well... oh well.

Again, I feel as though I should point out that using something like gummiboot or rEFInd will still allow you to utilize the kernel efistub loader, but will give you much more flexability in how you are able to administer that aspect of your system.  Besides that, making the efibootmgr entry for one of those boot managers is way simpler because it doesn't require that you give it any arguments.  On top of that the gummiboot install script will actually make an efibootmgr entry for you with the gummiboot command (of course you can disable this by installing the package with --noscriptlet).

Edit: Also, the piped command you will notice that the initrd path is double backslashes because you are giving that sctring to iconv and you want it to treat them as actual characters so the first is escaping the second.

Last edited by WonderWoofy (2013-06-18 01:25:45)

Offline

#6 2013-06-18 02:06:07

tobit
Member
Registered: 2012-02-05
Posts: 34
Website

Re: [SOLVED] ASUS Screen Brightness Not Working

WonderWoofy wrote:

Interesting, so it added the escape character to the acpi_osi string.  Then in taht case, only escape the double quotes.  So it would be like this (shortened for simplicity):

# efibootmgr .... -u "initrd=\EFI\arch\initramfs-arch.img ... acpi_osi=\"!Windows 2012\" " 

With this, bash complains "-bash: !Windows: event not fount".

WonderWoofy wrote:

You can also try using the piping method, in which you convert from ascii to unicode.  So just as an example, I am going to take out all the extra crap and make it simple:

# echo "initrd=\\EFI\\arch\\initramfs-arch.img root=/dev/disk/by-uuid/xxxxxx-xxxxx-xxxxx-xxxxxxxxx acpi_osi=\'!Windows 2012\'" | iconv -f ascii -t ucs2 | efibootmgr --create --disk /dev/sda --part 1 --label "Arch Linux" --loader '\EFI\arch\vmlinuz-linux.efi' --append-binary-args -

Keep in mind that just because you single quote the argument string does not mean that you won't still need to escape the double quotes.  It is intended to be passed to the command as characters, not holding the special meaning that double quotes have in a command.  So escaping is absolutely necessary in this case.  Though I could have sworn that I had to escape the exclamation as well... oh well.

This unfortunately doesn't do the trick either.

It might be worth it to note that all of your suggestions have the keyboard backlight not working, while when I do

sudo efibootmgr -c -w -d /dev/sda -p 1 -L "Arch Linux" -l '\EFI\arch\vmlinuz-arch.efi' -u initrd=/EFI/arch/initramfs-arch.img root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi='"!Windows 2012"' add_efi_memmap

the keyboard backlight works, just the screen brightness/backlight doesn't.

Really appreciate the help, happy to try more, feel like I've been trying different variations the whole day today :-/

Offline

#7 2013-06-18 02:37:18

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ASUS Screen Brightness Not Working

Have you tried using acpi_backlight=vendor?  Or as suggested earlier, acpi_osi= (without anything after it)?

Can you set up gummiboot real quick?  It is pretty simple.  I ask because gummiboot does not use any quoting around its options line, so you can pass the argument exactly as acpi_osi="!Windows 2012" so then we can at least see if that will indeed fix your issue.  Setting this up doesn't mean that you can't then go back and additionally create an efibootmgr direct command.

Offline

#8 2013-06-18 20:37:58

tobit
Member
Registered: 2012-02-05
Posts: 34
Website

Re: [SOLVED] ASUS Screen Brightness Not Working

WonderWoofy wrote:

Have you tried using acpi_backlight=vendor?

Yup, keyboard backlight works, screen brightness doesn't.

WonderWoofy wrote:

Or as suggested earlier, acpi_osi= (without anything after it)?

Yup, I list this as the third thing tried in my original post.

WonderWoofy wrote:

Can you set up gummiboot real quick?  It is pretty simple.  I ask because gummiboot does not use any quoting around its options line, so you can pass the argument exactly as acpi_osi="!Windows 2012" so then we can at least see if that will indeed fix your issue.  Setting this up doesn't mean that you can't then go back and additionally create an efibootmgr direct command.

I set it up by installing it with

gummiboot --path=/boot/efi update

and deleted my efibootmgr entry. My /boot/efi/loader/entries/arch.conf looks like this:

title	Arch Linux
linux 	/EFI/arch/vmlinuz-arch.efi
initrd	/EFI/arch/initramfs-arch.img
options	root=UUID=d0b32080-84f0-4c6b-933b-f62b880afc09 ro rootfstype=ext4 efi_no_storage_paranoia elevator=noop acpi_osi=!Windows 2012 add_efi_memmap

I tried acpi_osi= as well as acpi_osi="!Windows 2012". The one pasted above gives me working keyboard backlight but not screen brightness. Using acpi_osi= does the same. Using acpi_osi="!Windows 2012" gives me no backlight and no screen brightness.

Thanks for your continued help, this is driving me insane...

Offline

#9 2013-06-18 22:04:04

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ASUS Screen Brightness Not Working

It should have been with the quotes, as otherwise you are telling it acpi_osi=!Windows which is not a real parameter I don't think.

Okay, can you try creating the file /etc/X11/xorg.conf.d/20-intel.conf with these contents:

Section "Device"
	Identifier 	"Intel Graphics"
	Driver	        "intel"
	Option	        "AccelMethod"  	"sna"
	Option          "Backlight"     "intel_backlight"
EndSection

Note that the AccelMethod is optional, but it will enable the newer and faster i915 graphics accel method.  It is pretty mature these days and I find it ito be quite stable.  The other option is "uxa" which is the default, so does not require an entry.

The page in the wiki that is dedicated to your machine seems to indicate that the acpi_osi="!Windows 2012" is the correct solution though, so I am unsure if this is going to do anythign for you.... at this point I think that whatever is worth a shot.

I will warn you that I am rapidly running out of ideas here.

Oh, BTW, you don't need to have the rootfstype in there, nor do you need the ro.  As long as you have the fsck hook in the initramfs, it will be checked before the filesytem is mounted.  The read-only parameter is really just kidn of a historical thing that was necessary when we used to not use an initrd/initramfs, so the only way to fsck the root filesystem was to mount it read only.  You should really have the fsck hook in any case in your mkinitcpio.conf as it is the far saner approach if you are going to have an initramfs anyway.


[side_note]I am curious as to what the efi_no_storage_paranoia boot parameter does.  I found the email to the mailing list where the patch was submitted, but I am unsure of what it is to be "really sure that the UEFI does sane gc and fulfills the spec".  Does this solve some problem for you? [/side_note]

Last edited by WonderWoofy (2013-06-18 22:05:04)

Offline

#10 2013-06-18 22:05:41

Padfoot
Member
Registered: 2010-09-03
Posts: 381

Re: [SOLVED] ASUS Screen Brightness Not Working

Check your journalctl to see if you are getting en error regarding asus_nb_wmi. If so, add asus_nb_wmi to the modules line in /etc/mkinitcpio.conf and then sudo mkinitcpio -p linux as per this thread: https://bbs.archlinux.org/viewtopic.php?id=162643

Offline

#11 2013-06-30 01:45:25

tobit
Member
Registered: 2012-02-05
Posts: 34
Website

Re: [SOLVED] ASUS Screen Brightness Not Working

WonderWoofy wrote:

It should have been with the quotes, as otherwise you are telling it acpi_osi=!Windows which is not a real parameter I don't think.

Okay, can you try creating the file /etc/X11/xorg.conf.d/20-intel.conf with these contents:

Section "Device"
	Identifier 	"Intel Graphics"
	Driver	        "intel"
	Option	        "AccelMethod"  	"sna"
	Option          "Backlight"     "intel_backlight"
EndSection

Note that the AccelMethod is optional, but it will enable the newer and faster i915 graphics accel method.  It is pretty mature these days and I find it ito be quite stable.  The other option is "uxa" which is the default, so does not require an entry.

The page in the wiki that is dedicated to your machine seems to indicate that the acpi_osi="!Windows 2012" is the correct solution though, so I am unsure if this is going to do anythign for you.... at this point I think that whatever is worth a shot.

I will warn you that I am rapidly running out of ideas here.

Oh, BTW, you don't need to have the rootfstype in there, nor do you need the ro.

I added the Backlight line for that file, and removed ro and rootfstype and it seems to work! Thank you SOOO much. Sorry for my late reply but I'm very grateful. Finally my computer boots properly with everything working.

WonderWoofy wrote:

[side_note]I am curious as to what the efi_no_storage_paranoia boot parameter does.  I found the email to the mailing list where the patch was submitted, but I am unsure of what it is to be "really sure that the UEFI does sane gc and fulfills the spec".  Does this solve some problem for you? [/side_note]

This is for the bug of efibootmgr not working with the latest kernel.

Offline

#12 2013-06-30 01:59:28

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] ASUS Screen Brightness Not Working

Hey, glad it is working for you.  I can't take credit for that solution though, I can only take credit for linking to it. 

Since I wrote that post, I have figured out what that parameter is for.  You should remove it from your kernel command line unless you know you need it.  What it does is it disables the checks for how full the nvram is and whether or not it can write to it.  The nvram getting filled is what was apaprently bricking all those Samsungs a few months back.  So the kernel devs put a check in place to see if the nvram was filled 50% or greater.  If it was, it would stop writing to the nvram.  Since then, Samsung has repsonded saying that it is safe to fill the nvram to within 5% (or maybe 5kb I can't remember).  But this problem has not been unique to Samsung devices.  In fact, with the pstore functioanlity, the kernel will try to dump its contents to the nvram on a panic so that you can later debug.  Of course, with the issue of filling nvram, this can cause serious problems for all machines.  My own Thinkpad, I suspect, suffered from this, as I had a kernel panic that resulted in a total inability to boot.  It wouldn't even POST.  I can only suspect, since I sent it back for warranty repair and got a new motherboard, but I determined that the conditions were right after speaking with Matthew Garrett.

Don't forget to mark the thread as [Solved].  This can be done by editing the first post.

Offline

#13 2013-06-30 02:38:34

tobit
Member
Registered: 2012-02-05
Posts: 34
Website

Re: [SOLVED] ASUS Screen Brightness Not Working

WonderWoofy wrote:

Hey, glad it is working for you.  I can't take credit for that solution though, I can only take credit for linking to it. 

Since I wrote that post, I have figured out what that parameter is for.  You should remove it from your kernel command line unless you know you need it.  What it does is it disables the checks for how full the nvram is and whether or not it can write to it.  The nvram getting filled is what was apaprently bricking all those Samsungs a few months back.  So the kernel devs put a check in place to see if the nvram was filled 50% or greater.  If it was, it would stop writing to the nvram.  Since then, Samsung has repsonded saying that it is safe to fill the nvram to within 5% (or maybe 5kb I can't remember).  But this problem has not been unique to Samsung devices.  In fact, with the pstore functioanlity, the kernel will try to dump its contents to the nvram on a panic so that you can later debug.  Of course, with the issue of filling nvram, this can cause serious problems for all machines.  My own Thinkpad, I suspect, suffered from this, as I had a kernel panic that resulted in a total inability to boot.  It wouldn't even POST.  I can only suspect, since I sent it back for warranty repair and got a new motherboard, but I determined that the conditions were right after speaking with Matthew Garrett.

Don't forget to mark the thread as [Solved].  This can be done by editing the first post.


Good to know will do!

Offline

Board footer

Powered by FluxBB