Improving CHDK ND filter support

  • 108 Replies
  • 32410 Views
*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #90 on: 11 / July / 2018, 02:30:05 »
Advertisements
The override did not have any effect. In and Out are the same.
Thanks. Maybe it's just leftover code on those cams.

I noticed that sx10 has two sets of ND functions in the canon firmware. CHDK uses TurnOnNdFilter / TurnOffNdFilter which call into NdActuator.c functions

PutInNdFilter / PutOutNdFilter also exist, but call IrisController.c functions.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 3725
Re: Improving CHDK ND filter support
« Reply #91 on: 11 / July / 2018, 15:53:48 »
the code found for earlier cams like ixus700_sd500 seems quite different.
Indeed. The oldest cam I looked at was the a410, looks like older ones have a version of that IrisSpecification.c routine that does not call get_nd_value - those hits are incorrect.

*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #92 on: 15 / July / 2018, 02:10:29 »
ixus40_sd300, ixus50_sd400, ixus700_sd500 and s2is have the NdActuator.* eventprocs

I think GetNdFilterDeltaEvAdjustValue is the ND value and GetNdFilterDeltaEv is the current value.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 3725
Re: Improving CHDK ND filter support
« Reply #93 on: 15 / July / 2018, 12:47:26 »
I think GetNdFilterDeltaEvAdjustValue is the ND value and GetNdFilterDeltaEv is the current value.
Confirmed on Ixus40 (GetNdFilterDeltaEvAdjustValue is constant 189, GetNdFilterDeltaEv is 0 when ND out, 189 when in).

edit:
I'll continue working on the rest of the stuff mentioned here, soon.
« Last Edit: 15 / July / 2018, 17:01:19 by srsa_4c »


*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #94 on: 15 / July / 2018, 18:02:34 »
I'll continue working on the rest of the stuff mentioned here, soon.
Thanks. I'm happy to have your help with this, but if you'd rather work on other stuff, I can probably take it from here.

My goal is to end up with script functions
1) get_nd_value - same as the function we've been discussing. The main thing left is finding a suitable match for cameras with both iris and ND. Adding sigfinder detection of what a camera has may be useful to decide which to use, as well as flagging possible errors in ports. I started this in finsig_thumb2, but all the d6 cameras are iris only or both so it doesn't cover the ND only case.

2) determine whether ND is currently in or out. I'm not sure if this is better as a boolean, or something like GetNdFilterDeltaEv, or both. With get_nd_value it's pretty trivial to go from one to the other, so in terms of finding firmware functions, whichever is easiest is fine.
Don't forget what the H stands for.

*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #95 on: 15 / July / 2018, 19:20:22 »
The main thing left is finding a suitable match for cameras with both iris and ND.
On g7x, g16, g12 and g9,
PutInNdFilter -> first sub called after ClearEventFlag -> first call is get_nd_value
This looks like it should cover most "both" cameras. g7 (the old vxworks one, not g7x) looks a bit different.

On cameras with an iris where ND functions control the iris, the call where get_nd_value would be is GetUsableAvRange. Many ND-only cameras (elph180 and d10 at least) also call GetUsableAvRange in this position.

edit:
In trunk 5077, I added a match based on PutInNdFilter for digic 6 iris + ND cams. I also added GetUsableAvRange to the CSVs, because it's useful to see in disassembly.
« Last Edit: 15 / July / 2018, 21:28:13 by reyalp »
Don't forget what the H stands for.

Re: Improving CHDK ND filter support
« Reply #96 on: 15 / July / 2018, 23:46:38 »
On g7x, g16, g12 and g9, PutInNdFilter -> first sub called after ClearEventFlag -> first call is get_nd_value
I've only been half way paying attention to this (sorry) but I can of course make the G16 changes and test. Just need to figure out what you've done.

What about the G10? 

Or the S90-S110 series cams that have iris and ND filter?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #97 on: 16 / July / 2018, 00:39:39 »
I've only been half way paying attention to this (sorry) but I can of course make the G16 changes and test. Just need to figure out what you've done.
At the moment, I'm trying to find code paths that are relatively easy to add to the sig finder. I figure if g9 and g7x and a few cameras released in between obviously the same code, others in the same time span probably do as well.

You could check that the get_nd_value added in 5077 for g16 returns something that looks like an ND value (using call_func_ptr with the address from stubs_entry), but I'm pretty confident the match I added is right.
Don't forget what the H stands for.


*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #98 on: 16 / July / 2018, 01:58:42 »
In trunk 5079, I added a finsig_thumb2 match for get_current_nd_value (aka GetNdFilterDeltaEv). This seemed easier to match than the one that just returns the in/out state.

This again is only valid iris + ND cams, but the logic should be valid for pre-digic 6.

Addresses below are from g7x 100d

0xfc4f029b ShowCurrentExp_FW -> fc4f028c -> fc4f025c
fc4f025c calls fc321abe, which fills an array of shorts with exposure values, and then prints them with a string like "Exp  Av %d, Tv %d, Gain %d\n"

The function fc321abe that fills the array calls a veneer of the function that gets the current ND value and stores the result in offset 8.  On no-ND and ND-only cameras, there is a function that returns 0 instead of the veneer.
Don't forget what the H stands for.

*

Online reyalp

  • ******
  • 11583
Re: Improving CHDK ND filter support
« Reply #99 on: 23 / July / 2018, 00:29:56 »
Here's a slight update to srsa_4c's patch posted earlier. It just uses the eventprocs to find get_nd_value and get_nd_current_value on the old vxworks cams

It looks like GetCurrentAvValue should be usable to find get_nd_current_value on later ND-only cams, but there needs to be a way to avoid bogus results on cameras that have an iris.
Don't forget what the H stands for.

 

Related Topics