Ubuntu – I can’t lower the backlight/brightness

16.04amd-graphicsbacklightbrightness

Why I can't control the brightness/backlight level?

At the first:

Notebook Positivo BGH - C500 Series. 
Processor: AMD C60 series (dual core 800 mhz-1ghz)
GPU: Radeon HD 6290 (worked with fglrx/Catalyst)

Hello everybody, this is my first post in 8-years-use of Ubuntu/Kubuntu, I've never had problems with any version, but when I've upgraded from Willy to Xenial I haven't take care in the latest version that the AMD/ATI property drivers (fglrx) have been discontinued or unsupported by the developers, and they advice against not upgrade for AMD users. The Fn keys dosen't work!

However, after upgrade, when I was configuring, I want install drivers from console:

sudo apt-get install fglrx fglrx-updates 
"fglrx" and "fglrx-updates" has no candidates

In the version Willy (and previous versions), I can't control or lower the brightness/backlight util the property drivers have been instaled.

In Ubuntu 16.04, the drivers are:

xserver-xorg-video-amdgpu
xserver-xorg-video-radeon

And These are open drivers, but this is not the trouble really.

I've tried the following procedures:

I tried to put various links, but the newbies can't post more 2 links

Abstract:

1. Can't change backlight level by installing driver.

    sudo apt-get install xserver-org-video-amdgpu
    sudo apt-get install xserver-org-video-radeon

##2. It persist high shine, despite modifing /sys/class/backlight, and the promp shows me (radeon_bl0 is present):

    lspci | grep ati
    00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Wrestler [Radeon HD 6290]
    ls /sys/class/backlight
    radeon_bl0

Inside the folder, brightness, max_brightness, actual_brightness, bl_power and others are present

    echo > 10 /sys/class/backlight/radeon_bl0/brightness 

There is no effect

    echo > 100 /sys/class/backlight/radeon_bl0/max_brightness
    permission denied
    chmod 0777 /sys/class/backlight/radeon_bl0/max_brightness
    nano /sys/class/backlight/radeon_bl0/max_brighness
    modifing 255 to 100
    Ctrl+O > I/O Error 
    chmod 0777 /sys/class/backlight
    The same result >  I/O Error 

And find another way:

    ls -alh /sys/class/backlight
    lrwxrwxrwx  1 root root 0 abr 23 12:23 radeon_bl0 -> ../../devices/pci0000:00/0000:00:01.0/drm/card0/card0-LVDS-1/radeon_bl0

And trying the same, and no effect.

3. Modifing the grub:

    GRUB_CMDLINE_LINUX="acpi_osi=Linux" | No effect
    GRUB_CMDLINE_LINUX="acpi_backlight=none" | No effect
    GRUB_CMDLINE_LINUX="acpi_backlight=vendor" | No effect
    GRUB_CMDLINE_LINUX="acpi_backlight=video" | No effect
    GRUB_CMDLINE_LINUX="acpi_backlight0" | No effect
    GRUB_CMDLINE_LINUX="acpi_backlight=radeon_bl0" | No effect

Rebooting and edit grub (with the same sentences) before start Ubuntu, strangely It don't start.
Starting in "recovery mode", /sys/class/backlight, shows me:

     acpi_video0

But the SDDM dosen't start.

4. Adding the X11 configuration.

      cd /usr/share/X11/xorg.conf.d
      dir > 10-amdgpu.conf is present
      nano 10-amdgpu.conf | shows me

               Section "OutputClass"
                 Identifier "AMDgpu"
                 MatchDriver "amdgpu"
                 Driver "amdgpu"
               EndSection
I added

              Section "Device"
                Identifier "card0" | put also "AMDgpu"
                Driver "amdgpu" 
                Option "Backlight" "radeon_bl0"
                BusID "PCI:00:01:01"
             End Section

But it dosen't work, due option "Backlight" is for intel driver. I revised man of amdgpu and not figure this option. In several times, neither starts SDDM.

5. Using the command setpci:

     setpci -s 00:01.0 F4.B=7F | Not work
     setpci -s 00:01.0 F4.B=FF | Not work
     setpci -s 00:01.0 F4.B=50 | Not work
     setpci -s 00:01.0 F4.B=80 | Not work

This video card not support by the setpci

6. Installing xbacklight

     sudo apt-get install xbacklight
     xbacklight -s 80 | there is no effect 
     No outputs have backlight property 
     xbacklight -d LVDS -s 80
     RANDR Query Version returned error -1

It dosen't work, I've searched, and xbacklight is deprecated for xf86-video-ati for control of backlight, I've installed script "light" (lightscript) but It dosen't work too.

7. Making udev rule:

          nano /etc/udev/rules.d/81-backlight.rules

          # Set backlight level to 8
         SUBSYSTEM=="backlight", ACTION=="add", KERNEL=="acpi_video0", ATTR{brightness}="8"
          Save & Exit and there is no effect after boot

8. Using systemd-backlight service.

           I don't understeand how this works, but I've got this from the prompt: 
           systemctl list-units | grep -i backl

           systemd-backlight@backlight:radeon_bl0.service     loaded active exited    Load/Save Screen Backlight Brightness of backlight:radeon_bl0

           system-systemd\x2dbacklight.slice       loaded active active    system-systemd\x2dbacklight.slice

The systemd-backlight service is loaded for /sys/class/backlight ! But It dosen't work, the backlight don't change.

9. Using xrandr

       Finally I put in the console:
xrandr --output LVDS-1 --brightness 0.6 | 0.4 | 0.3
Previously identified output 

This "worked" for me, but when I restart the values of xrandr going to default, by more than I put xrandr –output LVDS1 –brightness 0.5 at start session. (On Kde by the System Settings>Start and Shutdown)

Conclussion

In all cases, the brightness/backlight ever is high, it dosen't matter I do, the Fn Keys don't work, and the Kde Indicator for brightness goes to 0 and the LCD looks the Christmas tree because it's turn up/down infinitely.

Anyone have more ideas?

Sorry for my bad english!

Best Answer

There's something very odd about the syntax you're using to write to the files in /sys/class/backlight/. Please try this, instead:

echo 128 | sudo tee /sys/class/backlight/radeon_bl0/brightness

By the way, you were not able to modify "max_brightness" because that file is just there to let you know the maximum brightness you can use. You need to change the file named "brightness".

About your shell syntax: The shell redirection operator > only works if you're already running a shell as root (for example, using sudo -s), but I should let you know that doing so is generally considered a bad idea. Logging in to a root shell gives you great power; and with great power comes great whopping mistakes. It's easy to forget you're running as root and then accidentally mess up your whole system. That's why I recommend sudo, as in the example above. Sudo is a reminder to be careful: anything after the word sudo is normally off-limits and potentially dangerous.

However, if you are curious, it is possible to use the > file redirection operator the way you were asking, but you'd need to change the arguments around. The part that comes after the > is the filename to write to, the part before it is the command whose output you want to redirect. So, for example,

$ sudo -s
# cd /sys/class/backlight/*/
# echo 128
128
# echo 100 > brightness
# cat brightness
100
# echo 200 > brightness
# cat max_brightness
255
# cat max_brightness > brightness
# cat brightness
255
# exit
$ 

(You'll notice your prompt changes to a hash mark when you're running a root shell. That's a subtle warning sign. Typing exit will get you back to the safety of your normal user account.)