tl;dr > scripted SD override using the set_focus() command is still not 100% reliable.My A1200's continues to have difficulties using AFL & MF modes under the new 1.3.0 SD override code. The camera occasionally seems to get into a focus lock mode where set_focus() commands have no effect. It also seems to stay locked regardless of whether it's in AFL or MF modes. And when it starts doing this it eventually reverts to using the passed set_focus() value.
Unfortunately, when this happens appears to be random - after 100's of tests & test scripts & repeated combinations I cannot detect a pattern of what makes this happen. But approximately 20% of the time, set_focus() fails and that's clearly a problem for this and potentially other cameras.
Unreliable operation in scripts is probably worse than not having the function at all.
There was a recent SVN patch (3383) that causes set_focus() to use SET_NOW rather than SET_LATER that might explain why the set_mf() command is affected. But looking at the code tells me that when the camera was in AFL mode, it previously was doing a SET_NOW.
(Also note that all the testing in this thread was done prior to this patch).
The only progress I've made is that if I modify set_focus() to always use SET_LATER, I have yet to see the bug after hundreds of test runs (usually more than enough to trigger it when it uses SET_NOW).
The original reason for using SET_NOW rather than SET_LATER when AFL was engaged is probably lost in history and it's not clear if it worked properly for all cameras given the messy state that the whole SD override code was in. The current logic for using SET_NOW is to avoid a crash in AFL mode for some cameras. The theory is that allowing set_focus() to move the lens mechanism after a HALF_PRESS can cause timing issues and crashes.
What to do about this then ? Options :
- Nothing. Its just another broken bit of SD overrides for one camera model.
- Continue testing for an answer. Not sure I have much more time for this one.
- Switch the set_focus() code back to pre-3383 state. This will change things for set_mf() mode in cameras without Canon MF but likely won't help AFL mode.
- Add a #define that configures set_focus() as a SET_NOW or SET_LATER command on a per camera basis. Default to SET_NOW.
- Add a #define that configures set_focus() as a SET_NOW or SET_LATER command on a per camera basis. Default to SET_LATER
It would help to have more eyes / cameras on this. The new
meteor2.lua script I've been testing seems to be particulary vunerable to the bug and has enough print statements to show when it's happening. For testing, turn off dark frames, set the Tv to 1 second and the shot count to 2. If it does not fail on the first shot then it never fails during any give script run.