You are not logged in.

#1 2019-08-16 22:41:13

f1she3
Member
Registered: 2019-01-05
Posts: 8

[SOLVED] AMD Radeon RX 590 no /sys/class/backlight

Hi !

I've switched to sway (powered by wayland) recently, and I have troubles setting my screen brightness (I used to do so via xrandr), so I tried to do it via backlight but I can't find any folder under /sys/class/backlight/ to set the brightness of my screens. I tried the fixes proposed here https://wiki.archlinux.org/index.php/Backlight#ACPI but it didn't change anything, still an empty /sys/class/backlight folder.
I'm using an AMD RX 590 with the open source amdgpu driver + VA-API + Vulkan (I followed this wiki page https://wiki.archlinux.org/index.php/AMDGPU).
Do you have any idea why the acpi interface does not show up, and / or if there's an alternative solution to manage my screens' brightness ?

Thanks a lot !

Last edited by f1she3 (2019-08-18 00:16:58)


-- fishe3 - Fool me once --

Offline

#2 2019-08-17 13:00:57

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] AMD Radeon RX 590 no /sys/class/backlight

To be clear:  You have a desktop PC with a graphics card and a normal monitor connected to it? You are not talking about a laptop?

That 'backlight' entry in /sys is something for laptops where you cannot control the backlight like on a normal monitor (because the laptop's display has no buttons and menu like an external monitor).

When you mention xrandr, I'm guessing you used xrandr's "-brightness" option? If that's the case, you weren't actually changing the backlight of your monitor, you instead were changing the graphics output of your graphics card.

There's two things you can look into: (1) a program named "ddcutil", and (2) a version of the program "redshift" that works with sway.

About (1):

It's possible to control a monitor's menu entries remotely from the PC with "DDC". There's a tool "ddcutil" in the AUR for sending DDC commands to a monitor. Using it would look like this:

sudo ddcutil setvcp 10 35

That "10" is the DDC code for the monitor's brightness control. The "35" is the value that it will be set to. This command line here would be the same as manually going into the monitor's menu and navigating to the brightness setting and changing it to "35".

Using DDC has the downside that it does not change brightness instantly. The communication to the monitor takes a second. DDC can be buggy on some monitors.

About (2):

"redshift" tweaks the "color lookup table" in your graphics card, same as what "xrandr -brightness" does internally. It's not really built for changing brightness, but it can still be used for that. I heard there are forks of redshift that work with sway. You would run it like this:

redshift -x  # reset colors
redshift -b 0.8 -O 6500

This example here reduces brightness to 80%. That weird "-O 6500" parameter is there because redshift is really intended for changing the "color temperature". That "6500" value is the default color temperature and means the program will leave the colors alone.

Something technical about redshift and "xrandr -brightness":

Because xrandr can't actually change the backlight of the monitor, using xrandr has the downside that blacks aren't getting darker. When you use the "xrandr -brightness" command, you are reducing the range of colors you can see on the monitor. Instead of the full range of (0,0,0) to (255,255,255) RGB colors, the graphics will be squeezed into a reduced range, for example from (0,0,0) to (220,220,220). Everything will get darker, except a black (0,0,0) stays the same.

Last edited by Ropid (2019-08-17 13:03:28)

Offline

#3 2019-08-18 00:16:20

f1she3
Member
Registered: 2019-01-05
Posts: 8

Re: [SOLVED] AMD Radeon RX 590 no /sys/class/backlight

Thanks for your quick and consistent answer !

Yes I'm indeed running a PC with an AMD GPU, not a laptop, thanks for the precision I did not know that.
I tried ddcutil but it didn't detect my screens, but even if it would as you said it remotely sets the brightness level of the screen, but these are already set to the lowest value (which is still too much for me).
So I tried redshift-wlr-gamma-control with your command, and it works very well ! That's exactly what I wanted to do smile
Thanks a lot for your help and explanations !

Have a nice day


-- f1she3 --


-- fishe3 - Fool me once --

Offline

Board footer

Powered by FluxBB