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

wl-mirror crashes in mesa when using the dmabuf backend with software rendering #48

Open
chscf opened this issue Aug 28, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@chscf
Copy link

chscf commented Aug 28, 2024

Hi there,

I have this problem: I'm running labwc-0.8.0 based on wlroots-0.18.0 on a laptop with an external monitor connected. After starting labwc the internal display (eDP-1) is extended by the external (DP-7). What I want is the internal display to be mirrored to the external monitor.

When I run wl-mirror in the following way:

wl-present mirror eDP-1 --fullscreen-output DP-7 --fullscreen

the internal display is indeed mirrored to the external monitor, but only for about half a second. Then the two displays fall back to the 'extended mode' no matter if wl-mirror is still running or not.

Does anyone have any hints what I'm doing wrong?
Thanks and best regards,
Christian

@Ferdi265
Copy link
Owner

Hi! if wl-mirror stops mirroring then it probably died. does wl-mirror print anything useful on stdout/stderr?

You can also add --verbose to your wl-mirror call to get extra log output.

I will also try to reproduce your issue once I find time.

@Ferdi265 Ferdi265 added the bug Something isn't working label Aug 28, 2024
@chscf
Copy link
Author

chscf commented Aug 28, 2024

Hi,

thanks for the quick reply!

This seems to be a segfault in Mesa's libgallium (I'm using mesa-24.2.0 with only softpipe,llvmpipe as gallium drivers, btw):

[  899.109573] wl-mirror[1384]: segfault at 576848 ip 00007f767cc7fc71 sp 00007ffd9e8db480 error 4 in libgallium-24.2.0.so[951c71,7f767c386000+993000] likely on CPU 6 (core 10, socket 0)
[  899.109584] Code: c9 0f 84 39 01 00 00 8b 04 24 85 c0 0f 84 df 00 00 00 4c 8d b5 68 0c 00 00 31 db eb 77 0f 1f 40 00 31 f6 31 d2 e8 9f bf fc ff <48> 8b b4 dd 78 88 00 00 4d 85 e4 0f 84 88 01 00 00 4d 8b 6c 24 48

wl-mirror -v output shows nothing scary I guess:

root [ ~ ]# cat /tmp/wl-mirror.out 
debug: main::main(): initializing stream
debug: main::main(): initializing wayland
debug: wayland::on_registry_add(): wl_shm (version = 2, id = 1)
debug: wayland::on_registry_add(): zwlr_gamma_control_manager_v1 (version = 1, id = 2)
debug: wayland::on_registry_add(): zxdg_output_manager_v1 (version = 3, id = 3)
debug: wayland::on_registry_add(): zwlr_output_manager_v1 (version = 4, id = 4)
debug: wayland::on_registry_add(): wl_compositor (version = 5, id = 5)
debug: wayland::on_registry_add(): wl_subcompositor (version = 1, id = 6)
debug: wayland::on_registry_add(): wl_data_device_manager (version = 3, id = 7)
debug: wayland::on_registry_add(): zwp_primary_selection_device_manager_v1 (version = 1, id = 8)
debug: wayland::on_registry_add(): zwp_input_method_manager_v2 (version = 1, id = 9)
debug: wayland::on_registry_add(): zwp_text_input_manager_v3 (version = 1, id = 10)
debug: wayland::on_registry_add(): wl_seat (version = 9, id = 11)
debug: wayland::on_registry_add(): zwlr_virtual_pointer_manager_v1 (version = 2, id = 12)
debug: wayland::on_registry_add(): zwp_virtual_keyboard_manager_v1 (version = 1, id = 13)
debug: wayland::on_registry_add(): zwp_pointer_gestures_v1 (version = 3, id = 14)
debug: wayland::on_registry_add(): wp_cursor_shape_manager_v1 (version = 1, id = 15)
debug: wayland::on_registry_add(): xdg_wm_base (version = 3, id = 16)
debug: wayland::on_registry_add(): xdg_activation_v1 (version = 1, id = 17)
debug: wayland::on_registry_add(): org_kde_kwin_server_decoration_manager (version = 1, id = 18)
debug: wayland::on_registry_add(): zxdg_decoration_manager_v1 (version = 1, id = 19)
debug: wayland::on_registry_add(): wp_presentation (version = 1, id = 20)
debug: wayland::on_registry_add(): zwlr_export_dmabuf_manager_v1 (version = 1, id = 21)
debug: wayland::on_registry_add(): zwlr_screencopy_manager_v1 (version = 3, id = 22)
debug: wayland::on_registry_add(): zwlr_data_control_manager_v1 (version = 2, id = 23)
debug: wayland::on_registry_add(): wp_security_context_manager_v1 (version = 1, id = 24)
debug: wayland::on_registry_add(): wp_viewporter (version = 1, id = 25)
debug: wayland::on_registry_add(): wp_single_pixel_buffer_manager_v1 (version = 1, id = 26)
debug: wayland::on_registry_add(): wp_fractional_scale_manager_v1 (version = 1, id = 27)
debug: wayland::on_registry_add(): ext_idle_notifier_v1 (version = 1, id = 28)
debug: wayland::on_registry_add(): zwp_idle_inhibit_manager_v1 (version = 1, id = 29)
debug: wayland::on_registry_add(): zwp_relative_pointer_manager_v1 (version = 1, id = 30)
debug: wayland::on_registry_add(): zwp_pointer_constraints_v1 (version = 1, id = 31)
debug: wayland::on_registry_add(): zwlr_foreign_toplevel_manager_v1 (version = 3, id = 32)
debug: wayland::on_registry_add(): ext_session_lock_manager_v1 (version = 1, id = 33)
debug: wayland::on_registry_add(): wp_drm_lease_device_v1 (version = 1, id = 34)
debug: wayland::on_registry_add(): zwlr_output_power_manager_v1 (version = 1, id = 35)
debug: wayland::on_registry_add(): wp_tearing_control_manager_v1 (version = 1, id = 36)
debug: wayland::on_registry_add(): zwp_tablet_manager_v2 (version = 1, id = 37)
debug: wayland::on_registry_add(): zwlr_layer_shell_v1 (version = 4, id = 38)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 39)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 40)
debug: wayland::on_xdg_output_name(): updating output eDP-1 (id = 39)
debug: wayland::on_xdg_output_logical_size(): updating output eDP-1 (size = 1920x1200, id = 39)
debug: wayland::on_xdg_output_name(): updating output DP-7 (id = 40)
debug: wayland::on_xdg_output_logical_position(): updating output DP-7 (position = 1920,0, id = 40)
debug: wayland::on_xdg_output_logical_size(): updating output DP-7 (size = 3840x2160, id = 40)
debug: wayland::on_fractional_scale_preferred_scale(): scale = 1.0000
debug: wayland::on_xdg_toplevel_configure(): window resized to 100x100
debug: wayland::on_surface_configure_finished(): window configured
debug: main::main(): initializing EGL
debug: egl::init(): initialized EGL 1.5
debug: main::main(): initializing mirror
debug: options::find_output(): searching for output by name
debug: options::find_output(): found output with name eDP-1
debug: main::main(): initializing mirror backend
debug: mirror::auto_backend_fallback(): selecting backend dmabuf
debug: main::main(): entering event loop
debug: wayland::on_xdg_toplevel_configure(): window resized to 3840x2160
debug: egl::resize_window(): resizing EGL window to 3840x2160
debug: egl::resize_viewport(): resizing viewport
debug: egl::resize_viewport(): win_width = 3840, win_height = 2160
debug: egl::resize_viewport(): view_width = 2160, view_height = 2160
debug: egl::resize_viewport(): viewport 840, 0, 2160, 2160
debug: wayland::on_surface_configure_finished(): window configured
debug: wayland::on_surface_enter(): updating window scale
debug: wayland::on_surface_configure_finished(): window configured
debug: mirror-dmabuf::on_frame(): received 1920x1200 frame with 1 objects
debug: mirror-dmabuf::on_frame(): w=1920 h=1200 gl_format=8051 drm_format=34325258 drm_modifier=0000000000000000
debug: mirror-dmabuf::on_object(): fd=107 offset=         0 stride=      7680
debug: mirror-dmabuf::on_ready(): frame is ready
debug: egl::resize_viewport(): resizing viewport
debug: egl::resize_viewport(): win_width = 3840, win_height = 2160
debug: egl::resize_viewport(): view_width = 3456, view_height = 2160
debug: egl::resize_viewport(): viewport 192, 0, 3456, 2160
debug: mirror-dmabuf::on_frame(): received 1920x1200 frame with 1 objects
debug: mirror-dmabuf::on_frame(): w=1920 h=1200 gl_format=8051 drm_format=34325258 drm_modifier=0000000000000000
debug: mirror-dmabuf::on_object(): fd=107 offset=         0 stride=      7680
debug: mirror-dmabuf::on_ready(): frame is ready

An strace -f on wl-mirror shows this:

[pid  1312] write(2, "debug: mirror-dmabuf::on_frame()"..., 74debug: mirror-dmabuf::on_frame(): received 1920x1200 frame with 1 objects
) = 74
[pid  1312] write(2, "debug: mirror-dmabuf::on_frame()"..., 113debug: mirror-dmabuf::on_frame(): w=1920 h=1200 gl_format=8051 drm_format=34325258 drm_modifier=0000000000000000
) = 113
[pid  1312] write(2, "debug: mirror-dmabuf::on_object("..., 78debug: mirror-dmabuf::on_object(): fd=107 offset=         0 stride=      7680
) = 78
[pid  1312] write(2, "debug: mirror-dmabuf::on_ready()"..., 49debug: mirror-dmabuf::on_ready(): frame is ready
) = 49
[pid  1312] lseek(107, 0, SEEK_END)     = 9216000
[pid  1312] lseek(107, 0, SEEK_SET)     = 0
[pid  1312] mmap(NULL, 9216000, PROT_READ|PROT_WRITE, MAP_SHARED, 107, 0) = -1 EACCES (Permission denied)
[pid  1312] fcntl(107, F_DUPFD_CLOEXEC, 3) = 109
[pid  1312] mmap(NULL, 9220096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2d0ae6b000
[pid  1312] close(107)                  = 0
[pid  1312] munmap(0x7f2d0b736000, 9216000) = 0
[pid  1312] brk(0x2a77000)              = 0x2a77000
[pid  1312] brk(0x2a27000)              = 0x2a27000
[pid  1312] munmap(NULL, 9216000)       = 0
[pid  1312] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x576848} ---

The mmap returning EACCESS is suspicious I think?!

And the (lengthy) labwc debug output shows this:

..
00:00:04.520 [DEBUG] [backend/drm/fb.c:147] Failed to get DMA-BUF from buffer
00:00:04.520 [DEBUG] [backend/drm/drm.c:732] connector DP-7: Failed to import buffer for scan-out
..

Full output:

root [ ~ ]# cat /tmp/labwc.out 
00:00:00.000 [INFO] [../src/config/tablet.c:95] Adding button map for 0x140 with 0x110
00:00:00.000 [INFO] [../src/config/tablet.c:95] Adding button map for 0x14b with 0x111
00:00:00.000 [INFO] [../src/config/tablet.c:95] Adding button map for 0x14c with 0x112
00:00:00.000 [INFO] [../src/config/rcxml.c:1488] load default key bindings
00:00:00.000 [INFO] [../src/config/rcxml.c:1493] load default mouse bindings
00:00:00.000 [DEBUG] [../src/config/rcxml.c:1388] Loaded 34 merged mousebinds
00:00:00.000 [INFO] [../src/config/rcxml.c:1544] load default window switcher fields
00:00:00.000 [DEBUG] [../src/main.c:191] LABWC_PID=1487
00:00:00.000 [INFO] [backend/backend.c:350] Loading user-specified backends due to WLR_BACKENDS: drm
00:00:00.002 [INFO] [libseat] [libseat/libseat.c:73] Seat opened with backend 'seatd'
00:00:00.002 [INFO] [libseat] [libseat/backend/seatd.c:212] Enabling seat
00:00:00.002 [INFO] [backend/session/session.c:108] Successfully loaded libseat session
00:00:00.003 [DEBUG] [backend/session/session.c:381] Ignoring '/dev/dri/card1': not a KMS device
00:00:00.003 [INFO] [backend/backend.c:256] Found 1 GPUs
00:00:00.003 [INFO] [backend/drm/backend.c:185] Initializing DRM backend for /dev/dri/card0 (i915)
00:00:00.003 [DEBUG] [backend/drm/drm.c:111] Using atomic DRM interface
00:00:00.003 [DEBUG] [backend/drm/drm.c:131] ADDFB2 modifiers supported
00:00:00.003 [INFO] [backend/drm/drm.c:310] Found 4 DRM CRTCs
00:00:00.003 [INFO] [backend/drm/drm.c:268] Found 24 DRM planes
00:00:00.004 [DEBUG] [../src/server.c:352] manually creating headless backend
00:00:00.004 [INFO] [backend/headless/backend.c:67] Creating headless backend
00:00:00.005 [INFO] [util/env.c:25] Loading WLR_RENDERER option: pixman
00:00:00.005 [INFO] [render/pixman/renderer.c:328] Creating pixman renderer
00:00:00.005 [DEBUG] [render/allocator/allocator.c:132] Trying to create drm dumb allocator
00:00:00.005 [DEBUG] [render/allocator/drm_dumb.c:228] Created DRM dumb allocator
00:00:00.007 [DEBUG] [xcursor/wlr_xcursor.c:224] Loaded cursor theme 'Adwaita' at size 24 (118 available cursors)
00:00:00.011 [DEBUG] [../src/config/keybind.c:113] Found layout German
00:00:00.011 [DEBUG] [types/wlr_drm_lease_v1.c:637] Creating wlr_drm_lease_device_v1 for /dev/dri/card0
00:00:00.011 [INFO] [backend/drm/drm.c:1675] Scanning DRM connectors on /dev/dri/card0
00:00:00.012 [INFO] [backend/drm/drm.c:1726] Found connector 'eDP-1'
00:00:00.012 [INFO] [backend/drm/drm.c:1751] 'eDP-1' connected
00:00:00.012 [DEBUG] [backend/drm/drm.c:1541] Current CRTC: 82
00:00:00.012 [INFO] [backend/drm/drm.c:1555] Detected modes:
00:00:00.012 [INFO] [backend/drm/drm.c:1585]   1920x1200 @ 60.003 Hz (preferred)
00:00:00.012 [INFO] [backend/drm/drm.c:1585]   1920x1200 @ 40.017 Hz 
00:00:00.012 [INFO] [backend/drm/drm.c:1605] Physical size: 300x190
00:00:00.017 [INFO] [backend/drm/drm.c:1726] Found connector 'HDMI-A-1'
00:00:00.017 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-1'
00:00:00.017 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-2'
00:00:00.039 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-3'
00:00:00.039 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-4'
00:00:00.039 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-5'
00:00:00.039 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-6'
00:00:00.093 [INFO] [backend/drm/drm.c:1726] Found connector 'DP-7'
00:00:00.093 [INFO] [backend/drm/drm.c:1751] 'DP-7' connected
00:00:00.093 [DEBUG] [backend/drm/drm.c:1541] Current CRTC: 134
00:00:00.093 [INFO] [backend/drm/drm.c:1555] Detected modes:
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   3840x2160 @ 59.997 Hz (preferred)
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   3840x2160 @ 30.000 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   3840x2160 @ 29.970 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   2560x1440 @ 59.951 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   1920x1080 @ 60.000 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   1920x1080 @ 59.940 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   1920x1080 @ 59.934 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   1280x720 @ 60.000 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   1280x720 @ 59.940 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   1024x768 @ 60.004 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   800x600 @ 60.317 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   720x480 @ 60.000 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   720x480 @ 59.940 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   640x480 @ 60.000 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   640x480 @ 59.940 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1585]   640x480 @ 59.940 Hz 
00:00:00.093 [INFO] [backend/drm/drm.c:1605] Physical size: 700x400
00:00:00.093 [DEBUG] [backend/drm/drm.c:1317] Reallocating CRTCs
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector eDP-1 (connected, needs CRTC): CRTC 82 (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector HDMI-A-1 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-1 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-2 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-3 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-4 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-5 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-6 (disconnected): no CRTC (no change)
00:00:00.093 [DEBUG] [backend/drm/drm.c:1380]   Connector DP-7 (connected, needs CRTC): CRTC 134 (no change)
00:00:00.093 [INFO] [backend/drm/drm.c:1787] connector eDP-1: Requesting modeset
00:00:00.093 [DEBUG] [types/wlr_drm_lease_v1.c:531] Offering output eDP-1
00:00:00.093 [DEBUG] [../src/output.c:362] enable output
00:00:00.093 [DEBUG] [../src/output.c:371] set preferred mode
00:00:00.093 [DEBUG] [types/output/render.c:127] Attaching empty buffer to output for modeset
00:00:00.093 [DEBUG] [types/output/swapchain.c:27] Choosing primary buffer format XR24 (0x34325258) for output 'eDP-1'
00:00:00.093 [DEBUG] [types/output/swapchain.c:96] Testing swapchain for output 'eDP-1'
00:00:00.093 [DEBUG] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:00.096 [DEBUG] [render/allocator/drm_dumb.c:105] Allocated 1920x1200 DRM dumb buffer
00:00:00.097 [DEBUG] [render/pixman/renderer.c:186] Created pixman buffer 1920x1200
00:00:00.097 [DEBUG] [types/output/render.c:127] Attaching empty buffer to output for modeset
00:00:00.098 [INFO] [backend/drm/drm.c:889] connector eDP-1: Modesetting with 1920x1200 @ 60.003 Hz
00:00:00.110 [DEBUG] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:00.110 [DEBUG] [render/allocator/drm_dumb.c:105] Allocated 64x64 DRM dumb buffer
00:00:00.110 [DEBUG] [render/pixman/renderer.c:186] Created pixman buffer 64x64
00:00:00.110 [INFO] [backend/drm/drm.c:1787] connector DP-7: Requesting modeset
00:00:00.110 [DEBUG] [types/wlr_drm_lease_v1.c:531] Offering output DP-7
00:00:00.110 [DEBUG] [../src/output.c:362] enable output
00:00:00.110 [DEBUG] [../src/output.c:371] set preferred mode
00:00:00.110 [DEBUG] [types/output/render.c:127] Attaching empty buffer to output for modeset
00:00:00.110 [DEBUG] [types/output/swapchain.c:27] Choosing primary buffer format XR24 (0x34325258) for output 'DP-7'
00:00:00.110 [DEBUG] [types/output/swapchain.c:96] Testing swapchain for output 'DP-7'
00:00:00.110 [DEBUG] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:00.121 [DEBUG] [render/allocator/drm_dumb.c:105] Allocated 3840x2160 DRM dumb buffer
00:00:00.121 [DEBUG] [render/pixman/renderer.c:186] Created pixman buffer 3840x2160
00:00:00.124 [DEBUG] [types/output/render.c:127] Attaching empty buffer to output for modeset
00:00:00.126 [INFO] [backend/drm/drm.c:889] connector DP-7: Modesetting with 3840x2160 @ 59.997 Hz
00:00:00.539 [DEBUG] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:00.539 [DEBUG] [render/allocator/drm_dumb.c:105] Allocated 64x64 DRM dumb buffer
00:00:00.539 [DEBUG] [render/pixman/renderer.c:186] Created pixman buffer 64x64
00:00:00.539 [INFO] [backend/headless/backend.c:17] Starting headless backend
00:00:00.539 [DEBUG] [../src/server.c:580] WAYLAND_DISPLAY=wayland-0
00:00:00.549 [INFO] [../src/config/session.c:197] Not updating dbus execution environment: DBUS_SESSION_BUS_ADDRESS not set
00:00:00.549 [DEBUG] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:00.551 [DEBUG] [render/allocator/drm_dumb.c:105] Allocated 1920x1200 DRM dumb buffer
00:00:00.551 [DEBUG] [render/pixman/renderer.c:186] Created pixman buffer 1920x1200
00:00:00.553 [DEBUG] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:00.563 [DEBUG] [render/allocator/drm_dumb.c:105] Allocated 3840x2160 DRM dumb buffer
00:00:00.563 [DEBUG] [render/pixman/renderer.c:186] Created pixman buffer 3840x2160
00:00:04.473 [DEBUG] [types/wlr_compositor.c:771] New wlr_surface 0x611ff0 (res 0x55fe70)
00:00:04.473 [DEBUG] [types/xdg_shell/wlr_xdg_surface.c:401] new xdg_surface 0x6124b0 (res 0x564280)
00:00:04.473 [DEBUG] [../src/xdg.c:121] scheduling configure
00:00:04.492 [DEBUG] [../src/view-impl-common.c:55] [map] identifier=at.yrlf.wl_mirror, title=Wayland Output Mirror

00:00:04.520 [DEBUG] [backend/drm/fb.c:147] Failed to get DMA-BUF from buffer
00:00:04.520 [DEBUG] [backend/drm/drm.c:732] connector DP-7: Failed to import buffer for scan-out
00:00:04.823 [DEBUG] [types/output/render.c:146] Disabling direct scan-out on output 'eDP-1' (locks: 1)
00:00:04.823 [DEBUG] [types/output/cursor.c:54] Disabling hardware cursors on output 'eDP-1' (locks: 1)
00:00:04.824 [DEBUG] [types/output/render.c:146] Enabling direct scan-out on output 'eDP-1' (locks: 0)
00:00:04.824 [DEBUG] [types/output/cursor.c:54] Enabling hardware cursors on output 'eDP-1' (locks: 0)
00:00:04.856 [DEBUG] [backend/drm/fb.c:147] Failed to get DMA-BUF from buffer
00:00:04.856 [DEBUG] [backend/drm/drm.c:732] connector DP-7: Failed to import buffer for scan-out
00:00:05.159 [DEBUG] [types/output/render.c:146] Disabling direct scan-out on output 'eDP-1' (locks: 1)
00:00:05.159 [DEBUG] [types/output/cursor.c:54] Disabling hardware cursors on output 'eDP-1' (locks: 1)
00:00:05.159 [DEBUG] [types/output/render.c:146] Enabling direct scan-out on output 'eDP-1' (locks: 0)
00:00:05.159 [DEBUG] [types/output/cursor.c:54] Enabling hardware cursors on output 'eDP-1' (locks: 0)
00:00:09.330 [INFO] [../src/config/session.c:197] Not updating dbus execution environment: DBUS_SESSION_BUS_ADDRESS not set
00:00:09.330 [DEBUG] [types/wlr_drm_lease_v1.c:683] Destroying wlr_drm_lease_v1_manager
00:00:09.330 [DEBUG] [types/wlr_drm_lease_v1.c:103] Destroying wlr_drm_lease_device_v1 for /dev/dri/card0
00:00:09.330 [DEBUG] [types/wlr_drm_lease_v1.c:70] Destroying connector DP-7
00:00:09.330 [DEBUG] [types/wlr_drm_lease_v1.c:70] Destroying connector eDP-1

If you need any more logs, etc. I'm happy to help.

Thanks,
Christian

@Ferdi265
Copy link
Owner

Thanks for the logs! This appears to be some kind of issue with DMA-BUF import/export in combination with software rendering, though I'm not sure who is at fault here. The EACCESS in mmap is definitely strange.

In the meantime, you can try running wl-mirror with -b screencopy, which will use a different protocol to get the screen contents that avoids use of DMA-BUF at the cost of some CPU time (copying the buffer around in software).

@chscf
Copy link
Author

chscf commented Aug 29, 2024

Good morning,

-b screencopy works, but unfortunately this is unusable because it's really extremely slow...

As I said before, if I can provide any more logs or such, I'd be happy to help.

Thanks,
Christian

@Ferdi265
Copy link
Owner

Good morning,

Good morning!

-b screencopy works, but unfortunately this is unusable because it's really extremely slow...

Yeah, screencopy with SHM buffers isn't really intended for continuous video capture. It mostly exists as a fallback in wl-mirror since it basically always works, but as you said it can be slow with weak hardware or high resolutions. The screencopy protocol also has a DMA-BUF mode, but (a) I haven't implemented that yet and (b) I'm not sure it would work if the dmabuf-export protocol crashes somewhere in mesa.

As I said before, if I can provide any more logs or such, I'd be happy to help.

Thanks, Christian

What would really help me is knowing what hardware and distro you are running this on. Thanks for posting the mesa version as well though. I'm gonna try and see if I can reproduce this with your versions and LIBGL_ALWAYS_SOFTWARE=1.

@Ferdi265 Ferdi265 changed the title wl-mirror mirrors only a very short time wl-mirror crashes in mesa when using the dmabuf backend with software rendering Aug 29, 2024
@chscf
Copy link
Author

chscf commented Aug 29, 2024

Hi,

What would really help me is knowing what hardware and distro you are running this on. Thanks for posting the mesa version as well though. I'm gonna try and see if I can reproduce this with your versions and LIBGL_ALWAYS_SOFTWARE=1.

I've observed this so far on two laptops: one is an older Dell Latitude with integrated Intel Graphics:

model name      : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
0000:00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07) (prog-if 00 [VGA controller])

and the other is a quite new HP ZBook, also using the onboard graphics:

model name      : 12th Gen Intel(R) Core(TM) i7-1265U
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-UP3 GT2 [Iris Xe Graphics] (rev 0c)

Regarding the distro I use: I use an entirely selfmade linux system (roughly based on https://www.linuxfromscratch.org/, so everything is self-compiled and self-configured, etc. (and of course I cannot rule out that this is the reason for the segfaulting mesa ;-)

The kernel I use is 6.10.4.

Regards,
Christian

@Ferdi265
Copy link
Owner

Ferdi265 commented Sep 3, 2024

Thanks for the info! Under my current setup my wlroots doesn't seem to like to be started with LIBGL_ALWAYS_SOFTWARE, so I will need to check what's wrong before I can try to reproduce your issue. If it also crashes on my system with software rendering then I'm sure I'll be able to fix it or figure out the upstream bug to report.

I don't have a lot of time to work on wl-mirror at the moment though, so it might take a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants