G11 porting

  • 527 Replies
  • 96755 Views
*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #270 on: 17 / January / 2010, 07:45:38 »
Advertisements
Yes, i am using 360 as viewport_width. An no, currently i did not tested motiondetection&edge outline.
I tried now also a 480 pixel viewport width:

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #271 on: 17 / January / 2010, 07:47:37 »
I also tried to double (360*2) the viewport width, which does not looks so bad.
But there is still this green line at the top and the camera crashes when i release the shutter with a exception of the spytask.

Re: G11 porting
« Reply #272 on: 17 / January / 2010, 07:53:10 »
Probably too much memory allocated to the buffer.

Do you know how much spare memory there is on the G11 ?

(I think there is a CHDK option to display that).
« Last Edit: 17 / January / 2010, 07:56:23 by Microfunguy »

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #273 on: 17 / January / 2010, 08:02:48 »
Free memory: 879320 bytes
CHDK size: 287656 bytes


Re: G11 porting
« Reply #274 on: 17 / January / 2010, 08:08:08 »
Read the free memory value after allocating the zebra buffer.

If necessary, comment-out the rest of the zebra code, just allocate the memory.

I do not think you will have enough memory to cover the entire screen, only a central section.
« Last Edit: 17 / January / 2010, 08:20:24 by Microfunguy »

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #275 on: 17 / January / 2010, 08:37:43 »
Okay, i disabled the code in gui_osd_draw_zebra() unter the zebra_init() call (which allocates the memory):
Code: [Select]
int gui_osd_draw_zebra(int show) {
    unsigned int v, s, x, y, f, over;
    color cl_under=conf.zebra_color>>8, cl_over=conf.zebra_color&0xFF;
    static int need_restore=0;
    int viewport_height;
    int viewport_width;
    int mrec = ((mode_get()&MODE_MASK) == MODE_REC);
    int zebra_drawn=0;
    color cls[] = {
        COLOR_TRANSPARENT,
        (mrec)?COLOR_HISTO_B:COLOR_HISTO_B_PLAY,
        (mrec)?COLOR_HISTO_G:COLOR_HISTO_G_PLAY,
        (mrec)?COLOR_HISTO_BG:COLOR_HISTO_BG_PLAY,
        (mrec)?COLOR_HISTO_R:COLOR_HISTO_R_PLAY,
        (mrec)?COLOR_HISTO_RB:COLOR_HISTO_RB_PLAY,
        (mrec)?COLOR_HISTO_RG:COLOR_HISTO_RG_PLAY,
        COLOR_BLACK
    };

    if (!gui_osd_zebra_init(show))
        return 0;
#if 0  <------------------------------------------------------------- code disabled.
    if(timer==0) {
        draw_guard_pixel();
        timer=1;
        return 0;
....
    }

Then i checked the memory usage after pressing the shutter half in a over exposed picture situation.
Free memory stays arround 87xxxx.
Then i also disabled one of the free() calls (free(buf) ; ) in gui_osd_zebra_free(), to see what happens.
Camera still works stable, but with every halfpress shutter, the memory goes lower (as expected) in this steps:
880672
650224
419808
189392

Update: As is see in my code, i did this measurement with a viewportsize width of 480 (and not with 720).
« Last Edit: 17 / January / 2010, 08:48:42 by ERR99 »

Re: G11 porting
« Reply #276 on: 17 / January / 2010, 09:02:54 »
Deleted.
« Last Edit: 17 / January / 2010, 09:16:11 by Microfunguy »

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #277 on: 17 / January / 2010, 09:21:40 »
I repeated the test, now with 720 width.
I also commented out the used sx200 configuration (#define ZEBRA_HMARGIN0  30) and using #define ZEBRA_HMARGIN0  0 for max. memory usage.

If i only deactivate the osd-draw routine, nothing happens. Free memory after half pressing the shutter button is as high as before.
If i remove all free calls, memory drops down at the first half-shutter press to 356368 bytes and with the next press down to 95200 bytes.


Re: G11 porting
« Reply #278 on: 17 / January / 2010, 09:21:52 »
A bitmap buffer size of 960x240 = 230400, which is what the above test reports.

If you actually take a photo after memory has been allocated, does it crash ?

If not, we know memory allocation is not the problem.

Is image-review mode on ?

If so, maybe the Canon firmware tries to allocate memory.


« Last Edit: 17 / January / 2010, 10:12:50 by Microfunguy »

*

Offline ERR99

  • ****
  • 339
Re: G11 porting
« Reply #279 on: 17 / January / 2010, 10:42:31 »
Image review mode is on.
Currently the camera does not crash after releasing the half-pressed shutter button. I can take pictures, zebra looks 'almost' normal. What is still there, is this strange pixel line at the top of the screen...

 

Related Topics