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

Some touch events are not being fired on Ubuntu-Core #2463

Closed
jdbelo opened this issue Jun 9, 2022 · 38 comments
Closed

Some touch events are not being fired on Ubuntu-Core #2463

jdbelo opened this issue Jun 9, 2022 · 38 comments

Comments

@jdbelo
Copy link

jdbelo commented Jun 9, 2022

Hi everyone,

I’ve been struggling to integrate a multitouch film into my kiosk solution without success. For some reason, there are multitouch inputs that are not recognized (for instance, two fingers pinch) on the ubuntu-core (core20).

I opened this discussion on snapcraft forum and there I was recommended to open this issue here as well. You track the discussion here.

In a nutshell, some multitouch events are recognized in Ubuntu Desktop 20.04 but aren't recognized in Ubuntu Core (core20).

Does anyone have an idea about how to overcome this situation?

Thanks

@wmww
Copy link
Contributor

wmww commented Jun 9, 2022

Some things weren't obvious to me from the discussion:

  • Have you tested the exact same Electron snap on both Ubuntu 20.04 + Gnome with Wayland and Ubuntu Core + Ubuntu Frame? Or just Chromium on 20.04?
  • On Core, are you running the Electron app natively on Wayland or on X11 via the XWayland compatibility layer?

Unless you are running the Electron app with --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime, it's probably using XWayland. I would expect going through XWayland might not work as well as running natively on Wayland. If you want to make sure it's running on Wayland set an invalid X11 DISPLAY environment variable value (for example DISPLAY=no your_app). If that makes it not work you were probably running on XWayland before.

Another thing to try is running the Electron snap on Ubuntu Frame on Ubuntu 20.04. I suspect this will have the same behavior as Core, but would be good to check.

@AlanGriffiths
Copy link
Contributor

I have tried (on 22.04 Desktop) running the chromium snap (configured to use Wayland) on Ubuntu Frame. Two finger pinch works.

To configure Chrome to use Wayland:

  1. snap connect chromium:wayland
  2. Go to chrome://flags
  3. Search "Preferred Ozone platform"
  4. Set it to "Wayland"

Testing process:

  1. switch to a VT
  2. ubuntu-frame& sleep 2; chromium
  3. Try two finger pinch

Expect: page zooms
Actual: page zooms

This strongly suggests that the problem is with @jdbelo's Electron snap. Either with the Electron version being used or with the snap recipe (e.g. using Xwayland - although I would expect that to work anyway.)

@AlanGriffiths AlanGriffiths added the Needs Info Waiting on further information before the bug can be resolved label Jun 10, 2022
@frank-dspeed
Copy link

frank-dspeed commented Jun 16, 2022

i can not verify that this works but it produces a lot of output

[2022-06-16 17:23:46.078812] <information> mirserver: Starting
[2022-06-16 17:23:46.078884] < - debug - > mirserver: Not trying logind: "DISPLAY" is set and X need not have claimed the VT
[2022-06-16 17:23:46.078940] < - debug - > mirserver: Not using Linux VT subsystem for session management: Failed to find the current VT
[2022-06-16 17:23:46.078956] < - debug - > mirserver: No session management supported
[2022-06-16 17:23:46.078971] <information> VT switch key handler: No VT switching support available: MinimalConsoleServices does not support VT switching
[2022-06-16 17:23:46.079043] <information> mircommon: Loading modules from: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform
[2022-06-16 17:23:46.079072] <information> mircommon: Loading module: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
[2022-06-16 17:23:46.079097] <information> mircommon: Loading module: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
[2022-06-16 17:23:46.079113] <information> mircommon: Loading module: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2022-06-16 17:23:46.079737] <information> mirserver: Found display driver: mir:gbm-kms (version 2.8.0)
[2022-06-16 17:23:46.080509] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver nvidia
[2022-06-16 17:23:46.080519] <information> gbm-kms: Quirks: skipping device /dev/dri/card0 (matches driver quirk nvidia)
[2022-06-16 17:23:46.080534] <information> gbm-kms: Not probing device /dev/dri/card0 due to specified quirk
[2022-06-16 17:23:46.080546] <information> mirserver: (Unsupported by system environment)
[2022-06-16 17:23:46.080563] <information> mirserver: Found display driver: mir:x11 (version 2.8.0)
[2022-06-16 17:23:46.081017] <information> mirserver: Driver supports:
[2022-06-16 17:23:46.081026] <information> mirserver: 	System (priority 192)
[2022-06-16 17:23:46.081058] <information> mirserver: Selected display driver: mir:x11 (version 2.8.0)
[2022-06-16 17:23:46.081182] <information> mircommon: Loading modules from: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform
[2022-06-16 17:23:46.081218] <information> mircommon: Loading module: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.20
[2022-06-16 17:23:46.081228] <information> mircommon: Loading module: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.20
[2022-06-16 17:23:46.081235] <information> mircommon: Loading module: /snap/ubuntu-frame/2619/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2022-06-16 17:23:46.081778] <information> mirserver: Found rendering driver: mir:gbm-kms (version 2.8.0)
[2022-06-16 17:23:46.082135] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver nvidia
[2022-06-16 17:23:46.082144] <information> gbm-kms: Quirks: skipping device /dev/dri/card0 (matches driver quirk nvidia)
[2022-06-16 17:23:46.082159] <information> gbm-kms: Not probing device /dev/dri/card0 due to specified quirk
[2022-06-16 17:23:46.082257] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/renderD128, driver nvidia
[2022-06-16 17:23:46.082264] <information> gbm-kms: Quirks: skipping device /dev/dri/renderD128 (matches driver quirk nvidia)
[2022-06-16 17:23:46.082278] <information> gbm-kms: Not probing device /dev/dri/renderD128 due to specified quirk
[2022-06-16 17:23:46.082299] <information> mirserver: (Unsupported by system environment)
[2022-06-16 17:23:46.082316] <information> mirserver: Found rendering driver: mir:x11 (version 2.8.0)
[2022-06-16 17:23:46.082321] <information> mirserver: Driver supports:
[2022-06-16 17:23:46.082326] <information> mirserver: 	System (priority 192)
[2022-06-16 17:23:46.082347] <information> mirserver: Selected rendering driver: mir:x11 (version 2.8.0)
libEGL warning: DRI2: failed to authenticate
[2022-06-16 17:23:46.107951] < - debug - > miral: Display config using layout: 'default'
[2022-06-16 17:23:46.108038] <information> miral: Display config:
8>< ---------------------------------------------------
layouts:
# keys here are layout labels (used for atomically switching between them)
# when enabling displays, surfaces should be matched in reverse recency order

  default:                         # the default layout

    cards:
    # a list of cards (currently matched by card-id)

    - card-id: 0
      unknown-1:
        # This output supports the following modes: 1280x1024@60.0
        #
        # Uncomment the following to enforce the selected configuration.
        # Or amend as desired.
        #
        # state: enabled	# {enabled, disabled}, defaults to enabled
        # mode: 1280x1024@60.0	# Defaults to preferred mode
        # position: [0, 0]	# Defaults to [0, 0]
        # orientation: normal	# {normal, left, right, inverted}, defaults to normal
        # scale: 1
        # group: 0	# Outputs with the same non-zero value are treated as a single display
8>< ---------------------------------------------------
xkbcommon: ERROR: couldn't find a Compose file for locale "de_DE.UTF-8"
[2022-06-16 17:23:46.113574] <information> mirserver: Using software cursor
[2022-06-16 17:23:46.120797] <information> GLRenderer: EGL vendor: Mesa Project
[2022-06-16 17:23:46.120840] <information> GLRenderer: EGL version: 1.5
[2022-06-16 17:23:46.120853] <information> GLRenderer: EGL client APIs: OpenGL OpenGL_ES 
[2022-06-16 17:23:46.120863] <information> GLRenderer: EGL extensions: EGL_EXT_create_context_robustness EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_query_driver 
[2022-06-16 17:23:46.120877] <information> GLRenderer: GL vendor: Mesa/X.org
[2022-06-16 17:23:46.120885] <information> GLRenderer: GL renderer: llvmpipe (LLVM 12.0.0, 256 bits)
[2022-06-16 17:23:46.120893] <information> GLRenderer: GL version: OpenGL ES 3.2 Mesa 21.0.3
[2022-06-16 17:23:46.120901] <information> GLRenderer: GLSL version: OpenGL ES GLSL ES 3.20
[2022-06-16 17:23:46.121005] <information> GLRenderer: GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_draw_instanced GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_OES_viewport_array GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_robustness GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_ANDROID_extension_pack_es31a GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_cube_map_array GL_EXT_texture_norm16 GL_EXT_texture_view GL_KHR_blend_equation_advanced GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5 GL_OES_primitive_bounding_box GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_EXT_blend_func_extended GL_EXT_buffer_storage GL_EXT_float_blend GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_shader_image_atomic GL_EXT_clip_cull_distance GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_MESA_shader_integer_functions GL_EXT_clip_control GL_EXT_color_buffer_half_float GL_EXT_texture_compression_bptc GL_KHR_parallel_shader_compile GL_EXT_EGL_image_storage GL_EXT_shader_framebuffer_fetch_non_coherent GL_EXT_texture_shadow_lod GL_MESA_framebuffer_flip_y GL_EXT_depth_clamp GL_EXT_texture_query_lod 
[2022-06-16 17:23:46.121041] <information> GLRenderer: GL max texture size = 16384
[2022-06-16 17:23:46.121611] <information> GLRenderer: GL framebuffer bits: RGBA=0000, depth=0, stencil=0
[2022-06-16 17:23:46.121804] < -warning- > x11-buffer-allocator: Failed to bind EGL Display to Wayland display, falling back to software buffers: /build/mir-IUtbfV/mir-2.8.0+dev263-g3155355bc2/src/platform/graphics/egl_extensions.cpp(86): Throw in function mir::graphics::EGLExtensions::WaylandExtensions::WaylandExtensions(EGLDisplay)
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: EGL display doesn't support EGL_WL_bind_wayland_display

[2022-06-16 17:23:46.121841] <information> x11-buffer-allocator: No EGL_EXT_image_dma_buf_import_modifiers support, disabling linux-dmabuf import
unable to lock lockfile /run/user/1000/wayland-0.lock, maybe another compositor is running
[2022-06-16 17:23:46.123712] <information> mirserver: Selected input driver: mir:x11-input (version: 2.8.0)
[2022-06-16 17:23:46.123811] <information> mirserver: Mir version 2.8.0
[2022-06-16 17:23:46.126058] <information> GLRenderer: EGL vendor: Mesa Project
[2022-06-16 17:23:46.126138] <information> GLRenderer: EGL version: 1.5
[2022-06-16 17:23:46.126158] <information> GLRenderer: EGL client APIs: OpenGL OpenGL_ES 
[2022-06-16 17:23:46.126166] <information> GLRenderer: EGL extensions: EGL_EXT_create_context_robustness EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_context_flush_control EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_query_driver 
[2022-06-16 17:23:46.126173] <information> GLRenderer: GL vendor: Mesa/X.org
[2022-06-16 17:23:46.126178] <information> GLRenderer: GL renderer: llvmpipe (LLVM 12.0.0, 256 bits)
[2022-06-16 17:23:46.126182] <information> GLRenderer: GL version: OpenGL ES 3.2 Mesa 21.0.3
[2022-06-16 17:23:46.126186] <information> GLRenderer: GLSL version: OpenGL ES GLSL ES 3.20
[2022-06-16 17:23:46.126241] <information> GLRenderer: GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_draw_instanced GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_OES_viewport_array GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_robustness GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_ANDROID_extension_pack_es31a GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_cube_map_array GL_EXT_texture_norm16 GL_EXT_texture_view GL_KHR_blend_equation_advanced GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5 GL_OES_primitive_bounding_box GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_EXT_blend_func_extended GL_EXT_buffer_storage GL_EXT_float_blend GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_shader_image_atomic GL_EXT_clip_cull_distance GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_MESA_shader_integer_functions GL_EXT_clip_control GL_EXT_color_buffer_half_float GL_EXT_texture_compression_bptc GL_KHR_parallel_shader_compile GL_EXT_EGL_image_storage GL_EXT_shader_framebuffer_fetch_non_coherent GL_EXT_texture_shadow_lod GL_MESA_framebuffer_flip_y GL_EXT_depth_clamp GL_EXT_texture_query_lod 
[2022-06-16 17:23:46.126258] <information> GLRenderer: GL max texture size = 16384
[2022-06-16 17:23:46.126692] <information> GLRenderer: GL framebuffer bits: RGBA=8888, depth=0, stencil=0
[2022-06-16 17:23:46.129934] <information> mirserver: Initial display configuration:
[2022-06-16 17:23:46.129979] <information> mirserver: * Output 1: unknown connected, used
[2022-06-16 17:23:46.129994] <information> mirserver: . |_ Physical size 17.1" 338x271mm
[2022-06-16 17:23:46.130001] <information> mirserver: . |_ Power is on
[2022-06-16 17:23:46.130009] <information> mirserver: . |_ Current mode 1280x1024 60.00Hz
[2022-06-16 17:23:46.130017] <information> mirserver: . |_ Preferred mode 1280x1024 60.00Hz
[2022-06-16 17:23:46.130025] <information> mirserver: . |_ Orientation normal
[2022-06-16 17:23:46.130034] <information> mirserver: . |_ Logical size 1280x1024
[2022-06-16 17:23:46.130041] <information> mirserver: . |_ Logical position +0+0
[2022-06-16 17:23:46.130048] <information> mirserver: . |_ Scaling factor: 1.00
Gtk-Message: 17:23:48.217: Failed to load module "xapp-gtk3-module"
[266545:266545:0616/172348.540359:ERROR:gl_surface_egl.cc(852)] EGL Driver message (Error) eglGetPlatformDisplay: EGL_BAD_PARAMETER error: In internal function: Additional INFO may be available

[266545:266545:0616/172348.569416:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is 
[266545:266545:0616/172348.573452:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization

(chrome:266412): dbind-WARNING **: 17:23:48.592: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-n48dGRLgE4: No such file or directory
file descriptor expected, object (13), message create_pool(nhi)
error in client communication (pid 266412)
[266412:266412:0616/172348.613114:ERROR:wayland_event_watcher.cc(36)] libwayland: wl_display@1: error 1: invalid arguments for wl_shm@13.create_pool

[266600:266600:0100/000000.618615:ERROR:gl_surface_egl.cc(852)] EGL Driver message (Error) eglGetPlatformDisplay: EGL_BAD_PARAMETER error: In internal function: Additional INFO may be available

Trace/Breakpoint ausgelöst (Speicherabzug geschrieben)
frank@frank-MS-7821:~/nextcloud$ [266600:266600:0100/000000.865397:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is 
ubuntu-frame& sleep 2; chromium --enable-features=UseOzonePlatform --ozone-platform=wayland

@jdbelo

This comment was marked as off-topic.

@AlanGriffiths

This comment was marked as off-topic.

@jdbelo

This comment was marked as off-topic.

@jdbelo
Copy link
Author

jdbelo commented Jun 30, 2022

Some things weren't obvious to me from the discussion:

  • Have you tested the exact same Electron snap on both Ubuntu 20.04 + Gnome with Wayland and Ubuntu Core + Ubuntu Frame? Or just Chromium on 20.04?
  • On Core, are you running the Electron app natively on Wayland or on X11 via the XWayland compatibility layer?

Unless you are running the Electron app with --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime, it's probably using XWayland. I would expect going through XWayland might not work as well as running natively on Wayland. If you want to make sure it's running on Wayland set an invalid X11 DISPLAY environment variable value (for example DISPLAY=no your_app). If that makes it not work you were probably running on XWayland before.

Another thing to try is running the Electron snap on Ubuntu Frame on Ubuntu 20.04. I suspect this will have the same behavior as Core, but would be good to check.

Just to check if I understand corretly, when I run the electron app on Ubuntu Core, these flags (somehow) enable electron to use Wayland (--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime). Otherwise, the electron app uses XWayland, right?

How do I check if it's running Wayland or XWayland? With or without flags the environment variable DISPLAY remains empty.

@AlanGriffiths
Copy link
Contributor

Just to check if I understand corretly, when I run the electron app on Ubuntu Core, these flags (somehow) enable electron to use Wayland (--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime). Otherwise, the electron app uses XWayland, right?

How do I check if it's running Wayland or XWayland? With or without flags the environment variable DISPLAY remains empty.

Not quite.

On Linux there are two protocols Electron (or other apps) can use to connect to the compositor: X11 and Wayland. X11 is an old protocol dating back to 1980 and Wayland is the more recent replacement and addresses a range of issues (like security) that have become important over the decades.

Electron's "Ozone" platform supports both X11 and Wayland, but currently defaults to X11. Hence the need for the above switches.

Xwayland is a separate program that acts as an interpreter between applications X11 and compositors using Wayland. Historically (i.e. before Ozone supported Wayland) it was used when snapping Electron apps, but it is no longer needed. You've not shared your snapcraft.yaml recipe, so we don't know which approach you have taken.

The "modern" approach is described here:

https://mir-server.io/docs/packaging-an-electron-application-as-an-iot-gui

@frank-dspeed
Copy link

frank-dspeed commented Jun 30, 2022

The current switch for the autodetection

--ozone-platform-hint=auto
  • default is x11
  • auto selects Wayland if possible, X11 otherwise.
  • x11
  • wayland

Note

without this switch it uses default only with that switch it starts autodetection once autodetection got reported to work correct by google via incremental rollout to testers it will get a default flag.

@jdbelo
Copy link
Author

jdbelo commented Jun 30, 2022

Thanks

So, as I'm using these flags --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime I'm forcing Ozone to use Wayland? Is there any way to confirm this is happening (on Ubuntu Core)?

"My" custom electron snap is available here. The only change I've done was including the flags you have suggested in the wrapper.sh file.

This is my wrapper.sh file



#! /bin/sh

export SNAP_URL="$(snapctl get url)"

exec $SNAP/electron-helloworld/electron-quick-start --no-sandbox --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime

@AlanGriffiths
Copy link
Contributor

AlanGriffiths commented Jun 30, 2022

"My" custom electron snap is available here. The only change I've done was including the flags you have suggested in the wrapper.sh file

That is the "old way" using X11, it includes:

...
    command: usr/local/bin/x11_kiosk_launch $SNAP/snap/command-chain/desktop-launch $SNAP/usr/bin/wrapper
...
    stage-snaps:
      - mir-kiosk-x11

Where the mir-kiosk-x11 snap supplies x11_kiosk_launch and Xwayland. Please follow a more recent example.

@jdbelo
Copy link
Author

jdbelo commented Jun 30, 2022

I've been playing around with the Electron-quick-start branch of the iot-example-graphical-snap and I realized that there is no way to change de default URL. Although the env variable SNAP_URL is set, the main.js of electron-quick-start doesn't use it and loads a local index.html file.

I was able to change the url using the snap set comand making some local changes to the main.js file and replacing the original one on override-build step.

However, the multitouch behavior remains the same. The zoom-in gesture isn't still working.

@AlanGriffiths
Copy link
Contributor

AlanGriffiths commented Jun 30, 2022

However, the multitouch behavior remains the same. The zoom-in gesture isn't still working.

That is puzzling, but this problem is not seen with other applications or toolkits. And I specifically checked with Chromium (on Classic, not Core but there should be no significant differences in the input stack).

If I have time later, I will try to reproduce with your changes to the Electron snap

@frank-dspeed
Copy link

@AlanGriffiths just pinging you to know if you got the time to test that if there is anything we can do upstream simply ping me running on snapd (ubuntu core) is a big thing for me as i Plan to ship Terminals and Workstations to endcustomers with that.

@AlanGriffiths AlanGriffiths removed the Needs Info Waiting on further information before the bug can be resolved label Jul 1, 2022
@AlanGriffiths
Copy link
Contributor

i Plan to ship Terminals and Workstations to endcustomers with that.

@frank-dspeed Canonical doesn't have any customers with this problem. So, while I want it solved, I have other priorities...

My next questions are:

  1. can the problem be reproduced by someone else/on other hardware?
  2. does the sample app supports "pinch/zoom" on other Wayland compositors?

If you can help with either/both of these that would help.

@frank-dspeed
Copy link

@jdbelo can you please verify if that works with ubuntu-frame it is the successor of mir-kiosk i do not run into that issue with ubuntu-frame

@AlanGriffiths
Copy link
Contributor

i do not run into that issue with ubuntu-frame

You've built the app as described above? Or tested one of your own?

please verify if that works with ubuntu-frame

The problem won't be the differences between mir-kiosk and ubuntu-frame - they are built on exactly the same Mir libraries.

It is likely to be differences in what you are testing: either the way you're building the test app, or the hardware

@jdbelo
Copy link
Author

jdbelo commented Jul 1, 2022

@AlanGriffiths I've also realized that the flags which are being used in the Electron branch of the iot-example-graphical-snap are not exactly the same that were suggested here.

Flags used on the iot-example-graphical-snap:
--enable-features=UseOzonePlatform --ozone-platform=wayland --disable-dev-shm-usage --no-sandbox

Flags suggested here:
--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime

Regarding the two questions above, I can add that I've already used two different multitouch screens and the behavior was exactly the same.

@frank-dspeed
Copy link

frank-dspeed commented Jul 1, 2022

@jdbelo

The current switch for the autodetection

--ozone-platform-hint=auto
  • default is x11
  • auto selects Wayland if possible, X11 otherwise.
  • x11
  • wayland

Note

without this switch it uses default only with that switch it starts autodetection once autodetection got reported to work correct by google via incremental rollout to testers it will get a default flag.

please try it with only the hint set to auto. the other settings for ozone can be ignored and for wayland also and use a current chromium snap

@AlanGriffiths
Copy link
Contributor

use a current chromium snap

There is no problem with chromium, just with this Electron app

@AlanGriffiths
Copy link
Contributor

Flags used on the iot-example-graphical-snap: --enable-features=UseOzonePlatform --ozone-platform=wayland --disable-dev-shm-usage --no-sandbox

Flags suggested here: --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --enable-wayland-ime

Those differences shouldn't be a problem, but the snap should be using --enable-wayland-ime (that is input method support - onscreen keyboard and the like. Will fix the example)

@frank-dspeed
Copy link

electron === old chromium build so everything that does not work there should also not work in chromium and vice versa

@AlanGriffiths
Copy link
Contributor

We agree it works in current Chromium. But Electron != current chromium

Chromium support for Wayland has been improving rapidly: This might be something that got fixed.

@jdbelo
Copy link
Author

jdbelo commented Jul 1, 2022

Is there any alternative solution to electron on Ubuntu Core? I mean, I need a browser to load the URL but it mustn’t be exactly electron.

@AlanGriffiths
Copy link
Contributor

I need a browser to load the URL

@jdbelo
Copy link
Author

jdbelo commented Jul 1, 2022

WPE Webkit for Mir Kiosk does not solve this situation (I've already tested it). The custom electron snap works better and offers us more control in terms of what is being installed.

Do you have any idea about what should be my next step to make pitch/zoom-in work?

@AlanGriffiths
Copy link
Contributor

Do you have any idea about what should be my next step to make pitch/zoom-in work?

Not as such, but I can add something to this discussion:

I built the iot-example-graphical-snap example snap and tried running on a Wayland desktop (egmde) with a touchscreen...

I found that the pinch gestures are being interpreted as "resize" and cause the window to be resized (which would not be effective on Ubuntu Frame as the window is fullscreen). That's a choice the application makes (I don't know if that is in Electron code or in the "electron-quick-start" example).

Maybe this means something to you.

In any case, I think it is now clear that Mir is passing these events through correctly. So I'm closing the issue.

@jdbelo
Copy link
Author

jdbelo commented Jul 1, 2022

Many Thanks.
How did you find the pinch gesture is being interpreted as windows resize?

@AlanGriffiths
Copy link
Contributor

How did you find the pinch gesture is being interpreted as windows resize?

I saw the window resize

@frank-dspeed
Copy link

next step is to open that in electron as alan pointed out it will be something with the custom window handling code of them as this is also not chromium behavior

@jdbelo
Copy link
Author

jdbelo commented Jul 4, 2022

@AlanGriffiths could you please repeat the test you performed pointing electron to the google maps URL? Is the window still being resized?

I've just performed this test (using Ubuntu Core) and the zoom-in gesture worked perfectly.

Note: I had to make a little change to your repo. I removed WaylandWindowDecorations from --enable-features in order to make the multitouch work (I don't exactly know why just trial and error). Otherwise, it doesn't work at all (neither basic gestures such as tap, double-tap, scroll ...).

@jdbelo
Copy link
Author

jdbelo commented Jul 4, 2022

I've also realized there are some error messages in the iot-example-graphical-snap log when it is started. May they be the cause of any problem?


2022-07-04T11:18:53Z iot-example-graphical-snap.iot-example-graphical-snap[18618]: [18618:0704/111853.574821:ERROR:udev_watcher.cc(52)] Failed to initialize a udev monitor.
2022-07-04T11:18:53Z iot-example-graphical-snap.iot-example-graphical-snap[18699]: [18699:0704/111853.618405:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is
2022-07-04T11:18:53Z iot-example-graphical-snap.iot-example-graphical-snap[18699]: WARNING: Kernel has no file descriptor comparison support: Operation not permitted
2022-07-04T11:18:54Z systemd[1]: Stopping Service for snap application iot-example-graphical-snap.iot-example-graphical-snap...
2022-07-04T11:18:54Z systemd[1]: snap.iot-example-graphical-snap.iot-example-graphical-snap.service: Succeeded.
2022-07-04T11:18:54Z systemd[1]: Stopped Service for snap application iot-example-graphical-snap.iot-example-graphical-snap.
2022-07-04T11:18:54Z systemd[1]: Started Service for snap application iot-example-graphical-snap.iot-example-graphical-snap.
2022-07-04T11:18:55Z iot-example-graphical-snap.iot-example-graphical-snap[18775]: [18775:0704/111855.391396:ERROR:udev_watcher.cc(52)] Failed to initialize a udev monitor.
2022-07-04T11:18:55Z iot-example-graphical-snap.iot-example-graphical-snap[18810]: [18810:0704/111855.453508:ERROR:gpu_init.cc(481)] Passthrough is not supported, GL is egl, ANGLE is
2022-07-04T11:18:55Z iot-example-graphical-snap.iot-example-graphical-snap[18810]: WARNING: Kernel has no file descriptor comparison support: Operation not permitted

@AlanGriffiths
Copy link
Contributor

@jdbelo this closed bug report against Mir about touch gestures not working for Electron is not the place to be asking about packaging Electron as a snap.

@jdbelo
Copy link
Author

jdbelo commented Jul 4, 2022

Thanks. I continue to make tests because in I'm still not sure this is only an electron issue. Are you sure this is only an electron issue? If you point electron to google maps you will see that there are no problems and all gestures work perfectly.

This looks weird to me. I wouldn't expect different behaviors depending on the loaded URL, but I might not have the whole picture of the issue.

@AlanGriffiths
Copy link
Contributor

Are you sure this is only an electron issue?

I am sure it is not a Mir issue: changing the URL used by the Electron app won't affect what Mir is doing

@jdbelo
Copy link
Author

jdbelo commented Jul 4, 2022

Ok. Thanks for your support. My last question here is: where is the best place to request help on packaging electron apps as a snap and to discuss some points regarding electron flags and error messages (☝️)?

@AlanGriffiths
Copy link
Contributor

where is the best place to request help on packaging electron apps as a snap

For things specific to the IoT example:

https://github.com/MirServer/iot-example-graphical-snap/issues

and, for more general questions

https://forum.snapcraft.io/c/snapcraft/13

and to discuss some points regarding electron flags and error messages

Does Electron have some support forums?

@jdbelo
Copy link
Author

jdbelo commented Jul 4, 2022

Does Electron have some support forums?

Yes, they do

https://github.com/electron/electron

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

5 participants
@frank-dspeed @AlanGriffiths @wmww @jdbelo and others