fbv icon indicating copy to clipboard operation
fbv copied to clipboard

Screen is not cleared before nor after the image is shown

Open avanc opened this issue 5 years ago • 4 comments

I'm using fbv on my Raspberry Pi using a system build with buildroot. However, the screen is not cleared before nor after showing the image. As the package in the official buildroot repo still uses the old sources from http://s-tech.elsat.net.pl/fbv, I gave this newer version a try an compiled it. But the outcome is the same: the screen is not cleared, although the documentation of the parameter "--dontclear" makes me expecting that the screen should be cleared if this parameter is not set.

My additional observations are, that "--widthonly" and "--heightonly" don't have any effect. This features were my initial reason to switch to this version :-)

Any suggestions how I can investigate deeper would be highly appreciated, as I don't know how to continue.

avanc avatar Nov 12 '20 12:11 avanc

you should try this snippet of code to see whether it can clear the screen.

#include <stdio.h>
int main()
{
	printf("\033[H\033[J");
	fflush(stdout);
	return 0;
}

godspeed1989 avatar Nov 13 '20 02:11 godspeed1989

Thanks, that helped to nail it down: I'm starting fbv from a virtual (ssh) console and it draws the image successfully to /dev/fb0. However, the clear command is executed on the virtual console and not to the framebuffer. Is this intended?

My problem comes from a simple use-case: Slideshow If the first image covers the whole screen, but the second image is smaller, I don't want to see parts of the previous image.

avanc avatar Nov 13 '20 06:11 avanc

As a workaround I can do dd if=/dev/zero of /dev/fb0 However, this way I cannot use the slideshow option of fbv, as the screen is not cleared between images.

Before spending time in creating a patch, I want some feedback if this is the way to go:

  • Creating an additional comman line parameter "clear fb before drawing"
  • Everytime, fbv is going to show a new image, I write zeros to the frame buffer.

What do you think?

avanc avatar Nov 16 '20 10:11 avanc

I think the second one is a better option

godspeed1989 avatar Nov 16 '20 13:11 godspeed1989