Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#10862 - Add second backlight timeout

Attached to Project: Rockbox
Opened by Maurus Cuelenaere (mcuelenaere) - Thursday, 17 December 2009, 14:49 GMT+1
Task Type Patches
Category LCD
Status New
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 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.
   0001-Add-2nd-backlight-timeout.patch (12.2 KiB)
 b/apps/lang/english.lang                |   31 +++++++++++++++++++++
 b/apps/menus/display_menu.c             |    4 ++
 b/apps/settings.c                       |    2 +
 b/apps/settings.h                       |    2 +
 b/apps/settings_list.c                  |    8 +++++
 b/firmware/backlight-sw-fading.c        |   21 +++++++++++---
 b/firmware/backlight.c                  |   46 +++++++++++++++++++++++++-------
 b/firmware/export/backlight-sw-fading.h |   10 ++++--
 b/firmware/export/backlight.h           |    2 +
 9 files changed, 108 insertions(+), 18 deletions(-)

This task depends upon

Comment by Thomas Martitz (kugel.) - Friday, 18 December 2009, 18:17 GMT+1
What is this for? maybe you could explain a bit.
Comment by Maurus Cuelenaere (mcuelenaere) - Friday, 18 December 2009, 23:33 GMT+1
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, 04:03 GMT+1
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, 06:34 GMT+1
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, 15:02 GMT+1
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, 11:28 GMT+1
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...