You are not logged in.

#1 2013-03-23 11:45:23

AlVer
Member
Registered: 2013-03-23
Posts: 8

[SOLVED] impossible to change the brightness

Hello,

After 4 years on Ubuntu, I decided to try Arch Linux. Almost all works fine but the brightness. I can't modify it. With Ubuntu, the combination Fn + brightness up/down does not works but I resolved the problem with xbacklight. So I tried it on Arch and xbacklight doesn't work ! So I searched through the wiki and forum and tried "light" from AUR. It doesn't work. I saw this post https://bbs.archlinux.org/viewtopic.php?id=158775 but I don't understand where to change "acpi_backlight" or "acpi_osi" parameters.

Can anyone help me ?

Thanks in advance !

EDIT : of course, I tried to run xbacklight and light with sudo

Last edited by AlVer (2013-03-24 20:22:08)

Offline

#2 2013-03-23 12:06:50

M0rtiferrimus
Member
Registered: 2013-03-03
Posts: 34

Re: [SOLVED] impossible to change the brightness

Arch usually does pretty well with detecting special functions on keyboards. You can try using the keyboard without xbacklight if xbacklight is not working. From what I can tell, acpi_backlight and acpi_osi are terminal parameters, so you will need to change them in the terminal. However, I do not have any values for either parameter, so it might be wrong. Read the man page for "export" to become more familiar with setting variable values from the terminal. For a more brief overview, see this page. To set the variable value, for example, just type (without quotes) "export acpi_backlight=VALUE_YOU_WANT". If you mess up, just run (again, without quotes) "unset VARIABLE_YOU_JUST_SET". Be sure to replace "VALUE_YOU_WANT" and "VARIABLE_YOU_JUST_SET" with your actual values.

Offline

#3 2013-03-23 14:29:40

AlVer
Member
Registered: 2013-03-23
Posts: 8

Re: [SOLVED] impossible to change the brightness

Thank you for your response.
I've tried to use combination Fn + brightness up/down without xbacklight and it doesn't work.
On forum posts and on the wiki page about backlight, it said, for exemple to "boot with the acpi_backlight=vendor parameter" or "acpi_osi='!Windows 2012' in grub".  How can I do that ? Moreover, I use the same Grub for Ubuntu and Arch (installed from Ubuntu), is that a problem for this solution ?
I don't understand why xbacklight works very well with Ubuntu and not with Arch...

Offline

#4 2013-03-23 14:45:52

MagicSkyFairy
Member
Registered: 2013-03-14
Posts: 79

Re: [SOLVED] impossible to change the brightness

I can't get my screen brightness to change either.  It was the same story with the last distro I was using(poobuntu), so I'm assuming it has something to do with my hardware.  I've tried everything.

To answer your question about the boot options.

Open up /etc/default/grub, you'll need root privs to edit.

Goto the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

and add the parameters

GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=Linux acpi_backlight=vendor"

Save.

And then issue the command:

grub-mkconfig -o /boot/grub/grub.cfg

Again, you'll need root privs.

Reboot

???

Profit?

Hope this works for you.  I know how annoying it is to have a bright-ass light shinging in your face all the time. :\

Last edited by MagicSkyFairy (2013-03-23 14:48:28)


I have wasted atleast a second of your time by making you read my signature.

Offline

#5 2013-03-23 15:30:03

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Re: [SOLVED] impossible to change the brightness

AlVer wrote:

Hello,

After 4 years on Ubuntu, I decided to try Arch Linux. Almost all works fine but the brightness. I can't modify it. With Ubuntu, the combination Fn + brightness up/down does not works but I resolved the problem with xbacklight. So I tried it on Arch and xbacklight doesn't work ! So I searched through the wiki and forum and tried "light" from AUR. It doesn't work. I saw this post https://bbs.archlinux.org/viewtopic.php?id=158775 but I don't understand where to change "acpi_backlight" or "acpi_osi" parameters.

Can anyone help me ?

Thanks in advance !

EDIT : of course, I tried to run xbacklight and light with sudo

It may be an idea to have a look at what is in /sys/class/backlight/

There may be a single directory or more than one.

In one of my laptops I have for example:

 ls /sys/class/backlight/dell_backlight/
actual_brightness  bl_power  brightness  device  max_brightness  power  subsystem  type  uevent 

Having a look at the values of two specific files in that dir gives in my case:

 cat /sys/class/backlight/dell_backlight/max_brightness 
7
 cat /sys/class/backlight/dell_backlight/brightness 
7

If you want to reduce the brightness slightly then you can do for example

 echo 6 > /sys/class/backlight/dell_backlight/brightness 

In your case you need to check the name of the directory and use that instead of dell_backlight/ as necessary (i.e. do ls /sys/class/backlight/ and find the directory name there) and this allows you to build a small bash script to execute to change the brightness. The value in the brightness variable needs to be no more than whatever is in the max_brightness variable.  I have another machine where the max_brightness variable is something around 1458 so the numbers vary depending on the hardware.

You can then put suitable scripts into the power control settings area in KDE eg for running on battery or ac and choose the brightness levels accordingly  - and presumably can run scripts for other window managers/desktops too.

Perhaps this approach may help you get some control whilst you look for other solutions? Oh by the way the acpi brightness only works if acpi is running - not everyone has it installed and running. Hope this helps.

Last edited by mcloaked (2013-03-23 15:37:07)


Mike C

Offline

#6 2013-03-23 15:44:48

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

Re: [SOLVED] impossible to change the brightness

MagicSkyFairy wrote:

I can't get my screen brightness to change either.  It was the same story with the last distro I was using(poobuntu), so I'm assuming it has something to do with my hardware.  I've tried everything.

To answer your question about the boot options.

Open up /etc/default/grub, you'll need root privs to edit.

Goto the line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

and add the parameters

GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=Linux acpi_backlight=vendor"

Save.

And then issue the command:

grub-mkconfig -o /boot/grub/grub.cfg

Again, you'll need root privs.

Reboot

???

Profit?

Hope this works for you.  I know how annoying it is to have a bright-ass light shinging in your face all the time. :\

@OP are you using Intel graphics? This has been a recent issue with the latest kernels. You might have found this out if you had searched through the forums even a little.

The reason why I quote MagicSkyFairy above is that this is correct, you need to edit the kernel command line, which is what gives the kernel various boot options from the bootloader.

BUT, you should probably not be using acpi_backlight=vendor, as this sets of some random thermal warnings telling you to report it to the relevant mailing list. Instead, use acpi_osi="!Windows 2012" to tell acpi that this is not that particular operating system.

As far as how you would go about including quotes in a quoted string in /etc/defaults/grub... you are going to have to reference the grub documentation for that... I don't use such things (too many features I won't ever use... read bloat).

Offline

#7 2013-03-23 16:03:46

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Re: [SOLVED] impossible to change the brightness

AlVer wrote:

Thank you for your response.
I've tried to use combination Fn + brightness up/down without xbacklight and it doesn't work.
On forum posts and on the wiki page about backlight, it said, for exemple to "boot with the acpi_backlight=vendor parameter" or "acpi_osi='!Windows 2012' in grub".  How can I do that ? Moreover, I use the same Grub for Ubuntu and Arch (installed from Ubuntu), is that a problem for this solution ?
I don't understand why xbacklight works very well with Ubuntu and not with Arch...

I just remembered something that just might be relevant. I was tearing my hair out with a Samsung laptop which gave good brightness when on ac but so dim that I could hardly see the screen when on battery.  Eventually out of desperation I went into the BIOS settings and found a brightness setting that was set to "Auto" - after changing it to ""User controlled" and rebooting I was able to control screen brightness without any further problem after that.  So it may be worth checking if there is any similar BIOS setting in your machine?


Mike C

Offline

#8 2013-03-23 17:07:55

AlVer
Member
Registered: 2013-03-23
Posts: 8

Re: [SOLVED] impossible to change the brightness

So,

Before, in my /etc/default/grub I had "GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor". I changed it as MagicSkyFairy said, it doesn't work. After I changed for  GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=!Windows 2012 acpi_backlight=vendor", it doesn't work either. After that, I changed for GRUB_CMDLINE_LINUX_DEFAULT="quiet" and it works with my Ubuntu (I can use the Fn + brightness up/down combination, I couldn't do that before, I had to use the xbacklight command), but not with Arch Linux. So I wondered if it's because I use my Ubuntu's Grub to launch Arch Linux (I skipped the " Install and configure a bootloader" of the beginner's guide). Is it possible ?

I tried the mcloaked solution too (echo 6 > /sys/class/backlight/acpid_video0/brightness) . First, I don't have the permission to do that, even with sudo. So I tried as root. It works only after I reboot the computer, which is not very useful.
Strange thing, it's /sys/class/backlight/acpid_video0/brightness with Arch and /sys/class/backlight/dell_backlight/brightness with Ubuntu...

Finally, I looked into my BIOS option and there's no brightness settings in it.

Any other ideas ?

Thank you very much for all your responses.

Offline

#9 2013-03-23 17:17:16

MagicSkyFairy
Member
Registered: 2013-03-14
Posts: 79

Re: [SOLVED] impossible to change the brightness

I tried all this stuff too with no luck.

Do you have the open source or propriatary drives installed?

The open source ones are good, but they aren't as good as the closed source ones.

Last edited by MagicSkyFairy (2013-03-23 17:21:51)


I have wasted atleast a second of your time by making you read my signature.

Offline

#10 2013-03-23 17:20:08

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Re: [SOLVED] impossible to change the brightness

AlVer wrote:

So,

Before, in my /etc/default/grub I had "GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor". I changed it as MagicSkyFairy said, it doesn't work. After I changed for  GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=!Windows 2012 acpi_backlight=vendor", it doesn't work either. After that, I changed for GRUB_CMDLINE_LINUX_DEFAULT="quiet" and it works with my Ubuntu (I can use the Fn + brightness up/down combination, I couldn't do that before, I had to use the xbacklight command), but not with Arch Linux. So I wondered if it's because I use my Ubuntu's Grub to launch Arch Linux (I skipped the " Install and configure a bootloader" of the beginner's guide). Is it possible ?

I tried the mcloaked solution too (echo 6 > /sys/class/backlight/acpid_video0/brightness) . First, I don't have the permission to do that, even with sudo. So I tried as root. It works only after I reboot the computer, which is not very useful.
Strange thing, it's /sys/class/backlight/acpid_video0/brightness with Arch and /sys/class/backlight/dell_backlight/brightness with Ubuntu...

Finally, I looked into my BIOS option and there's no brightness settings in it.

Any other ideas ?

Thank you very much for all your responses.

To help with doing things as user - if your laptop just has a single user apart from root then you can (as root) use the visudo command to edit the /etc/sudoers file - uncomment the line which allows members of the wheel group to run any command without a password - and save the changes.  Then add the user to the wheel group.  Then the user can run any command (prefixed with sudo).  Of course if you would rather not allow the user to run "any" command prefixing it with sudo - then you can adapt the sudo facility to allow the user only to run specific commands - you will need to look up how to do that of course.   You can set up your own scriptlet as a command in a newly created "bin" directory in the user area, and then allow the user to run only that command. If that scriptlet does brightness changes and nothing else - by  say using "chbright x" where chbright is a file with execute permissions in /home/username/bin/ then that is a way round this restriction - of course there are other ways to achieve this also I guess.

Also it is possible to execute the brightness command before logging in - you can get the system to execute commands after the system boots but before login.

I don't know why the Ubuntu and Arch installations differ but I guess if the initialisation systems are different, or there is a different kernel, or if other key components are different versions then one or other can set up the /sys area differently though I am no expert on that!  However maybe the notes above will help?

Last edited by mcloaked (2013-03-23 17:20:47)


Mike C

Offline

#11 2013-03-23 17:25:06

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,222

Re: [SOLVED] impossible to change the brightness

mcloaked wrote:
AlVer wrote:

So,

Before, in my /etc/default/grub I had "GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor". I changed it as MagicSkyFairy said, it doesn't work. After I changed for  GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=!Windows 2012 acpi_backlight=vendor", it doesn't work either. After that, I changed for GRUB_CMDLINE_LINUX_DEFAULT="quiet" and it works with my Ubuntu (I can use the Fn + brightness up/down combination, I couldn't do that before, I had to use the xbacklight command), but not with Arch Linux. So I wondered if it's because I use my Ubuntu's Grub to launch Arch Linux (I skipped the " Install and configure a bootloader" of the beginner's guide). Is it possible ?

I tried the mcloaked solution too (echo 6 > /sys/class/backlight/acpid_video0/brightness) . First, I don't have the permission to do that, even with sudo. So I tried as root. It works only after I reboot the computer, which is not very useful.
Strange thing, it's /sys/class/backlight/acpid_video0/brightness with Arch and /sys/class/backlight/dell_backlight/brightness with Ubuntu...

Finally, I looked into my BIOS option and there's no brightness settings in it.

Any other ideas ?

Thank you very much for all your responses.

To help with doing things as user - if your laptop just has a single user apart from root then you can (as root) use the visudo command to edit the /etc/sudoers file - uncomment the line which allows members of the wheel group to run any command without a password - and save the changes.  Then add the user to the wheel group.  Then the user can run any command (prefixed with sudo).  Of course if you would rather not allow the user to run "any" command prefixing it with sudo - then you can adapt the sudo facility to allow the user only to run specific commands - you will need to look up how to do that of course.   You can set up your own scriptlet as a command in a newly created "bin" directory in the user area, and then allow the user to run only that command. If that scriptlet does brightness changes and nothing else - by  say using "chbright x" where chbright is a file with execute permissions in /home/username/bin/ then that is a way round this restriction - of course there are other ways to achieve this also I guess. If you do this then you need to remember that in the scriptlet file the command has a line "sudo echo 6 > /sys/class/backlight/dell_backlight/brightness " to put the new value into the variable as the newly allowed user and you choose the value to use within the script (could be fed from an input parameter to the scriptlet if it is a bash file for example as $1).

Also it is possible to execute the brightness command before logging in - you can get the system to execute commands after the system boots but before login.

I don't know why the Ubuntu and Arch installations differ but I guess if the initialisation systems are different, or there is a different kernel, or if other key components are different versions then one or other can set up the /sys area differently though I am no expert on that!  However maybe the notes above will help?

Last edited by mcloaked (2013-03-23 17:26:24)


Mike C

Offline

#12 2013-03-23 18:43:08

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

Re: [SOLVED] impossible to change the brightness

You have GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=!Windows 2012 acpi_backlight=vendor" and you don't see a problem with that?  First of all you don't need to have acpi_osi= as well as acpi_backlight= as it is one or the other.  That is not where the problem should be obvious though.

When you have acpi_osi=!Windows 2012 just like that without quotes, how does the kernel know that the 2012 is part of the acpi_osi=!Windows?  That is why it was expressed to you in quotes.  The problem is that you will now have quotes inside quotes.  So the space either needs to be delimited, or the string needs to be in quotes.

An example of this is how rEFInd handles this.  In the documentation, Rod indicates that in order to have a quoted string on the kernel command line it should be double double-quotes.  So it would be something like this for rEFInd

options "root=/dev/sda3 ro ""acpi_osi=!Windows 2012"" resume=/dev/sda4"

But, as I expressed earlier, I am not a grub user, so I am not sure how grub handles this.  But in any case, I would not expect what you currently have tried to work under any circumstances anyway.  So the proposed fixes are not necessarily wrong.

You can tank microsoft for being moronic enough to label their OS with a space in the string.

Offline

#13 2013-03-24 09:51:28

AlVer
Member
Registered: 2013-03-23
Posts: 8

Re: [SOLVED] impossible to change the brightness

I've tried with the double quotes, it doesn't work.

So, I installed grub from Arch instead of that of Ubuntu. I tried again all solution suggested here and none works.

I also tried to put in /etc/default/grub :

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

and

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=""!Windows 2012"" acpi_backlight=vendor splash"

and it doesn't work either.

I use the nvidia proprietary drivers.

Other ideas ?

Thank you

EDIT : Strange thing, the combination Fn + brightness up/down works on the grub "menu" (when you can choose the OS/Kernel to boot)

Last edited by AlVer (2013-03-24 10:07:44)

Offline

#14 2013-03-24 13:45:25

plam
Member
From: Bulgaria
Registered: 2010-03-16
Posts: 37

Re: [SOLVED] impossible to change the brightness

Try "quiet splash acpi_osi='!Windows 2012' acpi_backlight=vendor splash" but I can't promise anything, since I use syslinux(it is a nice little bootloader, maybe try it, it is really easy to configure)

Do you have acpi and acpid installed? Run "pacman -Q|grep acpi" and you should see acpi and acpid.
Do "systemctl status acpid.service", is it running and everything OK?

Edit: also try acpi_osi=Linux

Last edited by plam (2013-03-24 15:38:49)

Offline

#15 2013-03-24 16:07:16

AlVer
Member
Registered: 2013-03-23
Posts: 8

Re: [SOLVED] impossible to change the brightness

Yes, acpi and acpid are installed and acpid.service is running. I've tried to edit the /etc/default/grub file like you said and it doesn't work.

syslinux could it solve my problem ?

Offline

#16 2013-03-24 16:13:21

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

Re: [SOLVED] impossible to change the brightness

plam wrote:

Try "quiet splash acpi_osi='!Windows 2012' acpi_backlight=vendor splash" but I can't promise anything, since I use syslinux(it is a nice little bootloader, maybe try it, it is really easy to configure)

I am not sure how each particular bootloader handles this, but I do know that in order for the acpi_osi="!Windows 2012" it has to be double quotes instead of singles.  With elilo (and presumably lilo because it is configured the same way), you can simply escape/delimit the double quotes so that they are not handled in a special way.  So my particular elilo configuration has this in it:

<snip>
image=/EFI/arch/vmlinuz-linux.efi
	label=arch
	append="libahci.ignore_sss=1 quiet gpt add_efi_memmap acpi_osi=\"!Windows 2012\" "
	root=/dev/mapper/volgrp0-root_arch
	initrd=/EFI/arch/initramfs-linux.img
<snip>

I added the space between the enclosing quote and the escaped quote for the sake of clarity, but it is not necessary.  Whether grub, syslinux, etc. handle this is the same way, I don't know.  I do know that rEFInd simply has you use double quotes twice, so that leads me to think that there is not any real standard or consistency between boot loaders and boot managers.

Offline

#17 2013-03-24 16:23:13

plam
Member
From: Bulgaria
Registered: 2010-03-16
Posts: 37

Re: [SOLVED] impossible to change the brightness

AlVer wrote:

syslinux could it solve my problem ?

If the only reason of the problem is that you can't pass double quotes to grub, then I think it will, but we don't really know that.
In syslinux.cfg my entry for arch looks like this:
LABEL arch
        MENU LABEL arch
        LINUX ../vmlinuz-linux
        APPEND root=/dev/sda1 ro acpi_osi="Linux" pcie_aspm=force i915.lvds_downclock=1 i915.i915_enable_fbc=1 elevator=noop
        INITRD ../initramfs-linux.img

As you can see there are no quotes in the beginning and end of the line, so double quotes are OK in the parameters. Some other benefits of syslinux are: no need for extra partition if you use GPT; no need to issue any commands after you change /boot/syslinux/syslinux.cfg, just save the file and you changes take effect on the next reboot. I used to use grub, but I think that with GRUB2 things got unnecesarily complicated, and after some research I decided to use syslinux, as it is really KISS.

Offline

#18 2013-03-24 19:58:00

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

Re: [SOLVED] impossible to change the brightness

I too really like syslinux.  I use UEFI these days, but syslinux has always been enjoyable to me due to its amazing simplicity.  It reminds me of a super stripped down version 1 grub, which was way better in my opinion.

@plam, I'm not saying to change this if it is working, but in the sace of acpi_osi="Linux" you don't actually need the quotes.

Offline

#19 2013-03-24 20:21:48

AlVer
Member
Registered: 2013-03-23
Posts: 8

Re: [SOLVED] impossible to change the brightness

Problem solved !!!

I created the file /etc/X11/xorg.conf.d/20-nvidia.conf. I put in this file the following lines :


Section "Device"
   Identifier     "Device0"
   Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
   Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection

(see http://wiki.archlinux.fr/Nvidia ).


And now I can use xbacklight ! The combination Fn + brightness up/down doesn't work but I don't care.


Thank you all for your help !

Offline

#20 2013-03-24 20:40:45

MagicSkyFairy
Member
Registered: 2013-03-14
Posts: 79

Re: [SOLVED] impossible to change the brightness

AlVer wrote:

Problem solved !!!

I created the file /etc/X11/xorg.conf.d/20-nvidia.conf. I put in this file the following lines :


Section "Device"
   Identifier     "Device0"
   Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
   Option "RegistryDwords" "EnableBrightnessControl=1"
EndSection

(see http://wiki.archlinux.fr/Nvidia ).


And now I can use xbacklight ! The combination Fn + brightness up/down doesn't work but I don't care.


Thank you all for your help !

  Nice, I wonder if I can do the same thing with my amd card...

I've gotta rapair my junk right now, but I have one or two things I can try because of this thread.  It's been annoying having this bright screen shining in my face in the middle of the night. -_-

Glad you solved it.


I have wasted atleast a second of your time by making you read my signature.

Offline

Board footer

Powered by FluxBB