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
#[solved][Wayland] backlight control
98 messages · Page 1 of 1 (latest)
also, turning on/off screen resets brightness too
which also means suspend will make it reset
Can you do auditctl -w /sys/class/backlight and then post the journalctl log after starting a wayland compositor?
Start auditd.service before the auditctl command.
Use
journalctl -b0 -t audit | curl -F 'f:1=<-' ix.io
to upload the log
-- No entries --
try
journalctl -b0 --grep='audit:' | curl -F 'f:1=<-' ix.io
I ran wayland compositor after the commands, ran brightnessctl, and also changed brightness using keys
clearly the logs don't have that info
No, user space changes the brightness via /sys/class/backlight, and the kernel audit firmware should capture that with this particular audit rule, which basically logs any access to that path.
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
with sudo, right?
All commands should be run as root in this context, unless otherwise specified.
-w /sys/class/backlight -p rxwa
-w /sys/class/backlight/acpi_video0 -p rxwa
grep log_file /etc/audit/auditd.conf
max_log_file = 8
max_log_file_action = ROTATE
sudo find /sys -name actual_brightness -exec auditctl -w {} \;
yeah btw there is no actual_brightness file in /sys/class/backlight/acpi_video0
So what is the output of sudo find /sys -name actual_brightness
And what is in /sys/class/backlight/acpi_video0?
Can you try to find audit logs in dmesg
/sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/actual_brightness
Your words contradict themselves
wdym
/sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/actual_brightness
There are actual_brightness in acpi_video0
Can you post the output from
ls /sys/class/backlight/acpi_video0
findmnt /sys/class/backlight
actual_brightness bl_power brightness device max_brightness power scale subsystem type uevent
second one nothing
Ok, could you please try to see if there are any audit logs in dmesg?
Would you kindly upload them with
sudo dmesg | gzip | curl -F 'f:1=<-' ix.io
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
Alright, there is no audit log, maybe the kernel parameters have disabled it.
What is in /sys/class/backlight?
ls /sys/class/backlight
just acpi_video0
lspci -k | curl -F 'f:1=<-' ix.io
4ATM
What is your CPU and GPU?
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?
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?
It doesn't work with modesetting, which Wayland requires.
Can you explain what modesetting? I don't really understand what you're talking about
a method for setting display resolution and depth in the kernel space rather than user space
can you cat /proc/cmdline
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
Can you try the kernel parameter acpi_backlight=video?
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
What is this command? Can I just add kernel param to bootloader config and reboot?
Well, kexec should be faster, and there are another 2 parameters that need to be tested separately.
After reboot, can you find this directory /sys/class/backlight/intel_backlight?
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
videotovendor
kexec-tools
yoooo
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
there's now acer-wmi
that's with vendor
Can you ls it
Does echo some_number > /sys/class/backlight/acer-wmi/brightness change the screen brightness
although changing brightness via brightnessctl has no effect now
I assume brightnessctl already did that
Can you try it
brightnessctl only select one backlight device if there are several.
no effect with echo too
there is one though, and the output did mention it's acer_wmi
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
intel_backlight now
It works!!!!!!!
Thank you
[solved][Wayland] backlight control
Is the Wayland Composer problem also solved?
yeah I tried brightnessctl within the compositor
So no more
the brightness seems to reset until I press brightness control keys on my laptop keyboard
?
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
The kernel parameter acpi_backlight=native set by kexec is not permanent. It needs to be set in a config file
May you kindly extend a helping hand to those in need, if and when you can.
Have a nice day