This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#8400 - Option to keep backlight off while changing volume etc.
|
DetailsSome operations — like changing volume, switching to next song etc. — just don't require looking at the screen or even taking the DAP out of one's pocket. Nevertheless rockbox will turn power-expensive and sometimes annoying backlight on for every single keypress.
The patch adds an option to prevent any button but SELECT and/or POWER from turning backlight on, thus providing some king of manual backlight control. The patch was tested on Sansa C200. It should work fine on other players as well, but the choise of buttons may not be the best one and may require tweaking. |
This task depends upon
can it be turned on and off in the menu?
drivers/button.c:493:2: error: #error Can't guess BACKLIGHT_BTN_POWER for this targer
drivers/button.c: In function 'set_backlight_filter_buttons':
drivers/button.c:503: error: 'BACKLIGHT_BTN_POWER' undeclared (first use in this function)
drivers/button.c:503: error: (Each undeclared identifier is reported only once
drivers/button.c:503: error: for each function it appears in.)
make[1]: *** [/home/Jonathan/rockbox/build/firmware/drivers/button.o] Error 1
make: *** [build] Error 2
Thanks for this patch, I was looking for something like this for a while.
Ok, I thought a bit and here's version 2. Apply _instead_ of the first one.
Should work for iPod, please check it now.
> why not make this setting an int with potentially many 'filters'?
> Now you have two but there could be more.
For the same reason keymaps are hardcoded in rockbox. No need to. You can always change it in button-target.h and recompile rockbox leaving no useless code in it. BTW, I removed second filter option in v2 patch
the forward/back keys etc do not trigger the backlight, but the scrollwheel still does trigger it.
as the mein purpose of this patch is to disable backlight on volume+-, i consider this is a bug?
(current svn as of a few minutes ago)
We should have a small plugin that comes with this that will allow you to choose what button to use. And also have a way to detect the play it's on? Maybe different versions for different targets?
You can select those buttons by changing
#define BACKLIGHT_BUTTON
in button-target.h for your specific device. Also, any feedback will be appreciated.
Regarding other targets — sorry, I'm totally puzzled, simulator seems to work well and still I have no real
devices to test it on. Here's v3, which won't break simulator builds like v2 did ;-), and a small
patch to make it warn you of what's going on. Try playing with them, maybe you'll get some ideas...
would it be possible to have an option to only disable backlight for volume changes?
(imho options could be: all, not for volume, not for volume+trackskip, selected only)
the config-flags could be named all,novolume,novolumenskip,selected
the problem with having only menu and select enable the backlight is that you can easily go to a menu or other things without you noticing it (because the backlight doesnt turn on, but all keypresses are accepted).
another option would be to turn on the backlight as soon as another screen than the wps is displayed :-)
Also, which FS# are two other patches?
me (disorganizer): well, there were two options in the first patch, but after using it a while I changed that. The idea was that BACKLIGHT_BUTTON should contain all buttons which open menu etc., so try tweaking it. Or perhaps take relevant portions from v1.
Turning BL on as screen changes sounds much more appealing to me though, I'll think of it.
so if the wps is left, the backlight turns on. but if it still there after the keypress, it will stay off.
i also noticed that on left/right (aka track skipping) the caption backlight still works, which is nice :-)
but now the bad thing is:
this ONLY works in the simulator. when putting the patch on a real device it does not work (scrollwheel does turn on backlight).
the simulator showed no output with your debug commands, also the values for scrollwheel-actions match.
so i wonder:
why dont i get a debug output from your debug patch for the backlight on scrollwhell actions?
meaning: is there another place where the backlight is turned on when i use the scrollwheel?
btw:
the patch needs synching in the english.lang patch.
if the scrollwheel fires backlight_on but your original debug patch does not trigger, there must be some other function calling backlight_on when a scrollwheel action is detected, so your patch then needs to be expanded to also cover that function.
Yeah, that's the main problem, as simulator is all I have.
> is there another place where the backlight is turned on when i use the scrollwheel?
there's buttonlight_* that can be triggered, and there's remote_backlight_* but e200 lacks
remote display, and seems like that's all.
> another idea: wouldnt it be better to modify your debug patch to capture the "backlight_on" function calls?
It's not that easy, but on simulator any call to backlight_on will result in subsequent call to sim_backlight, so effectively it's the same.
For the real device... here's a patch to make it more talkative, and second one to make logf() write on primary lcd. Perhaps it will give some clues.
Don't forget to enable logf support during build.
Also, feel free to add logf() to suspicious places, it should work almost anywhere.
in file firmware\target\arm\sandisk\sansa-e200\button-e200.c there is a call to backlight_on() in line 197.
as far as i understand the code, this controlls the backlight behaviour for the scrollwheel.
i dont have my sansa handy right now so i cant compile and check, but i think this may be the cause for the "problem". could you check whether this could be the cause?
if not it will take some time until i find time and access to my e200 *g*
i commented the "backlight_on()" call in button-200.c to disable it.
i could not test it, but imho it should work (only for e200!).
at least it patches against 16213 without errors and compiles without errors :-)
if someone with an e200 is willing to test:
* try with "backlight on all keys" whether the scrollwheel still turns on the backlight. is there any difference when using the scrolllight?
* try with "backlight on selected" and check the scrollwheel now does not turn on the backlight.
even in the menu the scrollwheel is not recognised as movement, resulting in the backlight going off even if you move the scrollwheel. *sigh*
how can i let button-200.c know whether the active screen is the wps or not?
or said in another way:
as the scrollwheel turns on the backlight in button-200.c, how can i distinguish between "volume up/down"-moovements or "menu navigation" moovements of the scrollwheel?
or saind in yet another way:
if i disable the backlight_on() call as mentioned above, how can i ensure the backlight is turned on as soon as menu navigation is used instead of volume controll?
this variable could then be use to toggle whether the backlight should be lit on every buttonpress and scrollwheel moovement or not.
as im no programmer im sadly not in the condition to implement this.
I have an alternative idea: The short REC button is rarely used except for the recording screen to start record (you can also press PLAY to achieve this action). So why don't we invest this REC button to be the backlight switch?