Rockbox

Tasklist

FS#10862 - Add second backlight timeout

Attached to Project: Rockbox
Opened by Maurus Cuelenaere (mcuelenaere) - Thursday, 17 December 2009, 13:49 GMT
Task Type Patches
Category LCD
Status New
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

This patch adds a secondary backlight timeout (similar to what the the iPod OF does).

It adds two extra settings: secondary backlight timeout and secondary brightness (I'm not sure wrt the naming of those, any suggestions?)

The code isn't very clean, but it works (except for CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM targets, for which I haven't implemented this).

Please test this.
This task depends upon

Comment by Thomas Martitz (kugel.) - Friday, 18 December 2009, 17:17 GMT
What is this for? maybe you could explain a bit.
Comment by Maurus Cuelenaere (mcuelenaere) - Friday, 18 December 2009, 22:33 GMT
This adds a secondary configurable backlight timeout and brightness level, which allows for dimming the backlight after a couple of seconds and then completely shutting off after the "normal" backlight timeout (this behaviour is also present on some Nokia phones and the iPhone OF IIRC and is pretty useful IMO).

As an example to show this behaviour: set "normal" backlight to full brightness and 10sec timeout and secondary to halve brightness and 3 sec timeout.
Comment by Daniel Empie (BlastTyrant) - Saturday, 19 December 2009, 03:03 GMT
This works on both my v1 Fuze and my v1 c240.

The only thing that I noticed that probably isn't supposed to be there is that there is 2 "Off" settings within the Secondary Backlight Timeout submenu - one at the very top of the list and one at the very bottom. Both of the off settings work though. This was on both of my DAPs.

Apart from that, I tested it with varying timeout settings and brightness levels for both of the normal settings and the secondary settings. It works very well.

I patched r24079 to test this.
Comment by Teruaki Kawashima (teru) - Saturday, 19 December 2009, 05:34 GMT
the patch doesn't compile for gigabeatfx.
I got following error:

/home/teru/rockbox/build/apps/settings.o: In function `settings_apply':
settings.c:(.text+0xfdc): undefined reference to `backlight_set_2nd_brightness'
/home/teru/rockbox/build/apps/settings_list.o:(.data+0x1c0): undefined reference to `backlight_set_2
nd_brightness'
collect2: ld returned 1 exit status

gigabeatfx also has similar but very limited feature and I implemented similar function before for only gigabeatfx by someone's request.
i hope this helps. (note: the patch is quite out dated)
http://kamekun.web.fc2.com/rockbox/second_brightness.r20074.txt
Comment by Rosso Maltese (asettico) - Wednesday, 23 December 2009, 14:02 GMT
As far as I can deduce, firmware/backlight-sw-fading.c is not the right place where define backlight_set_2nd_brightness().
I think it should be defined beside backlight_set_brightness().
If I have some time, I will try in this direction.
Cross the fingers. :-)
Comment by Rosso Maltese (asettico) - Friday, 29 July 2011, 09:28 GMT
Did you hold your breath? ;-)

Probably the unresolved is due to the exclusion of backlight-sw-fading.c in build process, depending on the target type (Maurus states that he didn't implement it YET :-) for PWM fading targets).

I tried to take a look to the sources, but I have so little free time that I can't study the logic implemented.
I saw this statement in backlight.c

(void)fade_2nd; /* FIXME */

in function

static void backlight_setup_fade_down(bool fade_2nd)

Here it is called a backlight_dim(0) that I suppose switch the back light off.
I think that instead of a simply 0, it should be done something like in function_backlight_fade_down() in backlight-sw-fading.c, which takes care of argument fade_2nd.
But the question is: in PWM fading, how can I set the brightness to brightness_2nd?

Thanks for any hint.
I would like very much to see this feature in trunk.

Loading...