#[solved][Wayland] backlight control

98 messages · Page 1 of 1 (latest)

dark raven
#

Each time I start a wayland compositor (any), the brightness seems to reset until I press brightness control keys on my laptop keyboard. I also noticed that utilities like brightnessctl are able to change backlight brightness, but it doesn't get notified of change, and stays at old brightness until you change it using keyboard controls

#

also, turning on/off screen resets brightness too

#

which also means suspend will make it reset

azure basin
azure basin
azure basin
dark raven
#

-- No entries --

azure basin
dark raven
#

I ran wayland compositor after the commands, ran brightnessctl, and also changed brightness using keys

#

clearly the logs don't have that info

azure basin
#

Maybe the rule wasn't created or deleted, or the log is somewhere else.

#

@dark raven
What is the output of

auditctl -l
#

And what is the output of

grep log_file /etc/audit/auditd.conf
azure basin
dark raven
#

-w /sys/class/backlight -p rxwa
-w /sys/class/backlight/acpi_video0 -p rxwa

azure basin
dark raven
#

max_log_file = 8
max_log_file_action = ROTATE

azure basin
dark raven
#

yeah btw there is no actual_brightness file in /sys/class/backlight/acpi_video0

azure basin
#

And what is in /sys/class/backlight/acpi_video0?

azure basin
dark raven
#

/sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/actual_brightness

azure basin
dark raven
#

wdym

azure basin
#

/sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/actual_brightness
There are actual_brightness in acpi_video0

dark raven
#

wtf

#

now there is

azure basin
dark raven
#

actual_brightness bl_power brightness device max_brightness power scale subsystem type uevent

#

second one nothing

azure basin
dark raven
#

how should they look

#

I don't think there are

azure basin
dark raven
#

So I was looking it up online and even echo $level > /sys/class/backlight/acpi_video0/brightness has no effect until I use keyboard keys

azure basin
dark raven
#

just acpi_video0

azure basin
dark raven
#

4ATM

azure basin
dark raven
#

Intel Celeron U3400

#

and igpu is listed as Intel Core Processor lol

azure basin
# dark raven 4ATM

There has been a change in the kernel backlight stack that favours ACPI baclight management over vendor specific.

#

When did you first notice this problem?

dark raven
#

Ever since I installed linux on this trashtop

#

There's a script on archwiki

#!/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

You think it could work?

azure basin
dark raven
#

Can you explain what modesetting? I don't really understand what you're talking about

azure basin
dark raven
#

BOOT_IMAGE=../vmalinuz-linux root=/dev/sda3 rw resume=/dev/sda4 initrd../initramfs-linux.img

#

Sorry it's taking too long to respond, I'm just typing from desktop, and I can't copy text easily, and I'm also going afk to do some things at home

azure basin
dark raven
azure basin
azure basin
dark raven
#

nope

#

still acpi_video0

azure basin
# dark raven nope
sudo kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --command-line="root=/dev/sda3 rw resume=/dev/sda4 acpi_backlight=vendor"
sudo systemctl kexec
  • note: changed acpi_backlight from video to vendor
dark raven
#

kexec not found

#

what package is it in?

azure basin
dark raven
#

yoooo

azure basin
#

First try

sudo kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --command-line="root=/dev/sda3 rw resume=/dev/sda4 acpi_backlight=video"
sudo systemctl kexec

Then

sudo kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --command-line="root=/dev/sda3 rw resume=/dev/sda4 acpi_backlight=vendor"
sudo systemctl kexec

Finaly

sudo kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --command-line="root=/dev/sda3 rw resume=/dev/sda4 acpi_backlight=native"
sudo systemctl kexec

After each reboot see if there is a path /sys/class/backlight/intel_backlight0 or anything that is not acpi_video0

dark raven
#

there's now acer-wmi

dark raven
azure basin
dark raven
#

yeah, contents as in acpi_video0

#

actual_brightness bl_power, etc

azure basin
dark raven
#

although changing brightness via brightnessctl has no effect now

dark raven
azure basin
#

brightnessctl only select one backlight device if there are several.

dark raven
#

no effect with echo too

dark raven
azure basin
# dark raven no effect with echo too

Can you try this?

sudo kexec -l /boot/vmlinuz-linux --initrd=/boot/initramfs-linux.img --command-line="root=/dev/sda3 rw resume=/dev/sda4 acpi_backlight=native"
sudo systemctl kexec
dark raven
#

intel_backlight now

#

It works!!!!!!!

#

Thank you

#

[solved][Wayland] backlight control

azure basin
dark raven
#

yeah I tried brightnessctl within the compositor

azure basin
dark raven
#

the reset, idk, lemme try

#

yeah

#

solved too

#

What's funny is that I can set it to be even darker than I previously could

azure basin
dark raven
#

I understand, yeah

#

I will modify syslinux cfg

azure basin
#

Have a nice day