swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.21k stars 1.09k forks source link

All-black screengrabs using `grim` #8116

Open colinmarc opened 3 months ago

colinmarc commented 3 months ago

Sway Version: 1.9 (I also tested on a fairly recent git, but just downgraded to see if that would fix the issue)

Sway logs: https://gist.github.com/colinmarc/41c96239d8202722602659ff290c793f

Grim/wayland logs ``` ~ % WAYLAND_DEBUG=1 WL_DISPLAY=2 grim /tmp/shot.png [1860590.796] -> wl_display@1.get_registry(new id wl_registry@2) [1860590.804] -> wl_display@1.sync(new id wl_callback@3) [1860590.850] wl_display@1.delete_id(3) [1860590.854] wl_registry@2.global(1, "wl_shm", 1) [1860590.859] -> wl_registry@2.bind(1, "wl_shm", 1, new id [unknown]@4) [1860590.862] wl_registry@2.global(2, "wl_drm", 2) [1860590.864] wl_registry@2.global(3, "zwp_linux_dmabuf_v1", 4) [1860590.866] wl_registry@2.global(4, "wl_compositor", 6) [1860590.868] wl_registry@2.global(5, "wl_subcompositor", 1) [1860590.870] wl_registry@2.global(6, "wl_data_device_manager", 3) [1860590.872] wl_registry@2.global(7, "zwlr_gamma_control_manager_v1", 1) [1860590.874] wl_registry@2.global(8, "zxdg_output_manager_v1", 3) [1860590.876] -> wl_registry@2.bind(8, "zxdg_output_manager_v1", 2, new id [unknown]@5) [1860590.879] wl_registry@2.global(9, "ext_idle_notifier_v1", 1) [1860590.881] wl_registry@2.global(10, "zwp_idle_inhibit_manager_v1", 1) [1860590.884] wl_registry@2.global(11, "zwlr_layer_shell_v1", 4) [1860590.887] wl_registry@2.global(12, "xdg_wm_base", 2) [1860590.889] wl_registry@2.global(13, "zwp_tablet_manager_v2", 1) [1860590.891] wl_registry@2.global(14, "org_kde_kwin_server_decoration_manager", 1) [1860590.893] wl_registry@2.global(15, "zxdg_decoration_manager_v1", 1) [1860590.895] wl_registry@2.global(16, "zwp_relative_pointer_manager_v1", 1) [1860590.899] wl_registry@2.global(17, "zwp_pointer_constraints_v1", 1) [1860590.901] wl_registry@2.global(18, "wp_presentation", 1) [1860590.904] wl_registry@2.global(19, "zwlr_output_manager_v1", 4) [1860590.906] wl_registry@2.global(20, "zwlr_output_power_manager_v1", 1) [1860590.908] wl_registry@2.global(21, "zwp_input_method_manager_v2", 1) [1860590.910] wl_registry@2.global(22, "zwp_text_input_manager_v3", 1) [1860590.912] wl_registry@2.global(23, "zwlr_foreign_toplevel_manager_v1", 3) [1860590.914] wl_registry@2.global(24, "ext_session_lock_manager_v1", 1) [1860590.916] wl_registry@2.global(25, "wp_drm_lease_device_v1", 1) [1860590.919] wl_registry@2.global(26, "zwlr_export_dmabuf_manager_v1", 1) [1860590.921] wl_registry@2.global(27, "zwlr_screencopy_manager_v1", 3) [1860590.924] -> wl_registry@2.bind(27, "zwlr_screencopy_manager_v1", 1, new id [unknown]@6) [1860590.926] wl_registry@2.global(28, "zwlr_data_control_manager_v1", 2) [1860590.928] wl_registry@2.global(29, "wp_security_context_manager_v1", 1) [1860590.931] wl_registry@2.global(30, "wp_viewporter", 1) [1860590.933] wl_registry@2.global(31, "wp_single_pixel_buffer_manager_v1", 1) [1860590.936] wl_registry@2.global(32, "wp_content_type_manager_v1", 1) [1860590.938] wl_registry@2.global(33, "wp_fractional_scale_manager_v1", 1) [1860590.940] wl_registry@2.global(34, "zxdg_exporter_v1", 1) [1860590.942] wl_registry@2.global(35, "zxdg_importer_v1", 1) [1860590.944] wl_registry@2.global(36, "zxdg_exporter_v2", 1) [1860590.947] wl_registry@2.global(37, "zxdg_importer_v2", 1) [1860590.949] wl_registry@2.global(38, "xdg_activation_v1", 1) [1860590.951] wl_registry@2.global(39, "wp_cursor_shape_manager_v1", 1) [1860590.953] wl_registry@2.global(40, "zwp_virtual_keyboard_manager_v1", 1) [1860590.955] wl_registry@2.global(41, "zwlr_virtual_pointer_manager_v1", 2) [1860590.957] wl_registry@2.global(42, "zwlr_input_inhibit_manager_v1", 1) [1860590.958] wl_registry@2.global(43, "zwp_keyboard_shortcuts_inhibit_manager_v1", 1) [1860590.961] wl_registry@2.global(44, "zwp_pointer_gestures_v1", 3) [1860590.963] wl_registry@2.global(45, "wl_seat", 8) [1860590.965] wl_registry@2.global(47, "zwp_primary_selection_device_manager_v1", 1) [1860590.967] wl_registry@2.global(48, "wl_output", 4) [1860590.970] -> wl_registry@2.bind(48, "wl_output", 3, new id [unknown]@7) [1860590.973] wl_callback@3.done(2186) [1860590.975] -> zxdg_output_manager_v1@5.get_xdg_output(new id zxdg_output_v1@3, wl_output@7) [1860590.978] -> wl_display@1.sync(new id wl_callback@8) [1860591.008] wl_display@1.delete_id(8) [1860591.012] wl_output@7.geometry(0, 0, 600, 340, 0, "Dell Inc.", "DELL U2723QE", 0) [1860591.016] wl_output@7.mode(1, 3840, 2160, 59997) [1860591.019] wl_output@7.scale(2) [1860591.020] wl_output@7.done() [1860591.022] zxdg_output_v1@3.name("DP-1") [1860591.024] zxdg_output_v1@3.description("Dell Inc. DELL U2723QE 9R925H3 (DP-1)") [1860591.030] zxdg_output_v1@3.logical_position(0, 0) [1860591.032] zxdg_output_v1@3.logical_size(1920, 1080) [1860591.035] zxdg_output_v1@3.done() [1860591.037] wl_callback@8.done(2186) [1860591.040] -> zwlr_screencopy_manager_v1@6.capture_output(new id zwlr_screencopy_frame_v1@8, 0, wl_output@7) [1860591.066] zwlr_screencopy_frame_v1@8.buffer(875709016, 3840, 2160, 15360) [1860591.091] -> wl_shm@4.create_pool(new id wl_shm_pool@9, fd 5, 33177600) [1860591.095] -> wl_shm_pool@9.create_buffer(new id wl_buffer@10, 0, 3840, 2160, 15360, 875709016) [1860591.097] -> wl_shm_pool@9.destroy() [1860591.101] -> zwlr_screencopy_frame_v1@8.copy(wl_buffer@10) [1860617.677] wl_display@1.delete_id(9) [1860617.685] zwlr_screencopy_frame_v1@8.flags(0) [1860617.690] zwlr_screencopy_frame_v1@8.ready(0, 682, 594011466) [1860833.693] -> zwlr_screencopy_frame_v1@8.destroy() [1860834.289] -> wl_buffer@10.destroy() [1860834.293] -> zxdg_output_v1@3.destroy() [1860834.296] -> wl_output@7.release() [1860834.298] -> zwlr_screencopy_manager_v1@6.destroy() [1860834.300] -> zxdg_output_manager_v1@5.destroy() ```
System info ``` System: Host: baldanders Kernel: 6.8.0-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1 Desktop: Sway v: 1.10-dev-829c75b9 lm: greetd Distro: Manjaro base: Arch Linux CPU: Info: 8-core model: AMD Ryzen 7 5800X bits: 64 type: MT MCP arch: Zen 3+ rev: 2 cache: L1: 512 KiB L2: 4 MiB L3: 32 MiB Speed (MHz): avg: 2300 high: 3800 min/max: 2200/4850 boost: enabled cores: 1: 2200 2: 2200 3: 2200 4: 2200 5: 2200 6: 2200 7: 2200 8: 2200 9: 2200 10: 3800 11: 2200 12: 2200 13: 2200 14: 2200 15: 2200 16: 2200 bogomips: 121429 Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 Graphics: Device-1: AMD Navi 23 [Radeon RX 6650 XT / 6700S 6800S] vendor: Micro-Star MSI driver: amdgpu v: kernel arch: RDNA-2 pcie: speed: 16 GT/s lanes: 16 ports: active: DP-1 empty: DP-2, DP-3, HDMI-A-1, Writeback-1 bus-ID: 07:00.0 chip-ID: 1002:73ef Device-2: Logitech C920 PRO HD Webcam driver: snd-usb-audio,uvcvideo type: USB rev: 2.1 speed: 480 Mb/s lanes: 1 bus-ID: 3-1.4:5 chip-ID: 046d:08e5 Display: wayland server: X.org v: 1.21.1.11 with: Xwayland v: 21.1.99 compositor: Sway v: 1.10-dev-829c75b9 driver: gpu: amdgpu display-ID: 1 Monitor-1: DP-1 model: Dell U2723QE res: 3840x2160 dpi: 163 diag: 685mm (27") API: EGL v: 1.5 platforms: device: 0 drv: radeonsi device: 1 drv: swrast surfaceless: drv: radeonsi wayland: drv: radeonsi x11: drv: radeonsi inactive: gbm API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd v: N/A glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 6650 XT (radeonsi navi23 LLVM 16.0.6 DRM 3.57 6.8.0-1-MANJARO) device-ID: 1002:73ef API: Vulkan v: 1.3.279 surfaces: xcb,xlib,wayland device: 0 type: discrete-gpu driver: mesa radv device-ID: 1002:73ef device: 1 type: cpu driver: mesa llvmpipe device-ID: 10005:0000 ```

I'm getting all-black screenshots using grim. I wasn't sure where the bug is, but it seems more like the issue is on sway's side, based on the wayland debug log. The file is created and is the right size, but has all zeroes.

I grabbed the logs from nested sway because it's easier, but the same thing happens in non-nested mode.

emersion commented 3 months ago

Potentially duplicate of https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3824