Odd Linux FB issue on Pi

So, my issue is 2 fold:

  1. LVGL seems to be drawing on every other column, so I am seeing 1/2 my screen.
  2. The colors are wonky as well.

What MCU/Processor/Board and compiler are you using?

Raspberry Pi

What LVGL version are you using?


What do you want to achieve?

Use the touchscreen and display graphics

What have you tried so far?

Ive tried different resolutions, different values for the display buffer (Both single and double buffers).

Code to reproduce

#define DISP_BUF_SIZE 800*480
	// Touch pointer device init

	// Initialize `disp_buf` with the display buffer(s)
	static lv_color_t buf1[DISP_BUF_SIZE]; /*Declare a buffer for 10 lines*/
	static lv_color_t buf2[DISP_BUF_SIZE]; /*Declare a buffer for 10 lines*/

		lv_disp_buf_init(&disp_buf, buf1, NULL, DISP_BUF_SIZE);

	// Initialize and register a display driver
	lv_disp_drv_t disp_drv;
	disp_drv.flush_cb = fbdev_flush; 	// flushes the internal graphical buffer to the frame buffer
	disp_drv.buffer = &disp_buf; 		// set teh display buffere reference in the driver

	// Initialize and register a pointer device driver
	lv_indev_drv_t indev_drv;
	indev_drv.type = LV_INDEV_TYPE_POINTER;
	indev_drv.read_cb = evdev_read;     // defined in lv_drivers/indev/evdev.h

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

THis shows a close up of what I am seeing

One more piece of data, using the latest lv_drivers from GitHub

The colors are also wrong so I think the BPP is configured incorrectly.

If you’re using the fbdev driver I believe it prints color depth information to the console - you could try redirecting that to a file, then see if it matches what you set for LV_COLOR_DEPTH.

I am using the fbdev driver. And Ill be a monkey’s uncle, it shows 16bpp.

That did it, I dont care what anyone says, you da man :slight_smile:

1 Like

Glad it works.

I think there may be a bug in the fbdev driver which has existed for quite some time. Were you using LV_COLOR_DEPTH == 32 before?

Yep, 32. I was sure it was the framebuffering, but I was surely wrong :slight_smile:

Now I need to work on getting the touch calibrated.