Thanks to everyone who tested and posted results here. I'll update the wiki page and post the master spreadsheet here today.
What I think we've learned so far is that every port but one has some method of setting focus that works. Props to the various porters over the years for that!
However, none of the methods are common to all cameras. And we don't really know why the test cases that failed did not work. Was it the Canon f/w not acting when called? Or was it the tangled nest of CHDK #defines in shooting_can_focus() simply ignoring the request? Worse still - we have not looked at manual focus in video modes or the SD override menu items in the CHDK menus.
Where to next then? Here's a couple of ideas in search of comments :
- We could create a special build where shooting_can_focus() always returns true. If people will rerun the test script (with srsa_4c's timing tweaks and maybe an additional G12 set_aflock tweak test) we can actually find out which methods work and which were being randomly defeated by the #defines. (We could post the special build on a google drive like lapser did : lapser version of CHDK ).
- We can try to puzzle out the best definition for the existing #defines and make changes to shooting_can_focus() and camera.h settings in the 1.3.0 version that makes sense
- We can create a new set of #defines that make sense (example listed below) and do a mass change of all the platform_camera.h files and release in 1.3.0 for testing. We should probably also add a port specific function called something like set_mf_lock() that uses the new CAM_SD_OVER_MODE and that can be called from the menu code or a script. It would be painful at first but might be the cleanest in the end.
- Leave the #defines alone and publish a scripting guide telling which method works for each camera. Using simple brute force, we could even do a Lua lib that has all cameras listed and returns the approprate method. That would not help uBASIC scripting so maybe a new scripting function for both languages is needed that does the same thing.
- Do nothing - the current default case - and let the script writers sort it using methods like the kap_uav.lua script uses.
None of the above suggestions are perfect. And any change that affects all cameras is likely to break for a few. Do we just live with that and clean it up in the unstable version as we go? Maybe when 1.3.0 becomes stable, any camera not reported as working reverts to SD override disabled (until someone reports in)?
Over the last few days we tested less than 25% of the ported CHDK cameras. Further testing might have a lower response rate.
Appendix : Suggested #defines for comment if we start from scratch (verbose on purpose - better wording needed)
#define CAM_CAN_SD_OVERRIDE // the master define for shooting mode - disables all SD override code if not defined
#define CAM_CAN_SD_OVER_ONLY_IN_AFLOCK_MODE // only set_focus() when AFL is active (propcase?)
#define CAM_CAN_SD_OVER_ONLY_IN_MF_MODE // only set_focus() when MF is active (propcase?)
#define CAM_SD_OVER_MODE // defines which locking method to use - 0=none, 1=aflock, 2=PressSw1AndMF, 3=SS.MFOn, 4=
#define CAM_CAN_VIDEO_SD_OVERRIDE // the master define for video mode - disables all SD override code if not defined
#define CAM_CAN_VIDEO_SD_OVER_ONLY_IN_AFLOCK_MODE
#define CAM_CAN_VIDEO_SD_OVER_ONLY_IN_MF_MODE
#define CAM_VIDEO_SD_OVER_MODE // defines which locking method to use - 0=none, 1=aflock, 2=PressSw1AndMF, 3=SS.MFOn, 4=
todo : what about ContinuousAF and ServoAF modes - should shooting_can_focus() return more descriptive failure codes?