CHDK PTP interface - page 90 - General Discussion and Assistance - CHDK Forum supplierdeeply

CHDK PTP interface

  • 1241 Replies
  • 489536 Views
*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #890 on: 20 / October / 2012, 17:36:38 »
Advertisements
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.
Re-did the test with core_get_free_memory() adjusted to return camera_meminfo.free_size.

Ixus870:  5944 bytes
A470:     6256 bytes

The values vary depending on the starting mode (rec/play, ptp, tv-out), other parallel tasks also allocate/free memory...

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #891 on: 22 / October / 2012, 00:40:28 »
Cameras with DryOS >= r50 have a more complicated filewritetask. This means that a protocol change and a change of the hooking method will be needed to successfully retrieve those files.
In changeset 2226 I have checked in support code for this. It hasn't been tested on a DryOS r50 camera yet, so it may contain some errors.
Remote capture protocol:
I had to add (back) param3 as "position" value in PTP_CHDK_RemoteCaptureGetData. R50 and newer cameras will need it.

Some background info about the behaviour of new cameras:
The jpeg data is either completely present in memory when filewritetask is notified (similarly as in older cameras), or appears like this:
- first filewritetask invocation: file is opened, seek is performed to skip over the (future) exif data, first chunk of jpeg written, file left open
- second, third invocation: additional chunks (one per invocation) are written sequentially, file left open
- last invocation: seek to position 0, exif written, file closed
According to my observations, exif is placed into the same buffer as the second jpeg chunk. There is some delay between the availability of the big jpeg chunks, my code tries to wait when needed.

I have created a new #define in camera.h, with the name CAM_EXTENDED_FILEWRITETASK. As indicated by my comment, this could be substituted by a (not yet created) CAM_DRYOS_2_3_R50 define.

I'm considering to change the filewrite hook function to only require the pointer to the start of the task's data block as argument, and use #define'd offsets to the values of interest.

edit:
The r50 code is not working as expected, needs to be fixed. However, the camera-specific part is OK.
edit2:
After analyzing the code (and the debug data provided by nafraf) I concluded that there must be some multitasking issue between the ptp and filewrite tasks. If that's the case, changeset 2243 should fix it.
« Last Edit: 31 / October / 2012, 22:08:09 by srsa_4c »

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #892 on: 02 / November / 2012, 20:35:08 »
After analyzing the code (and the debug data provided by nafraf) I concluded that there must be some multitasking issue between the ptp and filewrite tasks. If that's the case, changeset 2243 should fix it.
The change has now been tested, and it appears to work correctly. Many thanks to nafraf for helping me to make this happen!
The final step towards supporting DryOS r50+ cameras (A810 only at the moment) will be the implementation of seek when writing the file - in chdkptp.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #893 on: 03 / November / 2012, 21:50:13 »
Temporary patch for chdkptp to handle seek while remote shooting (also prints some debug info).
update: The patched chdkptp is confirmed to work with a DryOS r50 client (A810).

@reyalp
Somehow ptp.Nparam doesn't get updated after ptp_transaction().
« Last Edit: 10 / November / 2012, 22:38:48 by srsa_4c »


Re: CHDK PTP interface
« Reply #894 on: 05 / November / 2012, 06:52:48 »
hello phil,

i am still using your CHDKPTPRemote (posted by you around page  38 - around a year back) along with  Mweerden's liveview patch.

as liveview is already included in the trunk and as it has been implemented as a top level patch, i have been unable to make the old code (c# solution) work with the new live view. if you still using the code and if  it is not to much effort can you upload a new version.

thanks

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: CHDK PTP interface
« Reply #895 on: 05 / November / 2012, 07:26:19 »
hello phil,

i am still using your CHDKPTPRemote (posted by you around page  38 - around a year back) along with  Mweerden's liveview patch.

as liveview is already included in the trunk and as it has been implemented as a top level patch, i have been unable to make the old code (c# solution) work with the new live view. if you still using the code and if  it is not to much effort can you upload a new version.

thanks

The live view code was revamped by reyalp to sort out issues and make it a lot more useable.

I didn't update my code because reyalp also created a really good client.
You can get it at https://www.assembla.com/spaces/chdkptp/documents.

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)

Re: CHDK PTP interface
« Reply #896 on: 05 / November / 2012, 08:16:22 »
thanks,
but  link gives me a 404, (can you pls check that the link is ok !)
is it a .net client or a c/c++ (dot net would be better for me)

Re: CHDK PTP interface
« Reply #897 on: 05 / November / 2012, 09:23:16 »


*

Offline Taka

  • *
  • 12
Re: CHDK PTP interface
« Reply #898 on: 06 / November / 2012, 11:10:27 »
Hello! 

Sorry, I'd like to know how to use the CHDK PTP interface available in https://www.assembla.com/spaces/chdkptp/documents with my Canon PowerShot SX130 IS. I need to use the remote capture feature, but I don't know which procedure to follow. I tried to follow the old posts in this forum, but I really understand very little programming... I'm understanding nothing  :'( Can anyone help me with this, please?

Thankfully :)

*

Offline reyalp

  • ******
  • 14080
Re: CHDK PTP interface
« Reply #899 on: 06 / November / 2012, 16:57:49 »
Sorry, I'd like to know how to use the CHDK PTP interface available in https://www.assembla.com/spaces/chdkptp/documents with my Canon PowerShot SX130 IS. I need to use the remote capture feature, but I don't know which procedure to follow.
Thankfully :)
You don't need do any programming. Assuming you are using windows:
- Install a recent  (1.1 or later) version of CHDK on the camera
- Install the libusb inf driver for your camera
- Download and unzip the latest chdkptp binary the link you quoted.
- Plug in the camera and run the chdkptp executable.
Don't forget what the H stands for.

 

Related Topics