Unfortunately, moving the camera smoothly and accurately is slow; takes a couple minutes to complete the entire zoom process.
Quote from: reyalp on 13 / July / 2020, 20:27:49That's not good. If you can post the crash log, that may be helpful. Here you go...
That's not good. If you can post the crash log, that may be helpful.
Edit: Now it happened, but A sleep(100) after set_zoom() just helped.& My Romlog is a bit different.
If you can post a simple script that reproduces the problem, that would be really helpful.
The attached script fails regularly. Put the camera in rec mode, and zoom-in about half-way. If the 'set_zoom(znext)' is successful, then the script executes, no problem. If however, get_zoom() doesn't return the set zoom level, things get interesting...Some of the time, you will see the message "i= 2", the lens will move in/out, and the script succeeds. More often it will display the message, then crash.EDIT: oops, wrong script.... corrected.Camera in P mode, AF Frame Center, Servo AF off, Continuous AF On
The assert appears likely to be triggered by TryTakeSemaphore failing (in elph330 100f ff225028 / elph130 ff1e9a18), although there's another case that could potentially trigger it as well. It seems likely that set_zoom and continuous AF could tie up the semaphore unexpectedly.
So, all I need to do is disable Continuous AF, and it should work without crashing?
We got here because I was trying to get set_zoom(get_zoom()+1) to work reliably. Sounds like the current solution is v1.5, with set_zoom_speed(1), and Continuous AF disabled. Then I should be able to increment the zoom without racking the lens in/out to get to the requested level?
--[[--@title MegaFail@param zr pre set_zoom() @default zr -1 @range zr -100 201@param d AF delay 100* @default d 0Starting with lens closed is different, mostly set_z_s is ignored.--]]--s=get_zoom_steps()if zr>=s then zr=s-1 end -- zr>=90 >> Imager.cset_zoom_speed(1)press "shoot_half"sleep(500)release "shoot_half"sleep(100) --to avoid CZ-romlogset_zoom(zr)click "shoot_half"sleep(d*100) -- to avoid AfC romlog, sometimes (ie d=10) (focus_busy??)set_zoom(zr+1)print("Zoom=",get_zoom())--[[--46>>set_zoom(47) every 2nd run >> CZ romlogspooky: ASSERT!! AFScanDriver.c Line 1526Occured Time 2020:07:15 21:32:49 << wrong timestamp, but good filedate. 8 min after that:ASSERT!! Imager.c Line 768Occured Time 2020:07:16 17:58:1597>>98ASSERT!! ComputerZoom.c Line 1967Occured Time 2020:07:16 18:34:48--]]--
short shooting_can_focus(){ if(camera_info.state.mode_play) return 0 ; // don't focus in playback if(focus_interlock_bypass) return 1; // checks disabled, allow if( camera_info.state.mode_video == 1) return 1; // FIXME : default to MF enabled in video mode for now#ifdef CAM_SD_OVER_IN_AF #ifdef PROPCASE_CONTINUOUS_AF if (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) return 0; // don't focus in continuous AF mode,#endif if (focus_busy) { short t=0; do {msleep(10); t=t+1;} while (focus_busy && (t<404)); if (t<404) shooting_update_dof_values(); return 0 ; } // don't focus twice#ifdef CAM_SD_OVER_IN_MF if (shooting_get_prop(PROPCASE_FOCUS_MODE)==1 ) return 1; // allow focus if MF enabled and camera can focus that way?#endif#ifdef CAM_SD_OVER_IN_AFL if (shooting_get_prop(PROPCASE_AF_LOCK)==1 ) return 1; // allow focus if AFL enabled and camera can focus that way?#endif#ifdef PROPCASE_SERVO_AF if (shooting_get_prop(PROPCASE_SERVO_AF)) return 0; // don't focus in servo AF mode#endif if ( (shooting_get_prop(PROPCASE_AF_LOCK)==0) // allow focus when in AF mode (i.e AFL or MF not enabled)? && (shooting_get_prop(PROPCASE_FOCUS_MODE)==0 )) return 1;#endif return 0;}
void shooting_set_focus(int v, short is_now){ int s=v; if (!camera_info.state.mode_play) { if (is_now && focus_busy) { short t=0; do {msleep(10); t=t+1;} while (focus_busy && (t<404)); if (t<404) { photo_param_put_off.subj_dist=shooting_get_subject_distance(); return ;} } // don't focus twice if (is_now && shooting_can_focus()) { if (conf.dof_subj_dist_as_near_limit) { s=shooting_get_near_limit_f(v,shooting_get_min_real_aperture(),get_focal_length(lens_get_zoom_point())); } if (!conf.dof_use_exif_subj_dist && (s != INFINITY_DIST)) s+=shooting_get_lens_to_focal_plane_width(); lens_set_focus_pos(s); } else photo_param_put_off.subj_dist=v; }}
Started by KaLi Feature Requests
Started by waterwingz Creative Uses of CHDK
Started by sarkar « 1 2 » Script Writing
Started by caiokn General Help and Assistance on using CHDK stable releases
Started by c_joerg Creative Uses of CHDK