Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen is not cleared before nor after the image is shown #16

Open
avanc opened this issue Nov 12, 2020 · 4 comments
Open

Screen is not cleared before nor after the image is shown #16

avanc opened this issue Nov 12, 2020 · 4 comments

Comments

@avanc
Copy link
Contributor

avanc commented Nov 12, 2020

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.

@godspeed1989
Copy link
Owner

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;
}

@avanc
Copy link
Contributor Author

avanc commented Nov 13, 2020

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
Copy link
Contributor Author

avanc commented Nov 16, 2020

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?

@godspeed1989
Copy link
Owner

I think the second one is a better option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants