This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6800 - Sansa e200 backlight fade in/out
Attached to Project:
Rockbox
Opened by Ivan Zupan (zivan56) - Sunday, 11 March 2007, 23:12 GMT+2
Last edited by Marc Guay (Marc_Guay) - Wednesday, 02 April 2008, 22:22 GMT+2
Opened by Ivan Zupan (zivan56) - Sunday, 11 March 2007, 23:12 GMT+2
Last edited by Marc Guay (Marc_Guay) - Wednesday, 02 April 2008, 22:22 GMT+2
|
DetailsThis adds a fade in/out feature similar to the one used on the iPod instead of just cutting power to the LCD.
The udelay used to leave the LCD in a low power state for a ~2 secs is not ideal, and probably needs to be removed or made non-blocking if possible. It would be useful to have the player in this state for ~5 sec if it didn't adversely affect the response time of the player. Ivan |
This task depends upon
Any idea what might be the reason?
does this need to be configurable? I dont think so.
I also saw some traffic on IRC about this and there seemed to be confusion about lcd_sleep/enable? lcd_enable(false) only shuts down visible display operations, not the chip itself. lcd_sleep_does the full move to standby. lcd_enable(true) of course brings it back from any level of power down. Those functions yield and aren't really multithread safe (yet).
it doesnt work though :p
I'm hoping another pair of eyes can figure it out.
currently it only dims once :(
Anyway, I did talk to the devs, we need to follow jdgordons approach (for thread-safety, proper coding etc), and we need to make it configurable in order to have a chance to get this committed. I hope someone will help us to do so.
What exactly do we need to get this committed? Maybe the fade should be done in _backlight_on() and _backlight_off() instead of introducing __backlight_dim()? That way it would be compatible to the HAVE_BACKLIGHT_PWM_FADING stuff and backlight.c could be left unchanged. At least, further resyncs would be easier then.
Any suggestions?
Anyway, I now managed to get jdgordon's approach running, too. It does the fading in the backlight_thread() itself instead of a ticktask, which was considered to be bad. It works quite well, however, I don't like it very much. While fading, the backlight_thread() feeds up itself with tons of BACKLIGHT_FADE_* events. Was it supposed to work this way, or should we rather use a timer to feed the queue?
Fading is now controlled by the new variable backlight_fade_state. It is set to 1 or 2 in _backlight_on() or _backlight_off(), indicating that either a fade-up or fade-down is desired. If so, backlight_tick() starts sending BACKLIGHT_FADE events to the backlight_thread() at a rate of HZ/25. Depending on the value of backlight_fade_state, the backlight_thread() then calls either __backlight_fade_up() or __backlight_fade_down() of the target. When fading is fished, backlight_fade_state is set back to 0, and backlight_tick() stops sending fade events.
Also fixed a bug when brightness was set to 1.
It's been tested quite intensely. If further work is needed to get it committed, someone may tell me, please.