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

CHDK PTP interface

  • 1244 Replies
  • 543660 Views
*

Offline nafraf

  • *****
  • 1308
Re: CHDK PTP interface
« Reply #1040 on: 09 / August / 2013, 05:16:56 »
Advertisements
@reyalp,
Patch in attachment is required to rs -jpg work in A490 continuous mode shoot.  tpont is testing with this patch applied.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #1041 on: 09 / August / 2013, 12:27:35 »
To reproduce the problem, just run separate rs commands many time in a row.
I had experienced something similar on the Ixus870/SD880. That camera has relatively small available memory. When I was attempting to use rs from a script, it failed in a few shots due to excessive memory consumption (something ate up the available RAM, without releasing it). With delays (1-2 sec?) between the rs attempts, the gradual memory leak seemed to vanish. I don't know whether your problem has anything to do with this though.

*

Offline tpont

  • **
  • 81
Re: CHDK PTP interface
« Reply #1042 on: 09 / August / 2013, 17:11:28 »
When I was attempting to use rs from a script, it failed in a few shots due to excessive memory consumption
Could you do rs commands after the error or did you have to power the camera off and on first?


*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #1043 on: 09 / August / 2013, 17:17:06 »
Could you do rs commands after the error or did you have to power the camera off and on first?
The memory was permanently lost, I think the cam usually crashed when the rs cycle was left running.
Try to print the available camera memory after every shot. OR see whether shooting in a slower pace helps.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #1044 on: 09 / August / 2013, 17:22:03 »
remote shoot in continuous mode seems to fail frequently on a540.
I'm afraid I can't be much help, but I suspect that the cause is a task synch issue - something isn't happening in the expected order.

*

Offline reyalp

  • ******
  • 14128
Re: CHDK PTP interface
« Reply #1045 on: 09 / August / 2013, 17:28:22 »
I'm afraid I can't be much help, but I suspect that the cause is a task synch issue - something isn't happening in the expected order.
No problem. I just posted here so people can be aware of the issue. I'll try to have a closer look this weekend.

I have only seen this issue when doing jpeg only, but I haven't tried a lot with raw. I ran two 60 shot sequences on D10 and didn't see the problem.
Don't forget what the H stands for.

*

Offline tpont

  • **
  • 81
Re: CHDK PTP interface
« Reply #1046 on: 09 / August / 2013, 18:06:16 »
Try to print the available camera memory after every shot.
When I after each photo run this (found earlier in this thread)
Code: [Select]
!return con:execwait('return get_meminfo()')I get this
Code: [Select]
con 142>
=true,{
 start_address=1363912,
 chdk_start=2212572,
 free_size=204752,
 chdk_size=147072,
 allocated_size=996624,
 total_size=1201376,
 allocated_peak=999872,
 name="system",
 allocated_count=1364,
 chdk_malloc=true,
 free_block_max_size=202696,
 end_address=2565288,
 free_block_count=15,
}
The values doesn't seem to change. They are the same right before the error appears as they were many shots earlier. Is there some other memory command I should use?

*

Offline reyalp

  • ******
  • 14128
Re: CHDK PTP interface
« Reply #1047 on: 10 / August / 2013, 01:37:14 »
OK, I think I understand how the issue on a540 happens. It appears that the raw hook for the next shot can be called before the filewrite hook for the preceding one has even started. For some reason, this seems to happen more frequently on the first shooting sequence after booting up.

It is likely the problem happens more with fast exposure times and small images. It probably won't happen if raw is also requested, because that will leave plenty of time for the filewrite hook to catch up.

The check I added in http://chdk.setepontos.com/index.php?topic=4338.msg102447#msg102447 isn't sufficient, because in that assumes the data has at least become available.

Attached debug patch shows this, by flashing the debug LED when the condition is hit. Note this is not a full solution, since it would clear the flag after every file type. It will only work if you are capturing only jpeg.

I'm not clear if this is related to the issue others have seen with continuous mode.
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDK PTP interface
« Reply #1048 on: 10 / August / 2013, 13:01:46 »
I have done some (not proper) testing. A410 (USB speed limited), S size images (around 64kB each).
I did get errors like
> rs /tmp -cont=1000
WARNING: timed out waiting for shot script
wait time 31,3551

before the patch, I think it did happen after the patch too. May depend on shutter speed - which has a big influence on the continuous shooting rate.
When shutter speed is high, I tend to find some files on the SD card - files, which have also been transferred.
Haven't noticed any blue LED activity.

@tpont
If you get "script is already running", you can stop the script the usual way (full shutter press in ALT mode, on camera).
« Last Edit: 10 / August / 2013, 13:04:11 by srsa_4c »

*

Offline reyalp

  • ******
  • 14128
Re: CHDK PTP interface
« Reply #1049 on: 10 / August / 2013, 17:54:38 »
I have done some (not proper) testing. A410 (USB speed limited), S size images (around 64kB each).
I did get errors like
> rs /tmp -cont=1000
WARNING: timed out waiting for shot script
wait time 31,3551

I've had instances like this where the script didn't start  shooting at all, I'm not clear why it happens yet. I don't think it's directly remoteshoot related. The current remoteshoot camera side script in chdkptp doesn't handle this well either, I'll try to check in a better behaved one in a bit.

edit:
If there is an error on the client during shooting but the script is still running, it will block until remotecap times out, and then shoot the remaining shots locally. It would be good to have a way to know from script if remotecap had been canceled by a timeout.

edit2:
but I'm seeing images being saved when they shouldn't be. This may have something to do with filewrite_set_discard_jpeg(1) being after the "pending" wait, but I would expect it to still be set from the previous shot...

edit3:
My earlier patch was insufficient, since it would clear the "pending" flag after the first chunk rather than when the transfer was complete. This was masked the delays I added to make the LED blinking visible.

I've moved on to logging to the camera log from all the different tasks with LogPrintf.

edit4:
One problem that leads to the jpegs being saved on the card is that the filewrite hook for shot N can finish *after* the raw hook sets ignore_current_write for shot N+1
« Last Edit: 10 / August / 2013, 22:30:45 by reyalp »
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal