IXUS110IS / SD960IS porting

  • 51 Replies
  • 5209 Views
*

Offline srsa_4c

  • ******
  • 3102
  • Publish
    IXUS110IS / SD960IS porting
    « on: 16 / December / 2012, 21:31:12 »
    Advertisements
    I've been experimenting on this camera for a while now, time to do a release.
    Source is in my temporary repo at https://subversion.assembla.com/svn/chdk-s1.ixus110
    The only known firmware revision so far is 1.01d.
    The port seems usable, so I'll probably check it in into the official source soon.
    Credits: I followed reyalp's D10 port, the rest (jogdial, wide screen) is based on the SX200, pux's recent patch for the SX210IS, and custom palette code from the A810.

    Issues:
    • SD override not done yet
    • while using TV-out (also when just plugging in the TV cable!)
      • live view buffers are reconfigured, anything relying on them is screwed (histogram, zebra), don't try to use scripts that compute exposure based on the live buffers
      • CHDK bitmap overlay is still wide screen, so right side can't be seen on TV
    • although live frame buffer support is implemented and looks correct, there may be issues, low frame rate (= when the scene is dark) live view over ptp is jerky
    • EXMEM configuration is forced due to the small amount of free RAM
    Unusual behaviour:
    Due to the small number of buttons I have remapped the On/Off button in ALT mode to act like the "DISP" button. You'll need to exit ALT mode to switch off the camera with it.

    The ALT button is the PLAY [>] button, short press. Press it longer for its original function.

    The attached build is to be used with the Bootable_SD_Card_Method

    Bug reports are welcome.
    edit: reformatted "issues" list
    edit2: ixus110_sd960-101d-1.2.0_r2391-full_ALPHA.7z (464.82 kB - downloaded 10 times.) removed, alpha2 up
    edit3: ixus110_sd960-101d-1.2.0_r2405-full_ALPHA2.7z (465.72 kB - downloaded 6 times.) removed, the port is available from the trunk autobuild and the stable autobuild
    « Last Edit: 31 / December / 2012, 15:05:40 by srsa_4c »

  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #1 on: 18 / December / 2012, 04:42:39 »
    Thanks for this. Been looking forward to one!

    *

    Offline srsa_4c

    • ******
    • 3102
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #2 on: 25 / December / 2012, 19:38:05 »
    Subject distance override is now done, first post updated with a new build.

    I hope somebody "in charge" will read this as I have a question and don't want to open a thread for it.
    While testing SD override on this cam, I found that it only causes the cam to crash when used in "AUTO" mode or with "Servo AF" turned on. AUTO mode on this camera implicitly enables continuous AF. To prevent these crashes, I came up with the following mod:
    Code: (diff) [Select]
    Index: core/shooting.c
    ===================================================================
    --- core/shooting.c (revision 2405)
    +++ core/shooting.c (working copy)
    @@ -736,6 +736,10 @@
         // TODO whats the reason for this ?!?
         return (shooting_get_zoom()<8) && (m!=MODE_AUTO) && (m!=MODE_SCN_UNDERWATER);
     #else
    +#if CAM_ONLY_SD_OVER_WHEN_NO_CONFLICT
    +    if ( (shooting_get_prop(PROPCASE_CONTINUOUS_AF)) || (shooting_get_prop(PROPCASE_SERVO_AF)) )
    +        return 0;
    +#endif
         return 1;
     #endif
     }
    Index: include/camera.h
    ===================================================================
    --- include/camera.h (revision 2405)
    +++ include/camera.h (working copy)
    @@ -46,6 +46,7 @@
         #undef  CAM_CAN_SD_OVER_IN_AF_LOCK          // Camera allows subject distance (focus) override when in AF Lock mode
         #undef  CAM_CAN_SD_OVER_IN_AF_LOCK_ONLY     // Camera allows subject distance (focus) override only when in AF Lock mode OR in movie mode
         #define CAM_CAN_SD_OVERRIDE             1   // Camera allows to do subject distance override
    +    #undef  CAM_ONLY_SD_OVER_WHEN_NO_CONFLICT   // Camera can't tolerate subject distance override when servo AF or continuous AF is active
         #define CAM_HAS_MANUAL_FOCUS            1   // Camera has manual focus mode
         #define CAM_HAS_USER_TV_MODES           1   // Camera has tv-priority or manual modes with ability to set tv value
         #undef  CAM_SHOW_OSD_IN_SHOOT_MENU          // On some cameras Canon shoot menu has additional functionality and useful in this case to see CHDK OSD in this mode
    Index: include/propset2.h
    ===================================================================
    --- include/propset2.h (revision 2405)
    +++ include/propset2.h (working copy)
    @@ -52,4 +52,7 @@
     #define PROPCASE_DIGITAL_ZOOM_MODE          91      //G10 Digital Zoom Mode/State 0 = off/standard, 2 = 1.7x, 3 = 2.1x
     #define PROPCASE_STITCH_DIRECTION           233     //D10 0=left>right, 1=right>left
     #define PROPCASE_STITCH_SEQUENCE            238     //D10 counts shots in stitch sequence, positive=left>right, negative=right>left
    +#define PROPCASE_VIDEO_RESOLUTION           169
    +#define PROPCASE_SERVO_AF                   293     //ixus110 0 = servo AF not active, 1 = servo AF active
    +#define PROPCASE_AF_LOCK                    11
     #endif
    I suspect that this is not the only model which crashes on subject distance override attempts when the above conditions are true.
    Would a patch like this be acceptable for inclusion? Any suggestions?

    *

    Offline reyalp

    • ******
    • 9802
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #3 on: 25 / December / 2012, 20:22:40 »
    I think this is fine, except  that "when_no_conflict" is not very descriptive, would be better if it somehow mentioned continuous AF. Having trouble coming up with one that isn't ridiculously long though.

    It would be good to check some other cameras with these modes, it's hard to see how SD override would actually work (even if it doesn't crash). In that case maybe we don't need the ifdef. (note that PROPCASE_CONTINUOUS_AF and PROPCASE_SERVO_AF don't exist for some propsets though)
    Don't forget what the H stands for.


    *

    Offline srsa_4c

    • ******
    • 3102
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #4 on: 25 / December / 2012, 21:44:28 »
    It would be good to check some other cameras with these modes, it's hard to see how SD override would actually work (even if it doesn't crash). In that case maybe we don't need the ifdef.
    There are multiple problems with this.
    - there might be more situations where SD override could cause trouble, which may require inclusion of other propcases
    - some of the propcases in question may not even exist for certain propsets (and even if they do, who would find them?)

    I could think of other ways to address this issue, but those are not possible with the current code:
    - make shooting_can_focus() weak, so it can be overridden for models that need it -> thumb code, probably not possible
    - make shooting_can_focus() call an optional platform function OR put it into generic/shooting.c and make it weak -> overhead, thumb-arm switch
    - make an #ifdef-monster based on propsets in shooting_can_focus() -> ugly, needs to be tested on many cameras

    *

    Offline reyalp

    • ******
    • 9802
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #5 on: 25 / December / 2012, 22:44:30 »
    There are multiple problems with this.
    - there might be more situations where SD override could cause trouble, which may require inclusion of other propcases
    What I meant is that it seems likely SD override will *never* work in servo or continuous af mode, in which case, those ones don't need to be under a camera.h ifdef. They might need an #ifdef propcase_* but to me that's better than a camera.h define, because it's only in one place and people making ports don't have to worry about it.
    Quote
    - make shooting_can_focus() weak, so it can be overridden for models that need it -> thumb code, probably not possible
    Yes, I thought about this too. Moving the whole thing to ARM or having a weak cam_shooting_can_focus() for any platform specific checks could be OK, but figuring out what all the existing cameras should do would be difficult. The same problem applies to cleaning up the whole shooting_can_focus mess in general.
    Don't forget what the H stands for.

    *

    Offline reyalp

    • ******
    • 9802
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #6 on: 28 / December / 2012, 23:16:14 »
    I can confirm my D10 also shuts down if SD override is used in servo AF mode,  ASSERT!! AFScanDriver.c Line 1228

    I don't think it has continuous AF, auto seems to work OK.
    Don't forget what the H stands for.

    *

    Offline srsa_4c

    • ******
    • 3102
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #7 on: 29 / December / 2012, 13:06:33 »
    What I meant is that it seems likely SD override will *never* work in servo or continuous af mode, in which case, those ones don't need to be under a camera.h ifdef. They might need an #ifdef propcase_* but to me that's better than a camera.h define, because it's only in one place and people making ports don't have to worry about it.
    OK, I was thinking about a "perfect" solution which would handle all possible situations where SD override is not recommended, hence my "multiple problems" lines.
    So your suggestion is to put that additional check into shooting_can_focus(), but without making a new camera.h #define for it. If it will be me doing this, the check will probably be restricted to propsets 2, 4, 5, as the others miss both propcases in their propset*.h header.

    I can confirm my D10 also shuts down if SD override is used in servo AF mode,  ASSERT!! AFScanDriver.c Line 1228

    I don't think it has continuous AF, auto seems to work OK.
    Thanks for the report.

    BTW, may I go ahead and add this port to trunk / 1.1? It's good enough for an alpha, I think.


    *

    Offline reyalp

    • ******
    • 9802
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #8 on: 29 / December / 2012, 15:39:45 »
    If it will be me doing this, the check will probably be restricted to propsets 2, 4, 5, as the others miss both propcases in their propset*.h header.
    I think we can just guard each one with with #ifdef PROPCASE_SERVO_AF etc, since even if it didn't crash, SD override doesn't make much sense in these modes.

    I'd love to find a way to clean up the whole focus code mess, but it's very difficult to see how it could happen with out access to most of the cameras.
    Quote
    BTW, may I go ahead and add this port to trunk / 1.1? It's good enough for an alpha, I think.
    Fine with me. I suggest you check in on one branch (probably the trunk) and then merge to the other. Make sure stubs_entry.S and stubs_auto.S are generated and included in the checkin. You can run tools/platprops.bash on the added platform before you check in to set the eol style and ignore properties.

    Don't forget what the H stands for.

    *

    Offline srsa_4c

    • ******
    • 3102
  • Publish
    Re: IXUS110IS / SD960IS porting
    « Reply #9 on: 30 / December / 2012, 13:58:04 »
    Port added to trunk: changeset 2425, autobuild enabled, alpha.
    I think we can just guard each one with with #ifdef PROPCASE_SERVO_AF etc, since even if it didn't crash, SD override doesn't make much sense in these modes.
    Done: changeset 2426

    I'll merge the above changes into 1.1 after some testing.

    edit: thx for the URL (I almost guessed it, but gave up before)
    « Last Edit: 30 / December / 2012, 20:46:08 by srsa_4c »

     

    Related Topics