changelog of trunk including comments / devtalk - page 16 - General Discussion and Assistance - CHDK Forum

changelog of trunk including comments / devtalk

  • 298 Replies
  • 187159 Views
*

Offline reyalp

  • ******
  • 13443
Re: changelog of trunk including comments / devtalk
« Reply #150 on: 31 / December / 2013, 18:57:46 »
Advertisements
On all my cameras the bottom four bits of get_file_counter() are always 0 so 'fc != last_fc + 1' is always true.

Phil.
Oh good point, I completely forgot about that. I'll take another look.

On your cameras, is the delay always needed, or is it intermittent ?
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: changelog of trunk including comments / devtalk
« Reply #151 on: 31 / December / 2013, 19:00:11 »
On all my cameras the bottom four bits of get_file_counter() are always 0 so 'fc != last_fc + 1' is always true.

Phil.
Oh good point, I completely forgot about that. I'll take another look.

On your cameras, is the delay always needed, or is it intermittent ?

Intermittent, that's why it wasn't noticed at first. Mainly shows when doing bursts.

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)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline reyalp

  • ******
  • 13443
Re: changelog of trunk including comments / devtalk
« Reply #152 on: 31 / December / 2013, 20:40:47 »
In changeset 3299 I updated the code to use get_target_file_num() instead of get_file_counter(), since get_target_file_num should be consistently in the same 1-9999 format across cameras. This will cause the occasional unnecessary wait when the counter wraps, but that shouldn't be a big deal.

I tested it by putting counters in the if and while (see attached patch). Based on this, it looks the file counter is almost never updated when the raw hook is entered on elph130, but updates within 10-20 ms most of the time. This is short enough that it is usually (not always) updated by when the file is opened (due to the hand-off between capt_seq and spytask)
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: changelog of trunk including comments / devtalk
« Reply #153 on: 31 / December / 2013, 23:45:17 »
In changeset 3299 I updated the code to use get_target_file_num() instead of get_file_counter(), since get_target_file_num should be consistently in the same 1-9999 format across cameras. This will cause the occasional unnecessary wait when the counter wraps, but that shouldn't be a big deal.

I tested it by putting counters in the if and while (see attached patch). Based on this, it looks the file counter is almost never updated when the raw hook is entered on elph130, but updates within 10-20 ms most of the time. This is short enough that it is usually (not always) updated by when the file is opened (due to the hand-off between capt_seq and spytask)

Works OK on G1X and SX40.

Interestingly on the G1X, if I take 1 photo with CHDK RAW disabled after starting the camera the file counter seems to always be correct in capt_seq_hook_raw_here. It never increments fn_miss_count.

If I take the first photo after power up with CHDK RAW enabled, the file counter is always incorrect when entering capt_seq_hook_raw_here and fn_miss_count is incremented for every photo.

Strange, need to do some more investigation on this.

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)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline reyalp

  • ******
  • 13443
Re: changelog of trunk including comments / devtalk
« Reply #154 on: 01 / January / 2014, 15:38:32 »
Interestingly on the G1X, if I take 1 photo with CHDK RAW disabled after starting the camera the file counter seems to always be correct in capt_seq_hook_raw_here. It never increments fn_miss_count.
The check code is only entered if CHDK raw is enabled, but the last_fn will get updated...

hmm, that will possibly be to the wrong value, since it doesn't wait. That will through the subsequent checks off. Oops.  :(
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 13443
Re: changelog of trunk including comments / devtalk
« Reply #155 on: 01 / January / 2014, 16:27:17 »
I've removed this, too many corner cases.

I was going to make last_fn only update if raw was enabled, but then it could get off by one when enabling / disabling raw.

A better approach might be to store the file counter when we are sure it's still the old value, before the shot starts or after it is completed. I'm not sure where we can do that though: The override hook or watching get_shooting() in spytask would both break on continuous mode.

For cameras like elph130 that almost always need a 10-20ms sleep, this isn't big deal. If there are cameras that usually don't need it, adding the extra 100ms to every shot is unfortunate.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4426
Re: changelog of trunk including comments / devtalk
« Reply #156 on: 12 / January / 2014, 13:50:32 »
When OPT_FIRMWARE_PC24_CALL is enabled, compilation fails for ports which have function references instead of addresses in stubs_entry_2.S, such as
NHSTUB(Some_Function, hacked_function)

Code: [Select]
-> main.elf
../platform/ixus115_elph100hs/libplatform.a(wrappers.o): In function `MakeAFScan':
wrappers.c:(.text+0xd70): undefined reference to `_MakeAFScan'
collect2: ld returned 1 exit status
make[1]: *** [main.elf] Error 1
make: *** [all-recursive] Error 1
Can this be fixed? I don't know the assembler well enough.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: changelog of trunk including comments / devtalk
« Reply #157 on: 12 / January / 2014, 16:40:28 »
When OPT_FIRMWARE_PC24_CALL is enabled, compilation fails for ports which have function references instead of addresses in stubs_entry_2.S, such as
NHSTUB(Some_Function, hacked_function)

Code: [Select]
-> main.elf
../platform/ixus115_elph100hs/libplatform.a(wrappers.o): In function `MakeAFScan':
wrappers.c:(.text+0xd70): undefined reference to `_MakeAFScan'
collect2: ld returned 1 exit status
make[1]: *** [main.elf] Error 1
make: *** [all-recursive] Error 1
Can this be fixed? I don't know the assembler well enough.

Not sure why it doesn't work; but you could try removing the stub and renaming 'hacked_function' to '_Some_Function' (don't forget the leading '_').

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)
  g7x2 (1.01a, 1.01b, 1.10b)


*

Offline srsa_4c

  • ******
  • 4426
Re: changelog of trunk including comments / devtalk
« Reply #158 on: 12 / January / 2014, 17:15:52 »
try removing the stub and renaming 'hacked_function' to '_Some_Function' (don't forget the leading '_').
That seems to work, thanks. Does this mean that instead of
Code: [Select]
NHSTUB(Some_Function, hacked_function)I can implement
Code: [Select]
_Some_Function() somewhere in /platform/[camera] and it will be used instead of the NHSTUB in the stubs_entry* file? There's one slight problem with this: someone who doesn't know the code, may think that the NHSTUB entry is what's being used.

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: changelog of trunk including comments / devtalk
« Reply #159 on: 12 / January / 2014, 17:24:18 »
try removing the stub and renaming 'hacked_function' to '_Some_Function' (don't forget the leading '_').
That seems to work, thanks. Does this mean that instead of
Code: [Select]
NHSTUB(Some_Function, hacked_function)I can implement
Code: [Select]
_Some_Function() somewhere in /platform/[camera] and it will be used instead of the NHSTUB in the stubs_entry* file? There's one slight problem with this: someone who doesn't know the code, may think that the NHSTUB entry is what's being used.

You should remove or comment out the NHSTUB entry (if you comment it out you can add comments to help others).

Make sure it still works if OPT_FIRMWARE_PC24_CALL is not enabled.

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)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics