SX20 Zebra crash - DryOS Development - CHDK Forum supplierdeeply

SX20 Zebra crash

  • 12 Replies
  • 4896 Views
SX20 Zebra crash
« on: 02 / May / 2010, 05:40:14 »
Advertisements
Hi All,

I've managed to enable Zebra on the SX20 by adding similar ifdef's to the SX200 in gui_osd.c. The SX200 has the same screen dimensions as the SX20 and these changes cause the zebra to display and fix aspect ratio issues.

When the shutter is half pressed the zebra performs exactly as expected, moving around and updating the screen. When I release the button the camera pauses for a while then crashes.

How do I stop this?

It looks like there are some values in camera.h which might control memory usage ZEBRA_HMARGIN0 and EDGE_HMARGIN. I don't understand how these work, but I have voodoo'ed with some of the values with my camera - no fix. The SX20 also has a problem with screen refreshing - menu redrawing doesnt work, could this be part of the problem?
« Last Edit: 02 / May / 2010, 05:47:36 by acid2000 »

Re: SX20 Zebra crash
« Reply #1 on: 09 / May / 2010, 05:44:04 »
I've fixed the refresh issue and still zebra does not work. Can anyone help?

Can no one even tell me what ZEBRA_HMARGIN0 and EDGE_HMARGIN actually does or how to find out what values I need to use are?

*

Offline OldGit

  • ****
  • 303
Re: SX20 Zebra crash
« Reply #2 on: 09 / May / 2010, 06:42:10 »
@acid2000
the "magic" that is done for the sx200 zebra etc was done by nandoide.
I suggest he is the best person to explain it.
(It gets a bit complex)  ;)
Maybe you could PM him (he is very helpful).

OldGit
SX200 IS-100C

Re: SX20 Zebra crash
« Reply #3 on: 09 / May / 2010, 13:56:57 »
A few recent cameras have a limited amount of memory available, especially as CHDK has increased in size.
In addition, not all of the bitmap buffer is used for screen display.
In the case of the SX200, an area 720x240 at top-left of the 960x270 buffer is used.
So, we only need to allocate memory for 960x240.
That is 30 rows less so ZEBRA_HMARGIN0 is set to 30.

You could save even more space by reducing width but that is more complicated because it would not be a continuous area of memory.

The 960x240 'letter-box' is a continuous area of memory that can be quickly copied using a single instruction.

I am not familiar with CHDK menus but I know you can display amount of memory available.

With zebra disabled, how much free memory is there ?
« Last Edit: 09 / May / 2010, 14:50:27 by Microfunguy »


Re: SX20 Zebra crash
« Reply #4 on: 13 / May / 2010, 18:16:44 »
There is 180200 bytes free when zebra isn't loaded

Re: SX20 Zebra crash
« Reply #5 on: 13 / May / 2010, 19:11:13 »
There is 180200 bytes free when zebra isn't loaded

That is a very small amount.

960 * 240 = 230,400

I will look very strange but try setting ZEBRA_HMARGIN0 to 120 and see if it crashes.


Re: SX20 Zebra crash
« Reply #6 on: 14 / May / 2010, 15:14:23 »
OK this is weird. If I boot up the camera from cold the free memory is 180200. If I then enable zebra, a crash occurs and it reboots. At that point the free ram is 239752 bytes. The zebra now doesn't crash.

So the question is how can I free all this ram automatically at boot.

Re: SX20 Zebra crash
« Reply #7 on: 14 / May / 2010, 15:19:15 »
Maybe you have a feature that requires memory (such as edge overlay) enabled.

Delete the CFG file and boot the camera a number of times and check the memory.

Do not make any menu changes that cause a new CFG file to be created.


Re: SX20 Zebra crash
« Reply #8 on: 14 / May / 2010, 15:49:40 »
OK so I deleted my config file, here are the values for free memory when it loads straight up. No config file.
231408
228560
231392
228600
228600


The camera still dies on zebra.

Before the crash the value for RAM is 224456 after the crash when the camera reboots the value is 287944. Zebra then works.


Disabling the games seems to free enough ram to make zebra and edge work correctly.
« Last Edit: 14 / May / 2010, 15:55:58 by acid2000 »

Re: SX20 Zebra crash
« Reply #9 on: 14 / May / 2010, 15:56:59 »
In that case, some CHDK built-in default option must require memory.

Some of those amounts of memory are smaller than required, the others are very close to what you require with hardly anything left-over.

« Last Edit: 14 / May / 2010, 15:59:52 by Microfunguy »

 

Related Topics