Setting focus from scripts or menus - page 31 - General Discussion and Assistance - CHDK Forum
supplierdeeply

Setting focus from scripts or menus

  • 556 Replies
  • 137626 Views
*

Offline srsa_4c

  • ******
  • 4426
Re: Setting focus from scripts or menus
« Reply #300 on: 04 / March / 2014, 14:36:27 »
Advertisements
Further to this - is you use set_focus() first and then set_aflock() to "hold" the value over subsequent shots, does it crash?
Hmmm. Without actually trying (on the a3400):
set_focus() is working when it doesn't attempt to set the focus in shooting_expo_param_override() while AF lock or MF is active. With reyalp's focus-setnow-in-aflock-2 patch, set_focus() has immediate effect in AF lock - that made the small test script work in AF lock. I know this isn't exactly the answer to the question.

Re: Setting focus from scripts or menus
« Reply #301 on: 04 / March / 2014, 15:18:27 »
With reyalp's focus-setnow-in-aflock-2 patch, set_focus() has immediate effect in AF lock - that made the small test script work in AF lock.
Leaving me wondering how many of the 14 (out of 92) tested cameras that had crashes using set_aflock() no longer will. And how many of those will now set_focus() in the mode.     

Doesn't change the rev 19 patch.  That gives us a useful set of #defines,  conditions that work for almost all cameras and a fully fuctional set_mf() script function.   However, some camera may be blocked from setting focus with AFL active when that will now actually work because they crashed prior to reyalp's patch.

I'll test this on the my SX50 when I get a moment. It's the only camera I have that crashed in AFL mode.

Edit : text corrected to only discuss cams that crashed with AFL enabled.
« Last Edit: 04 / March / 2014, 17:26:33 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #302 on: 04 / March / 2014, 19:52:24 »
Update : with the patch file in place,  the SX50hs now will focus without crashing after set_aflock() is called. 

Previously,  it crashed when trying to do that (as it still does if you just call set_focus() in bypass mode by itself).

I guess that I need to add this to its platform_camera.h :

Code: [Select]
#define CAM_SD_OVER_IN_AFL 1If this applies to all the other cameras that would not set_focus when AFL was active,  then we have a way to enable MF for all cameras - either set_aflock() or set_mf().   Maybe we don't even need set_mf()?
« Last Edit: 04 / March / 2014, 19:55:47 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #303 on: 06 / March / 2014, 19:45:47 »
Update : patch file version 20  (its getting hard to keep these current when anything else changes)

Changes :
  • Per this forum link commented out the interlocks in shooting_can_focus() for tracking AF / servo AF modes   Tested on my fussy SX50hs. The mf3_test.lua script reports success focusing while servo AF and tracking AF are engaged.
  • Updated mf3_test.lua to include reyalp's cleanup for unavailable props.
  • Updated mf3_test.lua to allow the focus interlock bypass function to be enabled.  This will allow retesting the cameras that crashed with the old style of setting focus in AFL mode.
  • Added  #define CAM_CAN_SD_IN_AFL 1 to SX50hs (yah!).  First of many I hope - once the patch gets added to the 1.3.0 trunk I will contact owners of cameras that crashed using set_focus() with AFL for retesting.
« Last Edit: 06 / March / 2014, 19:56:14 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline reyalp

  • ******
  • 13443
Re: Setting focus from scripts or menus
« Reply #304 on: 08 / March / 2014, 18:51:47 »
I've checked this in, trunk changeset 3373

I know I've said this before, but huge thanks to waterwingz for taking this on.

Per this forum link commented out the interlocks in shooting_can_focus() for tracking AF / servo AF modes   Tested on my fussy SX50hs. The mf3_test.lua script reports success focusing while servo AF and tracking AF are engaged.
This isn't actually correct for cameras that can normally SD override in AF mode, they will crash. The check should only be skipped if the camera is actually in MF or AF lock. I will add a fix for this.

Quote
Updated mf3_test.lua to allow the focus interlock bypass function to be enabled.  This will allow retesting the cameras that crashed with the old style of setting focus in AFL mode.
There wasn't an mf3_test.lua in the latest patch. I would definitely like to have an MF test script for new ports (and currently untested cameras) to include in the test directory.
Don't forget what the H stands for.

Re: Setting focus from scripts or menus
« Reply #305 on: 08 / March / 2014, 19:04:43 »
I've checked this in, trunk changeset 3373
Thank you so much.  Some things might still break - the patch is almost certainly not perfect,  but trying to maintain an uncommitted patch of that size is a huge PITA - when you revert your svn copy and reapply the patch, you have to go back through and svn add any new files that the patch created.  If you miss one,  you end up with this :
Quote
There wasn't an mf3_test.lua in the latest patch. I would definitely like to have an MF test script for new ports (and currently untested cameras) to include in the test directory.
oh krap .. attached below (again) .. can you please put it in CHDK/SCRIPTS/TEST for me?

Edit : forgot to add this :   WHOO HOO !
« Last Edit: 08 / March / 2014, 19:07:13 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 13443
Re: Setting focus from scripts or menus
« Reply #306 on: 08 / March / 2014, 20:00:39 »
Thank you so much.  Some things might still break - the patch is almost certainly not perfect,  but trying to maintain an uncommitted patch of that size is a huge PITA
Absolutely.

mf3_test was actually in the patch, my mistake. Added as CHDK/SCRIPTS/TEST/MFTEST.LUA with the logfile set to mf_<camera>.csv

Quote
Edit : forgot to add this :   WHOO HOO !
:D
Don't forget what the H stands for.

Re: Setting focus from scripts or menus
« Reply #307 on: 09 / March / 2014, 13:48:14 »
Please find the results for my G11 attached.
It contains two runs, as I had continuous AF on on the first run, off for the second run.

Thanks for working on this!


Re: Setting focus from scripts or menus - cameras needing retesting
« Reply #308 on: 09 / March / 2014, 14:31:03 »
Updated List of Cameras Needing Retesting

Based on reported test results, the following cameras are configured not to allow set_focus() to work when Automatic Focus Lock (AFL) is enabled.  They were reported to crash when doing so.  However, with the changes in the latest CHDK 1.3.0 release, this may now work properly. 

Please retest using the new mftest.lua script included in the latest update with Bypass Interlocks set to Yes and post the resulting log file here.

  a810 : no longer crashes
  a2300
  a2400
  a3400
  a4000
  d20
  ixus125_elph110hs : no longer crashes
  ixus700_sd500 : still crashes
  s110
  sx160is
  sx240hs  : no longer crashes
  sx260hs :  no longer crashes
  sx500is
  sx50hs : no longer crashes

Also, we are still looking for testing of these cameras using this method : MF Test Method Forum Link

    a800 a1100 a1300 a2100 a3000
    a450 a560 a580 a700 a710
    g7 g9
    ixus1000_sd4500 ixus240_elph320hs ixus300_sd4000
    ixus55_sd450 ixus75_sd750
    ixus750_sd550 ixus800_sd700 ixus900_sd900
    ixus95_sd1200 ixus950_sd850 ixus960_sd950 ixus980_sd990
    ixusizoom_sd30 s2is sx1 tx1

T.I.A.
« Last Edit: 11 / March / 2014, 19:42:45 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #309 on: 09 / March / 2014, 15:05:28 »
ixus125/elph110hs test attached.  No crash!

Thanks for your work!

 

Related Topics