supplierdeeply

The SX1 IS Porting Thread

  • 381 Replies
  • 62135 Views
  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #210 on: 27 / April / 2009, 04:10:57 »
    Advertisements
    It is still possible, that if the motion detection has problems in SX1, it is a porting issue, and therefore should be discussed here, at least if those of you who test it find no help in other MD threads in the forum. The variable aspect ratio may very well cause trouble there as well, and the viewport parameters may still be wrong. I have not tested these issues myself, but I will try to look into the MD code as well when I can. I have been rather busy with other things lately (last couple of days), so I have not been able to do much anything for CHDK.

    Motion detection with fudgey's script works on SX1 (version 080914 for cameras with video button from this thread). Although to run it correctly I had to mask right and bottom cells. Cells from those areas actuate shots without reason. I think intervalometer is in some part "guilty" of this. During tests I have manage to obtain 80-100ms of minimum delay.

    @pev69: OK, so I'll stay here in this thread. I suppose that it is an issue of porting still.

    @sei: I tried fudgey's script (version 080914) but my SX1 IS was firing with constant interval. I also gave the masking a try, but didn't find the correct values for that. Would you be so kind to send me the settings for the script which worked for you? Sorry, I masked left and right cells not right and bottom ones!!! That's it.

    @fboesch: thanks for the suggestion. Hmm, I also tried the script in MF mode. But I will try it again and more systematically tomorrow evening.

    « Last Edit: 27 / April / 2009, 04:21:54 by elorup »

  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #211 on: 27 / April / 2009, 12:06:44 »
    I have a quetion regarding green light for AF/red eyes reduction... It is almoust all the time blinks just before made a picture without CHDK. Also during 10s delay it was blinking. Now with CHDK not doing this any more... Is that a bug ?

    *

    Offline pev69

    • **
    • 55
  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #212 on: 27 / April / 2009, 13:18:53 »
    I have a quetion regarding green light for AF/red eyes reduction... It is almoust all the time blinks just before made a picture without CHDK. Also during 10s delay it was blinking. Now with CHDK not doing this any more... Is that a bug ?

    Good find, I did not notice this with CHDK since I've been only testing (and debugging) other features (than standard shooting) of it for now :)

    It seems to be used as a debug led in some repeating part of the code, and this continually interferes with the normal operation. As a quick fix for now, you can comment out the debug_led function body in platform\sx1\lib.c, so the lines:

    void debug_led(int state)
    {
     *(int*)LED_PR=state ? 0x46 : 0x44;
    }

    become:

    void debug_led(int state)
    {
    // *(int*)LED_PR=state ? 0x46 : 0x44;
    }


    But this must also be somehow remedied more future-proof at some point (or just remove calls to debug_led in the code, dunno).
    « Last Edit: 27 / April / 2009, 13:22:03 by pev69 »

    *

    Offline reyalp

    • ******
    • 9961
  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #213 on: 27 / April / 2009, 23:23:18 »
    debug LED should normally be something else, like the direct print LED.

    Shooting raw (among other things) normally flashes the debug LED.


    edit:
    here's a build with the debug LED disabled. The video card in my normal dev machine died, so I can't find the correct LED easily.
    « Last Edit: 27 / April / 2009, 23:26:21 by reyalp »
    Don't forget what the H stands for.


  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #214 on: 28 / April / 2009, 02:37:24 »
    Tried again fudgey's motion detection script last evening and used default values plus the mask right=2 and bottom=2. So the camera only used the 8 cells in the upper left part. It worked and didn't constantly fire. I threw things in the cameras field of view and it took pics. I set the SX1 to MF, then to AF. Worked the same, though I didn't test for differences in speed.

    Will continue testing.



    *

    Offline pev69

    • **
    • 55
  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #215 on: 29 / April / 2009, 09:15:01 »
    I tested the SX1 LEDs with the uBASIC set_led command and it is rather interesting what it can do in SX1! I did not find any documentation about set_led other than an old thing in wikia which says "ONLY for S3 (and S2 I guess)" and is not valid for SX1, so here goes. The working syntax for SX1 is:

    set_led a b

    where a is the LED number from 0 to 4 and b is the state for the LED. Note that set_led accepts a third argument (for compatibility's sake, I guess, it is brightness in some older cams) that is ignored in SX1. The LED numbers in SX1 are:

    0: power button green
    1: power button orange
    2: card/busy (red)
    3: print/shortcut (blue)
    4: AF/red-eye/timer (bright green)

    The state is the interesting part, as I found that it can be 0 to 6:

    0: off
    1: on
    2: blinking 2 Hz (on shorter than off)
    3: blinking really fast (about 5 Hz)
    4: blinking about 2,8 Hz (on longer than off)
    5: 3 fast blinks then off
    6: blinking 1 Hz (about equal on/off times)

    As a curiosity, combining different blinkings for the two power-button LEDs make for interesting more complex multi-color blinkings :)

    EDIT: Oh, about the implementation, those are all done by calling an original firmware function and the firmware then has a LED driver that implements the blinkings. The uBASIC command just maps the LED numbers a bit differently (a bit strange: those 0,1,2,3,4 become 4,5,7,8,9) and then calls _LEDDrive that is in firmware.

    EDIT2: Argh, edited for AF LED, I had previously enabled the debug_led, which caused the AF LED seem not to respond to set_led.
    « Last Edit: 29 / April / 2009, 10:00:42 by pev69 »

    *

    Offline Sei

    • *
    • 19
  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #216 on: 29 / April / 2009, 17:15:18 »
    Tried again fudgey's motion detection script last evening and used default values plus the mask right=2 and bottom=2. So the camera only used the 8 cells in the upper left part.
    When I was trying this script a mask right=1, bottom=1 was enough even for 9x9 cells. For minimum delay try changing the dimension to 3x3 and mask 1 right and 1 bottom. Set "compare interval" to 1, and "trigger delay" to 0. This should give you delay=100 ms or less (I measured 80 ms). If you will get better results it post here or let me know with private message.

  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #217 on: 30 / April / 2009, 12:28:42 »
    When I was trying this script a mask right=1, bottom=1 was enough even for 9x9 cells. For minimum delay try changing the dimension to 3x3 and mask 1 right and 1 bottom. Set "compare interval" to 1, and "trigger delay" to 0. This should give you delay=100 ms or less (I measured 80 ms). If you will get better results it post here or let me know with private message.

    I made it down to 65 ms (some shots even 45 ms, several 50 ms)  :D using the Motion detector speed test
    Columns=3
    Rows=3
    Threshold=10
    Compare interval=1
    Pixel Step=10
    Trigger Delay=1
    Masking=1 (Right=1, Bottom=1)

    Set the camera to MF mode
    « Last Edit: 30 / April / 2009, 12:33:31 by elorup »


  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #218 on: 30 / April / 2009, 16:43:30 »
    I think I stumbled upon a issue with the OSD in combination with CHDK 0.9.8-755.
    Everything works like it should but when I try to flip the display the image is instantly being projected in a mirror image as soon as I start to move the display.
    And only when I start to rotate the display, it flips back.
    And when I do the same, only with the CHDK menu being displayed, the complete CHDK OSD disapears.


    *

    Offline pev69

    • **
    • 55
  • Publish
    Re: The SX1 IS Porting Thread
    « Reply #219 on: 30 / April / 2009, 19:00:29 »
    I think I stumbled upon a issue with the OSD in combination with CHDK 0.9.8-755.
    Everything works like it should but when I try to flip the display the image is instantly being projected in a mirror image as soon as I start to move the display.
    And only when I start to rotate the display, it flips back.

    Oh dear, yes, it looks like the firmware draws the overlay also mirrored, when the display is flipped out and not rotated. Well, this should be rather easy to fix, since the display flip/rotate status is already known to the code. I'll see if I can squeeze some time to fix this also. Darn, I haven't gotten much anything done to CHDK lately. My intention is still to rework the whole gui-drawing system and now also including this fix + edge overlay + ... :), whenever I get myself to kick myself in the asss to devote the time...

    Quote
    And when I do the same, only with the CHDK menu being displayed, the complete CHDK OSD disapears.

    Yes, this is due to the fact that the menu is not redrawn unless the selection/settings/menu level is changed. If you get this, you can confirm that you are still in the menu by clicking up/down and behold the menu comes back (in this case also mirrored) :). One more thing to change/fix in the gui.
    « Last Edit: 30 / April / 2009, 19:03:34 by pev69 »

     

    Related Topics