Maybe they will guide me how to do this. But if somebody can direct me, that'd be nice.
The usual approach is to look at the disassembly of a similar generation camera that is already known, and find the corresponding code in your firmware.
That's ok. Looks like the buffers are updated less frequently with slower shutter speeds - stuttering on single buffer is really pronounced.
I think this is correct, in low light the live view exposure time becomes to long to support the normal live view update rate.
I'm not sure about that. Getting one buffer takes me 25-40ms.
That's what I see with a540 as well. Note that on these cameras, the buffer size depends somewhat on shooting mode and digital zoom. However in chdkptp at least, you won't get anywhere close to 30 FPS in practice, because transfer and rendering are sequential.
I wonder if ptp can send request for 3 memory areas and get it in one transaction, so that there is overhead for initiating only 1 transfer instead of 3.
Maybe I'm missing something, but this doesn't make sense to me. You want the most recent buffer, not getting them all at once.
In any case, you can only transfer one address per send_data. You can do multiple send_data calls in a single transaction (live view already does this for the meta data) but there is substantial overhead.
If the frame buffers were close together, it might be faster to grab all 3 at once and ignore the stuff in between, but this would require a new live view protocol... and anyway, you want the most recent buffer, not all 3 at a given point in time.
I have that in mind. I'm not sure if it's ok I'm basing on the old ptpcam (v1.0). I chose that one because of simplicity and compactness.
I'm not sure what you mean by ptpcam 1.0. There were various forks to support the CHDK extension. There are some significant bugs affecting PTP operations in the early versions. The main one that comes to mind is the one related to packet size that caused certain sized transfers to fail on some cameras. The corresponding chdkptp change is
http://trac.assembla.com/chdkptp/changeset/258/trunk I'm not sure if it was ever fixed in any of the ptpcam sources (i thought it was in the chdkde source, but it looks like it wasn't...)
chdkptp is also derived from the ptpcam source, but I have re-written substantial parts of it.
that I ignore in method to connect with camera rewritten by me.
For future compatibility, you should check the CHDK protocol version. This is documented in the chdk ptp.h file.