supplierdeeply

Camera crash on startup - investigation.

  • 112 Replies
  • 11012 Views
  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #20 on: 18 / March / 2011, 12:03:50 »
    Advertisements
    If have code for this, let us know, i can test if Ixus 1000 work ok, also on freeze on series RAW shoot.

    how can reproduce the startup crash, i know better now.when you put lots of jpg files on your card in 1 dir, so that 7 GB with 3-4 megabyte each files are reach, crash happen always with no msleep on my camera.
    Ixus 1000 HS

  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #21 on: 18 / March / 2011, 15:19:44 »
    Well, the first thing I made was start the camera and it didnt crashed but the "mint.lua" script doesnt work with that version (1090 test). It gives me an error code (42). I really need that mint.lua script to work so for me, I can't use this version. Sorry if I couldnt test it longer. :-[
    SX20 1.02d

    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #22 on: 18 / March / 2011, 17:22:15 »
    Well, the first thing I made was start the camera and it didnt crashed but the "mint.lua" script doesnt work with that version (1090 test). It gives me an error code (42). I really need that mint.lua script to work so for me, I can't use this version. Sorry if I couldnt test it longer. :-[

    Was there a message after the error number like 'unexpected symbol'?

    If this is the case then open the mint.lua file in a text editor and make sure there is a blank line at the end of the file.

    I recall reading that there is a problem with scripts when using code built under Windows. I think 'Brend R' found that the scripts have to have a blank line at the end to work properly. I believe the autobuild server is using Linux and the builds created there don't have this 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)

  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #23 on: 18 / March / 2011, 17:35:16 »
    Well, the first thing I made was start the camera and it didnt crashed but the "mint.lua" script doesnt work with that version (1090 test). It gives me an error code (42). I really need that mint.lua script to work so for me, I can't use this version. Sorry if I couldnt test it longer. :-[

    Was there a message after the error number like 'unexpected symbol'?

    If this is the case then open the mint.lua file in a text editor and make sure there is a blank line at the end of the file.

    I recall reading that there is a problem with scripts when using code built under Windows. I think 'Brend R' found that the scripts have to have a blank line at the end to work properly. I believe the autobuild server is using Linux and the builds created there don't have this problem.

    Phil.


    Yes there was the "unexpected symbol" message. I will try to do what you told me for mint.lua and keep you informed. Thanks.
    SX20 1.02d


    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #24 on: 18 / March / 2011, 17:37:54 »
    If have code for this, let us know, i can test if Ixus 1000 work ok, also on freeze on series RAW shoot.

    how can reproduce the startup crash, i know better now.when you put lots of jpg files on your card in 1 dir, so that 7 GB with 3-4 megabyte each files are reach, crash happen always with no msleep on my camera.

    Below is the code change for the open function that I am currently testing. Files that are opened for reading are opened with the unbuffered call otherwise the buffered version is used. This seems to work for the startup problem; but I'm not sure about your 'freeze on series RAW shoot' - do you get the crash on the same line number in the ROMLOG in this case as you do if it crashes on startup?

    In platform/generic/wrappers.c:
    Code: [Select]
    int open (const char *name, int flags, int mode )
    {
    #ifdef CAM_DRYOS_2_3_R39
        if(name[0]!='A')return -1;
    #endif
    #define O_RDONLY        0
    if (flags == O_RDONLY) // At startup opening the conf / font files conflicts with Canon task if use _Open. Camera can randomly crash.
    return _open(name, flags, mode);
        return _Open(name, flags, mode);
    }

    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)

  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #25 on: 19 / March / 2011, 11:34:13 »
    >Below is the code change for the open function that I am currently testing.

    thanks for code, i test soon.trhe crash is same line as startup crash.here is a thread of it.there are also some sx120 users with that problem, see in thread post of micklesh

    http://chdk.setepontos.com/index.php?topic=6057.0
    « Last Edit: 19 / March / 2011, 11:36:58 by Bernd R »
    Ixus 1000 HS

    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #26 on: 19 / March / 2011, 19:29:20 »
    >Below is the code change for the open function that I am currently testing.

    thanks for code, i test soon.trhe crash is same line as startup crash.here is a thread of it.there are also some sx120 users with that problem, see in thread post of micklesh

    http://chdk.setepontos.com/index.php?topic=6057.0

    Based on the info you posted in the other thread I don't think the code change to 'open' will fix the crash you are getting when shooting continuous. The RAW files are still going to be opened for writing and it sounds like the problem is happening in the Canon firmware code since you say it occurs when the camera shows 'Busy' on the LCD.

    Can you post the romlog from one of these crashes, the main.dump file from the same build (in the core directory) and the primary.bin firmware dump for the camera. With these it's possible to trace where in the firmware / CHDK code the crash is happening which may help to diagnose 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)

  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #27 on: 20 / March / 2011, 06:30:35 »
    I have test now your new open code a little.the start crash is solved, but the RAW write crash happen too.i get it after 3rd raw i write on my 15 megabyte/sec Card and after 5 RAW write(i test only once).My  22 megabyte/sec Card work without crash and my 6 megabyte/sec Card work too, i test several time.

    I upload the files you ask here.My version  is 100D

    http://www.zshare.net/download/880201570256d3e8/

    I have the idea to change the code that with a stat function call is check if the directory is here or not.thast more clean as skipmkdir on more raw write i think.

    If the directory is here, then no mkdir is called.
    but i dont know if that can help.

    thanks that you take a closer look on the files, i think problem can happen on all camera depend on SD Card and exposure time.
    Ixus 1000 HS


    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #28 on: 20 / March / 2011, 18:51:52 »
    I upload the files you ask here.My version  is 100D

    http://www.zshare.net/download/880201570256d3e8/

    thanks that you take a closer look on the files, i think problem can happen on all camera depend on SD Card and exposure time.

    The crash is happening on the 'open' call for the RAW file in raw_savefile.
    After re-reading the other posts I suspect this is a timing problem (like at startup) where another task is closing a file just before raw_savefile calls 'open'. Possibly the camera is offloading the save of the JPEG file to another task and if things happen in just the right (or wrong) way then you get the crash. All the fixes you talk about involved changing the timing in some way - including changing SD cards.

    Adding sleep calls or moving the call to capt_seq_hook_raw_here may help; but if it's a timing problem you will never know when it will resurface.

    I think the solution is the custom / modified version of '_Open' like I posted earlier.
    I've created a version of this code from the 1.00d IXUS 1000 firmware.

    Add this to boot.c:
    Code: [Select]
    int fsionotify_compfail = 0; // count of number of times the file handle was already in the array
    int fsionotify_success  = 0; // count of number of times the code succeeded

    int __attribute__((naked,noinline)) _Open(const char *name, int flags, int mode) {

       asm volatile (
    "STMFD   SP!, {R4-R8,LR} \n"
    "MOV     R6, R0 \n"
    "LDRB    R0, [R0] \n"
    "MOV     R7, R2 \n"
    "MOV     R4, R1 \n"
    "BL      sub_FF874504 \n"
    "MOV     R8, R0 \n"
    "MOV R0, #1 \n"
    "BIC     R5, R0, R4,LSR#12 \n"
    "BIC     R4, R4, #0x9000 \n"
    "MOV R0, R8 \n"
    "MOV     R1, #1 \n"
    "BL      sub_FF875894 \n"
    "MOV     R2, R7 \n"
    "MOV     R1, R4 \n"
    "MOV     R0, R6 \n"
    "BL      _open \n"
    "CMP R5, #0 \n"
    "MOV     R7, R0 \n"
    "MOVNE R0, R7 \n"
    "MOVNE   R2, R4 \n"
    "MOVNE   R1, R6 \n"
    "BLNE    sub_FF872470_my \n"
    "MOV     R0, R8 \n"
    "BL      sub_FF87590C \n"
    "MOV     R0, R7 \n"
    "LDMFD   SP!, {R4-R8,PC} \n"
       );

    return 0; // stop compiler warning
    }

    void __attribute__((naked,noinline)) sub_FF872470_my() {

       asm volatile (
    "STMFD   SP!, {R4-R8,LR} \n"
    "MOV     R5, R0 \n"
    "LDR     R0, =0x31B8 \n"
    "MOV     R7, R1 \n"
    "LDR     R0, [R0,#4] \n"
    "MOV     R6, R2 \n"
    "CMP     R0, #0 \n"
    "LDMEQFD SP!, {R4-R8,PC} \n"
    "CMP     R5, #0 \n"
    "LDMLTFD SP!, {R4-R8,PC} \n"
    "MOV     R4, #0 \n"
    "LDR     R2, =0x38EA8 \n"
    "MOV     R0, #0 \n"
    "loc_FF8724A4: \n"
    "ADD     R1, R0, R0,LSL#1 \n"
    "LDR     R1, [R2,R1,LSL#5] \n"
    "CMN     R1, #1 \n"
    "ADDEQ   R0, R0, R0,LSL#1 \n"
    "ADDEQ   R4, R2, R0,LSL#5 \n"
    "BEQ     loc_FF8724CC\n"
    "CMP     R1, R5 \n"

    "BEQ loc_2 \n" // + // branch if found entry matching new file handle

    "ADDNE   R0, R0, #1 \n"
    "CMPNE   R0, #0xA \n"
    "BLT     loc_FF8724A4 \n"

    "loc_FF8724CC: \n"
    "CMP     R4, #0 \n"
    "LDREQ   R1, =0x1C9 \n"
    "LDREQ   R0, =0xFF8723B8 \n" //aFsionotify_c
    "BLEQ    sub_FF81EB78 \n" //_DebugAssert

    "LDR R1, =fsionotify_success \n" // + // increment counter
    "LDR R0, [R1] \n" // + // of successful calls
    "ADD R0, R0, #1 \n" // +
    "STR R0, [R1] \n" // +

    "MOV     R0, #0 \n" // original code - save handle in array
    "STR     R0, [R4,#0x58] \n"
    "STR     R5, [R4] \n"
    "MOV     R0, R4 \n"
    "MOV     R1, R7 \n"
    "STR     R6, [R4,#0x24] \n"
    "BL      sub_FF872238 \n"
    "ADD     R1, R4, #0x28 \n"
    "MOV     R0, R7 \n"
    "LDMFD   SP!, {R4-R8,LR} \n"
    "B       sub_FF8381C4 \n"

    "loc_2: \n" // + // Handle case when new file handle returned from _open is already in array
    "LDR R1, =fsionotify_compfail \n" // + // increment counter then return rather than throw exception
    "LDR R0, [R1] \n" // + // equivalent to calling _open rather than _Open
    "ADD R0, R0, #1 \n" // +
    "STR R0, [R1] \n" // +
    "LDMFD   SP!, {R4-R8,PC} \n" // +
       );
    }

    Add this to gui.c (at the start of gui_draw_debug_vals_osd):
    Code: [Select]
    extern int fsionotify_compfail, fsionotify_success;
    sprintf(osd_buf, "%d,%d", fsionotify_compfail,fsionotify_success);
    draw_txt_string(34, 14, osd_buf, conf.osd_color);

    And comment out the Open stub in stubs_entry_2.s if present.

    This will show on screen the number of times the custom _Open code hits the problem (and the number of times it does not).

    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)

  • Publish
    Re: Camera crash on startup - investigation.
    « Reply #29 on: 21 / March / 2011, 10:20:21 »
    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 ?
    Ixus 1000 HS

     

    Related Topics