Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50625 Library:50543 in /sites/rockbox.org/flyspray/adodb/drivers/adodb-mysqli.inc.php on line 108 FS#6557 : save settings onto disk instead of config block



FS#6557 - save settings onto disk instead of config block

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Sunday, 21 January 2007, 14:22 GMT
Task Type Patches
Category Settings
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This is the first half of my settings and menu recoding effort.
I started from scratch and decided to split it because it was too hard to get all the settings done correctly and keep it in sync.

So, this patch saves all of global_settings to /.rockbox/config.cfg, Once we figure out what we want to do with the status variables we can add that (put them into a bin file on disk or into nvram?)

I had to up the ata thread stack to 3*default because even at 2x it was stkoving if dircache was enabled (now its at 61% after boot, h300) please let me know if this should be changed.

Also, for some reason my h300 stays boosted after boot, but there is no calls to cpu_boost() in the diff, so I'm not sure where that comes in.

Test and let me know what you think.
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Tuesday, 23 January 2007, 13:41 GMT
Reason for closing:  Accepted
Comment by Nils Wallménius (nls) - Sunday, 21 January 2007, 17:55 GMT
I tested this on my h320, I did not have the boost issue but some others.
I attached a version that applies cleanly, the previous one didn't for me
because of some whitespace changes.

1) Some defaults changed
*Volume defaults to 0dB (ouch)
*Battery capacity defaults to 3200mAh (the highest)

2) Resetting settings doesn't clear the config.cfg file but just
clears them, and then loads the old ones on reboot.

3) At least foreground/background color and "show path" setting isn't
correctly saved on shutdown or read on startup, they're always black
and off when powered on again. The path setting is always "off" i the
cfg's i managed to save.

4) Colors do seem to save correctly when "write .cfg" is used
and on shut down, but they are not read correctly resulting
in a black/black theme, not good ;-)

5) I don't know if this is a bug but when I tried to load my old cfg it made
all sorts of strange settings such as display flip turn on and the statusbar
showed "AIFF" and some numbers and the stereo icon from the recording screen
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 04:07 GMT
1) volume is fixed.. forgot a "else" :p
battery cap ill look into <- turns out it got missed in the conversion.... fixed
2) fixed
3) fixed, "show path" saves correclty, but unless you have it set to show full path it shows nothing in the / directory.
4) fixed
5) yeah, im not sure, I had this also, but this should work.. ill keep investigating...

ill post another patch later today
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 05:36 GMT
ok, here is the new patch... hopefully it applies cleanly..

everything in the first comment is fixed.
edit: ok, aparently this partially fails to read config files made by an unpatched rockbox... i dunno why :'(
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 07:10 GMT
oh bloody hell....
i found the problem.. for some reason I thought the bool settings used yes/no instead of on/off :'(
NOW i can start work on the system vars..

like I said before editing my previous comment.... this is now ready to go, so all I need is the go ahead.. (and more testers)
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 08:13 GMT
All hail Linus who found the stupid bug which made the wps file not save..
_This_ one is ready to roll
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 08:24 GMT
forgot to add settings_list.[ch]
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 13:53 GMT
fixed fmr and lng filename settings.
Comment by Marianne Arnold (pixelma) - Monday, 22 January 2007, 14:47 GMT
The latest version (Monday, 22 January 2007, 02:53PM) doesn't compile for my Ondio anymore
(probably missing an #endif, proper 'if' or something similar - sorry couldn't find the corresponding thing myself).
I removed the version I had before, patch applied cleanly but 'make' fails with the following error:

settings.c: In function 'settings_write_config':
settings.c:173: warning: implicit declaration of function 'RGB_UNPACK_RED'
settings.c:174: warning: implicit declaration of function 'RGB_UNPACK_GREEN'
settings.c:175: warning: implicit declaration of function 'RGB_UNPACK_BLUE'
settings.c: In function 'settings_load_config':
settings.c:585: warning: implicit declaration of function 'hex_to_rgb'

../apps/settings.o: In function `_settings_write_config':
settings.c:(.text+0x190): undefined reference to `_RGB_UNPACK_RED'
settings.c:(.text+0x194): undefined reference to `_RGB_UNPACK_GREEN'
settings.c:(.text+0x198): undefined reference to `_RGB_UNPACK_BLUE'
../apps/settings.o: In function `_settings_load_config':
settings.c:(.text+0x878): undefined reference to `_hex_to_rgb'
collect2: ld returned 1 exit status

I don't need no RGB settings... ;)
Comment by Jonathan Gordon (jdgordon) - Monday, 22 January 2007, 20:20 GMT
nuts, i uploaded the wrong version of th patch in my last message (blaming that on the time :p)
Comment by Jonathan Gordon (jdgordon) - Tuesday, 23 January 2007, 05:06 GMT
alrighty, this is the final version, working 100% including nvram settings (targets without nvram have the settings saved into /.rockbox/nvram.bin but the filename can change if its deemed stupid :p )
The only currently know "bug" is that the last dircache size is kept after disabling dircache, Its an easy fix, but if its left it means that a background scan can be done if the dircache_enable setting is turned off then on, so I think its better to leave it.

Also, its not so important, but the ata/mmc thread usage needs to be checked to see we have a nice number. ata usage on my h300 is 69% which is good (had to tripple the default stack size to not get any stkovs), pixelma said it was 45% on her ondio, so both have plenty of room for ata_idle_ callbacks).
ill edit this post once i check the nano usage

once this is commited I'd like to go through settings.[ch] and reorganise them, both are a horrible mishmash and could do with cleaning, but for fear of breaking anything accidently I want to leave that until after this. (Also stripping the status vars out of global_settings will be done then)

I scripted a compile on pretty much all the builds (and sims) and it doesnt break any which is nice...

Comment by Nils Wallménius (nls) - Tuesday, 23 January 2007, 11:46 GMT
Found one more thing, the "resume on startup" setting isn't saved to config.cfg or when
manualy saving a cfg. And it isn't read correctly when loading a cfg with the setting set to on.
Comment by Linus Nielsen Feltzing (linusnielsen) - Tuesday, 23 January 2007, 12:18 GMT
This patch should have the resume problem fixed.