Devices hotplug inside Weston container

Dear all,
I’m using weston application container image and I recently noticed that it has problem with usb hotplug.
At the startup of the container, I can see initialization logs for input devices e.g.:

[13:35:12.540] weston 9.0.0
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 9.0.0
[13:35:12.541] Command line: /usr/bin/weston
[13:35:12.541] OS: Linux, 5.4.193-5.7.0+git.f78299297185, #1-TorizonCore SMP PREEMPT Mon Jul 11 14:42:03 UTC 2022, aarch64
[13:35:12.543] Using config file '/etc/xdg/weston//weston.ini'
[13:35:12.548] Output repaint window is 999 ms maximum.
[13:35:12.552] Loading module '/usr/lib/aarch64-linux-gnu/libweston-9/drm-backend.so'
[13:35:12.594] initializing drm backend
[13:35:12.600] logind: not running in a systemd session
[13:35:12.600] logind: cannot setup systemd-logind helper (-61), using legacy fallback
[13:35:12.607] using /dev/dri/card0
[13:35:12.608] DRM: supports atomic modesetting
[13:35:12.608] DRM: supports GBM modifiers
[13:35:12.608] DRM: supports picture aspect ratio
[13:35:12.609] Loading module '/usr/lib/aarch64-linux-gnu/libweston-9/gl-renderer.so'
[13:35:12.678] EGL client extensions: EGL_EXT_client_extensions
               EGL_EXT_platform_base EGL_KHR_platform_wayland
               EGL_EXT_platform_wayland EGL_KHR_platform_gbm
[13:35:12.685] EGL version: 1.5
[13:35:12.686] EGL vendor: Vivante Corporation
[13:35:12.686] EGL client APIs: OpenGL_ES OpenVG
[13:35:12.686] EGL extensions: EGL_KHR_fence_sync EGL_KHR_reusable_sync
               EGL_KHR_wait_sync EGL_KHR_image EGL_KHR_image_base
               EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image
               EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image
               EGL_EXT_image_dma_buf_import
               EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_lock_surface
               EGL_KHR_create_context EGL_KHR_no_config_context
               EGL_KHR_surfaceless_context EGL_KHR_get_all_proc_addresses
               EGL_EXT_buffer_age EGL_ANDROID_native_fence_sync
               EGL_WL_bind_wayland_display
               EGL_WL_create_wayland_buffer_from_image EGL_KHR_partial_update
               EGL_EXT_swap_buffers_with_damage
               EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float
[13:35:12.688] EGL_KHR_surfaceless_context available
[13:35:12.737] GL version: OpenGL ES 3.2 V6.4.3.p1.305572
[13:35:12.737] GLSL version: OpenGL ES GLSL ES 3.20
[13:35:12.737] GL vendor: Vivante Corporation
[13:35:12.737] GL renderer: Vivante GC7000XSVX
[13:35:12.737] GL extensions: GL_OES_vertex_type_10_10_10_2
               GL_OES_vertex_half_float GL_OES_element_index_uint
               GL_OES_mapbuffer GL_OES_vertex_array_object
               GL_OES_compressed_ETC1_RGB8_texture
               GL_OES_compressed_paletted_texture GL_OES_texture_npot
               GL_OES_rgb8_rgba8 GL_OES_depth_texture
               GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_depth32
               GL_OES_packed_depth_stencil GL_OES_fbo_render_mipmap
               GL_OES_get_program_binary GL_OES_fragment_precision_high
               GL_OES_standard_derivatives GL_OES_EGL_image
               GL_OES_EGL_image_external GL_OES_EGL_image_external_essl3
               GL_OES_EGL_sync GL_OES_texture_stencil8
               GL_OES_shader_image_atomic GL_OES_sample_variables
               GL_OES_sample_shading
               GL_OES_texture_storage_multisample_2d_array
               GL_OES_shader_multisample_interpolation
               GL_OES_required_internalformat GL_OES_surfaceless_context
               GL_OES_copy_image GL_OES_draw_buffers_indexed
               GL_OES_geometry_shader GL_OES_geometry_point_size
               GL_OES_gpu_shader5 GL_OES_shader_io_blocks
               GL_OES_texture_border_clamp GL_OES_texture_buffer
               GL_OES_tessellation_shader GL_OES_tessellation_point_size
               GL_OES_texture_cube_map_array GL_OES_draw_elements_base_vertex
               GL_OES_texture_half_float GL_OES_texture_float
               GL_OES_primitive_bounding_box
               GL_KHR_texture_compression_astc_ldr
               GL_KHR_blend_equation_advanced GL_KHR_debug GL_KHR_robustness
               GL_EXT_texture_type_2_10_10_10_REV
               GL_EXT_texture_filter_anisotropic
               GL_EXT_texture_compression_dxt1 GL_EXT_texture_format_BGRA8888
               GL_EXT_texture_compression_s3tc GL_EXT_read_format_bgra
               GL_EXT_multi_draw_arrays GL_EXT_frag_depth
               GL_EXT_discard_framebuffer GL_EXT_blend_minmax
               GL_EXT_multisampled_render_to_texture
               GL_EXT_color_buffer_half_float GL_EXT_color_buffer_float
               GL_EXT_robustness GL_EXT_texture_sRGB_decode
               GL_EXT_draw_buffers_indexed GL_EXT_texture_border_clamp
               GL_EXT_texture_buffer GL_EXT_tessellation_shader
               GL_EXT_tessellation_point_size GL_EXT_geometry_shader
               GL_EXT_geometry_point_size GL_EXT_copy_image
               GL_EXT_texture_cube_map_array GL_EXT_gpu_shader5
               GL_EXT_shader_io_blocks GL_EXT_shader_implicit_conversions
               GL_EXT_multi_draw_indirect GL_EXT_draw_elements_base_vertex
               GL_EXT_texture_rg GL_EXT_primitive_bounding_box GL_EXT_sRGB
               GL_ANDROID_extension_pack_es31a GL_VIV_direct_texture
[13:35:12.738] GL ES 2 renderer features:
               read-back format: BGRA
               wl_shm sub-image to texture: yes
               EGL Wayland extension: yes
[13:35:12.893] event2  - eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204: is tagged by udev as: Touchscreen
[13:35:12.893] event2  - eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204: device is a touch device
[13:35:12.894] event2  - eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204: applying calibration: 0.967213 0.000801 0.015837 0.007515 0.982051 0.008767
[13:35:12.899] event3  - eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204 Mouse: not tagged as supported input device
[13:35:12.899] event3  - not using input device '/dev/input/event3'
[13:35:12.901] event1  - gpio-keys: is tagged by udev as: Keyboard
[13:35:12.901] event1  - gpio-keys: device is a keyboard
[13:35:12.903] event0  - sc-powerkey: is tagged by udev as: Keyboard
[13:35:12.903] event0  - sc-powerkey: device is a keyboard
[13:35:12.903] Touchscreen - eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204 - /sys/devices/platform/bus@5b000000/5b0e0000.usb/ci_hdrc.1/usb3/3-1/3-1.1/3-1.1.3/3-1.1.3:1.0/0003:0EEF:C002.0001/input/input5/event2
[13:35:12.903] libinput: configuring device "eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204".

After that everything works fine. Same for other devices like mouse etc.

But problem occurs when container is already running and then I want to plug in device.
In dmesg it seems ok:

[  229.295137] usb 3-1.1.3: USB disconnect, device number 4
[  232.897628] usb 3-1.1.3: new full-speed USB device number 5 using ci_hdrc
[  233.059769] input: eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204 as /devices/platform/bus@5b000000/5b0e0000.usb/ci_hdrc.1/usb3/3-1/3-1.1/3-1.1.3/3-1.1.3:1.0/0003:0EEF:C002.0002/input/input8
[  233.060302] input: eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204 Mouse as /devices/platform/bus@5b000000/5b0e0000.usb/ci_hdrc.1/usb3/3-1/3-1.1/3-1.1.3/3-1.1.3:1.0/0003:0EEF:C002.0002/input/input10
[  233.060975] hid-multitouch 0003:0EEF:C002.0002: input,hiddev96,hidraw0: USB HID v1.11 Mouse [eGalax Inc. eGalaxTouch P81X84 0121 vA1_NQZY k4.18.204] on usb-ci_hdrc.1-1.1.3/input0

Also, for example for touch panel I can see it’s working in evtest.
But there is no info in container log, and even though the devices are connected it has no effect on the desktop inside container.

Is there any way to some kind enable hotplugging devices inside weston container without having to restart?

Hello @matay1,

Thanks for reaching out to the Toradex Community!
Could you please share how you have started the weston container? Perhaps you could post the docker run command here and I could check if it works here for me.