You are not logged in.

#1 2011-12-17 13:16:07

robegrassi
Member
Registered: 2011-11-19
Posts: 13

Toshiba R830: how to fix brightness control after resume (Gnome)

Hi,

A well-known problem of this laptop (and similar models) is that the display brightness cannot be adjusted after resuming from standby. I put here my notes with the steps needed to fix the issue.

The workaround, which relies on the "toshset" tool, is due to omerp from the Ubuntu forum http://ubuntuforums.org/showthread.php?t=1550219 (see message #10). Toshset requires a modified version of the toshiba_acpi module, as discussed here https://bugs.launchpad.net/ubuntu/+sour … bug/644898. The patched toshiba_acpi by keks9n (https://launchpad.net/~keks9n/+archive/main) is working on my laptop with kernel 3.1.5.

1. Install kernel headers:
# pacman -S linux-headers

2. Download the package https://launchpad.net/~keks9n/+archive/ … 0.4.tar.gz and extract the toshiba_acpi.c file located in autobuilder/opt/toshiba-acpi-fix/src/. In the same dir of toshiba_acpi.c, create a Makefile with the content:

obj-m += toshiba_acpi.o

all:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

3. Run the following commands to compile, compress and install the module (this step must be repeated at every kernel upgrade):
$ make clean
$ make
$ gzip toshiba_acpi.ko
# cp toshiba_acpi.ko.gz /lib/modules/$(uname -r)/kernel/drivers/platform/x86
# mkinitcpio -p linux
Reboot and check that the module is loaded correctly:
$ dmesg | grep toshiba_acpi

4. Install toshset from AUR http://aur.archlinux.org/packages.php?ID=10776. Running
# toshset -bl on
after the laptop has resumed from standby and after the Fn+F6/F7 have been pressed, should now update the display brightness.

5. Under Gnome (maybe also under Xfce?), it is possible to use dbus-monitor to make the above command being invoked automatically at every attempt to change the brightness. This solution is again due to omerp http://ubuntuforums.org/showthread.php? … 19&page=13 (message #128). Few modifications are needed to make it work with Gnome 3.2. First make sure you can run toshset as normal user using sudo and without a password:
# groupadd toshset
# gpasswd -a <your-username> toshset
# visudo
Add the line:

%toshset ALL = NOPASSWD: /usr/bin/toshset

Then, create the script /usr/local/bin/gsd-monitor with the content (I found this guide on dbus-monitor very useful http://blog.fpmurphy.com/2009/02/dbus-monitor.html):

#!/bin/bash

IFACE="'org.gnome.SettingsDaemon.Power.Screen'"
DPATH="'/org/gnome/SettingsDaemon/Power'"

WATCH1="type='method_call', interface=${IFACE}, 
path=${DPATH}, member='StepUp'"
WATCH2="type='method_call', interface=${IFACE}, 
path=${DPATH}, member='StepDown'"
WATCH3="type='method_call', interface=${IFACE},
path=${DPATH}, member='SetPercentage'"

dbus-monitor "${WATCH1}" "${WATCH2}" "${WATCH3}" | \
awk '
/member=StepUp/ { system("sudo toshset -bl on > /dev/null") }
/member=StepDown/ { system("sudo toshset -bl on > /dev/null") }
/member=SetPercentage/ { system("sudo toshset -bl on > /dev/null") }
'

Make it executable
# chmod +x /usr/local/bin/gsd-monitor
and add it to the "Startup Programs" in gnome-session-properties. After logging out, the brightness control should finally work.

Hope it helps,

Roberto

Offline

Board footer

Powered by FluxBB