ELPH300HS aka IXUS220HS - Porting Thread

  • 836 Replies
  • 102921 Views
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #720 on: 10 / March / 2012, 12:23:07 »
    Advertisements
    Making Badpixel.bin:

    Fails always for me with release 1714.    I tried different ISO's.
    I went back to 1486 and it worked.
    Once you've got a working badpixel.bin file - keep it somewhere safe.  Then you can use DNG with the latest versions of CHDK (assuming there is some problem or another) by just copying it to the SD card.

    *

    Offline reyalp

    • ******
    • 9961
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #721 on: 10 / March / 2012, 14:31:24 »
    Making Badpixel.bin:

    Fails always for me with release 1714.    I tried different ISO's.
    I went back to 1486 and it worked.
    Can you provide more information on how it failed ?
    Don't forget what the H stands for.

  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #722 on: 10 / March / 2012, 15:37:02 »
    Hi,

    It takes one (rarely two) pictures then gives a fail message.  The message gives no further info.  I don't know what more to report.  Maybe the routine itself should give more detailed messages as to why it failed if it knows why.
    Can you provide more information on how it failed ?

    *

    Offline reyalp

    • ******
    • 9961
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #723 on: 10 / March / 2012, 16:14:45 »
    Hi,

    It takes one (rarely two) pictures then gives a fail message.  The message gives no further info.  I don't know what more to report.
    Whether it takes one or two pictures is an important piece of information.
    Don't forget what the H stands for.


    *

    Offline srsa_4c

    • ******
    • 3136
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #724 on: 11 / March / 2012, 11:14:29 »
    @imtheguy
    Next try. This time I tried to disable the dark frame at two locations. Also switched compilers, in case my usual compiler (toolchain) screwed up somehow. If this still isn't 100% reliable, then some big amount of Canon's code would have to be checked and "fixed". I'd rather not do that.

    You can reset your CHDK settings if you think they got corrupted: Miscellaneous Stuff -> Reset Options to Default (but you probably already knew this).

    I believe, this behaviour should exist in a number of newer cameras (especially CMOS ones), but apparently no one else has noticed or reported it.

    CHDK-ixus220_elph300hs-101g-1.0.0.zip - 0.35MB

    Code: [Select]
    Index: platform/ixus220_elph300hs/sub/101g/capt_seq.c
    ===================================================================
    --- platform/ixus220_elph300hs/sub/101g/capt_seq.c (revision 1725)
    +++ platform/ixus220_elph300hs/sub/101g/capt_seq.c (working copy)
    @@ -2,7 +2,7 @@
     #include "platform.h"
     #include "core.h"
     
    -static long *nrflag = (long*)(0x7514+0x8);  // FF18775C & FF1877C8
    +static long *nrflag = (long*)(0x7200+0x08);
     #define NR_AUTO (0) // have to explictly reset value back to 0 to enable auto
     #define PAUSE_FOR_FILE_COUNTER 100          // Enable delay in capt_seq_hook_raw_here to ensure file counter is updated
     
    @@ -13,6 +13,22 @@
     // while(1);
     //}
     
    +void __attribute__((naked,noinline)) disable_nr_when_needed()
    +{
    +asm volatile(
    +        "STMFD   SP!, {R1-R12,LR}\n"
    +        "MOV     R4, R0\n"
    +        "BL      core_get_noise_reduction_value\n"
    +        "CMP     R0, #1\n" // NOISE_REDUCTION_OFF
    +        "BNE     loc_dontsetnr\n"
    +        "MOV     R4, #1\n"
    +"loc_dontsetnr:\n"
    +        "MOV     R0, R4\n"
    +        "LDMFD   SP!, {R1-R12,PC}\n"
    +        );
    +}
    +
    +
     void __attribute__((naked,noinline)) capt_seq_task() {
     // FF882920   IXUS 220: DONE
     
    @@ -104,7 +120,7 @@
     " LDR R8, [R0,#0xC] \n"
     "       MOV     R0, R8 \n"
     
    -"       BL      sub_FF98B018 \n"
    +"       BL      sub_FF98B018_my \n" // ->
     
     "       BL      capt_seq_hook_raw_here\n"           // added
     
    @@ -333,6 +349,159 @@
      );
     }
     
    +
    +
    +void __attribute__((naked,noinline)) sub_FF98B018_my(  ) {
    +asm volatile (
    +      "    STMFD   SP!, {R3-R7,LR}\n"
    +      "    LDR     R5, =0x3D48C\n"
    +      "    MOV     R4, R0\n"
    +      "    LDR     R0, [R5, #0x28]\n"
    +      "    LDR     R7, =0x820C\n"
    +      "    CMP     R0, #0\n"
    +      "    MOV     R6, #0\n"
    +      "    BNE     loc_FF98B0A8\n"
    +      "    LDR     R0, [R5, #0xBC]\n"
    +      "    CMP     R0, #1\n"
    +      "    BNE     loc_FF98B090\n"
    +      "    LDRH    R0, [R5]\n"
    +      "    CMP     R0, R7\n"
    +      "    LDRNEH  R0, [R5, #0x96]\n"
    +      "    CMPNE   R0, #3\n"
    +      "    LDRNE   R0, [R4, #8]\n"
    +      "    CMPNE   R0, #1\n"
    +      "    BLS     loc_FF98B074\n"
    +      "    BL      sub_FF832D6C\n"
    +      "    TST     R0, #1\n"
    +      "    BEQ     loc_FF98B0A8\n"
    +      "    BL      sub_FF888708\n"
    +      "    B       loc_FF98B0A0\n"
    +"loc_FF98B074:\n"
    +      "    MOV     R0, #0xC\n"
    +      "    BL      sub_FF8886A0\n"
    +      "    TST     R0, #1\n"
    +      "    BEQ     loc_FF98B0A8\n"
    +      "    BL      sub_FF98B84C\n"
    +      "    BL      sub_FF8807AC\n"
    +      "    B       loc_FF98B0A0\n"
    +"loc_FF98B090:\n"
    +      "    MOV     R0, #0xC\n"
    +      "    BL      sub_FF8886A0\n"
    +      "    TST     R0, #1\n"
    +      "    BEQ     loc_FF98B0A8\n"
    +"loc_FF98B0A0:\n"
    +      "    MOV     R0, #1\n"
    +      "    LDMFD   SP!, {R3-R7,PC}\n"
    +"loc_FF98B0A8:\n"
    +      "    BL      sub_FF88318C\n"
    +      "    LDR     R0, [R5, #0x28]\n"
    +      "    CMP     R0, #0\n"
    +      "    BNE     loc_FF98B170\n"
    +      "    MOV     R0, R4\n"
    +      "    BL      sub_FF98A948\n"
    +      "    TST     R0, #1\n"
    +      "    LDMNEFD SP!, {R3-R7,PC}\n"
    +      "    MOV     R0, R4\n"
    +      "    BL      sub_FF98ACFC\n"
    +      "    BL      sub_FF98B790\n"
    +      "    LDR     R0, [R5, #0xBC]\n"
    +      "    CMP     R0, #1\n"
    +      "    BNE     loc_FF98B0FC\n"
    +      "    LDRH    R0, [R5]\n"
    +      "    CMP     R0, R7\n"
    +      "    LDRNEH  R0, [R5, #0x96]\n"
    +      "    CMPNE   R0, #3\n"
    +      "    LDRNE   R0, [R4, #8]\n"
    +      "    CMPNE   R0, #1\n"
    +      "    BHI     loc_FF98B104\n"
    +"loc_FF98B0FC:\n"
    +      "    MOV     R0, #2\n"
    +      "    BL      sub_FF889FEC\n"
    +"loc_FF98B104:\n"
    +      "    BL      capt_seq_hook_set_nr\n" // +
    +      "    LDRH    R0, [R5]\n"
    +      "    SUB     R1, R0, #0x8200\n"
    +      "    SUBS    R1, R1, #0x2D\n"
    +      "    BNE     loc_FF98B160\n"
    +      "    MOV     R5, #1\n"
    +      "    MOV     R2, #2\n"
    +      "    MOV     R1, SP\n"
    +      "    ADD     R0, R2, #0x15C\n"
    +      "    STR     R5, [SP]\n"
    +      "    BL      sub_FF895E60\n"
    +      "    TST     R0, #1\n"
    +      "    MOVNE   R1, #0xBC\n"
    +      "    LDRNE   R0, =0xFF98B28C\n"
    +      "    BLNE    sub_FF81EC88\n"
    +      "    LDRH    R0, [SP]\n"
    +      "    CMP     R0, #1\n"
    +      "    BLS     loc_FF98B158\n"
    +      "    MOV     R0, R4\n"
    +      "    STR     R5, [R4, #0xE4]\n"
    +      "    BL      sub_FFAF1030_my\n" // nr-related (read)
    +      "    B       loc_FF98B168\n"
    +"loc_FF98B158:\n"
    +      "    MOV     R0, #0\n"
    +      "    STR     R0, [R4, #0xE4]\n"
    +"loc_FF98B160:\n"
    +      "    MOV     R0, R4\n"
    +      "    BL      sub_FFAF0C70_my\n" // nr-related (read)
    +"loc_FF98B168:\n"
    +      "    MOV     R6, R0\n"
    +      "    B       loc_FF98B180\n"
    +"loc_FF98B170:\n"
    +      "    LDR     R0, =0x71AC\n"
    +      "    LDR     R0, [R0]\n"
    +      "    CMP     R0, #0\n"
    +      "    MOVNE   R6, #0x1D\n"
    +"loc_FF98B180:\n"
    +      "    MOV     R0, R6\n"
    +      "    LDMFD   SP!, {R3-R7,PC}\n"
    +        );
    +}
    +
    +void __attribute__((naked,noinline)) sub_FFAF1030_my(  ) {
    +asm volatile (
    +"    STMFD   SP!, {R4-R11,LR} \n"
    +"    SUB     SP, SP, #0x1C \n"
    +"    MOV     R4, R0 \n"
    +"    BL      sub_FF98BCC4 \n"
    +"    MVN     R1, #0 \n"
    +"    BL      sub_FF88DC0C \n"
    +"    LDR     R0, =0xFF98AA5C \n"
    +"    MOV     R1, R4 \n"
    +"    BL      sub_FF8C0990 \n"
    +"    LDR     R8, =0xD880 \n"
    +"    MOV     R5, #0 \n"
    +"    MOV     R0, R4 \n"
    +"    STR     R5, [R8] \n"
    +"    BL      sub_FF98A9C0 \n"
    +"    MOV     R0, R4 \n"
    +"    BL      sub_FF98ADD0 \n" // gives nr value in r0
    +"    BL      disable_nr_when_needed \n" //+
    +"    LDR     PC, =0xFFAF1070\n" // continue in ROM
    +        );
    +}
    +
    +void __attribute__((naked,noinline)) sub_FFAF0C70_my(  ) {
    +asm volatile (
    +"    STMFD   SP!, {R3-R7,LR} \n"
    +"    MOV     R4, R0 \n"
    +"    BL      sub_FF98BCC4 \n"
    +"    MVN     R1, #0 \n"
    +"    BL      sub_FF88DC0C \n"
    +"    LDR     R0, =0xFF98AA5C \n"
    +"    MOV     R1, R4 \n"
    +"    BL      sub_FF8C0990 \n"
    +"    MOV     R0, R4 \n"
    +"    BL      sub_FF98A9C0 \n"
    +"    MOV     R0, R4 \n"
    +"    BL      sub_FF98ADD0 \n" // gives nr value in r0
    +"    BL      disable_nr_when_needed \n" //+
    +"    LDR     PC, =0xFFAF0CA0\n" // continue in ROM
    +        );
    +}
    +
     /*************************************************************/
     
     void __attribute__((naked,noinline)) exp_drv_task(){

  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #725 on: 11 / March / 2012, 12:30:28 »
    I just tried it and it took two pictures then failed.
    Jon


    Whether it takes one or two pictures is an important piece of information.

  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #726 on: 11 / March / 2012, 12:39:32 »
    @imtheguy
    Next try.

    and a heck of a great try it is.  Now I can use DFS with any settings, <alt> on or off, and with no perceived limit before it kicks back in.  Did not go beyond 10 shots yet.  You nailed it this time.  The only funky think that happened is after switching settings back and forth a couple times I could no longer access the CHDK menu.  Camera not locked, just no menu.  I dont plan to do such stress tests in the field though.  Geat job, great work.  I will continue some more DFS testing later including raw, long runs and badpixel files. 

    Take a break!  Thanks again, Lee

    *

    Offline reyalp

    • ******
    • 9961
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #727 on: 11 / March / 2012, 15:20:17 »
    I just tried it and it took two pictures then failed.
    So it gave you the "badpixel.bin failed." message ?

    Does it sometimes only take one picture ? And if so, what happens in that case, does it give you the error message or just stop ?

    What capture mode do you have the camera in ? FWIW, badpixel will not work in the half sized low light/high iso/fast burst modes.


    Don't forget what the H stands for.


    *

    Offline philmoz

    • *****
    • 2936
      • Photos
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #728 on: 11 / March / 2012, 16:51:27 »
    I just tried it and it took two pictures then failed.
    Jon

    Can you create an empty badpixel.bin file in the CHDK folder and then take a few photos of a light colored wall as  DNG files (using the ISO you were trying) .

    Upload the DNG files to a file hosting site and post the link here please.

    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 srsa_4c

    • ******
    • 3136
  • Publish
    Re: ELPH300HS aka IXUS220HS - Porting Thread
    « Reply #729 on: 11 / March / 2012, 18:02:07 »
    and a heck of a great try it is.  Now I can use DFS with any settings, <alt> on or off, and with no perceived limit before it kicks back in.
    That's cool  :)
    Quote
    The only funky think that happened is after switching settings back and forth a couple times I could no longer access the CHDK menu.  Camera not locked, just no menu.
    That's not so cool. It shouldn't happen. Can you reproduce it? Is it related to setting the dark frame on/off?


    Something strange is going on here and I don't like it... It can be the toolchain, it can be a bug in the port, or it can be a DryOS bug like this: https://bitbucket.org/hudson/magic-lantern/changeset/99e80332797c

     

    Related Topics