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.)
Update June 16, 2019
Last month, 2 years after problem was reported, OP discovered LightDM (Ubuntu Unity Desktop Manager) was source of problem. That said, in addition to the list below, there is another grub
parameter that can be tried:
video.use_native_backlight=1
See this answer for more.
Original Answer
The ultimate reference seems to be in Arch Linux which is a site I've turned to many times to fix difficult problems.
Kernel Parameters
Looking at your cat /proc/cmdline
there are no extra kernel parameters passed. The above link states:
Sometimes, ACPI does not work well due to different motherboard implementations and ACPI quirks. This includes some laptops with dual graphics (e.g. Nvidia/Radeon dedicated GPU with Intel/AMD integrated GPU). On Nvidia Optimus laptops, the kernel parameter nomodeset can interfere with the ability to adjust the backlight. Additionally, ACPI sometimes needs to register its own acpi_video0 backlight
even if one already exists (such as intel_backlight
), which can be done by adding one of the following kernel parameters:
acpi_backlight=video
acpi_backlight=vendor
acpi_backlight=native
If you find that changing the acpi_video0
backlight does not actually change the brightness, you may need to use acpi_backlight=none
.
Try each of the acpi_backlight=xxxx
options on your grub kernel paremeters line
When xbacklight
doesn't work
You've tried xbacklight
already and the link above addresses this:
On some systems, the brighness hotkeys on your keyboard correctly modify the values of the acpi interface in /sys/class/backlight/acpi_video0/actual_brightness
(As we tried in comments) but the brightness of the screen is not changed. Brigthness applets from desktop environments (ie Ubuntu brightness setting slider bar) may also show changes to no effect.
If you have tested the recommended kernel parameters and only xbacklight
works, then you may be facing an incompatibility between your BIOS and kernel driver.
In this case the only solution is to wait for a fix either from the BIOS or GPU driver manufacturer.
A workaround is to use the inotify
kernel api to trigger xbacklight
each time the value of /sys/class/backlight/acpi_video0/actual_brightness
changes.
First install inotify-tools. Then create a script around inotify that will be launched upon each boot or through autostart.
Below is script you need to create called: /usr/local/bin/xbacklightmon
#!/bin/sh
path=/sys/class/backlight/acpi_video0
luminance() {
read -r level < "$path"/actual_brightness
factor=$((100 / max))
printf '%d\n' "$((level * factor))"
}
read -r max < "$path"/max_brightness
xbacklight -set "$(luminance)"
inotifywait -me modify --format '' "$path"/actual_brightness | while read; do
xbacklight -set "$(luminance)"
done
There is a lot more in the link above but these steps are a good place to start.
Dedicated Forums
For additional support there are dedicated Linux Graphics forums:
Best Answer
The issue is related to the Renoir graphics in AMD 4000 series processors. Here is a Phoronix article that gives a short description of it. Starting from Linux kernel 5.5, Renoir support was marked as no longer experimental. Kernel 5.7 is the newest kernel, so updating to that provides support for your processor.
I have a laptop with a 4500U. Upgrading to 5.7 helped fix every issue besides the brightness control.
The following steps to install the kernel comes from this answer which is a general version of an ubuntuforums.org post from user lykwydchykyn. The following steps contain some additions that I found useful when installing the kernel:
Go here (sorted by most recent build): https://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
Select the build you want, then navigate to the amd64/ directory.
Download 3 (maybe 4) debs to a folder somewhere:
Install the debs with whatever package manager front-end you use, or use these commands:
An additional resource is the Ubuntu wiki which explains how to install an upstream kernel with generic instructions. This is good for learning that you choose either the generic kernel or the lowlatency kernel and don't download all of them (like I did at first): https://wiki.ubuntu.com/Kernel/MainlineBuilds