domingo, 27 de marzo de 2011

Backlight workaround

I've found two solutions to this
the first one is in a terminal do this

sudo gedit /etc/default/grub
change bottom line to this
GRUB_CMDLINE_LINUX="nomodeset acpi_backlight=vendor (save the file)

sudo update-grub 
reboot



second one

1. Remove the 'nomodeset' hack from grub kernel loading parameter, now you cannot adjust backlight, for a while 

2. Restart system, open terminal and type this command:

~$ lspci | grep VGA

00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)


This number "00:02.0" is what you want to modify in the following script.

3. Copy the lines between the "###" mark, and save it as a file named something like 'backlight_d.sh', before saving, modify the number after pciset -s ##:##.# as the one you got from step 2

~$ gedit ./backlight_d.sh

################################################## ######
#!/bin/bash

old_b=9;
declare -i curr_b=240;
declare -i target_b=240;

while : ; do
b=`cat /sys/class/backlight/acpi_video0/brightness`;
delay="0.5"

if [ $old_b != $b ]; then
old_b=$b
let "target_b=$b * 20 + 12"
#printf "Target: %10d\n" $target_b
fi

hex_b=".";

if [ "$curr_b" -lt "$target_b" ] ; then
let "curr_b=$curr_b + 2"
if [ "$curr_b" -gt "$target_b" ] ; then
let "curr_b=$target_b"
fi

hex_b="-"
elif [ "$curr_b" -gt "$target_b" ] ; then
let "curr_b=$curr_b - 2"
if [ "$curr_b" -lt "$target_b" ] ; then
let "curr_b=$target_b"
fi

hex_b="-"
fi

if [ $hex_b != "." ] ; then
hex_b=`printf "%02X" $curr_b`
delay="0.005"
setpci -s 00:02.0 F4.B=$hex_b
fi

sleep $delay
done
################################################## ######

4. Copy it to /etc (in root mode) and make executable
# sudo cp ./backlight_d.sh /etc/
# sudo chmod +x /etc/backlight_d.sh

5. Add it to rc.local
# sudo nano /etc/rc.local

Find the line 'exit 0', add BEFORE it:

################################################## ######

nohup /etc/backlight_d.sh &

################################################## ######


All done! Restart now and watch the backlight magically change

SAUCES:

Touchpad workaround


Poster #83 got it right. The issue is caused by gnome-settings-daemon. There is, however, no need to adjust/recompile any code.
Hi, I was having the same issue. I believe that the Synaptics touchpad driver and Gnome both disable the touchpad individually. For some reason, Gnome (in particular gnome-settings-daemon) fails to re-enable it; which is why you end up with a dead touchpad, once you disable it.
To bring your touchpad back to life, enter the following command:
Code:
gconftool --type bool --set /desktop/gnome/peripherals/touchpad/touchpad_enabled true
The key "/desktop/gnome/peripherals/touchpad/touchpad_enabled" is where gnome-settings-daemon remembers that you disabled your touchpad. This is the reason, why it is disabled even after a reboot.
The issue will re-appear, next time you disable your touchpad. You need to prevent gnome-settings-daemon from disabling your touchpad in the first place, because the Synaptics touchpad driver does this already. To do so, run the following command in a terminal:
Code:
gconftool-2 --type string --set /apps/gnome_settings_daemon/keybindings/touchpad ""
This dissociates the key to lock your touchpad from gnome-settings-daemon. If for any reason, the latter command breaks the lock touchpad support for you, than you probably have a different issue. To re-associate the key with gnome-settings-daemon, run this command:
gconftool-2 --type string --set /apps/gnome_settings_daemon/keybindings/touchpad XF86TouchpadToggle
Hope this helps. I recommend rebooting after this procedure and check if this really fixed it for good. I noticed that the error only occurs only once after a reboot.