Hi,
I’m experimenting with the console framebuffer on the Raspberry Pi…
(Small ARM based Linux box for those who’ve been living in a cave for the
past 6 months)
The Pi is running Debian stable (and I have another running the "Raspbian"
release of Wheezy) SDL is Debians 1.2
My app (the BASIC interpreter) runs fine under X on the Pi, but I’ve been
having an intersting time on the console - lots of crashes, etc. however
when I realised the Pi has a 16bpp framebuffer and switched it to 16bpp it
all started to beheve itself better, and it’s a lot faster (so I guess SDL
isn’t doing any framebuffer converts) however it’s also flickering.
2 things I’ve noticed - one is a program that draws lots of lines, then
prints text on-top, then calls Flip, and repeats. (think background line
animation with static text on-top). Under X it looks fine, however on the
Pi console, I actually see the lines being drawn under & between the text
- if I stop the program it then looks OK, (no lines between the test) but
when running, there is this flickering.
the text output is fairly simple 8x8 characters which overwrites
everything underneath them.
When it was running in 32bpp mode, it was slower and I didn’t see this
flickering. I’m at a loss to think why I even see the lines underneath the
text in the first place - it’s almost as if Flip is being ignored and I’m
writing directly to the framebuffer, however I’m really not, and stopping
the program always causes it to display the right thing - ie. the text
over the lines.
The other thing is very similar with sprites - my sprite update code does
up to 3 BLITs per sprite - one to restore the old backgound, one to save
the new background and one to plot the sprite (on top of the saved
backgound), however when running, they flicker and I see the background
under the sprites which I’m not supposed to see as those 3 operations
happen without a flip in-between them…
And of-course this never happens under X, even fullscreen under X. (Nor
full-screen on a laptop, etc. and I’ve just checked it again on my laptop
- runs smoothly without flickering)
So is it me, the Pi, or …
Just FYI: I’m opening the screen with:
myScreen = SDL_SetVideoMode (screenWidth, screenHeight, BYTES_PER_PIXEL * 8, SDL_DOUBLEBUF | SDL_SWSURFACE) ;
fiddling with SDL_FULLSCREEN and SDL_HWSURFACE doesn’t change anything.
Pi reports this from GetVideoInfo:
Video Info:
hw_available: Yes
wm_available: No
blit_hw: No, blit_hw_CC: No, blit_hw_A: No
blit_sw: No, blit_sw_CC: No, blit_sw_A: No
blit_fill: No
video_mem: 2560
current_w: 1280
current_h: 1024
PixelFormat:
BitsPerPixel: 16, BytesPerPixel: 2
(current width and height are dependant on what it’s plugged into - it has
HDMI output and composite video - this is HDMI into my monitor)
Any thoughts appreciated…
Thanks,
Gordon