Suggestion for CHDK configuration file saving. - General Discussion and Assistance - CHDK Forum

Suggestion for CHDK configuration file saving.

  • 38 Replies
  • 9923 Views
*

Offline philmoz

  • *****
  • 3179
    • Photos
Suggestion for CHDK configuration file saving.
« on: 07 / April / 2013, 02:55:32 »
Advertisements
Currently the CHDK configuration information is saved to a single file.

This includes:
- OSD settings
- overrides, RAW settings, zebra, histogram, edge overlay etc,
- user menu settings
- etc...

Major system changes can break this file (either intentionally or by accident). This can mean that the old config file needs to be deleted; thus losing all settings.

I'm thinking it might be worth exploring the idea of splitting the settings into different files based on function groupings. For example saving the user menu settings into a separate file.

Any thoughts?
Worth doing, or a waste of time?
If it's worth doing, any ideas on how best to group the settings?

The changes would not be substantial to CHDK - the Conf structure would remain as is. It just needs multiple 'conf_info' structures, one for each file.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Online reyalp

  • ******
  • 12742
Re: Suggestion for CHDK configuration file saving.
« Reply #1 on: 07 / April / 2013, 03:22:00 »
My initial reaction is that it seems like more complexity for not very much gain.

It doesn't really solve the problem, in the sense that if an incompatible change is made, you still lose some group of settings. This doesn't seem particularly intuitive for end users.

Lots of small files is quite inefficient on SD cards, so loading might be noticeably slower.

Lots of files makes it harder to have two parallel versions, though you could have version specific directories I guess.

If you need to reset the config, you'd have to either guess which file needs to be deleted, or delete them all.

If we want to make configs migrate between versions, some alternatives would be
- include code (perhaps in module) that understands the previous version and migrates it.
- switch to a more flexible (probably text based)  format
- a script to export / import using set_config_value.
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1271
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Suggestion for CHDK configuration file saving.
« Reply #2 on: 07 / April / 2013, 04:44:15 »
A collection of configuration files is not mine. I use a script to save the OSD positions and the menu items.

=> http://trac.assembla.com/chdkde/browser/scripts/conf_rw/conf_rw.lua

An enhancement of the configuration would be a human-readable configuration file like an ini file.

msl
CHDK-DE:  CHDK-DE links

Re: Suggestion for CHDK configuration file saving.
« Reply #3 on: 07 / April / 2013, 07:04:42 »
Major system changes can break this file (either intentionally or by accident). This can mean that the old config file needs to be deleted; thus losing all settings.
I've taken to keeping "good" CCHDKx.CFG files for my cameras on the PC and downloading them over USB with chdkptp as part of the script I used when I update the CHDK image.  As mentioned, major system changes break this although its not a frequent thing.

Quote
I'm thinking it might be worth exploring the idea of splitting the settings into different files based on function groupings. For example saving the user menu settings into a separate file. Any thoughts?
From my perspective, the only defaults that I really care about are the OSD settings, turning off the Help popup, and (now) disabling shortcuts.  Of those, only the OSD setting (screen positions) takes enough time to setup that it matters.

I think I've mused before that allowing the icon screen positions to be camera specific would be nice. That way the person doing to the port gets to work around Canon icons.  But I guess that's really off-topic here.

Quote
Worth doing, or a waste of time? If it's worth doing, any ideas on how best to group the settings?
On a 1 to 10 in value,  I'd rate this a 4.   Per camera icon settings or some of the stuff tsvstar did with his UI functions (like user menu script activation rather than just setting the current one) might be more interesting for example.

On a related note,  something that might be more valuable, would be to add some sort of version ID / CRC / checksum magic number thing to the CFG file (or files).  That way CHDK would not load an incompatible CFG file after an incompatible rev - just revert to the defaults from the build?

Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline c10ud

  • ***
  • 245
Re: Suggestion for CHDK configuration file saving.
« Reply #4 on: 07 / April / 2013, 10:44:02 »
human readable config is the most interesting idea: it probably solves the problem of configuration/camera versioning and allows, well, human readable chdk config

first thing google suggests here is: http://code.google.com/p/inih/

Re: Suggestion for CHDK configuration file saving.
« Reply #5 on: 07 / April / 2013, 10:48:27 »
human readable config is the most interesting idea: it probably solves the problem of configuration/camera versioning and allows, well, human readable chdk config
And then there is always this :  http://zenoshrdlu.com/cfgedit/chdkcfgedit.html

David does a pretty good job of keeping it current.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1271
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: Suggestion for CHDK configuration file saving.
« Reply #6 on: 07 / April / 2013, 11:23:40 »
That's right. Thank you zeno. This editor is a nice program, if you like java. But that's not the topic.

The question was to improve the configuration. I never understood the kryptic style of the configuration file. A human readable file does not require a special editor.

Another topic are the default positions of the visible OSD elements (battery, sd card capacity, time). They come from 2007/2008. Here we need a recent solution. A camera dependent solution would be nice, but it makes a lot of damn work.

msl
CHDK-DE:  CHDK-DE links

Re: Suggestion for CHDK configuration file saving.
« Reply #7 on: 07 / April / 2013, 11:31:51 »
Another topic are the default positions of the visible OSD elements (battery, sd card capacity, time). They come from 2007/2008. Here we need a recent solution. A camera dependent solution would be nice, but it makes a lot of damn work.
Once there is a method to define on a per camera basis,  then its just a question of which CHDK users care enough to provide a patch.  Older cameras and those with few CHDK users just get stuck with the original setup - no harm done.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Online reyalp

  • ******
  • 12742
Re: Suggestion for CHDK configuration file saving.
« Reply #8 on: 07 / April / 2013, 17:24:08 »
Semi related though I've had about making working with set_config_value easier

1) Move the CONF_INFO lines lines to a standalone file, which would be included in conf.c
2) use sed to scrape name, number and type to a lua table
3) write a lua module so you can do stuff like
conf=require'conf'
conf.save_raw = 1
conf.batt_icon_pos = { 5, 10 }
etc.

This doesn't exactly solve the problem, but it would make it easier to put your favorite config values in a human editable / readable format and load them on demand. Given the names and types, dumping them out to a lua file would also be possible.

I still think moving the actual conf to a human readable format would be a big win, even at the cost of some efficiency.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3179
    • Photos
Re: Suggestion for CHDK configuration file saving.
« Reply #9 on: 12 / April / 2013, 20:57:01 »
I've had some more thoughts on this:

Using a human readable text file would potentially need a large chunk of memory (for the names or hashes of the config items). It will also slow down the load/save process (larger config file and search time). The config file gets saved fairly often at the moment so the logic around this would need optimisation.

Splitting the current binary file into three files still makes sense to me. The split would be:
- OSD & menu settings (position, colors, etc), excluding user menu
- User menu
- Everything else.

The OSD, menu settings and user menu are the most painful to redo, and the least likely to be affected by changes in the system (IMO).

Having a separate user menu file also opens up the option to have multiple user menu configurations saved with the user being able to switch between them.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

 

Related Topics