D20 porting thread

  • 42 Replies
  • 4804 Views
*

Offline nafraf

  • *****
  • 1257
  • Publish
    D20 porting thread
    « on: 21 / April / 2013, 19:20:41 »
    Advertisements
    I started a blind port for D20 100b some days ago.  Tests has been done by rdumont99. We don't have a full port, but the version is available for testers. If someone can test, and give feedback, send me a private message, I'll send you the link to the binary file.

    Source code is available here

    D20 has a focus_len_table format different from other cameras. It is not autodetected, each entry contains 2 values, the first is the zoom focus length, the second is 0, not 100 as expected by finsig_dryos.c. I'm not sure if that difference could cause any problem to CHDK. 
    Another option is that I had not discovered the right focus_len_table addres  ::)
    D20 focus_len_table format now is supported by finsig_dryos.c.

    Current status
    Tested:
    - RAW generation
    - Modemap
    - Custom palette
    - chdkptp connection
    - Test scripts run without problem, tested by eric100, logs here
    - LED addresses. discovered by rdumont99:
      GREEN_LED      0xC0220120,
      ORANGE_LED     0xC0223030.
    - USB remote sync
    - Movie quality override
    - Long exposure time
    - LED indexes (set_led(index,value))
    - Optical zoom during video recording

    Implemented but not tested:
    - GPS functions
    - Photo related overrides
    - liveview with different aspect ratio


    To do:
    - shooting.c tables
    - extended video time
    - More tests...
    « Last Edit: 19 / May / 2013, 20:18:39 by nafraf »

    *

    Offline srsa_4c

    • ******
    • 3133
  • Publish
    Re: D20 porting thread
    « Reply #1 on: 21 / April / 2013, 21:04:14 »
    D20 has a focus_len_table format different from other cameras. It is not autodetected, each entry contains 2 values, the first is the zoom focus length, the second is 0, not 100 as expected by finsig_dryos.c. I'm not sure if that difference could cause any problem to CHDK.
    AFAIK that table is only used in camera specific code, not in CHDK core. The first and the last focal length entry should be identifiable, if you look at the camera's specifications. The camera owner can tell you how many zoom steps the camera has (unless there's multiple dozen zoom points).
    If all these (starting value, last value, nr of entries) are ok, then the table is the right one.
    That second value is not used by CHDK calculations.

    *

    Offline nafraf

    • *****
    • 1257
  • Publish
    Re: D20 porting thread
    « Reply #2 on: 22 / April / 2013, 04:52:32 »
    AFAIK that table is only used in camera specific code, not in CHDK core. The first and the last focal length entry should be identifiable, if you look at the camera's specifications. The camera owner can tell you how many zoom steps the camera has (unless there's multiple dozen zoom points).
    If all these (starting value, last value, nr of entries) are ok, then the table is the right one.
    That second value is not used by CHDK calculations.
    Thanks.  I modified finsig_dryos.c, and then checked the generated values.

    D20 Specification: Focal Length: 5.0 (W) - 25.0mm (T)

    From firmware:
    Code: [Select]
    fff4abd8:       00001388        andeq   r1, r0, r8, lsl #7  <= (entry 0)      5000 decimal
    fff4abdc:       00000000        andeq   r0, r0, r0
    fff4abe0:       00001449        andeq   r1, r0, r9, asr #8<= (entry 1)
    fff4abe4:       00000000        andeq   r0, r0, r0
    .
    .
    .
    fff4afd8:       000061a8        andeq   r6, r0, r8, lsr #3  <= (entry 128)  25000 decimal
    fff4afdc:       00000000        andeq   r0, r0, r0
    fff4afe0:       000061a8        andeq   r6, r0, r8, lsr #3   <= (entry 129)  25000 decimal, ignored


    *

    Offline srsa_4c

    • ******
    • 3133
  • Publish
    Re: D20 porting thread
    « Reply #3 on: 26 / April / 2013, 13:58:43 »
    I modified finsig_dryos.c, and then checked the generated values.
    If your modified sigfinder works for other (new) models too, you could publish your change in the usual thread: http://chdk.setepontos.com/index.php?topic=6560 .


  • Publish
    Re: D20 porting thread
    « Reply #4 on: 28 / April / 2013, 19:14:08 »
    How can I get you the precise number of zoom stops? I tried the buttons (forgetaboutit) and I tried using CHDKPTP, but neither produced precise results.  Seems to be somewhere around 32 I'm guessing.

    *

    Offline nafraf

    • *****
    • 1257
  • Publish
    Re: D20 porting thread
    « Reply #5 on: 05 / May / 2013, 18:49:33 »
    How can I get you the precise number of zoom stops? I tried the buttons (forgetaboutit) and I tried using CHDKPTP, but neither produced precise results.  Seems to be somewhere around 32 I'm guessing.
    Take a photo with maximum optical zoom, then check exif data field "Optical Zoom Code".

  • Publish
    Re: D20 porting thread
    « Reply #6 on: 06 / May / 2013, 19:08:51 »
    Take a photo with maximum optical zoom, then check exif data field "Optical Zoom Code".
    Thanks!  It's 128.

    BTW, testing with two batteries, voltage right off the charger is around 4.066, quickly dropping to around 4.040 or 4.030.  The camera powers off at 3.335.

    *

    Offline nafraf

    • *****
    • 1257
  • Publish
    Re: D20 porting thread
    « Reply #7 on: 06 / May / 2013, 20:43:35 »
    Take a photo with maximum optical zoom, then check exif data field "Optical Zoom Code".
    Thanks!  It's 128.
    OK, that confirms values detected by finsig:  129 entries (0 to 128)

    Quote
    BTW, testing with two batteries, voltage right off the charger is around 4.066, quickly dropping to around 4.040 or 4.030.  The camera powers off at 3.335.
    Thanks, I updated vbat values.


    *

    Offline nafraf

    • *****
    • 1257
  • Publish
    Re: D20 porting thread
    « Reply #8 on: 16 / May / 2013, 00:36:45 »
    I'm trying to get correct values for aperture_sizes_table[] but I'm not sure about how to process all information.

    Eric100 ran this script (modified for D20) to take a photo with each zoom step, with ND and without ND filter. PROPCASE_AV values are in this log.
    Exif data is available here

    After processing data, a table is generated: nd state, zoom, PROPCASE_AV, Aperture(extracted from exif). File is in attachment.

    The problem is that there are only 4 different values for aperture: 3.9, 4.5, 4.8, 5.  For each aperture value, there are different PROPCASE_AV values.
    Code: [Select]
    Aperture  PROPCASE_AV
     3.9          387 - 399
     4.5          400 - 431
     5.0          432 - 439
     4.8          439
    Should I select the PROPCASE_AV mean value for each aperture?  Only 4 values for aperture, is it correct?
    Thanks

  • Publish
    Re: D20 porting thread
    « Reply #9 on: 18 / May / 2013, 17:03:57 »
    I just took my D20 outside in P mode and pointed it at the midday sky. It tells me that it has an aperture of 8.0 under those conditions. I'll see if I can run the Eric100 script and come up with a similar table with values from brighter lighting conditions.

     

    Related Topics