Improving CHDK ND filter support - page 11 - General Discussion and Assistance - CHDK Forum

Improving CHDK ND filter support

  • 234 Replies
  • 109977 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: Improving CHDK ND filter support
« Reply #100 on: 23 / July / 2018, 17:40:13 »
Advertisements
On g7x, g16, g12 and g9,
PutInNdFilter -> first sub called after ClearEventFlag -> first call is get_nd_value
I added detection for this (DryOS only), but now I think the method I used is too simplistic and can't handle the GetUsableAvRange variant - starts to look like custom matching functions are needed (method 22).
Code: [Select]
Index: tools/finsig_dryos.c
===================================================================
--- tools/finsig_dryos.c (revision 5084)
+++ tools/finsig_dryos.c (working copy)
@@ -335,6 +335,8 @@
     { "exmem_alloc" },
     { "exmem_free", OPTIONAL|LIST_ALWAYS },
     { "free" },
+    { "_PutInNdFilter", UNUSED|DONT_EXPORT }, // helper
+    { "get_nd_value", OPTIONAL },
 
     { "kbd_p1_f" },
     { "kbd_p1_f_cont" },
@@ -2092,10 +2094,15 @@
     { 23, "get_string_by_id", "NoError", 16,                                    99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     -2 },
     { 23, "EnableHDMIPower", "HDMIConnectCnt", 9,                               99,     99,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,},
     { 23, "DisableHDMIPower", "HDMIConnectCnt", 9,                              99,     99,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,},
+    { 23, "get_nd_value", "IrisSpecification.c", 25,                            -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,},
 
     //                                                                           R20     R23     R31     R39     R43     R45     R47     R49     R50     R51     R52     R54     R55     R57     R58     R59
     { 24, "get_string_by_id", "StringID[%d] is not installed!!\n", 64,           0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0x0000, 0x0000, 0x0000, 0xf000 },
 
+    //                                                                           R20     R23     R31     R39     R43     R45     R47     R49     R50     R51     R52     R54     R55     R57     R58     R59
+    { 25, "_PutInNdFilter", "PutInNdFilter_FW", 0,                                0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082,  0x082 },
+    { 25, "get_nd_value", "_PutInNdFilter", 0,                                    0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041,  0x041 },
+
     { 0, 0, 0, 0 }
 };
 
@@ -3008,6 +3015,39 @@
     return 0;
 }
 
+// Sig pattern:
+//      Func is Nth B/BL from previous found func
+// dryos_offset to be encoded as: 0xLLN
+// search distance is LL instructions
+int find_strsig25(firmware *fw, string_sig *sig)
+{
+    int ofst = dryos_offset(fw, sig);
+    if (ofst < 0) return 0;
+    int dist = (ofst&0xff0)>>4;
+    ofst &= 0xf;
+    int j = get_saved_sig(fw,sig->ev_name);
+    if (j >= 0)
+    {
+        if (func_names[j].val != 0)
+        {
+            int k = adr2idx(fw,func_names[j].val);
+            k = find_Nth_inst(fw,isBorBL,k,dist,ofst);
+            if (k != -1)
+            {
+                uint32_t fadr = followBranch(fw, idx2adr(fw,k), 0x01000001);
+                if (fadr != idx2adr(fw,k))
+                {
+                    fwAddMatch(fw,fadr,32,0,125);
+                    return 1;
+                }
+            }
+        }
+    }
+
+    return 0;
+}
+
+
 // Call processing function based on type
 int find_strsig(firmware *fw, string_sig *sig)
 {
@@ -3044,6 +3084,7 @@
     case 22:    return ((int (*)(firmware*))(sig->ev_name))(fw);
     case 23:    return fw_string_process(fw, sig, match_strsig23, 1);
     case 24:    return fw_string_process(fw, sig, match_strsig24, 0);
+    case 25:    return find_strsig25(fw, sig);
     }
 
     return 0;
Index: tools/finsig_vxworks.c
===================================================================
--- tools/finsig_vxworks.c (revision 5084)
+++ tools/finsig_vxworks.c (working copy)
@@ -338,6 +338,8 @@
     { "exmem_alloc" },
     { "exmem_free", OPTIONAL },
     { "free" },
+    { "get_nd_value", OPTIONAL },
+    { "get_current_nd_value", OPTIONAL },
 
     { "kbd_p1_f" },
     { "kbd_p1_f_cont" },
@@ -1066,6 +1068,8 @@
     {20, "MFOff", "MFOff_FW", 1 },
     {20, "GetAdChValue", "GetAdChValue_FW", 0 },
     {20, "HwOcReadICAPCounter", "GetCurrentMachineTime", 3 },
+    {20, "get_nd_value", "NdActuator.GetNdFilterDeltaEvAdjustValue_FW", 0 }, // old vx
+    {20, "get_current_nd_value", "NdActuator.GetNdFilterDeltaEv_FW", 0 }, // old vx
 
     { 1, "ExportToEventProcedure_FW", "ExportToEventProcedure", 1 },
     { 1, "AllocateMemory", "AllocateMemory", 1 },
@@ -1312,6 +1316,7 @@
     { 15, "wrapped_malloc", "\n malloc error \n", 0x01000001,                    0x0010 },
     { 15, "IsStrobeChargeCompleted", "\r\nCaptSeq::ChargeNotCompleted!!", 0x01000001 }, // ixus30, 40
     { 15, "get_resource_pointer", "Not found icon resource.\r\n", 0x01000001,    0x0008 },
+    { 15, "get_nd_value", "IrisSpecification.c", 0x01000001,                     0x0014 },
 
     { 16, "DeleteDirectory_Fut", (char*)DeleteDirectory_Fut_test, 0x01000001 },
     { 16, "MakeDirectory_Fut", (char*)MakeDirectory_Fut_test, 0x01000001 },

*

Offline srsa_4c

  • ******
  • 4451
Re: Improving CHDK ND filter support
« Reply #101 on: 27 / July / 2018, 16:32:20 »
PutInNdFilter based get_nd_value detection (using a custom routine) plus GetUsableAvRange detection for newer DryOS cams (result untested).
Code: [Select]
Index: tools/finsig_dryos.c
===================================================================
--- tools/finsig_dryos.c (revision 5084)
+++ tools/finsig_dryos.c (working copy)
@@ -335,6 +335,8 @@
     { "exmem_alloc" },
     { "exmem_free", OPTIONAL|LIST_ALWAYS },
     { "free" },
+    { "get_nd_value", OPTIONAL },
+    { "GetUsableAvRange", OPTIONAL|UNUSED },
 
     { "kbd_p1_f" },
     { "kbd_p1_f_cont" },
@@ -1542,6 +1544,49 @@
     return 0;
 }
 
+int find_get_nd_value(firmware *fw)
+{
+
+    int f1 = get_saved_sig(fw,"PutInNdFilter_FW");
+    int f2 = get_saved_sig(fw,"ClearEventFlag");
+    int f3 = find_saved_sig("get_nd_value");
+    if ((f3 >= 0) && (func_names[f3].val != 0)) // return if func already found
+        return 0;
+    if ((f1 < 0) || (f2 < 0))
+        return 0;
+    f1 = adr2idx(fw, func_names[f1].val);
+    f2 = adr2idx(fw, func_names[f2].val);
+    int k1 = find_Nth_inst(fw,isBL,f1,10,2);
+    int k2 = find_inst(fw,isBL,f1,6);
+    if ((k1 == -1) || (k2 == -1))
+        return 0;
+    // note for the following line: same address can have different index on cams with multiple fw regions
+    // followBranch2 is for veneer support (s110)
+    if ( followBranch2(fw,idx2adr(fw,k2),0x01000001) != idx2adr(fw,f2) ) // ClearEventFlag?
+        return 0;
+    k1 = idxFollowBranch(fw,k1,0x01000001); // PutInNdFilter_low
+    k2 = find_inst(fw,isBL,k1,6);
+    if (k2 == -1)
+        return 0;
+    // check for signs of other functions (GetUsableAvRange, etc)
+    int k3;
+    int k4 = 0;
+    for (k3=k2-1;k3>k2-3;k3--)
+    {
+        uint32_t v1 = fwval(fw, k3);
+        k4 += (v1 == 0xe28d0004)?1:(v1 == 0xe1a0100d)?4: // add r0,sp,#4 ; mov r1,sp - GetUsableAvRange
+              ((v1 & 0xffffff00) == 0xe3a00000)?0x10:0; // mov r0, #small_imm - sx400
+    }
+    if (k4 == 0) // probably get_nd_value
+    {
+        k2 = idxFollowBranch(fw,k2,0x01000001);
+        fwAddMatch(fw,idx2adr(fw,k2),32,0,122);
+        return 1;
+    }
+
+    return 0;
+}
+
 int find_getcurrentmachinetime(firmware *fw)
 {
     int f1 = get_saved_sig(fw,"SetHPTimerAfterTimeout");
@@ -2086,6 +2131,7 @@
     { 22, "SetHPTimerAfterTimeout", (char*)find_sethptimeraftertimeout, 0},
     { 22, "GetCurrentMachineTime", (char*)find_getcurrentmachinetime, 0},
     { 22, "get_self_task_errno_pointer", (char*)find_get_self_task_errno_pointer, 0},
+    { 22, "get_nd_value", (char*)find_get_nd_value, 0},
 
     //                                                                           R20     R23     R31     R39     R43     R45     R47     R49     R50     R51     R52     R54     R55     R57     R58     R59
     { 23, "UnregisterInterruptHandler", "HeadInterrupt1", 76,                    1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1 },
@@ -2092,6 +2138,8 @@
     { 23, "get_string_by_id", "NoError", 16,                                    99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     99,     -2 },
     { 23, "EnableHDMIPower", "HDMIConnectCnt", 9,                               99,     99,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,},
     { 23, "DisableHDMIPower", "HDMIConnectCnt", 9,                              99,     99,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,      3,},
+    { 23, "get_nd_value", "IrisSpecification.c", 25,                            -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,     -1,},
+    { 23, "GetUsableAvRange", "[AE]Prog Line Error!\n", 20,                      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,      1,},
 
     //                                                                           R20     R23     R31     R39     R43     R45     R47     R49     R50     R51     R52     R54     R55     R57     R58     R59
     { 24, "get_string_by_id", "StringID[%d] is not installed!!\n", 64,           0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0xf000, 0x0000, 0x0000, 0x0000, 0xf000 },
Index: tools/finsig_vxworks.c
===================================================================
--- tools/finsig_vxworks.c (revision 5084)
+++ tools/finsig_vxworks.c (working copy)
@@ -338,6 +338,8 @@
     { "exmem_alloc" },
     { "exmem_free", OPTIONAL },
     { "free" },
+    { "get_nd_value", OPTIONAL },
+    { "get_current_nd_value", OPTIONAL },
 
     { "kbd_p1_f" },
     { "kbd_p1_f_cont" },
@@ -1066,6 +1068,8 @@
     {20, "MFOff", "MFOff_FW", 1 },
     {20, "GetAdChValue", "GetAdChValue_FW", 0 },
     {20, "HwOcReadICAPCounter", "GetCurrentMachineTime", 3 },
+    {20, "get_nd_value", "NdActuator.GetNdFilterDeltaEvAdjustValue_FW", 0 }, // old vx
+    {20, "get_current_nd_value", "NdActuator.GetNdFilterDeltaEv_FW", 0 }, // old vx
 
     { 1, "ExportToEventProcedure_FW", "ExportToEventProcedure", 1 },
     { 1, "AllocateMemory", "AllocateMemory", 1 },
@@ -1312,6 +1316,7 @@
     { 15, "wrapped_malloc", "\n malloc error \n", 0x01000001,                    0x0010 },
     { 15, "IsStrobeChargeCompleted", "\r\nCaptSeq::ChargeNotCompleted!!", 0x01000001 }, // ixus30, 40
     { 15, "get_resource_pointer", "Not found icon resource.\r\n", 0x01000001,    0x0008 },
+    { 15, "get_nd_value", "IrisSpecification.c", 0x01000001,                     0x0014 },
 
     { 16, "DeleteDirectory_Fut", (char*)DeleteDirectory_Fut_test, 0x01000001 },
     { 16, "MakeDirectory_Fut", (char*)MakeDirectory_Fut_test, 0x01000001 },
edit:
false positive on sx400 removed
« Last Edit: 28 / July / 2018, 12:04:31 by srsa_4c »

*

Offline reyalp

  • ******
  • 14125
Re: Improving CHDK ND filter support
« Reply #102 on: 29 / July / 2018, 21:02:20 »
Here's an updated patch with get_current_nd_value for dryos ND only and Iris + ND cams

I'm still getting to grips with sig finder code, so please let me know if I'm doing anything silly.

For ND only cameras (detected by IrisSpecification.c string), it finds via GetCurrentAvValue

For ND+Iris cams (detected by task_Nd and task_IrisEvent) it uses get_current_exp, which in turn is found by the string in ShowCurrentExp. Note this finds a match on cameras like SX10.

I think these matches should be valid for vxworks too.

Attached 7z is capdis of the functions (get_nd_value, get_current_nd_value, get_current_exp)  for one sub of each dryos cam. I haven't looked at all of them but the ones I have seem correct.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Improving CHDK ND filter support
« Reply #103 on: 05 / August / 2018, 18:08:05 »
This will probably be parallel work, but anyway.
Partially adapted the dryos part of the -3 patch, for vxworks. The iris part is a straight copy and obviously does not work.
Code: [Select]
Index: tools/finsig_vxworks.c
===================================================================
--- tools/finsig_vxworks.c (revision 5088)
+++ tools/finsig_vxworks.c (working copy)
@@ -338,6 +338,9 @@
     { "exmem_alloc" },
     { "exmem_free", OPTIONAL },
     { "free" },
+    { "get_nd_value", OPTIONAL },
+    { "get_current_nd_value", OPTIONAL },
+    { "get_current_exp", UNUSED | OPTIONAL }, // helper, underlying function of ShowCurrentExp
 
     { "kbd_p1_f" },
     { "kbd_p1_f_cont" },
@@ -965,6 +968,86 @@
     return 0;
 }
 
+// for cams with both ND and iris
+int find_get_current_nd_value_iris(firmware *fw)
+{
+    // match is only for cams with both, task is mostly a good indicator
+    if(get_saved_sig(fw,"task_Nd") < 0 || get_saved_sig(fw,"task_IrisEvent") < 0) {
+        return 0;
+    }
+    int f1 = get_saved_sig(fw,"get_current_exp");
+    if(f1 < 0)
+        return 0;
+
+    f1 = adr2idx(fw, func_names[f1].val);
+    int blcnt, i;
+    // expect
+    // bleq DebugAssert
+    // followed by 5 bl with other instruction between
+    // looking for 5th
+    for(i=0, blcnt=0; i<16 && blcnt < 7; i++) {
+        if(!blcnt) {
+            if(isBL_cond(fw,f1+i)) {
+                blcnt++;
+            } else if(isBL(fw,f1+i)) {
+                return 0;
+            }
+            continue;
+        }
+        if(!isBL(fw,f1+i)) {
+            continue;
+        }
+        blcnt++;
+        if(blcnt == 6) {
+            int f2 = idxFollowBranch(fw,f1+i,0x01000001);
+            // non-ND cameras have a call to return 0
+            if(isMOV(fw,f2) && (fwRd(fw,f2) == 0) && (fwOp2(fw,f2) == 0)) // MOV R0, 0
+                return 0;
+            // veneer (might be better to require veneer)
+            if(isB(fw,f2)) {
+                f2 = idxFollowBranch(fw,f2,0x00000001);
+            }
+            fwAddMatch(fw,idx2adr(fw,f2),32,0,122);
+            return 1;
+        }
+    }
+    return 0;
+}
+
+int find_get_current_nd_value(firmware *fw)
+{
+
+    // string only present on ND-only cameres
+    if(find_str(fw, "IrisSpecification.c") < 0) {
+        return find_get_current_nd_value_iris(fw);
+    }
+
+    int f1 = get_saved_sig(fw,"GetCurrentAvValue");
+    if(f1 < 0)
+        return 0;
+
+    f1 = adr2idx(fw, func_names[f1].val);
+    // skip wrapper
+    if (!isBL(fw,f1+1))
+        return 0;
+    f1 = idxFollowBranch(fw,f1+1,0x01000001);
+    // expect
+    // ldr r0, ="IrisController.c"
+    // bl DebugAssert
+    // bl get_current_nd_value
+    int sadr = find_str(fw, "IrisController.c");
+    int j = find_nxt_str_ref(fw, sadr, f1);
+    if ((j < 0) || (j-f1 > 8))
+        return 0;
+
+    j = find_Nth_inst(fw,isBL,j,8,2);
+    if (j == -1)
+        return 0;
+    f1 = idxFollowBranch(fw,j,0x01000001);
+    fwAddMatch(fw,idx2adr(fw,f1),32,0,122);
+    return 1;
+}
+
 //------------------------------------------------------------------------------------------------------------
 
 // Data for matching the '_log' function
@@ -1066,6 +1149,8 @@
     {20, "MFOff", "MFOff_FW", 1 },
     {20, "GetAdChValue", "GetAdChValue_FW", 0 },
     {20, "HwOcReadICAPCounter", "GetCurrentMachineTime", 3 },
+    {20, "get_nd_value", "NdActuator.GetNdFilterDeltaEvAdjustValue_FW", 0 }, // old vx
+    {20, "get_current_nd_value", "NdActuator.GetNdFilterDeltaEv_FW", 0 }, // old vx
 
     { 1, "ExportToEventProcedure_FW", "ExportToEventProcedure", 1 },
     { 1, "AllocateMemory", "AllocateMemory", 1 },
@@ -1312,6 +1397,8 @@
     { 15, "wrapped_malloc", "\n malloc error \n", 0x01000001,                    0x0010 },
     { 15, "IsStrobeChargeCompleted", "\r\nCaptSeq::ChargeNotCompleted!!", 0x01000001 }, // ixus30, 40
     { 15, "get_resource_pointer", "Not found icon resource.\r\n", 0x01000001,    0x0008 },
+    { 15, "get_nd_value", "IrisSpecification.c", 0x01000001,                     0x0014 },
+    { 15, "get_current_exp", "Exp  Av %d, Tv %d, Gain %d\r", 0x01000001 },
 
     { 16, "DeleteDirectory_Fut", (char*)DeleteDirectory_Fut_test, 0x01000001 },
     { 16, "MakeDirectory_Fut", (char*)MakeDirectory_Fut_test, 0x01000001 },
@@ -1394,6 +1481,7 @@
     { 22, "set_control_event", (char*)find_set_control_event, 0 }, // vx
     { 22, "filesem_init", (char*)find_filesem_init, 0 }, // vx
     { 22, "GetCurrentMachineTime", (char*)find_getcurrentmachinetime, 0},
+    { 22, "get_current_nd_value", (char*)find_get_current_nd_value, 0},
 
     //                                                                                          Vx
     { 100, "DebugAssert", "\nAssert: File %s Line %d\n", 0,                                     10 },

*

Offline reyalp

  • ******
  • 14125
Re: Improving CHDK ND filter support
« Reply #104 on: 06 / August / 2018, 00:01:47 »
This will probably be parallel work, but anyway.
Partially adapted the dryos part of the -3 patch, for vxworks. The iris part is a straight copy and obviously does not work.
Thanks. I hadn't started on vxworks yet, so no parallel work. Here's an a version with the _iris and get_current_exp matches updated. I haven't checked the other results much.

After I did this, I realized G7 is the only vxworks iris+ND camera, so it wouldn't be too much work to just find the functions manually for that case. OTOH, it does have a bunch of subs.

Also, in my previous posts I said task_Nd was present on ND cameras, but on vxworks it's actually task_NdActuator. My script used substring matches  :-[
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14125
Re: Improving CHDK ND filter support
« Reply #105 on: 12 / August / 2018, 22:20:42 »
I checked in the finsig_vxworks and finsig_dryos changes for get_nd_value, get_current_nd_value and get_current_exp. These aren't 100% verified, but I checked the disassembly for a pretty good sample and didn't find any issues.

Next steps:
* Figure out what to do with cameras defined to have ND which do not have have the new functions (ixus1000, sx400)
* Add wrappers and script interface
* Come up with a test script

Other notes:
get_nd_value and get_current_nd_value are found on some cameras that have NdActuator code but (probably) don't really have an ND (s2is, a650, sx1, sx10, sx20). AFAIK the matches are working correctly, it's just a case of Canon leaving dead code around.

ixus300_sd4000 and ixus310_elph500hs are both defined as ND + Iris in CHDK, and have both sets of tasks. It's unclear what hardware these cams actually have, but the functions are found.
« Last Edit: 10 / November / 2018, 17:43:07 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: Improving CHDK ND filter support
« Reply #106 on: 13 / August / 2018, 16:53:40 »
* Figure out what to do with cameras defined to have ND which do not have have the new functions (ixus1000, sx400)
IMHO neither of those cameras have ND (their aperture specification is not "ND-like").
Quote
get_nd_value and get_current_nd_value are found on some cameras that have NdActuator code but (probably) don't really have an ND (s2is, a650, sx1, sx10, sx20). AFAIK the matches are working correctly, it's just a case of Canon leaving dead code around.
That would be my guess too. I was going to say that the s2is has the same optical unit as the s3is and s5is, but the internal ID turned out to be different (s2: OPTICAL_EC164; s3, s5: OPTICAL_EC195)

*

Offline reyalp

  • ******
  • 14125
Re: Improving CHDK ND filter support
« Reply #107 on: 04 / September / 2018, 00:45:06 »
Patch with proposed script interface. Includes an updated ndtest.lua which uses it. For the moment, it dummies out the new ND functions on ixus1000 and sx400

I've tested on D10, elph130, elph180 and g7x. The reported ND values are very close to what I get from rawop meter.

get_nd_value_ev96
- returns APEX 96 value of the ND filter from Canon adjustment data, regardless of ND state or camera mode
- returns 0 on cameras without ND

get_nd_current_ev96
- returns ND APEX96 value if ND in, or 0 if ND out.
- returns 0 on cameras without ND

I'm open to better suggestions for the names. I included ev96 to make it clear they are in the same units as tv96 etc. I used "current" to try to indicate that it is an instantaneous value, rather than the other get_ functions that return value that's only updated on half press. I will probably add similar "current" functions for av and tv (and ISO if it can be found) for https://chdk.setepontos.com/index.php?topic=13508.0

The rational for returning 0 (rather than nil or false or an error) for non-ND cameras is that it makes scripts simpler. If you want to do an APEX calculation, you can just do TV + AV + ND... and not need to have separate cases. This is less useful for _value, I could be convinced it should return false, but we already have get_nd_present()

Note that on ND only cameras, you'd need to use min_av for the AV term to avoid potentially counting the ND twice.

I haven't felt a need for separate get_nd_state (boolean for in/out),  checking if get_nd_current_ev96() is 0 or not seems simple and clear enough.

Script functions are only implemented for Lua at the moment, but I will probably add ubasic support for all the functions after I'm happy with the Lua implementation.

I plan to check this in the next few days if there are no objections
* Figure out what to do with cameras defined to have ND which do not have have the new functions (ixus1000, sx400)
IMHO neither of those cameras have ND (their aperture specification is not "ND-like").
Agreed.  I don't really want to break them if "ND" override works and iris doesn't, but for ixus1000 it's testing was ambiguous whether either works.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14125
Re: Improving CHDK ND filter support
« Reply #108 on: 08 / September / 2018, 21:36:09 »
I checked in the above in trunk 5099 without modification.

ndtest.lua now uses the firmware ND value by default, and checks that get_nd_current_ev96 reflects the ND state requested by the script.

Some observations related to: https://chdk.setepontos.com/index.php?topic=13228.msg137603#msg137603

In "quick" mode calling set_nd_filter() in the raw hook doesn't seem to work. The ND filter gets set, but the the camera changes the state again when the next shoot_full happens.

This applies to elph130, D10 and G7 X. Elph180 has CAM_ND_SET_AV_VALUE, which sets the Av propcases along with ND and appears to work.

The old ndtest.lua had special case to call set_nd_filter() after the remote hook in "quick" mode.

The new script has two options to test this behavior: "Set ND in shoot hook" (which mimics the old behavior) and "Set AV prop on ND-only cam" (which acts like CAM_ND_SET_AV_VALUE)

My feeling is that CAM_ND_SET_AV_VALUE should be the default for ND only cameras.

However, the behavior will still be inconsistent on manual ND cameras like the G7 X. I was somewhat surprised it suffers from a similar issue, since the firmware in manual ND filter cams seems to pretty much leave it alone, and it already sets PROPCASE_ND_FILTER_STATE in set_nd_filter()

I plan to improve ndtest a bit more then ask for wider testing.
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14125
Re: Improving CHDK ND filter support
« Reply #109 on: 04 / February / 2019, 02:08:25 »
I plan to improve ndtest a bit more then ask for wider testing.
Finally got this checked in, trunk 5156.

The new script gives a pass, fail or warning result in the console and log. With default settings, it will detect if CAM_ND_SET_AV_VALUE is required, either for all ND overrides, or just for "quick" mode.

I'd appreciate test results from any cameras with an ND filter that aren't listed as tested below.

The test procedure is simple:
* CHDK 1.5 build 5160 or later is required
* Aim the camera at a stable, low contrast scene, like a blank wall
* In Canon settings, shooting mode should be P, continuous mode should be enabled, flash and review should be off
* Run the script with default settings
* Post the log here.
If it says ALL PASSED then everything works fine. If there are warnings or errors, more details will be in the log.

Results so far:

"Normal" ND + Iris - needs ND set in shoot hook in quick
G7X
G1X
S110
S100 - (had first shot glitch on one run)

"Normal" ND only cams - needs CAM_ND_SET_AV_VALUE in quick
D10
ELPH130
A3200
A3400
ixus150

Need CAM_ND_SET_AV_VALUE always
ELPH180 - has CAM_ND_SET_AV_VALUE, all pass

Others
A410 - first shot glitch, needs av prop in cont, quick
A490 - first shot glitch, needs ND in shoot hook (AV prop doesn't work, gets reset???)
IXUS65 - first shot glitch, needs av prop in cont, quick
IXUS115 - failed in quick, ND goes in after hook (bad remote hook?) otherwise "normal"
IXUS870 - first shot glitch, needs av prop in quick

"First shot glitch"
= first shot in each sequence is ~1 stop more exposed.


Full list of cameras with CAM_HAS_ND_FILTER as of r5160 (strikethrough = tested)

a1000
a1100
a1200
a1300
a1400
a2000
a2100
a2200
a2300
a2400
a2500
a2600
a3000
a3100
a3200
a3300
a3400
a4000
a410
a420
a430
a450
a460
a470
a480
a490 * override issue in quick (ND control appears to work)
a495 * override issue in quick (ND control appears to work)
a530 * missing remote hook
a550
a560
a580
a800
a810
d10
d20
d30
g10
g11
g12
g15
g16
g1x
g7
g7x
g9
ixus1000_sd4500 * port has issues
ixus100_sd780
ixus105_sd1300 * override issue in quick (ND control appears to work)
ixus110_sd960
ixus115_elph100hs
ixus120_sd940
ixus125_elph110hs
ixus130_sd1400 * override issue in quick (ND control appears to work)
ixus132_elph115
ixus135_elph120
ixus140_elph130
ixus145_elph135
ixus150_elph140
ixus160_elph160
ixus170_elph170
ixus175_elph180
ixus220_elph300hs
ixus230_elph310hs
ixus240_elph320hs
ixus255_elph330hs
ixus285_elph360hs
ixus300_sd4000 * override issue in quick (ND control appears to work)
ixus30_sd200 * missing remote hook
ixus310_elph500hs
ixus40_sd300 * missing remote hook
ixus50_sd400 * missing remote hook
ixus55_sd450
ixus60_sd600
ixus65_sd630
ixus700_sd500 * missing remote hook
ixus70_sd1000
ixus750_sd550
ixus75_sd750
ixus800_sd700
ixus80_sd1100
ixus850_sd800
ixus85_sd770
ixus860_sd870
ixus870_sd880
ixus900_sd900
ixus90_sd790
ixus950_sd850
ixus95_sd1200
ixus960_sd950
ixus970_sd890
ixus980_sd990
ixusizoom_sd30
ixusw_sd430
n
n_facebook
s100
s110
sx610hs
« Last Edit: 12 / August / 2019, 20:45:04 by reyalp »
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal