Loading CHDK in AgentRAM for a few more cameras - General Discussion and Assistance - CHDK Forum

Loading CHDK in AgentRAM for a few more cameras

  • 73 Replies
  • 19914 Views
*

Offline koshy

  • *****
  • 1096
Loading CHDK in AgentRAM for a few more cameras
« on: 15 / October / 2014, 10:35:44 »
Advertisements
Nafraf and I discussed loading CHDK in ARAM and I'm starting this thread for any work that might arise from that discussion.

There currently is no a list of cameras where CHDK is loaded in ARAM, but as nafraf pointed out and executed it is possible to check them using some linux commands: "grep OPT_CHDK_IN_ARAM=1 platform/*/sub/*/makefile.inc | tr "//" " " | awk '{ print $2 }' | uniq"
Here is the list of cameras where OPT_CHDK_IN_ARAM=1 is used in makefile.inc:

a1000
a1100
a2000
a3100
a470
a495
a800
d10
g12
ixus100_sd780
ixus115_elph100hs
ixus310_elph500hs
ixus80_sd1100
ixus85_sd770
ixus870_sd880
ixus90_sd790
ixus970_sd890
sx110is
sx20
sx220hs
sx230hs


If length = 0x32000 in this table:  http://chdk.wikia.com/wiki/User:Srsa_4c/AdditionAgentRAM_%28table%29 it is possible to load CHDK in ARAM.

The 18 Cameras I have and can test where that applies:
For each of which I'll eventually get the result of CHDKPTP =return get_meminfo'system'.free_block_max_size

a1200   100C   509440
a2100   100A   780664 => 973008
a3200   100A   533232 => 269912??
a480   100B   495416 => 697616
a490   100E   197144 => 410456
a580   101B   595936 => 683544
a590   101B   587544
ixus1000_sd4500   100D   428072 => 483616 still working on other issues
ixus105_sd1300   100D   699432 => 912848
ixus110_sd960   101D   504744 => 446680??
ixus120_sd940   103B   309400 => 460896
ixus130_sd1400   100C   410416 => 462568
ixus200_sd980   101C   442848 => 562712
ixus95_sd1200   100C   691312 => 887432
ixus980_sd990   100E   1172872 => 1252648
sx10   102B   622904 => 702552
sx120is   100B   846624 => 1064112
sx200is   100D   366800 => 624016

Further Cameras where that applies which I currently don't have:

a2200
a3000
a3300
g10
g11
ixus220_elph300hs
ixus300_sd4000
s90
s95
sx130is
sx1
sx210is
« Last Edit: 31 / October / 2014, 16:13:40 by koshy »
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #1 on: 15 / October / 2014, 11:29:14 »
For cameras that have adequate RAM already, is there any advantage to doing this?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline ADamb

  • **
  • 65
  • sx200is
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #2 on: 15 / October / 2014, 13:56:14 »
Question should be how much allocatable ram is needed for CHDK?
Anyway, here is patch for sx200is, tested.
I left both ARAM_MALLOC and EXTMEM_MALLOC, not much left of ARAM after loading CHDK.
SX200 IS-100C

*

Offline koshy

  • *****
  • 1096
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #3 on: 15 / October / 2014, 14:37:45 »
For cameras that have adequate RAM already, is there any advantage to doing this?
Who / what defines "adequate RAM"... More RAM is something that will never hurt unless one believes 640 kB ought to be enough for anybody and I think that one sorted itself out ;-) Seriously though testing my 18 cams for actual memory availability in the current trunk builds was the first thing I intended to do on this.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #4 on: 15 / October / 2014, 15:23:32 »
If you read through the agent_ram thread, it's not clear that this increases memory for scripting much although it does help with normal picture taking and storage on low memory cameras. There are also some cautions about not trying to universally apply this. There is also a philmoz post about how to test that the memory is not used. My point was that moving CHDK to agent_ram may have risks that don't need to be taken if they don't solve a specific problem beyond "more is better"
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline koshy

  • *****
  • 1096
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #5 on: 15 / October / 2014, 20:29:18 »
Verbose memory check results for A series of cameras:

For each the results of these two commands:
Code: [Select]
=return get_meminfo()
=return get_meminfo'system'.free_block_max_size


A480:
Code: [Select]
2:return:table:{chdk_start=1928652,free_size=498056,chdk_size=159816,allocated_size=837648,free_block_count=20,name="combined",allocated_count=1418,chdk_malloc=true,free_block_max_size=496256,allocated_peak=898448,total_size=1347200,}
3:return:495416

A490:
Code: [Select]
2:return:table:{chdk_start=2219348,free_size=200160,chdk_size=152560,allocated_size=995728,free_block_count=13,name="combined",allocated_count=1429,chdk_malloc=true,free_block_max_size=197992,allocated_peak=1061904,total_size=1195888,}
3:return:197144

A580
Code: [Select]
2:return:table:{chdk_start=1829956,free_size=598560,chdk_size=161744,allocated_size=1119736,free_block_count=21,name="combined",allocated_count=1515,chdk_malloc=true,free_block_max_size=596584,allocated_peak=1180528,total_size=1730576,}
3:return:595936

A590
Code: [Select]
5:return:table:{chdk_start=1835388,free_size=590120,chdk_size=161164,allocated_size=1125664,free_block_count=18,name="combined",allocated_count=1548,chdk_malloc=true,free_block_max_size=588352,allocated_peak=1183624,total_size=1728304,}
6:return:587544

A1200
Code: [Select]
6:return:table:{chdk_start=63752988,free_size=757632,chdk_size=152576,allocated_size=1222824,free_block_count=11,name="combined",allocated_count=1490,chdk_malloc=true,free_block_max_size=509440,allocated_peak=1328168,total_size=1980568,}
7:return:509440

A2100
Code: [Select]
6:return:table:{chdk_start=2027276,free_size=985616,chdk_size=150912,allocated_size=912016,free_block_count=15,name="combined",allocated_count=1450,chdk_malloc=true,free_block_max_size=973008,allocated_peak=970304,total_size=1902536,}
7:return:973008

A3200
Code: [Select]
5:return:table:{chdk_start=63752052,free_size=751024,chdk_size=151648,allocated_size=1224416,free_block_count=7,name="combined",allocated_count=1490,chdk_malloc=true,free_block_max_size=533232,allocated_peak=1328280,total_size=1975528,}
6:return:533232
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline koshy

  • *****
  • 1096
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #6 on: 15 / October / 2014, 21:02:20 »
Verbose memory check results for IXUS series of cameras:

For each the results of these two commands:
Code: [Select]
=return get_meminfo()
=return get_meminfo'system'.free_block_max_size


IXUS 95
Code: [Select]
3:return:table:{chdk_start=2263572,free_size=692272,chdk_size=150724,allocated_size=1010440,free_block_count=11,name="combined",allocated_count=1455,chdk_malloc=true,free_block_max_size=691776,allocated_peak=1066808,total_size=1714432,}
4:return:691312

IXUS 105
Code: [Select]
5:return:table:{chdk_start=2279548,free_size=700608,chdk_size=262144,allocated_size=996272,free_block_count=14,name="combined",allocated_count=1453,chdk_malloc=true,free_block_max_size=700112,allocated_peak=1056096,total_size=1696880,}
6:return:699432

IXUS 110
Code: [Select]
12:return:table:{chdk_start=62581644,free_size=1771184,chdk_size=153200,allocated_size=1388336,free_block_count=10,name="combined",allocated_count=1474,chdk_malloc=true,free_block_max_size=1264648,allocated_peak=1455672,total_size=3164264,}
13:return:504744

IXUS 120
Code: [Select]
11:return:table:{chdk_start=2628772,free_size=312256,chdk_size=151336,allocated_size=1329056,free_block_count=18,name="combined",allocated_count=1473,chdk_malloc=true,free_block_max_size=309992,allocated_peak=1391736,total_size=1641312,}
12:return:309400

IXUS 130
Code: [Select]
6:return:table:{chdk_start=2789900,free_size=411592,chdk_size=150864,allocated_size=1413480,free_block_count=11,name="combined",allocated_count=1478,chdk_malloc=true,free_block_max_size=411096,allocated_peak=1473432,total_size=1825072,}
7:return:410416

IXUS 200
Code: [Select]
2:return:table:{chdk_start=2760076,free_size=445864,chdk_size=161484,allocated_size=1352104,free_block_count=13,name="combined",allocated_count=1467,chdk_malloc=true,free_block_max_size=443696,allocated_peak=1416504,total_size=1797968,}
3:return:442848

IXUS 980
Code: [Select]
3:return:table:{chdk_start=2297812,free_size=1175352,chdk_size=151312,allocated_size=1321000,free_block_count=22,name="combined",allocated_count=1557,chdk_malloc=true,free_block_max_size=1173544,allocated_peak=1380464,total_size=2508976,}
4:return:1172872

IXUS 1000
Code: [Select]
2:return:table:{chdk_start=3034684,free_size=431088,chdk_size=162920,allocated_size=1499528,free_block_count=13,name="combined",allocated_count=1654,chdk_malloc=true,free_block_max_size=428920,allocated_peak=1565200,total_size=1930616,}
> =return get_meminfo'system'.free_block_max_size
3:return:428072
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline koshy

  • *****
  • 1096
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #7 on: 15 / October / 2014, 21:17:58 »
Verbose memory check results for SX series of cameras:

For each the results of these two commands:
Code: [Select]
=return get_meminfo()
=return get_meminfo'system'.free_block_max_size


SX10
Code: [Select]
4:return:table:{chdk_start=2061348,free_size=623784,chdk_size=160396,allocated_size=1322760,free_block_count=14,name="combined",allocated_count=1565,chdk_malloc=true,free_block_max_size=623304,allocated_peak=1381576,total_size=1959168,}
5:return:622904

SX120
Code: [Select]
4:return:table:{chdk_start=2097540,free_size=1499,chdk_size=162916,allocated_size=1835408,free_block_count=847040,name="combined",allocated_count=1047648,chdk_malloc=true,free_block_max_size=848928,allocated_peak=986480,total_size=3089576,}
5:return:846624

SX220
Code: [Select]
6:return:table:{chdk_start=2578452,free_size=367968,chdk_size=162260,allocated_size=1353704,free_block_count=20,name="combined",allocated_count=1478,chdk_malloc=true,free_block_max_size=367640,allocated_peak=1411888,total_size=1733648,}
7:return:366800
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline koshy

  • *****
  • 1096
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #8 on: 15 / October / 2014, 21:20:48 »
On the two side note items here is a screenshot from SX120 and the ROMLOG for the crash with the IXUS 1000 when switching to REC mode in CHDKPTP.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline reyalp

  • ******
  • 14125
Re: Loading CHDK in AgentRAM for a few more cameras
« Reply #9 on: 15 / October / 2014, 22:05:05 »
My point was that moving CHDK to agent_ram may have risks that don't need to be taken if they don't solve a specific problem beyond "more is better"
Given the number of cameras it has been enabled for without negative side effects, I'd expect the odds of this to be pretty low. I would enabled it on any camera that can be tested, although I wouldn't expend a lot of effort doing it for ones that already have lots of free ram.

There isn't really an obvious cut-off for "enough" free RAM. Generally 500k or more should be fine, but timelapses that take a lot of images may benefit from more.

Another thing to note is that EXMEM causes problems on some cameras, so enabling ARAM may let you disable exmem.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal