Rockbox

Tasklist

FS#7538 - Custom user splash screen.

Attached to Project: Rockbox
Opened by Gerritt Gonzales (GRaTT) - Sunday, 05 August 2007, 04:00 GMT
Last edited by Jonathan Gordon (jdgordon) - Monday, 14 January 2008, 00:04 GMT
Task Type Patches
Category User Interface
Status Closed
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 100%
Votes 0
Private No

Details

This works on the sansa simulator but not on target.
It does not hinder the target at all in it present state.
When I removed the checks it tries to load the bmp and
the screen looks a little strange then goes straight
to the user start screen.

It is supposed to load a user bmp from /splash.bmp of
the DAP dimensions(l*W), like the custom backdrops.
Suggestions and help are welcome.
GRaTT
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Monday, 14 January 2008, 00:04 GMT
Reason for closing:  Rejected
Additional comments about closing:  No solution without a negative impact
2008-04-16: A request to re-open the task has been made. Reason for request: its still in sync from my end with svn, its a neat patch, please re-open
Comment by Gerritt Gonzales (GRaTT) - Sunday, 05 August 2007, 07:05 GMT
After some discussion on irc this was deemed ok for committing if it works.
Unfortunately the location of the function show_logo may be to early to open files.
This as well as various other version work in sims and in the plugins
but on target the read continues to fail.
This however is a good code snipit for reading and displaying a bmp file from disk.
The initialization of the struct fb_data save_buffer[LCD_WIDTH*LCD_HEIGHT*sizeof(fb_data)]
may be wrong but "works" it initializes to big a buffer,
struct fb_data save_buffer[LCD_WIDTH*LCD_HEIGHT] seems to be the proper way,
and work as well(in sim and plugin).
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 01:48 GMT
I have managed to get this working but after the RB logo displays.
It uses a config file to set the splash time out
and does not slow things down if the config file is not present.
There may be a better place for this code to go, but this works.
There may also be better image display code and buffer sizing but
again this works for now.
User must create a "splash.cgf" text file in /.rockbox.
A single number eg. (5) gives a 5 second splash display.
A bitmap "/splash.bmp" file of mp3 player dimensions must be in the root dir.
Anything that will work as a backdrop will work.

GRaTT
Comment by Jonathan Gordon (jdgordon) - Monday, 06 August 2007, 02:13 GMT
add the splash timeout to the standard confing file and global_setting (and settings_list.c) byt the time you want to dispolay the splash that file should have been parsed already.
also, splash.bmp should go in /.rockbox and not in /. remove the static infront of the fb_data variable as its not needed ever again once it has been displayed.
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 04:35 GMT
Made the above changes to the code,
except for the config file. I currently use it as a test
and will need to look at how to make the changes you suggest.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 04:54 GMT
It did not like when I removed the static it hung before
the RB logo.
This patch just moves the expected splash.bmp location to /.rockbox.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 07:04 GMT
This update replaces the RB splash screen if you have a
/.rockbox/splash.cfg file with a number and a ./rockbox/splash.bmp
bitmap such as a backdrop for your player.
There is a slight delay in display and it shows a white screen
for less than 1 second before showing the RB logo or custom splash image.
It only affects LCD_BITMAP targets.
There is still room for improvement.
GRaTT
Comment by Jonathan Gordon (jdgordon) - Monday, 06 August 2007, 07:27 GMT
the reason it hung removing the static is probably because you used too much stack space... so leave it in... the sizeof(fb_data) part of that line isnt needed (im now 99% sure of it :p ).
also, I think the splash filename should be in the config file also (config.cfg... not splash.cfg) because then if no filename is set there is no need to do an extra open() on a file which may not exist (iirc open is the "slow" part of file access).
Comment by Gerritt Gonzales (GRaTT) - Monday, 06 August 2007, 16:58 GMT
To speed up the display slightly I removed the splash.cfg file
and hard coded the display time to 3 sec.
I agree the options should be in the config or menu settings
but I do not know how to do that.
If the /.rockbox/splash.bmp file is there and successfully read
it will display it, else it will display the original
RB logo. The RB logo does not display for as long now, this is fixable
only with adding more delay.
I was able to remove the sizeof(fb_data) but not the static.

I also added in the code so the simulator will act the same way.
I think this is as close to the beginning of main.c that will open the bmp file.
Anybody good with menu and setting options??
GRaTT
Comment by Jonathan Gordon (jdgordon) - Monday, 06 August 2007, 21:57 GMT
settings_list.c, you want to copy and INT_SETTING, and a FILENAME_SETTING
Comment by Jonathan Gordon (jdgordon) - Tuesday, 07 August 2007, 04:55 GMT
after a quick review....
you should modify the show_logo() function instead of main() to do this. or at least split your code into a seperate functio so it doesnt need to be dupolicated in main().

also, you need to figure out how to get this going on the remote lcd... its exactly the same, except the fb_data type cannot be used (the fb_data type is different when the main screen is colour and the remote isnt.)
what you should do is create a single variable static unsigned char buffer[LCD_WIDTH*LCD_HEIGHT*sizeof(fb_data)]; which on single screen targets will not change anything, and on remote targets you will then be able to read the bmp once, display it on the main lcd, then re-read it into the same buffer and display it on the remote (that buffer will be more than big enough for hte remote screen). DONT try displaying it on the remote lcd unless you re-read it... bmp_read_file() does conversions which will cause all types of wierdness if you try displaying the buffer for the main screen on the remote...

also, consider not closing the fd untill the remote is finished being read, open() is slow, seek() is fast in comparisson (iirc)
Comment by Gerritt Gonzales (GRaTT) - Tuesday, 07 August 2007, 08:27 GMT
I could not get this to work in show_logo(), the file read
failed every time.
This updated patch adds a custom user setting menu
"Configure Splash Screen" to the Display menu.
(off,on,2,3,4,5,6,7,8,9) are the options.
When off the delay before the original logo is very small.
I just managed to figure out the menu code and I do not have a remote.
GRaTT
Comment by Jack Suter (chrisjs169) - Tuesday, 07 August 2007, 17:27 GMT
Fixed issue with patch not applying (I think)
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 08 August 2007, 06:11 GMT
just in case
sync to current svn (r14238M-070807) and tested on target.
I removed some of my extra code.
The next patch will move the code to misc.c
Is the small time delay before displaying the original RB logo
an issue.
GRaTT
Comment by Jonathan Gordon (jdgordon) - Wednesday, 08 August 2007, 07:10 GMT
yes, there should be no extra delay if the user doesnt want to set a custom image
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 08 August 2007, 15:01 GMT
The time delay is very small, less than 1 sec.
Due to where the show_logo is run in main.c with
this patch It will have this additional delay compared to
the original. I do not believe I could speed up check before
displaying the RB logo. Is checking a bool faster than checking an int
or the other way around??
I do not want to attempt moving function calls around in main to get
this portion to come earlier.
I do not have 2 targets to test side by side to see if this delay is
"perceived" or real.
Will this be committable to svn or will this very small time delay be to much??
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 08 August 2007, 20:42 GMT
Working with no noticeable delay for non custom splash users.
"Configure Splash Screen" menu under "Display menu"
all show_splash() code in misc.c
Can this get committed now.
GRaTT
Comment by Keith Perri (perrikwp) - Monday, 13 August 2007, 09:03 GMT
I modified the patch so that if the custom splash was smaller
than the LCD screen size than it would center the splash. That
is all that I think is left to do with this patch and I hope that
this will be committed in the next few days. -Keith
Comment by Jack Suter (chrisjs169) - Monday, 13 August 2007, 19:42 GMT
Slight bug that caused malformed patch. Fixed.
Comment by Gerritt Gonzales (GRaTT) - Saturday, 18 August 2007, 17:43 GMT
There is now NO DELAY, NONE, NADA, ZERO for non custom splash users
and the custom splash is a little faster.
I split up my added code in main.c to do this.
Future TODO: support for any name.bmp file
selectable from context menu like the backdrop.
Can This be committed now?
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Sunday, 19 August 2007, 01:51 GMT
On IRC there are concerns of the static array
used for the image buffer.
"on the 320x240 colour targets, this is 150KB (not insignifant)"
The line of code is:
static fb_data save_buffer2[LCD_WIDTH*LCD_HEIGHT];

This array is used to store the image data. I have tried without static
it will not display. Any ideas, anybody, to try and get this size down.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Sunday, 19 August 2007, 08:24 GMT
use /.rockbox/splash.bmp
or
using the context menu select any
bitmap in the /.rockbox/backdrops/
directory to use as your custom splash screen.
You still need to enable/disable it under
settings/General Settings/Display/Configure splash Screen
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Sunday, 19 August 2007, 19:14 GMT
Code clean up and added some code from the backdrop display,
specific for some LCD_DEPTH targets.
When you select a bitmap to display as a splash from the context menu
it will now show you the splash image. If there is an error it
tries /.rockbox/splash.bmp and then the RB logo.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 22 August 2007, 00:31 GMT
A whole new approach with a plugin.
A new autostart menu item (on, off), under Display to autostart a plugin.
If not enabled there is NO DELAY on startup. If enabled
it bypasses the RB logo and tries to start the plugin named
"/.rockbox/rocks/apps/autostart.rock". In this case to display a bitmap
"/.rockbox/splash" by default. If this autostart.rock plugin is called with a bitmap with the
"Open With" menu it writes a conf file in "/.rockbox/rocks/apps/splash.conf"
This file will be used if the default splash.bmp is not present in "/.rockbox", allowing for a
user configurable splash screen without file renaming.
Can it be committed this way??
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 22 August 2007, 01:09 GMT
I need feedback fro disk and flashed DAP owners.
Is there a speed on boot issue??
The last patch is slower in general but
V7.1 is fast.
GRaTT
Comment by Dave Chapman (linuxstb) - Wednesday, 22 August 2007, 10:00 GMT
The concept of configurable splash screens was discussed in IRC on 20 August, starting at around 10.11am.

The general view seems to be that:

a) the purpose of the splash is to display something whilst Rockbox is initialising, and
b) a custom splash by definition can't be displayed until after the majority of this initialisation is done, by which time there is no point in displaying it.

So the conclusion seemed to be that we should make it easier for users to compile their own builds with a custom splash (i.e. change the show_logo() code to better adapt to different sized bitmaps, so users don't have to modify any C code to change the splash .bmp), and add "run-time configurable splash screen" to the "NODO" list - i.e. no patch that implements it will be accepted.

Hopefully I've interpreted the views of other devs correctly - if not, please speak up!
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 22 August 2007, 23:43 GMT
One last patch for anybody interested.
No NOTICEABLE delay on sansa,
the show_logo() is called later but before the tag_cache get initialized.
This means no added delay unless you want a custom splash, the RB logo gets
displayed as before just a little later and ends the same time.
The only added delay is to check a variable(not human noticeable, imho).
and stuff is still happening to "require" a splash if desired.

This only adds a menu option under Display "Configure Splash Screen"
to config the splash screen (off, on, 1-9) and the
show_splash() function in misc.c
(this could even be removed and the splash plugin called instead) slower only to custom splash users.
and two variables, one int splash_timeout and one (char*)splash_file.

The plugin does all the configuration for specific file display, use open with to
display the bitmap and create a splash.cfg file. Run the cfg file that is now highlighted
to load the settings. Use any bitmap(of screen size) anywhere on the DAP. Run the splash plugin
to see what bitmap will be displayed.
Is it required? No
Does it harm? No
Does it look pretty? yes
It allows users more config without compiling which is not user friendly.
Sorry for the rant.
GRaTT
Comment by denis (perldiver) - Thursday, 23 August 2007, 04:52 GMT
this is an amazing patch, thanks!
pity that you still see the solid (rockbox default) color screen right before it though. at least a black screen would be nice.
Comment by Gerritt Gonzales (GRaTT) - Thursday, 23 August 2007, 16:34 GMT
Are you saying you still see the RB logo?? You should not after version V3.
On Sansa I see the boot messages and then the splash no noticeable delay.
A little more work and I could find the clear screen that is called before
the splash and speed it up a little more. The RB logo still ends the same time.
By default the last patch will look for /splash.bmp first if the splash is enabled
for speed before checking the configured screen.
The RB logo is displayed by default. No NOTICEABLE DELAY on sansa.
GRaTT
Comment by denis (perldiver) - Friday, 24 August 2007, 00:22 GMT
not the logo itself, just the solid color screen which is the same color (official rockbox color) as these forums (it comes right after the initial loading bar screen on gigabeat for example).
Comment by Gerritt Gonzales (GRaTT) - Friday, 24 August 2007, 03:09 GMT
I have had a bug for a while now even with clean svn build,
where I do not see this screen. I get a couple (2-5) lines at
the top of the screen all garbled, then the RB logo or custom
splash screen.
When the splash screen was loading slower, previous patches
there was a quick splash of light blue screen, I do not get that now.
Do you still see this blue screen with the RB logo, using the latest patch
or just with the custom splash screen??
GRaTT
Comment by denis (perldiver) - Tuesday, 28 August 2007, 03:10 GMT
all seems great with the latest version!
Comment by Gerritt Gonzales (GRaTT) - Thursday, 30 August 2007, 20:48 GMT
Here is a faster version of V7.1, NO DELAY on sansa, using the context menu.
Updates: Speed of dispay from V7.1 for RB logo and custom splash.
The "set as splash screen" context menu will only display itself
if you have the custom splash enabled.

Splash (anyname.bmp) bitmaps must still be in the backdrops directory.
It will also try /splash.bmp if enabled and an image is not set.
I am trying to either:
1. only show context menu if in backdrops directory. (feedback: good dir for splash files?)
2. enable the anyname.bmp to be anywhere, but I have been unable to get #2 correctly.
With the plugin for settings the anyname.bmp could be anywhere but the two are not compatible.
Unless I could read/write splash_timeout and splash_file from the splash plugin so far unable to do that.
any Ideas/Info welcome.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Friday, 31 August 2007, 00:36 GMT
Fixed bug where splash would not show from backdrops dir.
GRaTT
Comment by Anonymous Submitter - Friday, 31 August 2007, 22:12 GMT
This patch has a conflict with the cmp_resize patch in apps/misc.c (read_bmp_file)...
Comment by Anonymous Submitter - Friday, 31 August 2007, 22:16 GMT
i meant bmp_resize
Comment by Gerritt Gonzales (GRaTT) - Saturday, 01 September 2007, 14:42 GMT
Yes it does conflict with bmp_resize. I have added the
the required lines, commented out in the patch.
Edit the patch to compile with bmp_resize.
GRaTT
Comment by denis (perldiver) - Saturday, 08 September 2007, 16:40 GMT
using the latest version, everything works just fine (.bmp file is in the backdrops folder). however, if i go into plugins/applications/splash i get "error reading bitmap".
Comment by Gerritt Gonzales (GRaTT) - Sunday, 09 September 2007, 04:29 GMT
@perldiver
The splash plugin only works with the autorock.diff version.
The autorock.diff version could also be optimized to display a little faster than the posted version.
The autorock plugin version is the only one that will allow the .bmp file to be anywhere.

Version 7.1... series
Configure the splash using the "Configure splash Screen" from the display menu,
when ON (or 2-9), the context menu "set as Splash Screen" will show for .bmp files.
When OFF no context menu will show to set splash screen.
.bmp files must be in the backdrops dir to display
(I was unable to get the plugin to read rb->global_setting.splash_file,
and unable to use a random dir for setting from the context menu).
It will try /splash.bmp if there is
an error opening the set file and then the RB logo as a last resort.
GRaTT
Comment by Frank Grisafi (JobVanDam) - Tuesday, 09 October 2007, 20:22 GMT
Is it possible to randomly display one of several splashs of my choosing?
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 10 October 2007, 05:44 GMT
This could be done by scanning the backdrops directory
and then choosing a random .bmp file instead of a set file.
It could be another option, I like the idea.
Since this will never be committed another menu option should not matter.
Check back I will implement this when I get time.
GRaTT
Comment by Gerritt Gonzales (GRaTT) - Wednesday, 17 October 2007, 14:23 GMT
Updated for new Theme Setting Menu.
Configure Splash Screen setting now under
Theme Setting.
Gratt
Comment by Travis Tooke (tdtooke) - Saturday, 17 November 2007, 02:13 GMT
Nice patch, everything is working as advertised for me.
Comment by Nikkhil (AceNik) - Sunday, 18 November 2007, 19:56 GMT
hey thanks guys works perfect on my h10 [20GB]
Comment by Nikkhil (AceNik) - Sunday, 18 November 2007, 19:59 GMT
you can also download this image for your splash screens just resize this to you screen size & save as bmp, credits go to jblog -- pijulius

http://solutions-i.org/julius/images/rbss.jpg
Comment by Dave Greenidge (Dave G) - Monday, 19 November 2007, 09:23 GMT
Love this patch. Working fine on my Sansa e200.
Comment by Chris Kagan (KindOfBlues71) - Tuesday, 20 November 2007, 14:21 GMT
The backlight is off while displaying the custom splash screen for the first few seconds then the backlight turns on right before going to the Start Screen on my 30gig 5G iPod Video. I've tried changing the settings of both the custom splash by choosing different lengths of time to display as well as the LCD settings but nothing changes this behavior.
Comment by Chris Kagan (KindOfBlues71) - Tuesday, 20 November 2007, 14:22 GMT
Sorry for the double-post, forgot to say that I'm using tdtooke's Underground custom build based on r15627.
Comment by Dave Greenidge (Dave G) - Tuesday, 27 November 2007, 11:40 GMT
The current build r15833 will no longer compile with this patch...onplay.c declares an undefined instruction "splash"
Comment by Chris Kagan (KindOfBlues71) - Tuesday, 27 November 2007, 13:37 GMT
I hope work continues on this patch so it compiles with current builds, it's awesome!
Comment by Dave Greenidge (Dave G) - Tuesday, 27 November 2007, 13:39 GMT
Sorry my mistake. It's the english lang file which stops compilation of the source.
Comment by Nikkhil (AceNik) - Tuesday, 04 December 2007, 17:12 GMT
synced to rev 15872 , there was a hunk failed at english.lang which is fixed now enjoy c ya
Comment by Gerritt Gonzales (GRaTT) - Sunday, 09 December 2007, 22:10 GMT
Updated to current SVN for changes in list setting code Dec 06 2007.
GRaTT

Comment by Andrew Hall (Fatman) - Tuesday, 08 January 2008, 20:52 GMT
Seems this may be broken in 16027

Getting errors in lang.h
Around line 600 about the definition of LANG_SET_AS_SPLASH
Comment by Gerritt Gonzales (GRaTT) - Sunday, 13 January 2008, 18:00 GMT
updated for revision 16078 Jan 13
This will probably be closed soon as the Devs have no intent on
adding it to SVN.
Testing on the sansa I can not tell the difference between having this patch
compiled in and set to OFF and not having this patch when timing start up times.
If people are interested maybe anythingbutipod will host closed rockbox patches
that people still use and want.
GRaTT

Loading...