SDL2+Wayland on Buildroot Embedded System

Hello!

I’m running SDL2-2.24.1 on a buildroot based system. The target is an Allwinner H3 with a Mali400 GPU. I compiled SDL2 with kmsdrm, opengles and wayland support enabled. KMSDRM works just fine out of the box. However I’m wanting to composite video behind an SDL2 overlay using gstreamer, hence the potential need for Wayland.

After setting SDL_VIDEODRIVER=wayland , launching weston and then re-running my app, I get a ton of symbol errors:

DEBUG: Failed loading wl_egl_window_create: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_egl_window_create
DEBUG: Failed loading wl_egl_window_destroy: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_egl_window_destroy
DEBUG: Failed loading wl_egl_window_resize: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_egl_window_resize
DEBUG: Failed loading wl_egl_window_get_attached_size: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_egl_window_get_attached_size
DEBUG: Failed loading wl_cursor_theme_load: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_cursor_theme_load
DEBUG: Failed loading wl_cursor_theme_load: /usr/lib/libwayland-egl.so.1: undefined symbol: _wl_cursor_theme_load
DEBUG: Failed loading wl_cursor_theme_destroy: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_cursor_theme_destroy
DEBUG: Failed loading wl_cursor_theme_destroy: /usr/lib/libwayland-egl.so.1: undefined symbol: _wl_cursor_theme_destroy
DEBUG: Failed loading wl_cursor_theme_get_cursor: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_cursor_theme_get_cursor
DEBUG: Failed loading wl_cursor_theme_get_cursor: /usr/lib/libwayland-egl.so.1: undefined symbol: _wl_cursor_theme_get_cursor
DEBUG: Failed loading wl_cursor_image_get_buffer: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_cursor_image_get_buffer
DEBUG: Failed loading wl_cursor_image_get_buffer: /usr/lib/libwayland-egl.so.1: undefined symbol: _wl_cursor_image_get_buffer
DEBUG: Failed loading wl_cursor_frame: /usr/lib/libwayland-client.so.0: undefined symbol: _wl_cursor_frame
DEBUG: Failed loading wl_cursor_frame: /usr/lib/libwayland-egl.so.1: undefined symbol: _wl_cursor_frame
DEBUG: Failed loading xkb_state_key_get_syms: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_state_key_get_syms
DEBUG: Failed loading xkb_state_key_get_syms: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_state_key_get_syms
DEBUG: Failed loading xkb_state_key_get_syms: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_state_key_get_syms
DEBUG: Failed loading xkb_keysym_to_utf8: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keysym_to_utf8
DEBUG: Failed loading xkb_keysym_to_utf8: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keysym_to_utf8
DEBUG: Failed loading xkb_keysym_to_utf8: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keysym_to_utf8
DEBUG: Failed loading xkb_keymap_new_from_string: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keymap_new_from_string
DEBUG: Failed loading xkb_keymap_new_from_string: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keymap_new_from_string
DEBUG: Failed loading xkb_keymap_new_from_string: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keymap_new_from_string
DEBUG: Failed loading xkb_state_new: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_state_new
DEBUG: Failed loading xkb_state_new: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_state_new
DEBUG: Failed loading xkb_state_new: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_state_new
DEBUG: Failed loading xkb_keymap_key_repeats: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keymap_key_repeats
DEBUG: Failed loading xkb_keymap_key_repeats: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keymap_key_repeats
DEBUG: Failed loading xkb_keymap_key_repeats: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keymap_key_repeats
DEBUG: Failed loading xkb_keymap_unref: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keymap_unref
DEBUG: Failed loading xkb_keymap_unref: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keymap_unref
DEBUG: Failed loading xkb_keymap_unref: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keymap_unref
DEBUG: Failed loading xkb_state_unref: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_state_unref
DEBUG: Failed loading xkb_state_unref: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_state_unref
DEBUG: Failed loading xkb_state_unref: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_state_unref
DEBUG: Failed loading xkb_context_unref: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_context_unref
DEBUG: Failed loading xkb_context_unref: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_context_unref
DEBUG: Failed loading xkb_context_unref: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_context_unref
DEBUG: Failed loading xkb_context_new: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_context_new
DEBUG: Failed loading xkb_context_new: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_context_new
DEBUG: Failed loading xkb_context_new: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_context_new
DEBUG: Failed loading xkb_state_update_mask: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_state_update_mask
DEBUG: Failed loading xkb_state_update_mask: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_state_update_mask
DEBUG: Failed loading xkb_state_update_mask: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_state_update_mask
DEBUG: Failed loading xkb_compose_table_new_from_locale: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_table_new_from_locale
DEBUG: Failed loading xkb_compose_table_new_from_locale: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_table_new_from_locale
DEBUG: Failed loading xkb_compose_table_new_from_locale: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_table_new_from_locale
DEBUG: Failed loading xkb_compose_table_unref: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_table_unref
DEBUG: Failed loading xkb_compose_table_unref: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_table_unref
DEBUG: Failed loading xkb_compose_table_unref: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_table_unref
DEBUG: Failed loading xkb_compose_state_new: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_state_new
DEBUG: Failed loading xkb_compose_state_new: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_state_new
DEBUG: Failed loading xkb_compose_state_new: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_state_new
DEBUG: Failed loading xkb_compose_state_unref: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_state_unref
DEBUG: Failed loading xkb_compose_state_unref: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_state_unref
DEBUG: Failed loading xkb_compose_state_unref: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_state_unref
DEBUG: Failed loading xkb_compose_state_feed: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_state_feed
DEBUG: Failed loading xkb_compose_state_feed: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_state_feed
DEBUG: Failed loading xkb_compose_state_feed: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_state_feed
DEBUG: Failed loading xkb_compose_state_get_status: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_state_get_status
DEBUG: Failed loading xkb_compose_state_get_status: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_state_get_status
DEBUG: Failed loading xkb_compose_state_get_status: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_state_get_status
DEBUG: Failed loading xkb_compose_state_get_one_sym: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_compose_state_get_one_sym
DEBUG: Failed loading xkb_compose_state_get_one_sym: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_compose_state_get_one_sym
DEBUG: Failed loading xkb_compose_state_get_one_sym: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_compose_state_get_one_sym
DEBUG: Failed loading xkb_keymap_key_for_each: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keymap_key_for_each
DEBUG: Failed loading xkb_keymap_key_for_each: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keymap_key_for_each
DEBUG: Failed loading xkb_keymap_key_for_each: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keymap_key_for_each
DEBUG: Failed loading xkb_keymap_key_get_syms_by_level: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keymap_key_get_syms_by_level
DEBUG: Failed loading xkb_keymap_key_get_syms_by_level: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keymap_key_get_syms_by_level
DEBUG: Failed loading xkb_keymap_key_get_syms_by_level: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keymap_key_get_syms_by_level
DEBUG: Failed loading xkb_keysym_to_utf32: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keysym_to_utf32
DEBUG: Failed loading xkb_keysym_to_utf32: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keysym_to_utf32
DEBUG: Failed loading xkb_keysym_to_utf32: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keysym_to_utf32
DEBUG: Failed loading xkb_keymap_mod_get_index: /usr/lib/libwayland-client.so.0: undefined symbol: _xkb_keymap_mod_get_index
DEBUG: Failed loading xkb_keymap_mod_get_index: /usr/lib/libwayland-egl.so.1: undefined symbol: _xkb_keymap_mod_get_index
DEBUG: Failed loading xkb_keymap_mod_get_index: /usr/lib/libwayland-cursor.so.0: undefined symbol: _xkb_keymap_mod_get_index
DEBUG: wayland not available

and eventually the SDL init phase fails since it can’t find the wayland backend. At the time this happens, weston is running and I can see a desktop shell on screen.

I’ve also exported LD_LIBRARY_PATH=/usr/lib as a hail mary, but the same behavior ensues.

Has anyone ever seen this?

Thanks in advance!

Alright, after more splunking, I think I see what’s up. My wayland/weston compositor is running on tty1. SDL by default is trying to connect to wayland-0 (on tty0).

Is there a reason this is hard coded? I know in gstreamer and other applications I can specify which socket to use.

maybe with the WAYLAND_DISPLAY environment variable?

1 Like

Hey Daniel,

Good catch! When running WAYLAND_DISPLAY=wayland-1 mysdlbinary it appears to create the video backend and then segfaults without any real debug information. I’ll see if I can get it to coredump and trace it from there to see where the snag is.