droazen
March 1st, 2008, 01:52 AM
Hi,
Like several others on this forum, I found that the keyboard backlight on my MBP wasn't working properly in Gutsy "out of the box", even with pommed installed. Eventually I managed to get it working more or less as well as in OS X, and thought it might be useful to make a post here detailing the steps I took.
1. Install pommed:
sudo aptitude install pommed
2. Add applesmc to /etc/modules:
echo applesmc | sudo tee -a /etc/modules
3. Adjust the "on_threshold" and "off_threshold" values in the "kbd" section of /etc/pommed.conf to something a bit more responsive to ambient light changes than the default values of 20 and 40, respectively. After some experimenting, I found that 40 for the "on_threshold" and 80 for the "off_threshold" works very nicely (nicely as in "the backlight comes on if I turn the lights off in my room, and goes off if I turn the lights on"). Also make sure that the "auto" setting is set to "yes", and the "default" setting is set to your desired default brightness. Below is my kbd section for reference:
# Keyboard backlight control
kbd {
# default value for automatic backlight (0 - 255)
default = 255
# step value (1 - 127)
step = 50
# ambient light thresholds for automatic backlight (0 - 255)
on_threshold = 40
off_threshold = 80
# enable/disable automatic backlight
auto = yes
}
4. reboot
5. If you find that the values you entered for on_threshold and off_threshold are not giving you the behavior you want, tweak them in /etc/pommed.conf and then type the following to make the new settings take effect:
sudo /etc/init.d/pommed restart
The way these threshold values seem to be used by pommed is as follows: if the backlight is currently off and the left and right ambient light sensors both dip below the on_threshold, the backlight gets turned on. Otherwise, if the backlight is currently on and either the left or the right ambient light sensor goes above the off_threshold, the backlight gets turned off.
This is based on my interpretation of the following section of the kbd_backlight_ambient_check() function in the v1.8 pommed source:
if ((amb_r < kbd_cfg.on_thresh) && (amb_l < kbd_cfg.on_thresh))
{
logdebug("Ambient light lower threshold reached\n");
/* backlight already on */
if (kbd_backlight_get() > KBD_BACKLIGHT_OFF)
return;
/* turn on backlight */
kbd_bck_info.auto_on = 1;
kbd_backlight_set(kbd_cfg.auto_lvl, KBD_AUTO);
}
else if (kbd_bck_info.auto_on)
{
if ((amb_r > kbd_cfg.off_thresh) || (amb_l > kbd_cfg.off_thresh))
{
logdebug("Ambient light upper threshold reached\n");
kbd_bck_info.auto_on = 0;
kbd_backlight_set(KBD_BACKLIGHT_OFF, KBD_AUTO);
}
}
Hope this helps someone someday :)
Like several others on this forum, I found that the keyboard backlight on my MBP wasn't working properly in Gutsy "out of the box", even with pommed installed. Eventually I managed to get it working more or less as well as in OS X, and thought it might be useful to make a post here detailing the steps I took.
1. Install pommed:
sudo aptitude install pommed
2. Add applesmc to /etc/modules:
echo applesmc | sudo tee -a /etc/modules
3. Adjust the "on_threshold" and "off_threshold" values in the "kbd" section of /etc/pommed.conf to something a bit more responsive to ambient light changes than the default values of 20 and 40, respectively. After some experimenting, I found that 40 for the "on_threshold" and 80 for the "off_threshold" works very nicely (nicely as in "the backlight comes on if I turn the lights off in my room, and goes off if I turn the lights on"). Also make sure that the "auto" setting is set to "yes", and the "default" setting is set to your desired default brightness. Below is my kbd section for reference:
# Keyboard backlight control
kbd {
# default value for automatic backlight (0 - 255)
default = 255
# step value (1 - 127)
step = 50
# ambient light thresholds for automatic backlight (0 - 255)
on_threshold = 40
off_threshold = 80
# enable/disable automatic backlight
auto = yes
}
4. reboot
5. If you find that the values you entered for on_threshold and off_threshold are not giving you the behavior you want, tweak them in /etc/pommed.conf and then type the following to make the new settings take effect:
sudo /etc/init.d/pommed restart
The way these threshold values seem to be used by pommed is as follows: if the backlight is currently off and the left and right ambient light sensors both dip below the on_threshold, the backlight gets turned on. Otherwise, if the backlight is currently on and either the left or the right ambient light sensor goes above the off_threshold, the backlight gets turned off.
This is based on my interpretation of the following section of the kbd_backlight_ambient_check() function in the v1.8 pommed source:
if ((amb_r < kbd_cfg.on_thresh) && (amb_l < kbd_cfg.on_thresh))
{
logdebug("Ambient light lower threshold reached\n");
/* backlight already on */
if (kbd_backlight_get() > KBD_BACKLIGHT_OFF)
return;
/* turn on backlight */
kbd_bck_info.auto_on = 1;
kbd_backlight_set(kbd_cfg.auto_lvl, KBD_AUTO);
}
else if (kbd_bck_info.auto_on)
{
if ((amb_r > kbd_cfg.off_thresh) || (amb_l > kbd_cfg.off_thresh))
{
logdebug("Ambient light upper threshold reached\n");
kbd_bck_info.auto_on = 0;
kbd_backlight_set(KBD_BACKLIGHT_OFF, KBD_AUTO);
}
}
Hope this helps someone someday :)