Noticed you mentioned using a script to get the crash - missed that before.
Can you provide a link to the script - if it's an old one there might be something incompatible in it.
I can test it on my cameras to make sure we're not chasing the wrong thing.
It's a script that's bundled with CHDK, EXAM\tv_uni_e.lua.
I mentioned earlier that the camera stopped responding on half-press, but in further testing I believe the camera may have already been hung before I got that far. If I don't use the up/down arrows to zoom in the script, then it doesn't crash.
I suspect the set_zoom call is what's at fault. Specifically, lens_set_zoom_point() in platform/generic/wrappers.c. Even if you're sure you gave me the correct zoom_busy address a few days ago
, there are still a couple of camera-specific hacks in there trying to avoid a hang. The SX30, SX130, G10, and G12 do this:
// have to sleep here, zoom_busy set in another task, without sleep this will hang
while (zoom_busy) msleep(10);
And other cameras do this:
#if defined (CAMERA_s95)
// this will hang sometimes on s95 when zoom_busy gets stuck as a 1
// we add a timeout as a work-around for this problem
startTime = get_tick_count();
while (get_tick_count() < (startTime + 2000)) {
if (!zoom_busy)
break;
}
#else // !CAMERA_s95
while (zoom_busy);
#endif // !CAMERA_s95
I changed the while loop to look like the SX30 etc. one:
while (zoom_busy) msleep(10);
... which fixed the problem for the IXUS 220 (allowing me to zoom all the way out in the lua script with no hang), and I suspect might fix the S95 too, although I can't test that.
Would the following loop be generally safe?
startTime = get_tick_count();
while (get_tick_count() < (startTime + 2000)) {
if (!zoom_busy)
break;
msleep(10);
}
The minimally intrusive change I could make to fix the IXUS220 would be this:
#if defined (CAMERA_s95)
// this will hang sometimes on s95 when zoom_busy gets stuck as a 1
// we add a timeout as a work-around for this problem
startTime = get_tick_count();
while (get_tick_count() < (startTime + 2000)) {
if (!zoom_busy)
break;
}
#elif defined(CAMERA_ixus220_elph300hs)
while (zoom_busy) msleep(10);
#else // !CAMERA_s95
while (zoom_busy);
#endif // !CAMERA_s95
... but while that won't change behavior for anyone else, it only adds to the mess.