DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

Brightness level set to max (sometimes) when waking up from suspend

Open AC17dollars opened this issue 1 year ago • 9 comments

Compositor

  • [x] niri
  • [ ] Hyprland
  • [ ] Other (specify)

Description

After suspend from idle ( not direct suspend ), waking up puts the monitor brightness to max, then updating brightness goes back to previous levels.

This has also caused quickshell crash, quickshell-mirror/quickshell#296

Expected Behavior

Brightness intact on waking up

Steps to Reproduce

  1. In Power Settings, put for Battery ( 1min, 1min, 1min) lock time, monitor off time, suspend time
  2. Wait 1 min without doing anything, system goes to suspend
  3. Wake from suspend, brightness is max.

Error Messages/Logs

Paste error messages or logs here

Screenshots/Recordings

AC17dollars avatar Oct 09 '25 06:10 AC17dollars

I don't think this is related to dms, any backlight changes are pretty primitive - just calling brightnessctl - not tied into any dbus events or anything that would auto-trigger it.

bbedward avatar Oct 09 '25 13:10 bbedward

So what is setting the brightness to max when waking from suspend?

I believe it is not actually being set/saved though. The saved value is still the original but when waking from suspend the saved brightness is not being loaded or something and defaulting to max brightness just like it does in early booting.

I had my brightness to min before suspend, when i wake from suspend it is max brightness but I increase the brightness again, it doesn't become max. It falls to min and increases by one step from min ( previous brightness).

AC17dollars avatar Oct 10 '25 10:10 AC17dollars

Same issue here, also on niri.

Just as another datapoint: I never had this issue when I was using swayidle and hyprlock along with the brightness widget on waybar. It only started when I switched over to dms. It could also be a quickshell issue; I'm not sure!

My laptop is usually set to 25 brightness. When it comes back from suspend (sometimes) it's very bright but the control still says 25. I have to give it a little bump and back to 25 to recover.

wixoff avatar Oct 16 '25 19:10 wixoff

After further investigation it might just be an issue with my laptop.

When operating normally I can see the brightness is set to 25% in /sys/class/backlight/amdgpu_bl1/brightness.

After returning from suspend (or even just screen blanking) the screen brightness is very much higher, but that system-stored backlight value is still at 25%. So I wrote the simplest script to just read the value and write it back immediately, and that restores the correct brightness. I'll get it connected to a hook to run automatically.

I'm still not sure why this surfaced recently, though.

wixoff avatar Oct 20 '25 21:10 wixoff

@AC17dollars I'm not sure what distro/kernel you are using, but I just downgraded my Fedora 42 system from kernel 6.16.10-200 to 6.16.5-200 and the brightness problem disappeared.

wixoff avatar Oct 21 '25 02:10 wixoff

I am on 6.17.4-arch2-1. Haven't downgraded the kernel yet but this issue still exists. Not sure if this a kernel issue but I'll be sure to check this on lts kernel.

AC17dollars avatar Oct 27 '25 05:10 AC17dollars

Doesn't happen on 6.12.55-1-lts kernel. Will update when it fixes for the mainline.

AC17dollars avatar Oct 27 '25 05:10 AC17dollars

I think this may be relevant https://wiki.archlinux.org/title/Backlight#Save_and_restore_functionality

bbedward avatar Nov 04 '25 23:11 bbedward

I think this may be relevant https://wiki.archlinux.org/title/Backlight#Save_and_restore_functionality

This is running and it restores correctly on shutdown / restart.

It wasn't working properly during suspend after idling (not explicit suspend or closing the lid) on some mainline kernel. Now, I guess it works on mainline kernel too as I haven't noticed this issue on general use.

Doesn't happen on 6.12.55-1-lts kernel.

So possibly some kernel regressions at that time.

AC17dollars avatar Nov 05 '25 04:11 AC17dollars