SX50 HS porting thread - page 6 - DryOS Development - CHDK Forum

SX50 HS porting thread

  • 350 Replies
  • 122172 Views
*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #50 on: 05 / January / 2013, 18:10:24 »
Advertisements
Thanks, waterwingz. I could not get it from CHDK_User_Quick_Start_Guide.pdf, so I will read the CHDK User Manual.

*

Offline bojofbas

  • *
  • 22
  • SX50 100b
Re: SX50 HS porting thread
« Reply #51 on: 06 / January / 2013, 05:01:43 »
Any news on this being release as an Alpha build

*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #52 on: 14 / January / 2013, 02:21:41 »
I am not sure I could make the porting from firmware 1.00b to 1.00c well.
Here is a ported ALPHA Build for FW 1.00c and a patch file.
Thanks, ERR99.

*

Offline lapser

  • *****
  • 1093
Re: SX50 HS porting thread
« Reply #53 on: 28 / January / 2013, 11:59:20 »
The crash here comes from the canon firmware (Assert) when CHDK trys to set the focus_distance. If MF + Safetyfocus=OFF is active, then the CANON Firmware throws this assert (No crash with Safety Focus=ON). Currently im not sure hot to fix this, until now i cant find somtehing wrong in the port.
This is also a problem in the sx260 port. I just discovered that my sx260 camera doesn't crash if safety MF is on, too. It sounds like the propcase 5 cameras may disbable the focus motor in manual focus with safety off, assuming there won't be any focus calls.

In any event, I don't think you need to worry about it in the SX50 port for now. If someone figures it out, we can apply it to the sx260 too.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Offline lapser

  • *****
  • 1093
Re: SX50 HS porting thread
« Reply #54 on: 30 / January / 2013, 03:02:01 »
I just got a SX50, partly based on you doing the port. Thanks! Fortunately, it's 100b, so I was able to compile some changes I've made to CHDK and test them out with the SX50.

One of my changes reads through the raw buffer adding up pixels, similar to the shot histogram. With the SX50, the values returned are way out of range. It looks like the raw buffer addresses may be off? Maybe you could re-check this code in lib.c?
Code: [Select]
char *hook_raw_image_addr()
{

// [0x3B14 + 0xC] --> defines which buffer is active

    if (*((int*)(0x3B14 + 0xC)) != 0)       //SX50: 0x3B14 (@FF08A0B0 ) + 0xC (@FF08A0DC)
        return (char*) 0x4ADB23C0;
    else
        return (char*) 0x44000000;
}

char *hook_alt_raw_image_addr() {
    if (*((int*)(0x3188 + 0xC)) == 0)
        return (char*) 0x4ADB23C0;
    else
        return (char*) 0x44000000;
}

long hook_raw_size() {
    return 0x124AB50;                       //SX50 @FF43302C
}
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline philmoz

  • *****
  • 3407
    • Photos
Re: SX50 HS porting thread
« Reply #55 on: 30 / January / 2013, 03:23:41 »
I just got a SX50, partly based on you doing the port. Thanks! Fortunately, it's 100b, so I was able to compile some changes I've made to CHDK and test them out with the SX50.

One of my changes reads through the raw buffer adding up pixels, similar to the shot histogram. With the SX50, the values returned are way out of range. It looks like the raw buffer addresses may be off? Maybe you could re-check this code in lib.c?
Code: [Select]
char *hook_raw_image_addr()
{

// [0x3B14 + 0xC] --> defines which buffer is active

    if (*((int*)(0x3B14 + 0xC)) != 0)       //SX50: 0x3B14 (@FF08A0B0 ) + 0xC (@FF08A0DC)  <<<<<<<<<<<<<<<<<<
        return (char*) 0x4ADB23C0;
    else
        return (char*) 0x44000000;
}

char *hook_alt_raw_image_addr() {
    if (*((int*)(0x3188 + 0xC)) == 0)                                                       <<<<<<<<<<<<<<<<<<
        return (char*) 0x4ADB23C0;
    else
        return (char*) 0x44000000;
}

long hook_raw_size() {
    return 0x124AB50;                       //SX50 @FF43302C
}

One of the lines I've highlighted in the code snippet above is wrong.
They should both test the same RAM address (but with reversed comparisons which is correct).

My guess is the second one is wrong and was not updated from the build the port was copied from.

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)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline lapser

  • *****
  • 1093
Re: SX50 HS porting thread
« Reply #56 on: 30 / January / 2013, 14:04:14 »
One of the lines I've highlighted in the code snippet above is wrong.
They should both test the same RAM address (but with reversed comparisons which is correct).
My guess is the second one is wrong and was not updated from the build the port was copied from.
Thanks Phil. I tested it both ways, and neither worked. That is, I copied the first address to the second comparison, and vice versa. Hopefully, ERR99 can figure it out. I'll be happy to compile and test it for you if you need me to. Just post the changes you think will work.
========

Like the SX260, the SX50 has an undocumented ND filter. Try setting the ND filter IN in the CHDK menu. It works, but darkens the screen, also like the SX260, and the shots are underexposed. It looks like you can set the exposure compensation to +3EV (maximum) and get close to the right exposure with the ND filter IN. I'll write a script to calibrate this for the sx260 and sx50. Just be sure to leave the ND filter flag 1 for the SX50, the way it is now. It might be useful to add a calibration factor for each camera, if it has an undocumented filter. get_bv96() could be modified to correct for the undocumented ND filter.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline lapser

  • *****
  • 1093
Re: SX50 HS porting thread
« Reply #57 on: 31 / January / 2013, 15:07:04 »
Code: [Select]
        char osd_buf[30];
        int xx= *((int*)(0x3B14 + 0xC));
        sprintf(osd_buf, "%d", xx ); // modify cnt to what you want to display
        draw_txt_string(2, 2, osd_buf, conf.osd_color);
I added this code in core_spytask() and this appears to be the correct address to choose the active buffer. It starts at -1 before the first picture, then 0 after the first picture, 1 after the second, 0..1..0 etc.

So it looks like the buffer addresses are incorrect.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Offline philmoz

  • *****
  • 3407
    • Photos
Re: SX50 HS porting thread
« Reply #58 on: 01 / February / 2013, 16:41:03 »
Code: [Select]
        char osd_buf[30];
        int xx= *((int*)(0x3B14 + 0xC));
        sprintf(osd_buf, "%d", xx ); // modify cnt to what you want to display
        draw_txt_string(2, 2, osd_buf, conf.osd_color);
I added this code in core_spytask() and this appears to be the correct address to choose the active buffer. It starts at -1 before the first picture, then 0 after the first picture, 1 after the second, 0..1..0 etc.

So it looks like the buffer addresses are incorrect.

The buffer addresses look correct based on the firmware dump (don't have the camera so I can't test it).

The (0x3b14 + 0xc) address also looks correct so the code should be:
Code: [Select]
char *hook_raw_image_addr()
{
    if (*((int*)(0x3B14 + 0xC)) != 0)
        return (char*) 0x4ADB23C0;
    else
        return (char*) 0x44000000;
}

char *hook_alt_raw_image_addr()
{
    if (*((int*)(0x3B14 + 0xC)) == 0)
        return (char*) 0x4ADB23C0;
    else
        return (char*) 0x44000000;
}

What do you get if you try and save a .DNG image?

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)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline lapser

  • *****
  • 1093
Re: SX50 HS porting thread
« Reply #59 on: 01 / February / 2013, 17:15:29 »
What do you get if you try and save a .DNG image?
I hadn't checked that. The .DNG image looks good now, so the buffer addresses are correct. You're right as usual, Phil, thanks.

The problem is with the shot meter routines, so it must be something else. I'll have to test it some more.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics