On Mon, Jan 16, 2023 at 02:25:25PM +0000, Matti Ristimäki wrote:
> Hi,
Hi,
> 
> 
> 
> Ok, this might be the reason…
> 
> Your Qt app segfaults in the stand-alone RDP Weston instance case. We
> have no idea why that would be, when weston-smoke works. If it is
> because the app requires hardware accelerated OpenGL (or you use a
> proprietary EGL implementation), then it might still
> work with the DRM-backend. This is because the RDP-backend does not
> yet support hardware accelerated OpenGL or Vulkan apps. Normally apps
> will just fall back to Mesa's software renderer, but maybe your app
> needs something extra or maybe you are not using Mesa as your EGL etc.
> 
Right, the proprietary driver can't/won't fallback to a software renderer,
or it doesn't have a pipeline that can do that.

Also, you could probably replicate this without the RDP backend at all,
by just start weston with --use-pixman argument and attempt to start any
client that wants to perform 3D/hardware acceleration and would
probably die out the same.
> 
> 
> ------------------------------------------------------------------------------------
> 
> Testing weston-simple-egl with RDP and HDMI-display
> 
> ------------------------------------------------------------------------------------
> 
> 
> 
> "Force driving" weston-simple-egl to RDP-weston session: 
> (WAYLAND_DISPLAY=wayland-1)
> 
> 
> 
> Command:
> 
> 
> 
> WAYLAND_DISPLAY=wayland-1 weston-simple-egl
> 
> has EGL_EXT_buffer_age and EGL_EXT_swap_buffers_with_damage
> 
> Segmentation fault
> 
> 
> 
> Logging:
> 
> 
> 
> root@sm2s-imx8mp:~# journalctl -f
> 
> -- Journal begins at Mon 2023-01-16 09:50:23 CET. --
> 
> Jan 16 11:47:32 sm2s-imx8mp audit[1569]: ANOM_ABEND auid=0 uid=0 gid=0 ses=5 
> pid=1569 comm="weston-simple-e" exe="/usr/bin/weston-simple-egl" sig=11 res=1
> 
> Jan 16 11:47:32 sm2s-imx8mp kernel: audit: type=1701 
> audit(1673866052.888:25): auid=0 uid=0 gid=0 ses=5 pid=1569 
> comm="weston-simple-e" exe="/usr/bin/weston-simple-egl" sig=11 res=1
> 
> 
> 
> Result:
> 
> 
> 
> Doesn't work.
> 
> 
> 
> 
> 
> And similar error appears, when I’m trying to drive “Qt” application on 
> RDP-weston:
> 
> 
> 
> Jan 16 13:51:55 sm2s-imx8mp audit[2027]: ANOM_ABEND auid=0 uid=0 gid=0 ses=5 
> pid=2027 comm="QSGRenderThread" exe="/opt/cpx/cpx" sig=11 res=1
> 
> Jan 16 13:51:55 sm2s-imx8mp kernel: audit: type=1701 
> audit(1673873515.594:33): auid=0 uid=0 gid=0 ses=5 pid=2027 
> comm="QSGRenderThread" exe="/opt/cpx/cpx" sig=11 res=1
> 
> 
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------------
> 
> 
> 
> 
> 
> "Force driving" weston-simple-egl to a HDMI display 
> (WAYLAND_DISPLAY=wayland-0)
> 
> 
> 
> Command:
> 
> 
> 
> WAYLAND_DISPLAY=wayland-0 weston-simple-egl
> 
> 
> 
> Logging:
> 
> 
> 
> root@sm2s-imx8mp:/opt/cpx# WAYLAND_DISPLAY=wayland-0 weston-simple-egl
> 
> has EGL_EXT_buffer_age and EGL_EXT_swap_buffers_with_damage
> 
> 304 frames in 5 seconds: 60.799999 fps
> 
> 302 frames in 5 seconds: 60.400002 fps
> 
> 302 frames in 5 seconds: 60.400002 fps
> 
> 302 frames in 5 seconds: 60.400002 fps
> 
> 302 frames in 5 seconds: 60.400002 fps
> 
> 
> 
> 
> 
> Result:
> 
> 
> 
> Works fine, animation runs smoothly.
> 
> 
> 
> [cid:image001.png@01D929AF.41CA1A80]
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------------
> 
> 
> 
> 
> 
> BR,
> 
> 
> 
> -Matti
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Pekka Paalanen <ppaala...@gmail.com>
> Sent: maanantai 16. tammikuuta 2023 11.40
> To: Matti Ristimäki <matti.ristim...@planmeca.com>
> Cc: Marius Vlad <marius.v...@collabora.com>; 
> wayland-devel@lists.freedesktop.org
> Subject: Re: Wayland/weston, Qt and RDP connection...
> 
> 
> 
> On Sat, 14 Jan 2023 11:58:37 +0200
> 
> Marius Vlad <marius.v...@collabora.com<mailto:marius.v...@collabora.com>> 
> wrote:
> 
> 
> 
> > On Fri, Jan 13, 2023 at 08:07:07PM +0000, Matti Ristimäki wrote:
> 
> > > Hi,
> 
> > Hi,
> 
> > >
> 
> > >
> 
> > >
> 
> > > Thanks for the reply!
> 
> > >
> 
> > >
> 
> > >
> 
> > > Jep, this might be the reason...
> 
> > >
> 
> > > > --modules=systemd-notify.so --modules=screen.share.so
> 
> > >
> 
> > > This might be a long shot but it is screen-share.so (hyphen).
> 
> 
> 
> Hi,
> 
> 
> 
> this typo would stop Weston from starting, and Weston would clearly say in 
> its log why. The Weston log output is always important to look at. If the 
> compositor doesn't start, also applications will fail to start with "Failed 
> to create wl_display" or other such error.
> 
> 
> 
> If you use Weston's --log option, check the file since Weston won't print its 
> log to the standard output. I might recommend to not use --log, and let the 
> systemd service unit forward the stdout and stderr into the journal instead 
> (which it does by default).
> 
> 
> 
> > Jan 13 08:20:06 sm2s-imx8mp cpx.sh[769]: EGL: Warning: No default
> 
> > display support on wayland
> 
> 
> 
> That means that the application is not checking whether connecting to a 
> Wayland compositor worked or not. This is an application bug, but it is just 
> secondary fallout from the primary failure. Quite likely the application will 
> also crash (segfault).
> 
> 
> 
> The reason is that EGL_DEFAULT_DISPLAY is equal to NULL, so I infer that the 
> application code does not verify that the wl_display is not NULL before using 
> it.
> 
> 
> 
> EGL_DEFAULT_DISPLAY cannot work with Wayland by design.
> 
> 
> 
> > > We did try the RDP-weston -session this way too...
> 
> > >
> 
> > > 1.
> 
> > >
> 
> > > Running RDP-weston -session manually via terminal and after that forcing 
> > > weston-smoke to the RDP-weston -session.
> 
> > >
> 
> > >
> 
> > >
> 
> > > First weston rdp-backend command via terminal. Notice, that here the
> 
> > > "--modules=screen-share.so" is written correctly: (And after that
> 
> > > WAYLAND_DISPLAY=wayland-0 is running...)
> 
> > >
> 
> > >
> 
> > >
> 
> > > weston --backend=rdp-backend.so --modules=screen-share.so
> 
> > > --rdp-tls-cert=/data/etc/ssh/tls.crt
> 
> > > --rdp-tls-key=/data/etc/ssh/tls.key
> 
> > Just noticed, you already start weston with the RDP backend *and* with
> 
> > the screen-share module. Is that on purpose?
> 
> 
> 
> I suspect that is not intended. Having both rdp-backend and screen-share in 
> the same Weston instance has no use.
> 
> 
> 
> 
> 
> > The screen-share module starts a weston instance with the RDP backend
> 
> > (assuming you have start-on-startup in the ini file) which you connect
> 
> > to.
> 
> >
> 
> > So for instance, if you have the following in your ini file:
> 
> >
> 
> > [core]
> 
> > modules=screen-share.so
> 
> >
> 
> > [screen-share]
> 
> > command=/path/to/weston --backend=rdp-backend.so
> 
> > --shell=fullscreen-shell.so --no-clients-resize
> 
> > --rdp-tls-key=rdp/tls.key --rdp-tls-cert=rdp/tls.crt --no-config
> 
> > start-on-startup=true
> 
> >
> 
> > Then you run it like:
> 
> >
> 
> > $ /path/to/weston --config /path/to/weston.ini
> 
> >
> 
> > It would automatically start *another* weston instance on the machine
> 
> > to connect to. Weston then chooses up, its own a back-end to use
> 
> > locally (for instance the DRM back-end), but also creates another
> 
> > weston instance with the RDP back-end (which is being done by the 
> > screen-share module).
> 
> 
> 
> This is the right idea.
> 
> 
> 
> One shall never start the "second" Weston if screen sharing is desired, only 
> the screen-share plugin in the "first" Weston can do that.
> 
> 
> 
> > So, when the second RDP instance is started by screen-share.so it
> 
> > won't really do anything as it won't be able to do a socket bind
> 
> > (being an already RDP server instance on that port).
> 
> >
> 
> > Do you have a display/an output on that local device, or is it without
> 
> > any outputs graphic devices?
> 
> >
> 
> > Can you provide a full weston log when this happens?
> 
> 
> 
> That would be interesting.
> 
> 
> 
> Matti, it could be beneficial to build the set-up in steps:
> 
> 
> 
> 1. No screen-share, no Qt app. Just Weston with its local backend (DRM
> 
>    quite likely) and a demo app, e.g. weston-simple-egl (shows a
> 
>    spinning triangle in OpenGL ES 2).
> 
> 
> 
> 2. Add screen-share, but no Qt app. Make sure both local and RDP
> 
>    outputs look good with a demo app.
> 
> 
> 
> 3. Add the Qt app.
> 
> 
> 
> If you stop at the first point where you encounter problems, it is easier to 
> ask and answer.
> 
> 
> 
> You have already shown that a stand-alone (non-screen-sharing) RDP Weston 
> instance works fine with your weston-smoke experiment.
> 
> 
> 
> Your Qt app segfaults in the stand-alone RDP Weston instance case. We have no 
> idea why that would be, when weston-smoke works. If it is because the app 
> requires hardware accelerated OpenGL (or you use a proprietary EGL 
> implementation), then it might still work with the DRM-backend. This is 
> because the RDP-backend does not yet support hardware accelerated OpenGL or 
> Vulkan apps. Normally apps will just fall back to Mesa's software renderer, 
> but maybe your app needs something extra or maybe you are not using Mesa as 
> your EGL etc.
> 
> implementation.
> 
> 
> 
> A full Weston log would answer many questions.
> 
> 
> 
> Proprietary graphics driver stacks tend to be hard to work with, because 
> obviously we cannot fix them, and they often work only in very narrow 
> circumstances. Some vendors even patch Weston, so it would be good to 
> understand if you are using an upstream Weston or something with downstream 
> patches.
> 
> 
> 
> 
> 
> Thanks,
> 
> pq
> 
> This e-mail may contain confidential or privileged information and is 
> intended solely for the person to whom it is addressed. If you have received 
> this e-mail in error, please notify the sender immediately and destroy this 
> e-mail. Any unauthorized copying, disclosure or distribution of the material 
> in this e-mail is strictly forbidden. We will not be liable for direct, 
> indirect, special or consequential damages arising from the alteration of 
> this e-mail, or as a result of any virus being passed on or as of 
> transmission of this e-mail in general.



> [13:25:42.289] caught signal 15
> [13:25:42.314] output for input device event0 removed
> [13:25:42.314] output for input device event1 removed
> [13:25:42.314] output for input device event2 removed
> [13:25:42.314] output for input device event3 removed
> [13:25:42.314] output for input device event4 removed
> [13:25:42.314] output for input device event6 removed
> [13:25:42.315] event0  - 30370000.snvs:snvs-powerkey: device removed
> [13:25:42.315] event1  - Logitech USB Receiver: device removed
> [13:25:42.316] event2  - Logitech USB Receiver Mouse: device removed
> [13:25:42.316] event3  - Logitech USB Receiver Consumer Control: device 
> removed
> [13:25:42.316] event4  - Logitech USB Receiver System Control: device removed
> [13:25:42.316] event6  - Logitech USB-PS/2 Optical Mouse: device removed
> Date: 2023-01-16 CET
> [13:25:42.601] weston 9.0.0
>                https://wayland.freedesktop.org
>                Bug reports to: 
> https://gitlab.freedesktop.org/wayland/weston/issues/
>                Build: 9.0.0
> [13:25:42.601] Command line: /usr/bin/weston --log=/run/user/0/weston.log 
> --modules=systemd-notify.so
> [13:25:42.601] OS: Linux, 5.10.35-lts-5.10.y+g0eccd203234b, #1 SMP PREEMPT 
> Wed Nov 23 08:33:43 UTC 2022, aarch64
> [13:25:42.601] Using config file '/etc/xdg/weston/weston.ini'
> [13:25:42.602] Output repaint window is 16 ms maximum.
> [13:25:42.602] Loading module '/usr/lib/libweston-9/drm-backend.so'
> [13:25:42.606] initializing drm backend
> [13:25:42.611] logind: session control granted
> [13:25:42.617] using /dev/dri/card1
> [13:25:42.617] DRM: supports atomic modesetting
> [13:25:42.617] DRM: does not support GBM modifiers
> [13:25:42.617] DRM: supports picture aspect ratio
> [13:25:42.617] Loading module '/usr/lib/libweston-9/gl-renderer.so'
> [13:25:42.623] EGL client extensions: EGL_EXT_client_extensions
>                EGL_EXT_platform_base EGL_KHR_platform_wayland
>                EGL_EXT_platform_wayland EGL_KHR_platform_gbm
> [13:25:42.626] EGL version: 1.5
> [13:25:42.626] EGL vendor: Vivante Corporation
> [13:25:42.626] EGL client APIs: OpenGL_ES
> [13:25:42.626] 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_create_context_robustness EGL_EXT_protected_surface
>                EGL_EXT_protected_content 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:25:42.626] EGL_KHR_surfaceless_context available
> [13:25:42.630] GL version: OpenGL ES 3.1 V6.4.3.p2.336687
> [13:25:42.630] GLSL version: OpenGL ES GLSL ES 3.10
> [13:25:42.630] GL vendor: Vivante Corporation
> [13:25:42.630] GL renderer: Vivante GC7000UL
> [13:25:42.630] 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_texture_storage_multisample_2d_array
>                GL_OES_required_internalformat GL_OES_surfaceless_context
>                GL_OES_draw_buffers_indexed GL_OES_texture_border_clamp
>                GL_OES_texture_buffer GL_OES_texture_cube_map_array
>                GL_OES_draw_elements_base_vertex GL_OES_texture_half_float
>                GL_OES_texture_float GL_KHR_blend_equation_advanced
>                GL_KHR_debug GL_KHR_robustness
>                GL_KHR_robust_buffer_access_behavior
>                GL_EXT_texture_type_2_10_10_10_REV
>                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_texture_cube_map_array
>                GL_EXT_multi_draw_indirect GL_EXT_draw_elements_base_vertex
>                GL_EXT_texture_rg GL_EXT_protected_textures GL_EXT_sRGB
>                GL_VIV_direct_texture
> [13:25:42.630] GL ES 2 renderer features:
>                read-back format: BGRA
>                wl_shm sub-image to texture: yes
>                EGL Wayland extension: yes
> [13:25:42.646] event0  - 30370000.snvs:snvs-powerkey: is tagged by udev as: 
> Keyboard
> [13:25:42.646] event0  - 30370000.snvs:snvs-powerkey: device is a keyboard
> [13:25:42.654] event1  - Logitech USB Receiver: is tagged by udev as: Keyboard
> [13:25:42.654] event1  - Logitech USB Receiver: device is a keyboard
> [13:25:42.663] event2  - Logitech USB Receiver Mouse: is tagged by udev as: 
> Mouse
> [13:25:42.663] event2  - Logitech USB Receiver Mouse: device is a pointer
> [13:25:42.672] event3  - Logitech USB Receiver Consumer Control: is tagged by 
> udev as: Keyboard
> [13:25:42.672] event3  - Logitech USB Receiver Consumer Control: device is a 
> keyboard
> [13:25:42.681] event4  - Logitech USB Receiver System Control: is tagged by 
> udev as: Keyboard
> [13:25:42.681] event4  - Logitech USB Receiver System Control: device is a 
> keyboard
> [13:25:42.749] event6  - Logitech USB-PS/2 Optical Mouse: is tagged by udev 
> as: Mouse
> [13:25:42.750] event6  - Logitech USB-PS/2 Optical Mouse: device is a pointer
> [13:25:42.754] event5  - audio-hdmi HDMI Jack: is tagged by udev as: Switch
> [13:25:42.755] event5  - not using input device '/dev/input/event5'
> [13:25:42.771] libinput: configuring device "30370000.snvs:snvs-powerkey".
> [13:25:42.772] libinput: configuring device "Logitech USB Receiver".
> [13:25:42.772] libinput: configuring device "Logitech USB Receiver Mouse".
> [13:25:42.772] libinput: configuring device "Logitech USB Receiver Consumer 
> Control".
> [13:25:42.772] libinput: configuring device "Logitech USB Receiver System 
> Control".
> [13:25:42.772] libinput: configuring device "Logitech USB-PS/2 Optical Mouse".
> [13:25:42.773] DRM: head 'HDMI-A-1' found, connector 35 is connected, EDID 
> make 'LNX', model 'Linux SVGA', serial 'Linux #0'
> [13:25:42.773] Registered plugin API 'weston_drm_output_api_v1' of size 24
> [13:25:42.775] Chosen EGL config details: id:  41 rgba: 8 8 8 0 buf: 24 dep:  
> 0 stcl: 0 int: 1-60 type: win|pix|pbf|swap_preserved vis_id: XRGB8888 
> (0x34325258)
> [13:25:42.775] Output HDMI-A-1 (crtc 33) video modes:
>                800x600@60.3, preferred, current, 40.0 MHz
> [13:25:42.775] associating input device event0 with output HDMI-A-1 (none by 
> udev)
> [13:25:42.775] associating input device event1 with output HDMI-A-1 (none by 
> udev)
> [13:25:42.775] associating input device event2 with output HDMI-A-1 (none by 
> udev)
> [13:25:42.775] associating input device event3 with output HDMI-A-1 (none by 
> udev)
> [13:25:42.775] associating input device event4 with output HDMI-A-1 (none by 
> udev)
> [13:25:42.775] associating input device event6 with output HDMI-A-1 (none by 
> udev)
> [13:25:42.775] Output 'HDMI-A-1' enabled with head(s) HDMI-A-1
> [13:25:42.775] Compositor capabilities:
>                arbitrary surface rotation: yes
>                screen capture uses y-flip: yes
>                presentation clock: CLOCK_MONOTONIC, id 1
>                presentation clock resolution: 0.000000001 s
> [13:25:42.775] Loading module '/usr/lib/weston/kiosk-shell.so'
> [13:25:42.776] Loading module '/usr/lib/weston/screen-share.so'
> [13:25:42.776] Loading module '/usr/lib/weston/systemd-notify.so'
> [13:25:42.777] info: add 1 socket(s) provided by systemd

Attachment: signature.asc
Description: PGP signature

Reply via email to