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

Setting focus from scripts or menus

  • 601 Replies
  • 206657 Views
Re: Setting focus from scripts or menus
« Reply #390 on: 30 / March / 2014, 14:48:59 »
Advertisements
I think you mean MF here? AFL was not treated specially in the old code.
Line 690 in luascript.c (r3382) checked this :
Code: [Select]
if (shooting_get_prop(camera_info.props.af_lock))Although I'm not really sure if/where that ever gets set.

Quote
Also, SET_LATER in AFL (and MF I think, but I'm not sure) crashes quite a few cameras, so this would break some that are currently (mostly) working.
I think we have a list of those ones in this thread.  They only started working once the patch was implemented so it would be easy to #define them separately.

Quote
Another alternative would be let the script decide to do SET_NOW or SET_LATER. This would not be good for script portability.
Yuck.

Quote
There are also some different lens control functions in the the firmware, so maybe there is something else we can call on these cameras.
The problem, as always,  is testing all the models.

Quote
For your tests, I assume you have servo and continuous AF off?
Yes. (Camera doesn't have a continuous AF option).
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14110
Re: Setting focus from scripts or menus
« Reply #391 on: 30 / March / 2014, 15:18:10 »
I think you mean MF here? AFL was not treated specially in the old code.
Line 690 in luascript.c (r3382) checked this :
Code: [Select]
if (shooting_get_prop(camera_info.props.af_lock))Although I'm not really sure if/where that ever gets set.
Your AF lock changes included setting the propcase in set_aflock.

That change was added as part of the the SD override rework, in r3373. In the original code, only MF had the special case (and as I said earlier, it was only applied to cameras defined as having native MF, +/- some other confusing and maybe broken conditions)
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14110
Re: Setting focus from scripts or menus
« Reply #392 on: 30 / March / 2014, 19:13:08 »
I think srsa's suggestion of testing MoveFocusLensToDistance directly in aflock and mf without calling set_focus has merit. While I don't see any way our code would cause the observed symptoms, there's definitely room for some bugs.

Capturing some discussion from IRC (edited for relevance)

< waterwingz> well,  that answers one question ... bork mode is possible from a cold power up using only set_mf() ...  and it  "seems" to be easier to get into bork mode when the script first sets the zoom position (there's a scripted 3 second delay after it does that)

< waterwingz> somehow the meteor2.lua v2.3 script seem to hit it more than my various test scripts ... and once I edit luascript.c to use SET_LATER  it runs correctly all the time ...

< reyalp> I don't think a blanket set_later is the correct solution since the old mf cams have been using set_now since forever and some crash
though a crash is easier to detect than an intermittent failure I guess
the crashy ones are going to need their own define or something too


Also, related to focus overrides in general:
< reyalp>     while ((shooting_is_flash_ready()!=1) || (focus_busy)) msleep(10);
wtf  is flash_ready doing in there...
< waterwingz> I had assumed it did not want to fire while still charging ?
< reyalp> sure, but what the hell is it doing in the focus override code?
also, that would impact set_now...
because you definitely don't need to wait for flash in that case
there's the stuff with conf.dof_subj_dist_as_near_limit and conf.dof_use_exif_subj_dist
which I have no idea what is supposed to be doing or what the defaults are


Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 14110
Re: Setting focus from scripts or menus
« Reply #393 on: 30 / March / 2014, 20:00:19 »
Test patch for waterwingz
Don't forget what the H stands for.


Re: Setting focus from scripts or menus
« Reply #394 on: 09 / May / 2014, 06:32:40 »
As part of the never-ending SDM 1.86 beta tests, I tried focus-bracketing with the SX50hs.
It did of course crash, even with the modifications introduced by this excellent thread.
So, I tried CHDK and that also crashed.

SDM focus override using a script works fine and I assume so will CHDK.

It is surprising so many cameras will tolerate focus-override in continuous shooting mode.
Do you think the SX50hs problems are related to the fact that it has its own focus-bracketing option ?

Re: Setting focus from scripts or menus
« Reply #395 on: 09 / May / 2014, 08:08:27 »
I tried focus-bracketing with the SX50hs. It did of course crash, even with the modifications introduced by this excellent thread.
Not surprising. 

AFAIK, there has been no work done updating the various CHDK menu driven SD override functions to reflect the learnings from the scripting updates.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #396 on: 18 / May / 2014, 00:39:22 »
Hello. I ran the MF test script with a ixus240 / ELPH320HS .  Tests 3 and 6 fail. Others pass. No crashes. See attached

Re: Setting focus from scripts or menus
« Reply #397 on: 19 / May / 2014, 02:23:04 »
Hi i checked the spreadsheet several pages back and it says test info required for A1300 and A800.
Do you still require test data for these, if so i can assist with A800 and two a1300
regards


Re: Setting focus from scripts or menus
« Reply #398 on: 19 / May / 2014, 06:37:41 »
Hi i checked the spreadsheet several pages back and it says test info required for A1300 and A800.
Do you still require test data for these, if so i can assist with A800 and two a1300
regards
I'm still maintaining that spreadsheet so getting test data on missing cameras is much appreciated. 

When the MF updates were done for 1.3.0 I guessed the setting for any missing cameras.  It will be interesting to see how well I did (and make any necessary corrections of course).
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Setting focus from scripts or menus
« Reply #399 on: 14 / June / 2014, 13:26:42 »
A small update to the issues I've had with set_focus() not always working properly on my A1200.  While playing with a script today, I again ran into the circumstance where, after setting MF or AFL and then setting the focus,  the camera would shoot with the wrong focus setpoint.

Mostly out of frustration,  I added a "shoot_half" cycle after the set_zoom() code to try and resync things.  So far, it seems to have worked. 

My set_zoom() code now looks like this :
Code: [Select]
function update_zoom(zpos)
    if(zpos >= 0 ) then
        zstep=((get_zoom_steps()-1)*zpos)/100
        print("setting zoom to "..zpos.." percent step="..zstep)
        sleep(200)
        set_zoom(zstep)
        sleep(1000)
        local count = 0
        press("shoot_half")
        repeat
           sleep(100)
           count = count + 1
        until (get_shooting() == true ) or (count > 40 )   
        release("shoot_half")
    end
end
« Last Edit: 14 / June / 2014, 13:51:40 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal