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

Setting focus from scripts or menus

  • 556 Replies
  • 133458 Views
Advertisements
SX130 => http://forum.chdk-treff.de/download/file.php?id=2605
S110 => http://forum.chdk-treff.de/download/file.php?id=2607
@msl :  I think that all the recent camera (like the S110, SX50 etc) are only going to pass if the SS.MFOn test is performed.  I've enabled it by default in the latest versions of the test script.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3332
    • Photos
I can, but little point I think, both CSV's have no file size and no data contained within - presumably because the camera crashes and powers itself off?
True.   Usually I open & close log files each time write to them in my scripts.  For some reason unknown,  I chose to not do that in this script - bad decision.   I'll add that to the update list.  Don't worry about it for now.

Meanwhile,  we've learned that with CHDK as it is today,  you need to enable Lua native calls, and put this
Code: [Select]
        call_event_proc("SS.Create")
        call_event_proc("SS.MFOn")
at the start of your script and this

Code: [Select]
        call_event_proc("SS.Create")
        call_event_proc("SS.MFOff")
at the end if you want to use the set_focus() function on the G15.

Is it necessary to call SS.Create each time?
I thought you only needed to call this once.

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

  • ******
  • 13387
Is it necessary to call SS.Create each time?
Should only be needed once.

Also, the result from the eventprocs should probably be checked for -1 so we know they were registered.

For older cameras, MFOn etc probably needs  RegisterShootSeqEvent

edit:
calling the registration eventprocs more than once is usually harmless AFAIK.
« Last Edit: 03 / January / 2014, 17:37:50 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 13387
Here's a version that calls the variants of MFOn / MFOff and registration functions that I know of. If all variants return -1 it will be logged.
Don't forget what the H stands for.


Re: Setting focus from scripts or menus : phase 1 testing complete !
« Reply #84 on: 03 / January / 2014, 18:34:15 »
Here's a version that calls the variants of MFOn / MFOff and registration functions that I know of. If all variants return -1 it will be logged.
Thanks for that - I'll roll in into v2.5

I think this might be a good point to call a halt to testing?   We have a lot of good data about more than 30% of all CHDK supported cameras.   An amazing job by all the testers over a holiday period :

nocaC_230  JvdP  msl  reyalp  nafraf  zeno srsa_4c  adeuring  peabody  philmoz  blackhole  andrew.stephens.754365  JohnW  fe50  flipper321 

and from the CHDK-DE forum

erfi00  Werner_O    imagesetter  Martin_badPixel Knarf FE50 the clipper norbertloev rudi

My apology to anyone I missed .. so sorry .

Hat's off to you all!   :D

Per discussion on the CHDK IRC channel,  the next step is to update the unstable version to allow the set_focus() function to be called with all the current interlocks (#defines) disabled.   Then we will ask the huge favor of all the testers to rerun a new script with the latest autobuild version.  I'll warn you now that some tests will crash the cameras but should tell us exactly what will work & will not work on your camera.

Once we have that, it should be possible to actually make set_focus() work properly from any script.  (We will also look at the SD menu overrides at that point too.)

Please stay tuned - the response so far from all of you (small dedicated band that your are) has been simply awesome!


Ported :   A1200    SD940   G10    Powershot N    G16

Setting focus from scripts or menus : Phase 2
« Reply #85 on: 04 / January / 2014, 20:03:43 »
After a couple of IRC discussions with reyalp, the consensus is to add a Lua scripting function that disables the various #defined interlocks that decide if set_focus() actually gets issued or not.   With all of your help,  this will then be used to collect as much information as possible about what works and doesn't for each camera directly at the Canon firmware level.

I've attached a patch file that implements this. My preference would have been to put #defines around the changes so that they are only a build option for people doing new ports once these set_focus() tests are complete.  However, luascript.c is a module and conditional compilation in modules is strongly discouraged by the CHDK devs.

I've also attached a reworked script that captures more information than the previous script.  It can run without actually taking any pictures ( shoot_half only ) although there is an option to enable full shots.  It also lets you run with interlocks disabled or enabled.   And logging opens and closes with each write to preserve as much of the log as possible during testing if there is a crash.

The plan now is to update the unstable branch with some variation of this patch and then ask all the testers to load the new version and run the new test script.  Be warned that with interlocks disable,  some test steps will cause the camera to shutdown.  Once that is done,  a final determination can be made about how to finally fix CHDK's  SD override functions so that they work consistently for all cameras.

I'd appreciate feedback on the script changes - for now you can run with the interlocks enabled and any current CHDK build.  Post any MF_test.csv and comments here? 

TIA

« Last Edit: 05 / January / 2014, 18:32:41 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3332
    • Photos
Re: Setting focus from scripts or menus : Phase 2
« Reply #86 on: 04 / January / 2014, 23:20:45 »
After a couple of IRC discussions with reyalp, the consensus is to add a Lua scripting function that disables the various #defined interlocks that decide if set_focus() actually gets issued or not.   With all of your help,  this will then be used to collect as much information as possible about what works and doesn't for each camera directly at the Canon firmware level.

I've attached a patch file that implements this. My preference would have been to put #defines around the changes so that they are only a build option for people doing new ports once these set_focus() tests are complete.  However, luascript.c is a module and conditional compilation in modules is strongly discouraged by the CHDK devs.

I've also attached a reworked script that captures more information than the previous script.  It can run without actually taking any pictures ( shoot_half only ) although there is an option to enable full shots.  It also lets you run with interlocks disabled or enabled.   And logging opens and closes with each write to preserve as much of the log as possible during testing if there is a crash.

The plan now is to update the unstable branch with some variation of this patch and then ask all the testers to load the new version and run the new test script.  Be warned that with interlocks disable,  some test steps will cause the camera to shutdown.  Once that is done,  a final determination can be made about how to finally fix CHDK's  SD override functions so that they work consistently for all cameras.

I'd appreciate feedback on the script changes - for now you can run with the interlocks enabled and any current CHDK build.  Post any MF_test.csv and comments here? 

TIA

My cameras all have SS.Create + PT_MFOn.
Version 2.6 attached which adds the PT_MFOn test to the SS.Create block.

Edit: Results for v2.6 on G12, G1X, IXUS310 & SX40 (all with bypass interlock on).
G12, G1X & IXUS310 pass all tests.
SX40 crashes on set_focus_only, passes the other three.
Tested IXUS700 with interlock bypass; but all tests crash the camera.

Phil.
« Last Edit: 04 / January / 2014, 23:40:06 by philmoz »
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)

Re: Setting focus from scripts or menus : Phase 2
« Reply #87 on: 05 / January / 2014, 01:24:37 »
My cameras all have SS.Create + PT_MFOn.
Version 2.6 attached which adds the PT_MFOn test to the SS.Create block.
Thanks for that.  reyalp's version did the RegisterShootSeqEvent & SS.Create events first then tried all the actual "enable MF" calls.  I tried to match the register calls and the enable calls - obviously unsuccessfully.
Ported :   A1200    SD940   G10    Powershot N    G16


Hi,

i hav patched my Code and now i get that message:

Set Focus Tester v2.5 SX230HS
:126 attempt to call global 'set_focus_interlock_bypass' (a nil value)
***ABGEBROCHEN***

What I have done wrong?

By

*

Online philmoz

  • *****
  • 3332
    • Photos
Hi,

i hav patched my Code and now i get that message:

Set Focus Tester v2.5 SX230HS
:126 attempt to call global 'set_focus_interlock_bypass' (a nil value)
***ABGEBROCHEN***

What I have done wrong?

By

Did you copy the updated lua.flt module file to the CHDK/MODULES directory?

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