Powershot SX150 IS Porting Thread - page 21 - General Discussion and Assistance - CHDK Forum

Powershot SX150 IS Porting Thread

  • 279 Replies
  • 114473 Views
*

Offline reyalp

  • ******
  • 14080
Re: Powershot SX150 IS Porting Thread
« Reply #200 on: 18 / November / 2012, 18:26:50 »
Advertisements
I have recently tried to do some low light shots using long times (for example 15 seconds). and i have found out that sometimes dngs are NOT saved when using times longer than 2 seconds. The card is a fast 32 gb sandisk uhs1.
Card type and speed is completely irrelevant.

CHDK decides whether or not to save raw based on some CHDK settings (like "raw exceptions", "only first raw in series" etc) and camera mode (for example, some low light/high iso modes don't produce valid raw data). There is nothing that depends directly on exposure speed.

It's also possible that the Canon code takes a different path that doesn't hit the raw hook under some circumstances. This should be repeatable if the conditions are identical. If you can narrow it down to some repeatable set of settings, that would be helpful.

Finally, there is a shortcut to toggle raw on and off, which you may hit inadvertently. On your camera this is probably trigger by pressing the 'disp' button in alt mode.
Don't forget what the H stands for.

Re: Powershot SX150 IS Porting Thread
« Reply #201 on: 19 / November / 2012, 12:07:33 »
I have recently tried to do some low light shots using long times (for example 15 seconds). and i have found out that sometimes dngs are NOT saved when using times longer than 2 seconds. The card is a fast 32 gb sandisk uhs1.
Card type and speed is completely irrelevant.

Thank you for the reply. Ok, so it's not the card.

Quote
CHDK decides whether or not to save raw based on some CHDK settings (like "raw exceptions", "only first raw in series" etc) and camera mode (for example, some low light/high iso modes don't produce valid raw data). There is nothing that depends directly on exposure speed.

Ok, and i have checked, there aren't exceptions: raw should be always saved.

Quote
It's also possible that the Canon code takes a different path that doesn't hit the raw hook under some circumstances. This should be repeatable if the conditions are identical. If you can narrow it down to some repeatable set of settings, that would be helpful.

Finally, there is a shortcut to toggle raw on and off, which you may hit inadvertently. On your camera this is probably trigger by pressing the 'disp' button in alt mode.

I'm sure i haven't pressed disp in alt mode.

Let's start from certain things:
i have tried to shot the same thing in M mode, 2second delay, starting from 1/500 to 5 second i have the raw, at 15 seconds there isn't a raw file. If you want exif data i'll upload them somewhere.

Turned off the camera.

Then i have retried 15 seconds, 2 seconds delay, and i have a raw (?)

So tried with tv bracketing +-1 1/3 around 15 seconds... custom delay 3seconds and 3 shots and:

- i don't have a raw for the first shot (15 seconds)
- i have raws for the second (exif indicates 15seconds but it's brighter) and the third (6 seconds) shot.

Thank you in advance.


*

Offline srsa_4c

  • ******
  • 4451
Re: Powershot SX150 IS Porting Thread
« Reply #202 on: 19 / November / 2012, 12:35:00 »
@pshotuser
There is another possible issue: CHDK might not get consistent file numbers. Try to shoot a number of pictures, where each picture (scene) is unique. When done, try to pair the RAW and JPEG pictures. If you find JPEG/RAW pairs where the RAW's file number is one less than the file number of the corresponding JPEG, then this will be the case. The missing files are simply overwritten.
edit: You can substitute "DNG" in place of "RAW" above (it doesn't matter here).
« Last Edit: 19 / November / 2012, 12:42:41 by srsa_4c »

Re: Powershot SX150 IS Porting Thread
« Reply #203 on: 20 / November / 2012, 10:55:49 »
Thank you srsa_4c, now i don't have time to try but i have found that you are right!

For example, when i first discovered the problem i had shot IMG_0277.JPG and the raw is SND_0276.WAV, and there isn't a raw for 276 that maybe has been overwritten.

In fact i have these files:

Code: [Select]
IMG_0273.JPG  IMG_0275.JPG  IMG_0277.JPG  SND_0274.WAV
IMG_0274.JPG  IMG_0276.JPG  SND_0273.WAV  SND_0276.WAV

Still there are missing dng files (i rename them to wav in order to download them to the pc without opening the battery door), but i think it's a step forward in trying to understand the problem.


*

Offline srsa_4c

  • ******
  • 4451
Re: Powershot SX150 IS Porting Thread
« Reply #204 on: 20 / November / 2012, 13:13:53 »
Attached is a test version with the following patch:
Code: (patch) [Select]
Index: platform/sx150is/sub/100a/capt_seq.c
===================================================================
--- platform/sx150is/sub/100a/capt_seq.c (revision 2297)
+++ platform/sx150is/sub/100a/capt_seq.c (working copy)
@@ -6,6 +6,8 @@
 
 static long *nrflag = (long*)0x5CB4;
 
+#define PAUSE_FOR_FILE_COUNTER 150
+
 #include "../../../generic/capt_seq.c"
Side effect is an additional 150ms delay when RAW/DNG is enabled.
It is possible that the delay is not enough and some RAW files will still be overwritten, if that happens, please report it.

edit: attachment removed, official releases now include this change
« Last Edit: 25 / November / 2012, 07:35:52 by srsa_4c »

Re: Powershot SX150 IS Porting Thread
« Reply #205 on: 20 / November / 2012, 13:23:54 »
Side effect is an additional 150ms delay when RAW/DNG is enabled.
It is possible that the delay is not enough and some RAW files will still be overwritten, if that happens, please report it.
A quick grep of the svn tree shows values as high as 300 used for the #define in some cameras.

Interestingly, different firmware versions of the same cameras  ( eg  A810, SX240, SX260 ) use different values in some cases.

Definitely not a precise hack.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: Powershot SX150 IS Porting Thread
« Reply #206 on: 20 / November / 2012, 13:32:40 »
A quick grep of the svn tree shows values as high as 300 used for the #define in some cameras.

Interestingly, different firmware versions of the same cameras  ( eg  A810, SX240, SX260 ) use different values in some cases.

Definitely not a precise hack.
I'd consider getting that counter earlier (before shooting), and increment it by one :)
Not sure about side effects though (in continuous mode for example).

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Powershot SX150 IS Porting Thread
« Reply #207 on: 20 / November / 2012, 14:04:34 »
A quick grep of the svn tree shows values as high as 300 used for the #define in some cameras.

Interestingly, different firmware versions of the same cameras  ( eg  A810, SX240, SX260 ) use different values in some cases.

Definitely not a precise hack.
I'd consider getting that counter earlier (before shooting), and increment it by one :)
Not sure about side effects though (in continuous mode for example).

It's not that simple - the file 'counter' increment may also update the directory name counter (high order bits) in some cases. If you don't get that part updated you will end up with the RAW/DNG files in the wrong location.

The code that sleeps for the defined delay could be modified to check if the file counter value has changed and finish early if it has. That would at least minimise the delay.

Really needs a better reverse engineering effort to find the task that controls it and see if there's a smarter way. This was a real quick and dirty fix I added to get around the problem :)

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)


*

Offline srsa_4c

  • ******
  • 4451
Re: Powershot SX150 IS Porting Thread
« Reply #208 on: 20 / November / 2012, 14:27:34 »
It's not that simple - the file 'counter' increment may also update the directory name counter (high order bits) in some cases. If you don't get that part updated you will end up with the RAW/DNG files in the wrong location.

The code that sleeps for the defined delay could be modified to check if the file counter value has changed and finish early if it has. That would at least minimise the delay.

Really needs a better reverse engineering effort to find the task that controls it and see if there's a smarter way. This was a real quick and dirty fix I added to get around the problem :)
I see, it's more complicated then...

Re: Powershot SX150 IS Porting Thread
« Reply #209 on: 21 / November / 2012, 15:26:11 »
Attached is a test version with the following patch:
Code: (patch) [Select]
Index: platform/sx150is/sub/100a/capt_seq.c
===================================================================
--- platform/sx150is/sub/100a/capt_seq.c (revision 2297)
+++ platform/sx150is/sub/100a/capt_seq.c (working copy)
@@ -6,6 +6,8 @@
 
 static long *nrflag = (long*)0x5CB4;
 
+#define PAUSE_FOR_FILE_COUNTER 150
+
 #include "../../../generic/capt_seq.c"
Side effect is an additional 150ms delay when RAW/DNG is enabled.
It is possible that the delay is not enough and some RAW files will still be overwritten, if that happens, please report it.

I have downloaded the 7z archive, but there is only diskboot.bin and not ps.fi2 . It's enought to overwrite the diskboot.bin i have on the card? Thank you.

p.s. Could the problem be due to dark frame subtraction? With brief shutter time i have never had a problem.

 

Related Topics