CHDK PTP interface - page 89 - General Discussion and Assistance - CHDK Forum

CHDK PTP interface

  • 1227 Replies
  • 372675 Views
*

Offline srsa_4c

  • ******
  • 4426
Re: CHDK PTP interface
« Reply #880 on: 09 / October / 2012, 00:00:26 »
Advertisements
So in this case, we don't need to fall back to the older registration functions, unless we decide to use other eventproc "hooks".
I haven't found anything obvious. Close() could be wrapped in filewritetask, but that obviously needs that task hook implemented.
Quote
The firmware code doesn't always return with a BX LR, so it might return to your thumb code without switching back to thumb mode. This is most common on vxworks cameras, but happens in some cases newer cameras do it too. So generally you shouldn't call a firmware function directly without a wrapper.
I see, just looked at a main.dump.

*

Offline reyalp

  • ******
  • 13392
Re: CHDK PTP interface
« Reply #881 on: 09 / October / 2012, 00:14:22 »
So in this case, we don't need to fall back to the older registration functions, unless we decide to use other eventproc "hooks".
I haven't found anything obvious. Close() could be wrapped in filewritetask, but that obviously needs that task hook implemented.
I actually meant for other purposes, not detecting file write complete. I agree, none of the others look like good candidates for that.

Edit:
Note we should be able to detect if the camera has PT_CompleteFileWrite. The original firmware version (on D10 at least) returns 0. If we call it before registering our own, -1 will indicate the firmware doesn't support, while 0 will indicate it does.
« Last Edit: 09 / October / 2012, 00:18:49 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 13392
Re: CHDK PTP interface
« Reply #882 on: 13 / October / 2012, 22:47:00 »
Note we should be able to detect if the camera has PT_CompleteFileWrite. The original firmware version (on D10 at least) returns 0. If we call it before registering our own, -1 will indicate the firmware doesn't support, while 0 will indicate it does.
I implemented this in changeset 2212.

One other "hook" that might be worth looking into is PT_CompleteSynchroWrite, although in a540, I don't see where that would be called.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4426
Re: CHDK PTP interface
« Reply #883 on: 14 / October / 2012, 17:54:31 »
Small status update.
Cameras with DryOS >= r50 have a more complicated filewritetask. Depending on the recording mode and image resolution, the camera can start to write the file before the whole jpeg appears in memory. This means that a protocol change and a change of the hooking method will be needed to successfully retrieve those files.

@reyalp
On the A470, the event procedure registration consumes 5352 bytes according to core_get_free_memory() - tested with the first version of register_pt_hooks().

You may have already noticed, there's a typo in changeset 2212.


*

Offline reyalp

  • ******
  • 13392
Re: CHDK PTP interface
« Reply #884 on: 14 / October / 2012, 18:59:45 »
On the A470, the event procedure registration consumes 5352 bytes according to core_get_free_memory() - tested with the first version of register_pt_hooks().
That's not too bad, but if we end up using this, it the final version should probably only register the first time it's needed, rather than in startup. I wouldn't worry about this for now.

Quote
You may have already noticed, there's a typo in changeset 2212.
Thanks for pointing that out. I didn't notice since a540 doesn't have PT_CompleteFileWrite, and I haven't implemented filewrite task in D10 yet.
Don't forget what the H stands for.

Re: CHDK PTP interface
« Reply #885 on: 19 / October / 2012, 20:43:17 »
@reyalp and srsa_4c.
Thanks guys for very nice work on chdkptp and remote shoot feature.

In my project cam take pictures every minute 24/7 which is more than a half milion shots in one year. I think that so much shots is big stress for camera HW and even bigger for flash card even if is used card with SLC and ECC card erorr correcting.
For now I using old cams with gphoto2 - here is function/parameter --capture-image-and-download thats allow shoot photo to buffer then download directly using PTP.
But now I want to use newer Canon cam (old one has been damaged - sensor KO) and new Digic don't have feature for PTP capture - ofcourse if isn't used CHDK.  :)

Now I have IXUS 870IS (FW 1.01a) and I want to test your new feature.
I have compiled chdkptp r311 and downloaded branch ptp-remote-capture-test2216

I am CHDK beginner so can somebody please update needed sources for my cam? FW dump is at https://www.box.com/s/tscho3m30j/9/55272271/536293935/1

*

Offline srsa_4c

  • ******
  • 4426
Re: CHDK PTP interface
« Reply #886 on: 20 / October / 2012, 01:08:48 »
I am CHDK beginner so can somebody please update needed sources for my cam?
Please be a bit patient. I also have this camera and, out of curiosity, created the necessary modifications for it. However, remote shooting appears to eat up its memory for some reason (unlike on other cameras), and causes it to crash after a few shots. As I'm curious whether it's my fw version (1.00e) that makes problems, I'll make the necessary mods for your fw too - soon.
If you're unlucky, the cam will be as unstable as mine.
Check back in a day or so.

Support code added (check svn).
Keep in mind that
- this whole thing is subject to change (client commands, protocol)
- due to some unknown factors on this camera, do not repeat the rs command too fast (2-3 seconds should work), or the camera will crash
- you'll need the ptp.h header from ptp-remote-capture-test for chdkptp, or else the necessary commands will not appear
- to reduce camera wear, you may need to do some additional scripting (like activating focus lock, setting desired operating mode, ...)
« Last Edit: 20 / October / 2012, 17:58:06 by srsa_4c »

*

Offline reyalp

  • ******
  • 13392
Re: CHDK PTP interface
« Reply #887 on: 20 / October / 2012, 15:44:45 »
As I'm curious whether it's my fw version (1.00e) that makes problems
I think it's very unlikely that the Canon firmware version would make a difference.
Don't forget what the H stands for.


*

Offline srsa_4c

  • ******
  • 4426
Re: CHDK PTP interface
« Reply #888 on: 20 / October / 2012, 16:18:18 »
As I'm curious whether it's my fw version (1.00e) that makes problems
I think it's very unlikely that the Canon firmware version would make a difference.
True, it was a silly idea. Incidentally, the 1.00e fw revision for this camera has a bad bug that made Canon issue a firmware upgrade (to 1.01a).

After some testing I found that I had to increase the delay between rs calls. It works normally with a delay of ~2-3 seconds. There may be a camera setting that causes this.

The event procedure registration costs 0 bytes of RAM on this cam, according to calls to core_get_free_memory().

*

Offline philmoz

  • *****
  • 3332
    • Photos
Re: CHDK PTP interface
« Reply #889 on: 20 / October / 2012, 16:50:19 »
The event procedure registration costs 0 bytes of RAM on this cam, according to calls to core_get_free_memory().

Keep in mind that core_get_free_memory returns the size of the largest free block currently in the heap, not the total amount of free memory available.

If the event registration required a small amount of memory and there was a small free block on the heap available you would not see any change in the return value from core_get_free_memory.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics