This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#5651 - X5 LCD Shutoff and Graceful Shutdown
Attached to Project:
Rockbox
Opened by Michael Sevakis (MikeS) - Wednesday, 12 July 2006, 03:11 GMT+2
Opened by Michael Sevakis (MikeS) - Wednesday, 12 July 2006, 03:11 GMT+2
|
DetailsPatch that puts the X5's LCD chip in standby mode when the backlight turns off and goes through the recommended poweroff sequence on power off. I combined these because implementing one pretty much automatically implements the other.
Note: I don't know why the entire backlight-x5.c is being diff'ed. I didn't change the entire file. Changes: - Added LCD shutdown and standby code to lcd-x5.c - Implemented a new function lcd_shutdown() to lcd.h for shutting down LCD during power off. Called from power_off() power-x5.c - Added #define BL_X5 12 to config.h since having it defined as BL_IRIVER_H100 causes conflicts. I also needed lcd_enable() declared independently from an H100 build. _ Added lcd_enable calls to __backlight_on and __backlight_off in backlight-x5.c. - Added LCD instruction #define's to lcd-x5.c plus two static routines. |
This task depends upon
Closed by Rani Hod (RaeNye)
Wednesday, 09 August 2006, 00:07 GMT+2
Reason for closing: Out of Date
Additional comments about closing: deprecated by #5772, which was committed.
Wednesday, 09 August 2006, 00:07 GMT+2
Reason for closing: Out of Date
Additional comments about closing: deprecated by #5772, which was committed.
Does the LCD enabling introduce a noticable delay?
BTW, in backlight-x5.c you added lcd_enable() calls.
I do notice the 0.2 second delay when enabling the LCD;
IMHO it's better to shutdown LCD only after a period of time (say, 1 min - but configurable in the same way you configure backlight time).
I find the LCD disabling on system shutdown important; it may help to reduce the intermittent "white screen" effect.
I didn't really think about the delay till you said something! :) I'm pretty sure that it can't be reduced by much.
A delay and setting would be better but I wanted to keep this patch's purpose well focused. The LCD off time and backlight OFF time can conflict too.
The "white screen" effect can happen even if the LCD chip is off since it is the backlight that does it (chip off/backlight on=white screen-- I tried it). But...something is going about and turning the display ~back on~ (nothing to do with the patch). What is happening is not obvious to me at the moment.
Ok. In other files only the changed lines are being diff'd and I added headers and calls there too.
Might be connected to the patch, or to the backlight flicker on shutdown you're experiencing.
*However*, the backlight flash IS related to turning off the LCD chip. There's no flash if the LCD is left powered on and all is okay if the only the display is turned off. I'm *guessing* the LCD chip normally drains some caps if left on (schematics would help :). Theory: If the LCD chip if off, the caps are left charged and when the GPO1 pin on the PCF50606 goes low after PCF50606 shutdown(default state) it briefly turns on the D305A and drains the caps causing the flash. I could be totally out in left field but will put it to the test. I'm working on it and learning in the process and want to go and ask some *good* questions.
BTW: I also note that the supposed backlight dimming/LCD contrast patch actually does nothing at all to set backlight brightness since it doesn't set the duty cycle of PWMC1 of the 50606, ie. no "pcf50606_(0x35, )" calls are made.
regarding your BTW: backlight brightness is modified exactly as you said (PWM), I think the code is in lcd-x5.c.
There's no code for backlight control in lcd-x5.c from any of the aformentioned patches nor in the original file. The BL patch sets LCD contrast by adjusting voltages (safe to raise above stock levels??).
If anyone cares: I figured out how to turn the charge indicator LEDs on and off. Maybe a quicky patch for that, eh?
http://www.rockbox.org/twiki/bin/view/Main/PortPinAssignments#X5_PCF50606_GPO
:-)
I must warn you that dealing with PCF50606 might get you in deep trouble with the device.
After I tried to enable these instead of the virtual HDD led, I had to open up mine, disconnect the battery wire and resolder it because it went awfully hot.
But actually it's important for RB to turn the LEDs off on boot, since if you boot from AC mode they're still on.
I mostly want to focus on making LCD driver 100% - 110% at the moment. Then release a patch that adds LCD menu options that depend on it so as to not do the "one huge patch" thing. There was also a small mistake in the original power ON sequence taken from the X5 firmware (not fixed in this patch).
About HWM: The highspeed write mode cannot be used unless the screen buffer is rotated 90deg (entry more horitonal AM=0) or by reading bitmaps in column-major order with the writes done horizontally (ie vert. on screen). Dummy writes are inserted automatically for alignent so it isn't an issue but I don't know if that read order would be "harmful" to the CPU cache or something. I already get 123.5 full-screen frames/sec with CPU boosted but there's nothing wrong with faster if possible. I like to experiment.
FS#5735(Use Hold button to switch off the backlight in X5)so that LCD off will occur only when the user forces it.
What do you think?
Could you please sync to current CVS?
FS#5735so I have a copy and I'll submit something of higher quality that can be easily added to it. This works like the OF BL flick?Ok I have to resynce
FS#5740. My preference would be to useFS#5740first then add power features to it because it assumed the display is never really turned off but it hasn't been approved. Going the other way is a more hairy ordeal.Are you looking for just something to turn the LCD display OFF or the whole chip?
If you want the LCD off thing forced through now...I'll do it (I'll add the register defines there too). Let me know.
FS#5740soon, so you can rely on it in the next version.Don't hurry though, I won't have that much time for RB tomorrow :)
What I want to do is:
(a) have lcd_shutdown(), lcd_standby() functions in lcd-x5.c
(b) have a setting for lcd shutdown (never, always, on hold switch)
(c) [later on] add to this setting "after X seconds" as well
(b) En proceso but sticky issues.
(c) I'll probably attempt this right off.
Shutdown Display
Always, Never, On Hold Switch, With Backlight (??), ??s-??m <= Should be able to be fairly long
* "On Hold Switch" is X5-centric or this is on other players too?
* "On Hold Switch" as BL option too? I personally don't want BL off with hold automatically.
* Min/Max time setting (??) Me thinks 90s (max BL besides "On")/5min.
* The BL must go off with the LCD. Keep LCD >= BL?
* If BL is "On", never shutdown LCD or force BL off? Another setting maybe? Avoid settings bloat!
* If "Always", then LCD must be turned on just before power off (flash).
* Language/voice files needed.
* This might need a settings version increment, no?
I know you're busy most of the time but I want this done right so I'd like to hear your input about the stickier issues since this setting is initially your idea.
To solve the LCD >= BL issue it might be better to have it as "LCD off ??s after BL off" with always=0, never=infinity.
The hold switch might be in a different setting: on hold switch shutdown: nothing/BL/BL&LCD.
IIRC, CONFIG_BLOCK_VERSION increment is unnecessary when you only add new settings at the end of the settings struct.
Hold still does its main function, but when hold is active there's a different LCD off/BL off timeout.
IMHO it's rather similar to the BL off timeout *when AC powered* setting.
Backlight
Backlight (While Plugged In)
Backlight (On Hold Key) = Off,On,Normal (default == Normal)
First Keypress Enables Backlight Only
Caption Backlight
Sleep (After Backlight Off) = Always,Never,5s,10s,15s,20s,30s,45s,60s,90s,2m (default == 10s)
Brightness
Contrast
Line Selector
Clear Backdrop
Background Colour
Foreground Colour
Reset Colours
Visible display will just go off with BL on X5 since showing it again is fast enough. LCD Sleep will actually cut internal power/oscillation.
Food for thought:
I'm thinking a backlight submenu would be a good idea now since five of 13 items relate to backlight settings. Can do later.
How bout adding the backlight PWM fading?? Maybe later too. :)
FS#5772