• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Settings
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by jdgordon - 2007-01-21

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

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.

Closed by  jdgordon
2007-01-23 13:41
Reason for closing:  Accepted
nls commented on 2007-01-21 17:55

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

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

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 :’(

oh bloody hell….
i found the problem.. for some reason I thought the bool settings used yes/no instead of on/off :’(
fixed… 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)

All hail Linus who found the stupid bug which made the wps file not save..
_This_ one is ready to roll

forgot to add settings_list.[ch]

fixed fmr and lng filename settings.

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+0×190): undefined reference to `_RGB_UNPACK_RED’ settings.c:(.text+0×194): undefined reference to `_RGB_UNPACK_GREEN’ settings.c:(.text+0×198): undefined reference to `_RGB_UNPACK_BLUE’ ../apps/settings.o: In function `_settings_load_config’:
settings.c:(.text+0×878): undefined reference to `_hex_to_rgb’ collect2: ld returned 1 exit status

I don’t need no RGB settings… ;)

nuts, i uploaded the wrong version of th patch in my last message (blaming that on the time :p)

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…

nls commented on 2007-01-23 11:46

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.

Project Manager

This patch should have the resume problem fixed.


Available keyboard shortcuts


Task Details

Task Editing