GNOME Bugzilla – Bug 483134
Brightness *increases* on idle on AC with idle_dim_ac disabled
Last modified: 2008-06-30 10:23:11 UTC
In gnome-power-manager 2.20.0 as included in the current development release of Ubuntu "Gutsy", the screen brightness is *increased* on idle when idle_dim_ac is disabled. In this circumstance, the screen brightness should not be changed *at all* on idle - after all, idle_dim_ac being disabled should not mean that the screen becomes *brighter* on idle (a truly nonsensical action). Anyway, I have developed a patch against gpm-backlight.c that resolves the issue. Now, whenever the idle callback is called, the gpm_backlight_brightness_evaluate_and_set function will NOT be called if we are on AC and idle_dim_ac is false (or on battery and idle_dim_batt is false. Could this be integrated into the next release - this is a particularly annoying regression from 2.18... Diff is available at http://launchpadlibrarian.net/9690288/gpm-backlight.c.diff (was written against Ubuntu version, but should apply against upstream)
The patch is incorrect - you don't need to do this. The code is here: /* get AC status */ on_ac = gpm_ac_adapter_is_present (backlight->priv->ac_adapter); /* reduce if on battery power */ if (on_ac == FALSE) { gpm_conf_get_uint (backlight->priv->conf, GPM_CONF_BACKLIGHT_BRIGHTNESS_BATT, &value); scale = (100 - value) / 100.0f; brightness *= scale; } else { scale = 1.0f; } Does that look correct? I don't think you can make scale a number greater than 1.0... Tell me if I'm wrong. Richard.
That code isn't the problem. The problem is that adjusting the brightness with the keyboard changes the brightness without changing any gconf settings. I haven't confirmed this in the source code, but it seems very likely that that's what's happening.
The 2.21.1 gpm_backlight_brightness_evaluate_and_set () does those gpm_conf_get_uint (backlight->priv->conf, GPM_CONF_BACKLIGHT_BRIGHTNESS_AC, &value); brightness = value / 100.0f; on_ac = gpm_ac_adapter_is_present (backlight->priv->ac_adapter); if (enable_action == TRUE && backlight->priv->system_is_idle == TRUE) { gpm_conf_get_uint (backlight->priv->conf, GPM_CONF_BACKLIGHT_IDLE_BRIGHTNESS, &value); scale = value / 100.0f; brightness *= scale; } else { scale = 1.0f; } value = roundf (brightness * 100.0f); gpm_brightness_lcd_set_std (backlight->priv->brightness, value); When /apps/gnome-power-manager/backlight/idle_dim_ac is not set enable_action is not true and brightness is set to the /apps/gnome-power-manager/backlight/brightness_ac value, the default being 100 On idle the light change on idle to this value then, which is not likely what the user wants. Should the gconf brightness keys change when the user use the keyboard to set the screen bright? Otherwise where is stored the value to use?
corresponding debug log [gpm_screensaver_powersave_idle_changed] gpm-screensaver.c:102 (22:17:32): emitting powersave-idle-changed : (1) [powersave_idle_changed_cb] gpm-idle.c:335 (22:17:32): Received GS powesave idle changed: 1 [gpm_idle_set_mode] gpm-idle.c:98 (22:17:32): Doing a state transition: 1 [gpm_backlight_notify_system_idle_changed] gpm-backlight.c:584 (22:17:32): we were active for 57,925319s [gpm_backlight_notify_system_idle_changed] gpm-backlight.c:587 (22:17:32): changing powersave idle status to 1 [gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:376 (22:17:32): 1. main brightness 1,000000 [gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:390 (22:17:32): 2. battery scale 1,000000, brightness 1,000000 [gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:405 (22:17:32): 3. idle scale 1,000000, brightness 1,000000 [gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:425 (22:17:32): 4. ambient scale 1,000000, brightness 1,000000 [gpm_backlight_brightness_evaluate_and_set] gpm-backlight.c:443 (22:17:32): emitting brightness-changed : 100 [gpm_brightness_lcd_dim_hw] gpm-brightness-lcd.c:267 (22:17:32): new_level_hw=7 [gpm_brightness_lcd_dim_hw_step] gpm-brightness-lcd.c:198 (22:17:32): new_level_hw=7, last_set_hw=4 [gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:155 (22:17:32): Setting 4 of 7 [gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:155 (22:17:32): Setting 5 of 7 [gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:155 (22:17:32): Setting 6 of 7 [gpm_brightness_lcd_set_hw] gpm-brightness-lcd.c:155 (22:17:32): Setting 7 of 7
Hello, 1) I hate all these brightness related bugs, especially since they represent a regression. 2) There are several bugs that overlap(#478128, #483134, #483143, #509211) ; IMHO, there should be ONLY ONE I have reported this in Debian bug #467264 and I explained why the current (and former) behaviour is(was) wrong and how they should actually behave. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467264 To summarize: - AC and battery settings MUST not interact with each other - the battery *brightness*slider* should be *brought*back* (one should be able to set the default battery brightness level, no matter what automatic dimming effect is added) - dimming on idle should *really*dim*or*do*nothing*, if dimming is not possible; is should NEVER bright up the display - using the *brightness* *keys* should be a clear adjustment of the default brightness level and it should *always* have precedence over anything automatically computed or commanded - DO NOT DIM WHILE ACTIVE If anyone cares, here is the summary I made in the debian bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467264#33
Sorry, the entire list of bug was: bug #478128, bug #483134, bug #483143, bug #509211, bug #530346, bug #335673 and bug #483144
2008-06-30 Richard Hughes <richard@hughsie.com> * data/gnome-power-manager.schemas.in: * src/gpm-backlight.c: (gpm_backlight_brightness_evaluate_and_set), (conf_key_changed_cb): * src/gpm-conf.h: Fix the name and description of the gconf key: /apps/gnome-power-manager/backlight/brightness_dim_battery Fixes #483144