supplierdeeply

Alternative to PAUSE_FOR_FILE_COUNTER

  • 3 Replies
  • 600 Views
*

Offline philmoz

  • *****
  • 3056
    • Photos
Alternative to PAUSE_FOR_FILE_COUNTER
« on: 08 / August / 2015, 20:36:55 »
Advertisements
Attached is a patch for an alternative method of dealing with the problem currently solved by using PAUSE_FOR_FILE_COUNTER.

The issue is that the filename counter may not have been set to the correct value when CHDK tries to save a RAW/DNG file. The current fix is to wait until the file number has changed, up to a fixed interval. As recent testing has shown this is not 100% reliable.

This method uses a temporary filename when the RAW/DNG file is first saved, the renames the file when it is closed - hopefully by that time the file counter will be correct.

I've tested this on my G1X and it seems to work ok; but it needs more testing on other cameras that currently use PAUSE_FOR_FILE_COUNTER.

To try it on another camera, remove PAUSE_FOR_FILE_COUNTER from capt_seq.c and add USE_TEMP_NAME_FOR_RAW to platform_camera.h.

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)

*

Offline reyalp

  • ******
  • 11082
Re: Alternative to PAUSE_FOR_FILE_COUNTER
« Reply #1 on: 08 / August / 2015, 21:35:52 »
Nice idea  :D

Seems to work OK on ixus140 and sx160.

A couple of possible issues:
* There may be weirdness on folder change, since you can't rename across directories. I don't know if the folder change actually happens at the same time.
* remote capture uses the file number, and returns it with response indicating there is data to download, before the image data. It would be possible to do this differently, but it would be a protocol change. We could just make the client code fetch get_exp_count() on it's own, but it would complicate client code.
Don't forget what the H stands for.

*

Offline philmoz

  • *****
  • 3056
    • Photos
Re: Alternative to PAUSE_FOR_FILE_COUNTER
« Reply #2 on: 09 / August / 2015, 01:03:47 »
On the G1X the folder name seems to be correct, even if a new folder is created. Haven't explicitly tested what happens when the file number wraps around at 9999.

Remote capture is trickier. One option might be to use a completely custom naming scheme and store our own next file number in the config file.

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)

*

Offline reyalp

  • ******
  • 11082
Re: Alternative to PAUSE_FOR_FILE_COUNTER
« Reply #3 on: 09 / August / 2015, 02:40:53 »
On the G1X the folder name seems to be correct, even if a new folder is created. Haven't explicitly tested what happens when the file number wraps around at 9999.
What I meant was if the folder changes automatically between shots, i.e. hitting 9999 or 2000 images in the current folder. If the folder updates at the same time as the counter (which seems likely, though I've never logged it), then the tmp file will be created in the old folder, and the path used in rename will be in the new folder.
This is fairly rare in every day shooting, but pretty common for timelapse. It's also annoying to test.  ;)

It's a pity we don't have a FAT level move.
Quote
Remote capture is trickier. One option might be to use a completely custom naming scheme and store our own next file number in the config file.
I suppose we could just say it's up to the client and take the number out of the protocol. You could also managed numbers from script, or start with the current get_exp_count() number and increment yourself.

In chdkptp I've been meaning to add the substitution strings like imdl, which allows all kinds of time/date numbering, but the camera image numbering is a nice intuitive default.

I guess we could make the pause apply only to remotecap, but it would be even less likely to be well tested and has a substantial performance hit in come cases.
Don't forget what the H stands for.


 

Related Topics