Video buffer/screen issues - General Discussion and Assistance - CHDK Forum supplierdeeply

Video buffer/screen issues

  • 7 Replies
  • 2228 Views
*

Offline RaduP

  • *****
  • 908
Video buffer/screen issues
« on: 02 / October / 2009, 00:11:04 »
Advertisements
On my SD980, there is a strange issue with the screen buffer.
It appears that the screen buffer is 'taller' than the LCD itself. That is, the lcd is 240 lines, but the screen buffer is probably 260 or so tall. The camera seems to arbitrary map the screen buffer to the LCD, sometimes using the first 20(?) screen lines, and sometimes skipping them. In practice, this causes the first line of the CHDK menu to not be visible under certain circumstances.
Did anyone else happen to notice this issue on other cameras?

*

Offline reyalp

  • ******
  • 13456
Re: Video buffer/screen issues
« Reply #1 on: 02 / October / 2009, 00:23:56 »
You might want to look at the sx200 thread.
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 908
Re: Video buffer/screen issues
« Reply #2 on: 02 / October / 2009, 01:37:48 »
Well, I read it up to page 16, when it seems that all the screen problems were fixed.
I found that patch for draw_pixel, which I applied and it considerably improves the screen readability (although there are less effective pixels now). However, I couldn't find a solution for the menu y coordinates varying randomly.. If this was supposed to fix it, it doesn't.

*

Offline reyalp

  • ******
  • 13456
Re: Video buffer/screen issues
« Reply #3 on: 02 / October / 2009, 01:46:17 »
The visible start address varying by 20 pixels strikes me as extremely unlikely. I would suggest you are misinterpreting the evidence somehow. There are two copies of the bitmap buffer and CHDK normally writes to both (because it doesn't know which is active). So perhaps in your code, one is right and one is off by 20 ? Maybe you have got the size wrong ? Or there space between the two buffers, rather then one following exactly after the other ?

If you have diagnosed things correctly, there must be a variable in the canon firmware that stores this information somehow.

Rather than applying a random work in progress patch, you might want to look at the final code that got checked in for sx200.
Don't forget what the H stands for.


*

Offline RaduP

  • *****
  • 908
Re: Video buffer/screen issues
« Reply #4 on: 02 / October / 2009, 03:02:34 »
Yes, the problem was related to the space between buffers...
Anyway, I tried to do a partial update of a few files from the new SVN, and now I can't even boot the camera, it crashes at the logo :/ I reverted back all the changes, but I still can't get it to boot, this is extremely frustrating..

*

Offline RaduP

  • *****
  • 908
Re: Video buffer/screen issues
« Reply #5 on: 02 / October / 2009, 04:32:11 »
Ok, I got that [admin: avoid swearing please] to work again, it was the sound.. Same code as before, never touched it, but now it crashed. I really feel that satan himself put his tail in my camera :D

Anyway, where should I correct the problem with the space between buffers, so that it will work properly on other cameras as well? The right place is in draw_init(), frame_buffer[1] = frame_buffer[0] + screen_buffer_size;//+screen_buffer_width*30;

Coincidentally (or not) that corresponds to the value of  #define ZEBRA_HMARGIN0  30
So maybe it can be used there too?

One other thing: While this will cause the bottom text <ALT> to be properly aligned both cases, when the text is written in the second buffer, the top of the menu (the title) dissapears. I didn't update other files, except for camera.h and gui_draw.c because I have some of my debug code in other files, so this might be one of the reasons.

*

Offline reyalp

  • ******
  • 13456
Re: Video buffer/screen issues
« Reply #6 on: 02 / October / 2009, 05:12:43 »
does it solve your problem if you make vid_get_bitmap_buffer_height the appropriate amount larger than vid_get_bitmap_screen_height in your platform/sub/lib.c ?
Don't forget what the H stands for.

*

Offline RaduP

  • *****
  • 908
Re: Video buffer/screen issues
« Reply #7 on: 02 / October / 2009, 05:26:37 »
Oh, it did, thanks! Well, except for the menu header not being update sometimes.


 

Related Topics