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

LVGL Wayland driver works with Wayland 9.0.0 but not 10.0.2 #264

Open
pclass-sensonix opened this issue Jan 10, 2023 · 5 comments
Open

LVGL Wayland driver works with Wayland 9.0.0 but not 10.0.2 #264

pclass-sensonix opened this issue Jan 10, 2023 · 5 comments

Comments

@pclass-sensonix
Copy link

pclass-sensonix commented Jan 10, 2023

I'm using the latest version of LVGL from the master branch and the latest Wayland driver from this lv_drivers repository on a small Embedded Linux device. When I run my application again Weston 9.0.0 on my device, it works great - however, when I install Weston 10.0.2, I get a segmentation fault in the Wayland driver at the lv_obj_set_style_bg_color line. Chromium works against both Wayland versions on the same hardware. The application is communicating with Weston because I can see output by exporting the WAYLAND_DEBUG=1 environment variable.

Here is my simple example application:

#include <lvgl/lvgl.h>
#include <lv_drivers/wayland/wayland.h>
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#include "ui.h"

#define H_RES (800)
#define V_RES (480)

static void * tick_thread(void * data)
{
    (void) data;
    while(true) {
        usleep(5 * 1000);
        lv_tick_inc(5);
    }
}

void hal_init(void)
{

    lv_init();

    lv_wayland_init();

    /* Create a display */
    lv_disp_t * disp = lv_wayland_create_window(H_RES, V_RES, "Window Title", NULL);

    lv_wayland_window_set_fullscreen(disp, true);

}

int main(void)
{
    /*LittlevGL init*/
    lv_init();

    hal_init();

    /*Create a Demo*/
    //ui_init();

    /*Change the active screen's background color*/
    lv_obj_set_style_bg_color(lv_scr_act(), lv_color_hex(0x003a57), LV_PART_MAIN);

    /*Handle LitlevGL tasks (tickless mode)*/
    while(1) {
        lv_timer_handler();
        usleep(5000);
    }

    return 0;
}

Here is the output from Weston with WAYLAND_DEBUG=1 exported:

[1149019.686] [email protected]_registry(new id wl_registry@2)
[1149020.973]  -> [email protected](1, "wl_compositor", 4)
[1149021.402]  -> [email protected](2, "wl_subcompositor", 1)
[1149022.652]  -> [email protected](3, "wp_viewporter", 1)
[1149023.052]  -> [email protected](4, "zxdg_output_manager_v1", 2)
[1149024.408]  -> [email protected](5, "wp_presentation", 1)
[1149024.816]  -> [email protected](6, "zwp_relative_pointer_manager_v1", 1)
[1149026.034]  -> [email protected](7, "zwp_pointer_constraints_v1", 1)
[1149026.452]  -> [email protected](8, "zwp_input_timestamps_manager_v1", 1)
[1149026.833]  -> [email protected](9, "wl_data_device_manager", 3)
[1149028.123]  -> [email protected](10, "wl_shm", 1)
[1149028.530]  -> [email protected](11, "weston_touch_calibration", 1)
[1149029.826]  -> [email protected](12, "wl_seat", 7)
[1149030.250]  -> [email protected](13, "weston_content_protection", 1)
[1149031.518]  -> [email protected](14, "wl_output", 3)
[1149031.927]  -> [email protected](15, "zwp_input_panel_v1", 1)
[1149032.305]  -> [email protected](16, "zwp_input_method_v1", 1)
[1149033.637]  -> [email protected](17, "zwp_text_input_manager_v1", 1)
[1149034.039]  -> [email protected](18, "xdg_wm_base", 3)
[1149035.300]  -> [email protected](19, "weston_desktop_shell", 1)
[1149036.398]  -> [email protected](20, "weston_screenshooter", 1)
[1149071.369] [email protected](1, "wl_compositor", 1, new id [unknown]@3)
[1149072.943] [email protected](2, "wl_subcompositor", 1, new id [unknown]@4)
[1149074.472] [email protected](10, "wl_shm", 1, new id [unknown]@5)
[1149076.476]  -> [email protected](0)
[1149076.714]  -> [email protected](1)
[1149077.745]  -> [email protected](909199186)
[1149077.972]  -> [email protected](875709016)
[1149078.171]  -> [email protected](875708993)
[1149078.356]  -> [email protected](875714642)
[1149078.541]  -> [email protected](875708754)
[1149080.381]  -> [email protected](875714626)
[1149080.702]  -> [email protected](875708738)
[1149080.902]  -> [email protected](808669784)
[1149081.940]  -> [email protected](808669761)
[1149082.183]  -> [email protected](808665688)
[1149082.379]  -> [email protected](808665665)
[1149082.591] [email protected]_pool(new id wl_shm_pool@6, fd 37, 4096)
[1149084.185] [email protected](8832)
[1149084.567] [email protected](18624)
[1149085.719] [email protected](12, "wl_seat", 1, new id [unknown]@7)
[1149086.404]  -> [email protected](6)
[1149086.646] [email protected](new id wl_callback@8)
[1149087.813]  -> [email protected](1)
[1149088.056]  -> [email protected]_id(8)

And here is the output of my application ( including the segmentation fault ):

>> ./splash 
[1149016.050]  -> [email protected]_registry(new id wl_registry@2)
[1149038.173] [email protected](1, "wl_compositor", 4)
[1149039.897]  -> [email protected](1, "wl_compositor", 1, new id [unknown]@3)
[1149041.212] [email protected](2, "wl_subcompositor", 1)
[1149041.730]  -> [email protected](2, "wl_subcompositor", 1, new id [unknown]@4)
[1149043.690] [email protected](3, "wp_viewporter", 1)
[1149044.106] [email protected](4, "zxdg_output_manager_v1", 2)
[1149044.490] [email protected](5, "wp_presentation", 1)
[1149046.146] [email protected](6, "zwp_relative_pointer_manager_v1", 1)
[1149048.382] [email protected](7, "zwp_pointer_constraints_v1", 1)
[1149048.794] [email protected](8, "zwp_input_timestamps_manager_v1", 1)
[1149049.171] [email protected](9, "wl_data_device_manager", 3)
[1149050.433] [email protected](10, "wl_shm", 1)
[1149050.842]  -> [email protected](10, "wl_shm", 1, new id [unknown]@5)
[1149052.532]  -> [email protected]_pool(new id wl_shm_pool@6, fd 5, 4096)
[1149055.740]  -> [email protected](8832)
[1149058.772]  -> [email protected](18624)
[1149060.192] [email protected](11, "weston_touch_calibration", 1)
[1149061.548] [email protected](12, "wl_seat", 7)
[1149061.960]  -> [email protected](12, "wl_seat", 1, new id [unknown]@7)
[1149063.731] [email protected](13, "weston_content_protection", 1)
[1149064.167] [email protected](14, "wl_output", 3)
[1149065.456] [email protected](15, "zwp_input_panel_v1", 1)
[1149065.846] [email protected](16, "zwp_input_method_v1", 1)
[1149066.220] [email protected](17, "zwp_text_input_manager_v1", 1)
[1149067.445] [email protected](18, "xdg_wm_base", 3)
[1149067.831] [email protected](19, "weston_desktop_shell", 1)
[1149069.502] [email protected](20, "weston_screenshooter", 1)
[1149070.811]  -> [email protected](new id wl_callback@8)
[1149088.531] [email protected]_id(8)
[1149089.677] [email protected](0)
[1149089.919] [email protected](1)
[1149090.106] [email protected](909199186)
[1149090.292] [email protected](875709016)
[1149090.469] [email protected](875708993)
[1149090.646] [email protected](875714642)
[1149091.688] [email protected](875708754)
[1149091.904] [email protected](875714626)
[1149092.093] [email protected](875708738)
[1149092.278] [email protected](808669784)
[1149092.459] [email protected](808669761)
[1149093.558] [email protected](808665688)
[1149093.770] [email protected](808665665)
[1149093.956] [email protected](6)
[1149094.159]  -> [email protected]_keyboard(new id wl_keyboard@9)
[1149095.300]  -> [email protected]_touch(new id wl_touch@10)
[1149095.588] [email protected](1)
[1149096.080]  -> [email protected]_surface(new id wl_surface@8)
[1149098.150]  -> [email protected]()
Segmentation fault

I do not understand what is failing and why it would work with Weston 9.0.0 but not 10.0.2. I'd greatly appreciate any help!

@symfund
Copy link

symfund commented Jan 11, 2023

With Weston 10.0.2, you should use XDG Shell, the WL SHELL is deprecated in favor of XDG Shell now!

In lv_drv_conf.h, enable the macro 'LV_WAYLAND_XDG_SHELL'

@pclass-sensonix
Copy link
Author

Thank you for the answer. I do believe that is the problem. I am now trying to enable XDG Shell in Yocto since the last official version of lv_drivers for Bitbake was version 8.3.0. It seems to have trouble compiling with XDG Shell enabled.

@pclass-sensonix
Copy link
Author

Hi @symfund - Have you been able to use the Wayland LVGL drivers with Weston 11.0.1? I was able to build this with Yocto and deploy to my ARM32 board with Weston 11.0.1 running. Chromium is able to render on using Weston, however the lvl driver does not seem to be able to render onto the display. It does not display any errors and does not set fault, it just does not render. I can see from the Weston side debugging that LVGL is able to communicate with it.

Here is the Wayland debugging I have captured from my LVGL application side ( and the source code is below ):

>> export WAYLAND_DISPLAY=wayland-1                                                                                                                                       
>> export WAYLAND_DEBUG=1                                                                                                                                               
>> export XDG_RUNTIME_DIR=/tmp    
>> splash                                                                                                                                                               
[2832542.019]  -> [email protected]_registry(new id wl_registry@2)
[2832551.152] [email protected](1, "wl_compositor", 5)
[2832551.454]  -> [email protected](1, "wl_compositor", 1, new id [unknown]@3)
[2832551.589] [email protected](2, "wl_subcompositor", 1)
[2832551.696]  -> [email protected](2, "wl_subcompositor", 1, new id [unknown]@4)
[2832551.802] [email protected](3, "wp_viewporter", 1)
[2832551.891] [email protected](4, "zxdg_output_manager_v1", 2)
[2832551.976] [email protected](5, "wp_presentation", 1)
[2832552.139] [email protected](6, "wp_single_pixel_buffer_manager_v1", 1)
[2832552.256] [email protected](7, "zwp_relative_pointer_manager_v1", 1)
[2832552.347] [email protected](8, "zwp_pointer_constraints_v1", 1)
[2832552.431] [email protected](9, "zwp_input_timestamps_manager_v1", 1)
[2832552.563] [email protected](10, "wl_data_device_manager", 3)
[2832552.665] [email protected](11, "wl_shm", 1)
[2832552.761]  -> [email protected](11, "wl_shm", 1, new id [unknown]@5)
[2832553.136]  -> [email protected]_pool(new id wl_shm_pool@6, fd 5, 4096)
[2832555.011]  -> [email protected](8832)
[2832555.568]  -> [email protected](18624)
[2832555.900] [email protected](12, "wl_seat", 7)
[2832556.051]  -> [email protected](12, "wl_seat", 1, new id [unknown]@7)
[2832556.248] [email protected](13, "weston_content_protection", 1)
[2832556.348] [email protected](14, "wl_output", 3)
[2832556.437] [email protected](15, "zwp_input_panel_v1", 1)
[2832556.523] [email protected](16, "zwp_input_method_v1", 1)
[2832556.606] [email protected](17, "zwp_text_input_manager_v1", 1)
[2832556.688] [email protected](18, "xdg_wm_base", 5)
[2832556.781]  -> [email protected](18, "xdg_wm_base", 5, new id [unknown]@8)
[2832556.882] [email protected](19, "weston_desktop_shell", 1)
[2832556.968] [email protected](20, "weston_screenshooter", 1)
[2832557.068]  -> [email protected](new id wl_callback@9)
[2832560.161] [email protected]_id(9)
[2832560.357] [email protected](0)
[2832560.452] [email protected](1)
[2832560.534] [email protected](909199186)
[2832560.612] [email protected](875709016)
[2832560.685] [email protected](875708993)
[2832560.759] [email protected](875714642)
[2832560.832] [email protected](875708754)
[2832560.910] [email protected](875714626)
[2832560.985] [email protected](875708738)
[2832561.060] [email protected](808669784)
[2832561.135] [email protected](808669761)
[2832561.209] [email protected](808665688)
[2832561.284] [email protected](808665665)
[2832561.357] [email protected](6)
[2832561.440]  -> [email protected]_keyboard(new id wl_keyboard@10)
[2832561.541]  -> [email protected]_touch(new id wl_touch@11)
[2832561.631] [email protected](5)
[2832561.960]  -> [email protected]_surface(new id wl_surface@9)
[2832562.193]  -> [email protected]_xdg_surface(new id xdg_surface@12, wl_surface@9)
[2832562.319]  -> [email protected]_toplevel(new id xdg_toplevel@13)
[2832562.487]  -> [email protected]_title("Splash Screen")
[2832562.618]  -> [email protected]_app_id("Splash Screen")
[2832562.704]  -> [email protected]()
[2832562.793]  -> [email protected]_surface(new id wl_surface@14)
[2832562.889]  -> [email protected]_surface(new id wl_surface@15)
[2832562.991]  -> [email protected]_surface(new id wl_surface@16)
[2832563.085]  -> [email protected]_surface(new id wl_surface@17)
[2832563.183]  -> [email protected]_surface(new id wl_surface@18)
[2832563.278]  -> [email protected]_surface(new id wl_surface@19)
[2832563.372]  -> [email protected]_surface(new id wl_surface@20)
[2832563.472]  -> [email protected]_surface(new id wl_surface@21)
[2832563.959]  -> [email protected]_pool(new id wl_shm_pool@22, fd 6, 40960)
[2832564.138]  -> [email protected]_buffer(new id wl_buffer@23, 0, 800, 24, 1600, 909199186)
[2832564.903]  -> [email protected]_subsurface(new id wl_subsurface@24, wl_surface@14, wl_surface@9)
[2832565.063]  -> [email protected]_desync()
[2832565.160]  -> [email protected]_position(0, -24)
[2832565.255]  -> [email protected](wl_buffer@23, 0, 0)
[2832565.348]  -> [email protected]()
[2832908.011]  -> [email protected](45056)
[2832908.193]  -> [email protected]_buffer(new id wl_buffer@25, 40960, 16, 16, 32, 909199186)
[2832908.646]  -> [email protected]_subsurface(new id wl_subsurface@26, wl_surface@15, wl_surface@9)
[2832908.817]  -> [email protected]_desync()
[2832908.909]  -> [email protected]_position(780, -21)
[2832908.998]  -> [email protected](wl_buffer@25, 0, 0)
[2832909.093]  -> [email protected]()
[2832909.202]  -> [email protected](49152)
[2832909.303]  -> [email protected]_buffer(new id wl_buffer@27, 45056, 16, 16, 32, 909199186)
[2832909.640]  -> [email protected]_subsurface(new id wl_subsurface@28, wl_surface@16, wl_surface@9)
[2832909.791]  -> [email protected]_desync()
[2832909.874]  -> [email protected]_position(760, -21)
[2832910.031]  -> [email protected](wl_buffer@27, 0, 0)
[2832910.148]  -> [email protected]()
[2832910.263]  -> [email protected](53248)
[2832910.364]  -> [email protected]_buffer(new id wl_buffer@29, 49152, 16, 16, 32, 909199186)
[2832910.688]  -> [email protected]_subsurface(new id wl_subsurface@30, wl_surface@17, wl_surface@9)
[2832910.834]  -> [email protected]_desync()
[2832910.922]  -> [email protected]_position(740, -21)
[2832911.013]  -> [email protected](wl_buffer@29, 0, 0)
[2832911.105]  -> [email protected]()
[2832911.210]  -> [email protected](57344)
[2832911.309]  -> [email protected]_buffer(new id wl_buffer@31, 53248, 804, 2, 1608, 909199186)
[2832911.650]  -> [email protected]_subsurface(new id wl_subsurface@32, wl_surface@18, wl_surface@9)
[2832911.795]  -> [email protected]_desync()
[2832911.883]  -> [email protected]_position(-2, -26)
[2832911.976]  -> [email protected](wl_buffer@31, 0, 0)
[2832912.156]  -> [email protected]()
[2832912.298]  -> [email protected](61440)
[2832912.409]  -> [email protected]_buffer(new id wl_buffer@33, 57344, 804, 2, 1608, 909199186)
[2832912.773]  -> [email protected]_subsurface(new id wl_subsurface@34, wl_surface@19, wl_surface@9)
[2832912.923]  -> [email protected]_desync()
[2832913.015]  -> [email protected]_position(-2, 480)
[2832913.103]  -> [email protected](wl_buffer@33, 0, 0)
[2832913.195]  -> [email protected]()
[2832913.296]  -> [email protected](65536)
[2832913.392]  -> [email protected]_buffer(new id wl_buffer@35, 61440, 2, 504, 4, 909199186)
[2832913.694]  -> [email protected]_subsurface(new id wl_subsurface@36, wl_surface@20, wl_surface@9)
[2832913.836]  -> [email protected]_desync()
[2832913.923]  -> [email protected]_position(-2, -24)
[2832914.016]  -> [email protected](wl_buffer@35, 0, 0)
[2832914.113]  -> [email protected]()
[2832914.218]  -> [email protected](69632)
[2832914.317]  -> [email protected]_buffer(new id wl_buffer@37, 65536, 2, 504, 4, 909199186)
[2832914.621]  -> [email protected]_subsurface(new id wl_subsurface@38, wl_surface@21, wl_surface@9)
[2832914.758]  -> [email protected]_desync()
[2832914.845]  -> [email protected]_position(800, -24)
[2832914.935]  -> [email protected](wl_buffer@37, 0, 0)
[2832915.027]  -> [email protected]()
Done with UI Init
#include <lvgl/lvgl.h>
#include <lv_drivers/wayland/wayland.h>
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#include "ui.h"
#include "wayland-xdg-shell-client-protocol.h"

#define H_RES (800)
#define V_RES (480)


int main(void)
{

    lv_init();

    lv_wayland_init();

    /* Create a display */
    lv_disp_t * disp = lv_wayland_create_window(H_RES, V_RES, "Splash Screen", NULL);

    lv_wayland_window_set_fullscreen(disp, false);

    /*Create a Demo*/
    ui_init();

    printf("Done with UI Init\n");

    while(1)
	{
		pause();
	}

    return 0;
}

@stale
Copy link

stale bot commented Apr 20, 2023

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 20, 2023
@skmodi
Copy link

skmodi commented Jun 27, 2024

I'm facing similar Segmentation fault issue. Do we have any fix for this issue ?

@stale stale bot removed the stale label Jun 27, 2024
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

3 participants