Camera crash on startup - investigation. - page 4 - General Discussion and Assistance - CHDK Forum

Camera crash on startup - investigation.

  • 112 Replies
  • 54383 Views
*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Camera crash on startup - investigation.
« Reply #30 on: 21 / March / 2011, 17:29:30 »
Advertisements
thanks for look into it, i do many photography sessions, and on all cards i use, when mkdirs are not execute on 2. or more raw crash not happen.

but to be safe i use your code and test.
seem make no sense to test the easy way with a stat to check if the dirs are here and only if not here create ?

If my theory is correct then it's all about the timing of the call to open in raw_savefile. Not calling mkdir means less code is executed and open is called slightly earlier thus avoiding the problem. You might also be able to fix it by calling msleep(10) just before the call to open in raw_savefile.

The problem with these fixes is that they aren't actually solving the problem - another code change later could alter the timing again and the problem could resurface.

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: Camera crash on startup - investigation.
« Reply #31 on: 22 / March / 2011, 05:47:03 »
I change now wrapper.c to old

Code: [Select]
int open (const char *name, int flags, int mode )
{
#ifdef CAM_DRYOS_2_3_R39
    if(name[0]!='A')return -1;
#endif
    return _Open(name, flags, mode);
}

and test the new fix in boot.c, after start i get 0.3.

after 1. series shot i get 6.12
2. series shoot 11.17

work great, no crash happen.I see save time vary from 1.6 to 2.2
but my card is full with files, i test again with clean card later.but as i remember when use _open, then a write need 2.4 sec or more always

So time vary is more problem of Card i think.On fast card, i get 0.12 after series and 1.1 sec save time constant.

another problem i see(but is no problem of Fix or alternate RAW buffer), i use chdk option RAW in jpg folder.and when i sort the files in windows by date

Before a RAW file is written there are 2 jpg files written.

This happen because camera can do 3 fps /sec and when RAW write to card is slower.on long exposure time, there is no problem.

Your G12 should be able in spec to shoot fast at 2 fps /sec on short exposure.

Have you see too that there are 2 jpg files written before RAW on your Camera ?.

when i compare exact, imag content(i move the camera to see better during series), it is that the filenumber is diffrent between jpg and RAW by 1.pictures are always ok, so the place of hook seem ok.

also the last RAW of a series shot is not written.so at end there are in a 6 image series 6 jpg and 5 RAW.

not very important, but maybe my hook is really wrong, if other Camera get not the Problem ?
Ixus 1000 HS

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Camera crash on startup - investigation.
« Reply #32 on: 22 / March / 2011, 06:16:55 »

and test the new fix in boot.c, after start i get 0.3.

after 1. series shot i get 6.12
2. series shoot 11.17

work great, no crash happen.I see save time vary from 1.6 to 2.2

The first number is the count of how many times _Open found the file handle already in the array - so it looks like there is definitely a significant conflict going on, given the number of times it fails.

The speed variation is also partly from the new _Open code - if it finds the file handle already in the array it bypasses the code that tries to add it. The end result is equivalent to calling _open instead of _Open on the file. As we saw earlier this results in slower write speeds.  One possible improvement here would be to do a msleep(10) in the new _Open code if it finds the problem and then retry. This would give the other task time to finish closing the file. When I get time, I'll try this out.

Quote
Before a RAW file is written there are 2 jpg files written.

also the last RAW of a series shot is not written.so at end there are in a 6 image series 6 jpg and 5 RAW.

I don't use CHDK RAW on the G12 since it has native RAW built in. On the SX30 I shot over 1300 images with DNG enabled and did not have any missing DNG files, although this camera does have a slower continuous rate.

I think the most likely reason for this is that the call to capt_seq_hook_raw_here is in the wrong place.

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: Camera crash on startup - investigation.
« Reply #33 on: 24 / March / 2011, 19:38:49 »
@philmoz :  thought I was starting to see the same startup crash on my IXUS120-SD940.  Camera would crash (shut down) before the CHDK logo appeared when pressing the Play button ( maybe 1 time in 5 it would startup properly).  Curiously, if I start the camera by holding down the Shoot power button the lens comes out and the camera starts every time.

Had a fair number of pictures on the card so I copied them all to my PC and deleted them.  Startup via the Play button started working fine (and is noticeably faster).  While I was moving the files off the card, Windows complained about one of them being "write protected" but I told it to move anyway. Now that things were working, I copied the files & directories back onto the card.  No more crashes - problem hiding out somewhere.

So - timing seems to matter. Not sure if the write protected file made the difference ?  Just another data point.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Camera crash on startup - investigation.
« Reply #34 on: 24 / March / 2011, 19:58:17 »
@philmoz :   Curiously, if I start the camera by holding down the Shoot power button the lens comes out and the camera starts every time.

I have been saying that for a long time now. This is the ONLY way that my SX20 will not crash at startup....by holding down the shoot button. It must mean something but I am not a programmer so I cannot help more than this.
SX20 1.02d

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Camera crash on startup - investigation.
« Reply #35 on: 24 / March / 2011, 21:27:18 »
@philmoz :   Curiously, if I start the camera by holding down the Shoot power button the lens comes out and the camera starts every time.

I have been saying that for a long time now. This is the ONLY way that my SX20 will not crash at startup....by holding down the shoot button. It must mean something but I am not a programmer so I cannot help more than this.

That's consistent with what I've seen and others have reported.
When you start in playback mode the camera appears to scan all the images on the card to build an in memory index.
This means it's opening and closing each file. If the timing is wrong it closes a file just as CHDK is opening the config or font file and the camera crashes.

@wowsers51 - have you been able to test with the version I posted earlier?

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: Camera crash on startup - investigation.
« Reply #36 on: 24 / March / 2011, 21:37:42 »
@philmoz :   Curiously, if I start the camera by holding down the Shoot power button the lens comes out and the camera starts every time.

I have been saying that for a long time now. This is the ONLY way that my SX20 will not crash at startup....by holding down the shoot button. It must mean something but I am not a programmer so I cannot help more than this.

That's consistent with what I've seen and others have reported.
When you start in playback mode the camera appears to scan all the images on the card to build an in memory index.
This means it's opening and closing each file. If the timing is wrong it closes a file just as CHDK is opening the config or font file and the camera crashes.

@wowsers51 - have you been able to test with the version I posted earlier?

Phil.


Yes 1 did and it crashed also. Sorry I can't help more than this. All I know is that before December of 2010, my SX20 NEVER ever crashed not even once. But since the beginning of December, that problem started when I downloaded a newer version of CHDK and since then, it has never been able to start without crashing. Sometimes, it will start just fine for several days, and then it will crash randomly for the next few days.
SX20 1.02d

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Camera crash on startup - investigation.
« Reply #37 on: 24 / March / 2011, 21:46:35 »
Yes 1 did and it crashed also. Sorry I can't help more than this. All I know is that before December of 2010, my SX20 NEVER ever crashed not even once. But since the beginning of December, that problem started when I downloaded a newer version of CHDK and since then, it has never been able to start without crashing. Sometimes, it will start just fine for several days, and then it will crash randomly for the next few days.

Are you able to dump the romlog from a crash using the version I posted?
I can then use this to trace the source of the crash.

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: Camera crash on startup - investigation.
« Reply #38 on: 24 / March / 2011, 21:48:34 »
Yes 1 did and it crashed also. Sorry I can't help more than this. All I know is that before December of 2010, my SX20 NEVER ever crashed not even once. But since the beginning of December, that problem started when I downloaded a newer version of CHDK and since then, it has never been able to start without crashing. Sometimes, it will start just fine for several days, and then it will crash randomly for the next few days.

Are you able to dump the romlog from a crash using the version I posted?
I can then use this to trace the source of the crash.

Phil.


I have tried this a few times and the camera just freeze and I need to remove the batteries in order to be able to restart the camera again.
SX20 1.02d

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Camera crash on startup - investigation.
« Reply #39 on: 24 / March / 2011, 22:19:50 »
I have tried this a few times and the camera just freeze and I need to remove the batteries in order to be able to restart the camera again.

I've found the best way to dump the romlog is to have a spare SD card that does not have CHDK installed or any images saved; but is configured to run scripts (http://chdk.wikia.com/wiki/Canon_Basic). This card can be very small - I use an old 128MB card.

I use the first romlog dump script from http://chdk.wikia.com/wiki/Canon_Basic/Scripts/Romlog saved to a file called 'extend.m' onto this card.

After the camera crashes, swap cards then start in playback mode, press the Func/Set button and when 'done' appears on the LCD turn off the camera. The ROMLOG.TXT should be saved on the SD card.

Hope this helps,
Phil.


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


SimplePortal © 2008-2014, SimplePortal