ardera / flutter-pi

A light-weight Flutter Engine Embedder for Raspberry Pi that runs without X.
MIT License
1.48k stars 153 forks source link

No mouse cursor on Ubuntu #395

Closed TeunVR closed 3 weeks ago

TeunVR commented 2 months ago

No mouse-cursor is rendered on different versions of Ubuntu. The mouse can be used to control the application, only rendering fails.

I tried with 20.04, 22.04 and 23.04 and on a Parallels Ubuntu VM on macOS (Apple Silicon) and on an Odroid M1S board. On all these systems i get the error as shown below. The mouse cursor works fine on Raspberry Pi CM4 with Raspbian Bookworm (kernel 6.1.0-rpi7-rpi-v8).

The log is made on Ubuntu 23.04 in a Parallels VM on macOS. The drmModeAddFB2WithModifiers fails with 'Invalid argument'. I added some debug logging to log the arguments that are used.

On these systems the following format and modifiers are logged: egl_gbm_render_surface.c: using fourcc AR24 (ARGB 8:8:8:8) with modifier 0xffffffffffffff On Raspberry pi the following format and modifiers are logged: egl_gbm_render_surface.c: using fourcc AR24 (ARGB 8:8:8:8) with modifier 0x0

Launching lib/main.dart on Ubuntu Parallels Teun in debug mode...
flutter-pi: no process found
filesystem_layout.c: icudtl file not found at /tmp/zoney/data/flutter_assets/icudtl.dat.
filesystem_layout.c: icudtl file not found at /usr/share/flutter/icudtl.dat.
[locales] Warning: The system has no configured locale. The default "C" locale may or may not be supported by the app.
==============Locale==============
Flutter locale:
  default: C
  locales: C C.UTF-8 C.UTF-8 C.UTF-8 C.UTF-8
===================================
===================================
EGL information:
  version: 1.4
  vendor: Mesa Project
  client extensions: EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm EGL_MESA_platform_surfaceless
  display extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers 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 EGL_KHR_image_base EGL_KHR_image_pixmap 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_image_dma_buf_export EGL_MESA_query_driver EGL_WL_bind_wayland_display
===================================
===================================
OpenGL ES information:
  version: "OpenGL ES 3.0 Mesa 23.2.1-1ubuntu3.1"
  shading language version: "OpenGL ES GLSL ES 3.00"
  vendor: "Mesa"
  renderer: "virgl (Apple M1 Pro (Compat))"
  extensions: "GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic 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_NV_pack_subimage GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean 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_instanced_arrays GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_NV_generate_mipmap_sRGB 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_debug_label GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_integer_mix GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp GL_KHR_context_flush_control GL_NV_shader_noperspective_interpolation GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_multisample_interpolation GL_OES_texture_border_clamp GL_EXT_blend_func_extended GL_EXT_float_blend GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_OES_EGL_image_external_essl3 GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_MESA_shader_integer_functions GL_EXT_color_buffer_half_float GL_EXT_texture_compression_bptc GL_KHR_parallel_shader_compile GL_EXT_EGL_image_storage GL_MESA_framebuffer_flip_y GL_EXT_depth_clamp GL_EXT_texture_query_lod GL_MESA_bgra "
===================================
window.c: Didn't find a videomode matching "480x480"! Falling back to display preferred mode.
window.c: WARNING: display didn't provide valid physical dimensions. The device-pixel ratio will default to 1.0, which may not be the fitting device-pixel ratio for your display.
Use the `-d` commandline parameter to specify the physical dimensions of your display.
display mode:
  resolution: 1352 x 768
  refresh rate: 59.949790Hz
  physical size: 0mm x 0mm
  flutter device pixel ratio: 1.000000
  pixel format: (any)
pluginregistry.c: Initialized plugins: services, text input, raw keyboard plugin,
window.c: Flutter requested render surface before supplying surface dimensions.
gl_renderer.c: Choosing EGL config with pixel format ARGB 8:8:8:8...
egl_gbm_render_surface.c: using fourcc AR24 (ARGB 8:8:8:8) with modifier 0xffffffffffffff
Connecting to VM Service at ws://127.0.0.1:49292/QbZ0qeu22u0=/ws
user_input.c: on_key_event
user_input.c: keyboard state ctrl active: no, alt active: no, keysym: 0xff7f
user_input.c: on_key_event
user_input.c: keyboard state ctrl active: no, alt active: no, keysym: 0x0000
user_input.c: on_key_event
user_input.c: keyboard state ctrl active: no, alt active: no, keysym: 0xff7f
user_input.c: on_key_event
user_input.c: keyboard state ctrl active: no, alt active: no, keysym: 0x0000

════════ Exception caught by services library ══════════════════════════════════
The following assertion was thrown during a platform message callback:
A KeyDownEvent is dispatched, but the state shows that the physical key is already pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyDownEvent#6fcb8(physicalKey: PhysicalKeyboardKey#5b142(usbHidUsage: "0x00070053", debugName: "Num Lock"), logicalKey: LogicalKeyboardKey#f3b7b(keyId: "0x10000010a", keyLabel: "Num Lock", debugName: "Num Lock"), character: null, timeStamp: 0:12:26.647991, synthesized)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 505 pos 16: '!_pressedKeys.containsKey(event.physicalKey)'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

When the exception was thrown, this was the stack:
#2      HardwareKeyboard._assertEventIsRegular.<anonymous closure> (package:flutter/src/services/hardware_keyboard.dart:505:16)
#3      HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:520:6)
#4      HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:643:5)
#5      KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:1167:37)
#6      BasicMessageChannel.setMessageHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:235:49)
#7      _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:603:35)
#8      _invoke2 (dart:ui/hooks.dart:344:13)
#9      _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
#10     _Channel.push (dart:ui/channel_buffers.dart:135:31)
#11     ChannelBuffers.push (dart:ui/channel_buffers.dart:343:17)
#12     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:737:22)
#13     _dispatchPlatformMessage (dart:ui/hooks.dart:257:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by services library ══════════════════════════════════
A KeyDownEvent is dispatched, but the state shows that the physical key is already pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyDownEvent#6fcb8(physicalKey: PhysicalKeyboardKey#5b142(usbHidUsage: "0x00070053", debugName: "Num Lock"), logicalKey: LogicalKeyboardKey#f3b7b(keyId: "0x10000010a", keyLabel: "Num Lock", debugName: "Num Lock"), character: null, timeStamp: 0:12:26.647991, synthesized)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 505 pos 16: '!_pressedKeys.containsKey(event.physicalKey)'
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by services library ══════════════════════════════════
A KeyDownEvent is dispatched, but the state shows that the physical key is already pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in `HardwareKeyboard`. This was the event: KeyDownEvent#6fcb8(physicalKey: PhysicalKeyboardKey#5b142(usbHidUsage: "0x00070053", debugName: "Num Lock"), logicalKey: LogicalKeyboardKey#f3b7b(keyId: "0x10000010a", keyLabel: "Num Lock", debugName: "Num Lock"), character: null, timeStamp: 0:12:26.647991, synthesized)
'package:flutter/src/services/hardware_keyboard.dart':
Failed assertion: line 505 pos 16: '!_pressedKeys.containsKey(event.physicalKey)'
════════════════════════════════════════════════════════════════════════════════
window.c: kms_window_set_cursor_locked create new cursor buffer
window.c: cursor_buffer_new
window.c: call drmdev_add_fb
modesetting.c: call drmModeAddFB2WithModifiers: w=22 h=28 drmPixelFmt=875713089 bo=13/0/0/0 pitches=88/0/0/0 off=0/0/0/0 mod=0/0/0/0 flags=2
modesetting.c: Couldn't add buffer as DRM fb. drmModeAddFB2WithModifiers: Invalid argument
window.c: no fb_id
window.c: kms_window_set_cursor_locked no cursor
TeunVR commented 3 weeks ago

Using custom mouse-cursor painter in Flutter for now. Good enough for testing.