Not sure I understand the difference between shot_meter and shot_histogram.
The shot histogram is what's already there. I've modified it to create a larger array based on bit depth instead of bit shifting, added a scale factor for greater accuracy, and added the ability to get a histogram of a rectangular area in the raw buffer.
The shot meter is similar to the camera meter, but you can specify the metering area. That's what my script does at the beginning. get_shot_meter() returns an Apex96 value that is the difference between the measured brightness and the optimum brightness. You can add this value to your exposure to correct the exposure for the next shot.
It would be good to get a definition of what each of these functions does, what parameters it expects, what it returns and maybe how they are used (they seem to interlock) :
Yes, I'll work on that when I can.
I also have a new set exposure routine that sets everything at once using propcases. That's part of the script handshaking. Anyway, I need to write all that up so you can understand how it works.
I saw that and separated it out (along with the backlight_off code and the APEX96 code). Its separate from the shot_meter stuff and there was a discussion in IRC with reyalp about how this should be handled. It comes down to "SET_NOW" versus "SET_LATER" in the shooting code and this might not be the best way to handle it.
The problem is that in continuous mode, my interval delay has to wait until the script sets the exposure before it takes the next shot. By setting all the exposure parameters at once, I can then let the camera take the next shot. I worked for months getting all this to work right.
Another problem I found is that set_sv96() is a mess. I got some glitches (flashing in the video) that I think were related to this. I simplified it, and it seems to work correctly in all my cameras.
I'm currently trying to understand the interaction between set_shot_interval() and capt_seq.c - if you use it and do a shoot() rather than press & release of full shoot the camera hangs for example.
There's a handshake in continuous mode that may be the culprit. set_shot_interval() has an optional 2nd parameter that turns off this handshake. Were you using shoot() in continuous mode?
I've got some documentation in the comments in the C code before most of the functions you're talking about.
I appreciate you trying to get this into the trunk by separating it out at reyalp's request. But a lot of this stuff is very closely interwoven to get it to work at high speed in continuous mode. I tried separating things out including the Apex96 conversion and the set_backlight() fix, but I never got anything past reyalp.
Fixing set_backlight() is very important to me and a lot of other posters. My fix works, is simple, and doesn't take significant time or memory. I gave up trying to get anything into the trunk when this was vetoed. My script uses it and it works (press <set> while script is taking pictures). It eliminates flashing in single shot mode, and minimizes it in continuous.
Maybe it would be better to make shot_histogram.c a module that I have control of for now, and make the interface to CHDK as simple as possible. It wouldn't be loaded unless someone tried to call one of my new functions, so it should be safer.