Description
I’m useing LVGL 9 to create a UI on a linux drm plane.
UI itself works for me.
I have gstreamer playing a video on the overlay plane and want to use LVGL to draw the UI over the video.
What MCU/Processor/Board and compiler are you using?
Radxa Zero 3W
What LVGL version are you using?
9-master
What do you want to achieve?
I need the UI to be transperent where nothing is drawn (black background)
What have you tried so far?
Changed the color format to be #define DRM_FOURCC DRM_FORMAT_ARGB8888
When useing modetest to set the alpha of the plane this affects all colors.
Code to reproduce
I run the a basic hello world menu.
The code block(s) should be formatted like:
int main(int argc, char **argv)
{
// setup keybard inout from stdin
set_stdin_nonblock();
printf("WASD Navigation active (Q to quit)\n");
/* Initialize LVGL. */
lv_init();
/* Initialize libDRM */
const char *device = "/dev/dri/card0";
lv_display_t * disp = lv_linux_drm_create();
lv_linux_drm_set_file(disp, device, -1);
// Create a virtual keyboard input device
lv_indev_t * kb_indev = create_virtual_keyboard();
// Check if the virtual keyboard was created successfully
if (kb_indev) {
printf("Virtual keyboard created successfully!\n");
} else {
printf("Error: Could not create virtual keyboard!\n");
}
/*Change the active screen's background color*/
lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(0x000000), LV_PART_MAIN);
/*Create a white label, set its text and align it to the center*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "Hello world");
lv_obj_set_style_text_color(lv_screen_active(), lv_color_hex(0xffffff), LV_PART_MAIN);
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
while (1) {
// Handle keyboard input
handle_keyboard_input();
lv_task_handler();
//ui_tick();
usleep(5000); // Sleep for a short period to allow LVGL to update
}
//lv_linux_run_loop();
//sleep(50);
return 0;
}
changes in lv_conf.h
#define LV_COLOR_DEPTH 32
#define LV_USE_LINUX_DRM 1
#define LV_USE_EVDEV 1