You are not logged in.

#1 2011-06-03 10:18:53

jonrob
Member
Registered: 2011-04-18
Posts: 5

No backlight control after suspend

Hi,

I can't change the brightness of my backlight after I resume my laptop from suspend.

A few details:

Editing my brightness file directly doesn't seem to have any effect and I'm using pm-utils for suspend.

LSCPI:

00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02)
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)
00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
00:19.0 Ethernet controller: Intel Corporation 82577LC Gigabit Network Connection (rev 06)
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)
00:1c.2 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 3 (rev 06)
00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)
00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 06)
00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)
01:00.0 SD Host controller: Ricoh Co Ltd MMC/SD Host Controller (rev 01)
02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)
ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)
ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)
ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)
ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)
ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)

Offline

#2 2011-06-05 10:13:29

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: No backlight control after suspend

It could be that the backlight driver needs to be forcefully unloaded before- and reloaded after suspend. Since you use pm-utils you can use the SUSPEND_MODULES setting for that.

Backlight usually consists of a kernel driver module which shows an item in /sys. You can set it directly like this:

Determine  maximum brightness level:

cat /sys/class/backlight/some_drivername/max_brightness

Set  it to half brightness   (if the max_brightness  was 44000) :

 "sudo echo 22000 > /sys/class/backlight/some_drivername/brightness"

If the item in sys doesn't exist check if the driver is loaded with 'lsmod', and search the logs for the drivername or lines related to 'backlight' or 'brightness'.

Last edited by rwd (2011-06-05 13:36:30)

Offline

#3 2011-06-06 10:02:38

jonrob
Member
Registered: 2011-04-18
Posts: 5

Re: No backlight control after suspend

Hey, thanks for the suggestion. I've had a play around, but without much success. I have come up with a bit more information though, so if that can help anybody find the answer more feedback would be great!

It seems that are two drivers in /sys/class/backlight, acpi_video0 and toshiba (toshiba being my laptop's manufacturer). After a fresh boot, the various brightness values are the following:

acpi_video0, max_brightness and brightness: 7
toshiba, max_brightness: 7
toshiba, brightness: -1056311073

Echoing to either driver's brightness file after a fresh boot results in a change in brightness.

After suspend, the values stay the same, except for the toshiba brightness one, which now matches acpi_video0 brightness. At this point, echoing no longer works.

I've tried adding the original value to this file, but it just tells me it's an invalid argument.

Seems to be the same problem with and without the addition to the pm_utils config files.

This is obviously a bug somewhere, if anyone knows where would be best to report it, I'll gladly push it upstream :-)

Offline

#4 2011-06-06 11:11:49

rwd
Member
Registered: 2009-02-08
Posts: 664

Re: No backlight control after suspend

Don't know where I got that 'suspend_modules' variable from. Not sure if it exists. Anyway this should work to unload and load modules. First check if you can do it by hand using rmmod and modprobe .

#!/bin/bash
#/etc/pm/sleep.d/66somefilename.sh
case $1 in
    suspend)
        rmmod -f the_modulename
        ;;
    resume)
        modprobe the_modulename
        ;;
    *)  echo "somebody is calling me totally wrong."
        ;;
esac

Search the arch wiki for issues with suspend and drivers

Last edited by rwd (2011-06-06 12:05:17)

Offline

#5 2011-06-09 08:41:29

jonrob
Member
Registered: 2011-04-18
Posts: 5

Re: No backlight control after suspend

Hmm... I've given it a try by hand, but there's no modules that correspond to the name of the driver in /sys, and grepping through /var/log/messages.log for brightness or backlight suggests that I'm interested in the video module. But rmmod'ing that (with i915 before that) kills my display and doesn't come back, even if I string it together with modprobe via && commands.

Thanks for all your help,

Offline

Board footer

Powered by FluxBB