Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-11-07 14:52:37

am4c130d
Member
Registered: 2014-01-07
Posts: 12

[SOLVED] Screen brightness not reset on resume from suspend/hibernate

Hi all

I'm looking for some help with a slight strange, and somewhat annoying issue I am having with the display brightness on my laptop screen when the laptop resumes from suspend or hibernate. My system is:

XFCE 4.12
Power Manager 1.4.4
systemd 235-2
Debian Buster/sid
Lightdm 1.18.3-4
lightlocker 1.0.8-1
HP 8440p with an external monitor (I use both screens in an extended setup).

My laptop suspends/hibernates perfectly with the exception that the screen brightness on the laptop display is reduced to 5% when it resumes.  xfce4-power-manager is set to manage the display:

On battery
Blank: 5 mins
Sleep: 10 mins
Switch off: 15 mins
Brightness reduction: 20%
After: 120 seconds

Plugged in
Blank: 5 mins
Sleep: 10 mins
Switch off: 15 mins
Brightness reduction: 80%
After: Never

/etc/logind.conf is default, except HandlePowerKey is set to suspend.

Everything was working fine until I loaded Enlightenment DE, which I've since purged from the system and I cannot find what change was made that sets the brightness during idle/sleep but doesn't allow it to recover.

I can increase the display brightness using the laptop keyboard FN keys, the XFCE4-power-manager icon in the systray and by directly changing /sys/class/backlight/intel_backlight/brightness

I've reinstalled xfce4-power-manager etc. all to no avail.

Its annoying, as opposed to a real issue, but I'd like to address it, if possible. Any helps appreciated - thanks.

Alan

Last edited by am4c130d (2017-11-09 20:43:39)

Offline

#2 2017-11-07 17:39:15

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: [SOLVED] Screen brightness not reset on resume from suspend/hibernate

When you installed enlightenment, did you install all the recommended dependencies as well? I notice from the package file that pm-utils is a recommended dependency and it has some hooks that might affect system configuration on resume from suspend.

I'm not sure if pm-utils is part of the base sid install or whether its required, but if it was installed as a dependency of enlightenment, trying removing it.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-11-08 17:41:54

am4c130d
Member
Registered: 2014-01-07
Posts: 12

Re: [SOLVED] Screen brightness not reset on resume from suspend/hibernate

Thanks ToZ.

pm-utils was installed - but not by Enlightenment, based on the other apps that seem to have been dependent/recommended at the same time. I should have added, I installed Enlightenment from experimental as Sid has a really old version. However, I did remove pm-utils, and rebooted - no joy unfortunately.

Observing things more closely, the laptop screen resumes at full brightness and then instantly drops to 5% - not sure if that is useful info. I'll look at the various suspend/sleep scripts in case there is a conflict there as well.

Thanks

Offline

#4 2017-11-08 18:21:51

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: [SOLVED] Screen brightness not reset on resume from suspend/hibernate

What about TLP or  laptop mode tools? Both also have capabilities to dim the screen based on configured settings.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2017-11-08 21:54:41

am4c130d
Member
Registered: 2014-01-07
Posts: 12

Re: [SOLVED] Screen brightness not reset on resume from suspend/hibernate

Thanks for sticking at this, greatly appreciated: neither of those packages are loaded. I scrubbed out acpid, acpi and acpi-support-base as well, just in case. It looks like its just xcfe4-power-manager, upower, powermgmt-base and systemd are installed now that control power.

I thought I'd made some progress, but I'm not sure.

systemd-backlight@backlight:intel_backlight.service appears to control what happens. However, it doesn't appear to launch the execstart command when the system resumes from suspend - I suspect because it already running. Its "config" file

/var/lib/systemd/backlight/pci-0000:00:02.0:backlight:intel_backlight 

appears to retain the correct value across suspends, and manually issuing

/lib/systemd/systemd-backlight load backlight:intel_backlight 

which is the execstart command restores the backlight value - but

systemctl start systemd-backlight@backlight:intel_backlight.service 

does not, as it doesn't reissue the systemd-backlight load command.

The man page for systemd-backlight talks about clamping the brightness to 1 or 5% of max, until some user space process can safely set it. The brightness is set to 36 on my system on resume, which is 5% of maximum. So it feels to be in this area that the issue lies - but I haven't worked out what needs to happen to restore it under the control of systemd. The variable referenced in the man page ID_BACKLIGHT_CLAMP is not configured in my udev scripts - and that seems unlikely to have changed.

I don't have this issue when I reboot - everything comes up correctly. I haven't investigated the suspend scripts yet...

Any thoughts?

Offline

#6 2017-11-09 20:42:56

am4c130d
Member
Registered: 2014-01-07
Posts: 12

Re: [SOLVED] Screen brightness not reset on resume from suspend/hibernate

SOLVED!

/sys/class/backlignt/acpi_video0/actual_brightness 

and

/sys/class/backlignt/acpi_video0/brightness 

Were both set to 1.  Whereas

/sys/class/backlignt/acpi_video0/max_brightness 

Had a value of 24, and

/sys/class/backlight/intel_backlight/actual_brightness
/sys/class/backlight/intel_backlight/brightness
/sys/class/backlight/intel_backlight/max_brightness 

were all 684 - i.e. maximum.

Setting

/sys/class/backlignt/acpi_video0/brightness 

to 24 fixed it! actual_brightness followed suit automatically.

I'm guess the kernel on resume reads acpi_video0, whereas systemd and xfce4_power_manager both read and set intel_backlight - they appear to be the generic and vendor specific settings for the same card.

Offline

Board footer

Powered by FluxBB