SX50 HS porting thread - page 22 - DryOS Development - CHDK Forum
supplierdeeply

SX50 HS porting thread

  • 350 Replies
  • 102143 Views
*

Offline srsa_4c

  • ******
  • 4411
Re: SX50 HS porting thread
« Reply #210 on: 29 / March / 2013, 13:16:13 »
Advertisements
The CHDK histogram feature works a lot of the time, but it flashes an incorrect histogram about twice per second sometimes. That appears to be a bug. When it works, the baseline is correct.
If you'd like to fix this, you could put some debug code into core/main.c to visualize the active viewport index (in idle, when in half-shoot, etc...)
Like this for example.
// Defined in stubs_min.S
extern char active_viewport_buffer;

Re: SX50 HS porting thread
« Reply #211 on: 29 / March / 2013, 13:35:57 »
The CHDK histogram feature works a lot of the time, but it flashes an incorrect histogram about twice per second sometimes. That appears to be a bug. When it works, the baseline is correct.
If you'd like to fix this, you could put some debug code into core/main.c to visualize the active viewport index (in idle, when in half-shoot, etc...)
Like this for example.
// Defined in stubs_min.S
extern char active_viewport_buffer;

If nobody else has time to look at this,  I'll have the SX50 back in a few days and will look at it then.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #212 on: 29 / March / 2013, 19:14:10 »
If you'd like to fix this, you could put some debug code into core/main.c to visualize the active viewport index (in idle, when in half-shoot, etc...)
Like this for example.
// Defined in stubs_min.S
extern char active_viewport_buffer;

The value of active_viewport_buffer cycles from 0 to 7.
I could not find any rule of the flashing. Is there anything I can do?

*

Offline srsa_4c

  • ******
  • 4411
Re: SX50 HS porting thread
« Reply #213 on: 29 / March / 2013, 20:15:58 »
The value of active_viewport_buffer cycles from 0 to 7.
I could not find any rule of the flashing. Is there anything I can do?
Since I don't have this camera, I can only guess.
platform/sx50hs/lib.c
vid_get_viewport_live_fb() currently only expects 4 buffers. viewport_buffers seems to have at least 8 buffer addresses (?)
try replacing the final return statement in vid_get_viewport_live_fb() with
return viewport_buffers[(active_viewport_buffer-1)&7];
or
return viewport_buffers[(active_viewport_buffer)&7];
and see whether the situation is better or worse.
You can also test ptp live view with chdkptp, wrong buffer indices will result in jerky movements (or even random noise if an unused buffer is displayed).


*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #214 on: 30 / March / 2013, 00:11:01 »
You can also test ptp live view with chdkptp, wrong buffer indices will result in jerky movements (or even random noise if an unused buffer is displayed).
I only have an upper half of Viewfinder with chdkptp-r311.
« Last Edit: 30 / March / 2013, 00:40:31 by yukia10 »

*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #215 on: 30 / March / 2013, 00:30:43 »
try replacing the final return statement in vid_get_viewport_live_fb() with
return viewport_buffers[(active_viewport_buffer-1)&7];
or
return viewport_buffers[(active_viewport_buffer)&7];
and see whether the situation is better or worse.
The following video was captured with a lens capped.
The result of (active_viewport_buffer-1)&7 is attached.
The result of (active_viewport_buffer)&7 was almost the same.

*

Offline lapser

  • *****
  • 1093
Re: SX50 HS porting thread
« Reply #216 on: 30 / March / 2013, 15:20:57 »
The following video was captured with a lens capped.
The result of (active_viewport_buffer-1)&7 is attached.
The result of (active_viewport_buffer)&7 was almost the same.
That's exactly what I see with 100b firmware too
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #217 on: 30 / March / 2013, 18:57:11 »
In lib.c:
Code: [Select]
// Y multiplier for cameras with 480 pixel high viewports (CHDK code assumes 240)
int vid_get_viewport_yscale() {
    return 1;
}
Setting viewport_yscale to 1 seems to improve the flashing of CHDK histogram and the shape of CHDK histogram was similar to Canon histogram. Is it possible?


*

Offline yukia10

  • *
  • 32
  • SX50_100c
Re: SX50 HS porting thread
« Reply #218 on: 31 / March / 2013, 03:56:33 »
I only have an upper half of Viewfinder with chdkptp-r311.
I could get a whole Viewfinder with chdkptp-r311 using the following code in lib.c (same as SX260HS):

Code: [Select]
int vid_get_viewport_display_xoffset_proper()   { return vid_get_viewport_display_xoffset() * 2; }
int vid_get_viewport_display_yoffset_proper()   { return vid_get_viewport_display_yoffset() * 2; }
int vid_get_viewport_width_proper()             { return vid_get_viewport_width() * 2; }
int vid_get_viewport_height_proper()            { return vid_get_viewport_height() * 2; }
int vid_get_viewport_fullscreen_height()        { return 480; }
I feel this is somewhat inconsistent with setting viewport_yscale to 1, but it seems OK so far.
« Last Edit: 31 / March / 2013, 04:26:03 by yukia10 »

*

Offline reyalp

  • ******
  • 13231
Re: SX50 HS porting thread
« Reply #219 on: 31 / March / 2013, 13:37:04 »
Just FYI, to get correct colors in the UI overlay (=bitmap), you will need to use the latest svn version of chdkptp.

You might want to compare the viewport* function code with sx40, that should be similar to sx50 and a fairly correct/complete implementation.

If the camera supports different aspect ratios, you should check each one.
Don't forget what the H stands for.

 

Related Topics