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

Crash on FreeBSD #99

Open
jbeich opened this issue Nov 13, 2024 · 10 comments
Open

Crash on FreeBSD #99

jbeich opened this issue Nov 13, 2024 · 10 comments

Comments

@jbeich
Copy link
Contributor

jbeich commented Nov 13, 2024

Regressed by a1599ee. Other zwp_linux_dmabuf_v1 consumers like mpv --vo=dmabuf-wayland work fine.

$ uname -a
FreeBSD 141amd64-default 14.1-RELEASE-p6 FreeBSD 14.1-RELEASE-p6 amd64

$ pkg info -x ffmpeg libva mesa sway
ffmpeg-6.1.2_5,1
libva-2.22.0
libva-intel-driver-2.4.1_3
libva-intel-hybrid-driver-1.0.2_3
mesa-dri-24.1.7_1
mesa-libs-24.1.7_1
sway-1.10
swaybg-1.2.1
swayidle-1.8.0_1

$ wayland-info | fgrep dmabuf
interface: 'zwp_linux_dmabuf_v1',                        version:  4, name:  2
interface: 'zwlr_export_dmabuf_manager_v1',              version:  1, name: 27

$ RUST_BACKTRACE=1 wl-screenrec
thread 'main' panicked at src/cap_wlr_screencopy.rs:96:62:
called `Result::unwrap()` on an `Err` value: [57, 1, 0, 0, 0, 0, 0, 0]
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: wayland_client::event_queue::queue_callback
   4: wayland_client::event_queue::EventQueue<State>::dispatching_impl
   5: wl_screenrec::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@russelltg
Copy link
Owner

Interesting, apparently dev_t isn't 8 bytes on BSD?

@jbeich
Copy link
Contributor Author

jbeich commented Nov 13, 2024

dev_t is 8 bytes since 2009 on NetBSD >= 6, since 2017 on FreeBSD >= 12 but remains 4 bytes on DragonFly and OpenBSD. Unfortunately, Rust fossilized 4-byte dev_t on FreeBSD.

@russelltg
Copy link
Owner

I'm not really sure what the proper fix to this is. Since the upper bytes are zero maybe it'd work to truncate it, but that seems messy.

I could maybe ask rustix folks to define their Dev type not as dev_t from libc...

@russelltg
Copy link
Owner

diff --git a/src/cap_wlr_screencopy.rs b/src/cap_wlr_screencopy.rs
index 0ead4d0..ab66cbf 100644
--- a/src/cap_wlr_screencopy.rs
+++ b/src/cap_wlr_screencopy.rs
@@ -93,6 +93,11 @@ impl Dispatch<ZwpLinuxDmabufFeedbackV1, ()> for State<CapWlrScreencopy> {
     ) {
         use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_dmabuf_feedback_v1::Event;
         if let Event::MainDevice { device } = event {
+            // HACK for https://github.com/russelltg/wl-screenrec/issues/99
+            // dev_t is the wrong size in rust's libc crate on freebsd
+            // just hope that the final bytes are zero....
+            #[cfg(target_os = "freebsd")]
+            let device = &device[0..std::mem::size_of::<dev_t>()];
             let dev = dev_t::from_ne_bytes(device.try_into().unwrap());
             let node = DrmNode::from_dev_id(dev).unwrap();
             let node = node                                                                                                                                                                                                                                                                                                                                                                                        

Can you test this hack patch?

@jbeich
Copy link
Contributor Author

jbeich commented Nov 29, 2024 via email

@russelltg
Copy link
Owner

What if you pass --dri-drvice /dev/dri/renderD128 (or whatever is the correct render node)

@jbeich
Copy link
Contributor Author

jbeich commented Nov 29, 2024 via email

@russelltg
Copy link
Owner

Can I get the wl-screenrec -vvv output with the patch but without --dri-device?

@jbeich
Copy link
Contributor Author

jbeich commented Dec 4, 2024

$ wl-screenrec -vvv
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected]_registry (wl_registry@2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected] (wl_callback@3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (1, Some("wl_shm"), 2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (2, Some("zwp_linux_dmabuf_v1"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (3, Some("wl_compositor"), 6)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (4, Some("wl_subcompositor"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (5, Some("wl_data_device_manager"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (6, Some("zwlr_gamma_control_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (7, Some("zxdg_output_manager_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (8, Some("ext_idle_notifier_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (9, Some("zwp_idle_inhibit_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (10, Some("zwlr_layer_shell_v1"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (11, Some("xdg_wm_base"), 5)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (12, Some("zwp_tablet_manager_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (13, Some("org_kde_kwin_server_decoration_manager"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (14, Some("zxdg_decoration_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (15, Some("zwp_relative_pointer_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (16, Some("zwp_pointer_constraints_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (17, Some("wp_presentation"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (18, Some("wp_alpha_modifier_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (19, Some("zwlr_output_manager_v1"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (20, Some("zwlr_output_power_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (21, Some("zwp_input_method_manager_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (22, Some("zwp_text_input_manager_v3"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (23, Some("ext_foreign_toplevel_list_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (24, Some("zwlr_foreign_toplevel_manager_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (25, Some("ext_session_lock_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (26, Some("wp_drm_lease_device_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (27, Some("zwlr_export_dmabuf_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (28, Some("zwlr_screencopy_manager_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (29, Some("zwlr_data_control_manager_v1"), 2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (30, Some("wp_security_context_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (31, Some("wp_viewporter"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (32, Some("wp_single_pixel_buffer_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (33, Some("wp_content_type_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (34, Some("wp_fractional_scale_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (35, Some("wp_tearing_control_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (36, Some("zxdg_exporter_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (37, Some("zxdg_importer_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (38, Some("zxdg_exporter_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (39, Some("zxdg_importer_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (40, Some("xdg_activation_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (41, Some("wp_cursor_shape_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (42, Some("zwp_virtual_keyboard_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (43, Some("zwlr_virtual_pointer_manager_v1"), 2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (44, Some("zwp_keyboard_shortcuts_inhibit_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (45, Some("zwp_pointer_gestures_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (46, Some("ext_transient_seat_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (47, Some("wl_seat"), 9)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (49, Some("zwp_primary_selection_device_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (73, Some("wl_output"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (40547)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected] (2, Some("zwp_linux_dmabuf_v1"), 4, zwp_linux_dmabuf_v1@3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected]_registry (wl_registry@4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected] (7, Some("zxdg_output_manager_v1"), 3, zxdg_output_manager_v1@5)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected] (73, Some("wl_output"), 4, wl_output@6)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected]_xdg_output (zxdg_output_v1@7, wl_output@6)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (1, Some("wl_shm"), 2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (2, Some("zwp_linux_dmabuf_v1"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (3, Some("wl_compositor"), 6)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (4, Some("wl_subcompositor"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (5, Some("wl_data_device_manager"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (6, Some("zwlr_gamma_control_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (7, Some("zxdg_output_manager_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (8, Some("ext_idle_notifier_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (9, Some("zwp_idle_inhibit_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (10, Some("zwlr_layer_shell_v1"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (11, Some("xdg_wm_base"), 5)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (12, Some("zwp_tablet_manager_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (13, Some("org_kde_kwin_server_decoration_manager"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (14, Some("zxdg_decoration_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (15, Some("zwp_relative_pointer_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (16, Some("zwp_pointer_constraints_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (17, Some("wp_presentation"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (18, Some("wp_alpha_modifier_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (19, Some("zwlr_output_manager_v1"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (20, Some("zwlr_output_power_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (21, Some("zwp_input_method_manager_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (22, Some("zwp_text_input_manager_v3"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (23, Some("ext_foreign_toplevel_list_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (24, Some("zwlr_foreign_toplevel_manager_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (25, Some("ext_session_lock_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (26, Some("wp_drm_lease_device_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (27, Some("zwlr_export_dmabuf_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (28, Some("zwlr_screencopy_manager_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (29, Some("zwlr_data_control_manager_v1"), 2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (30, Some("wp_security_context_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (31, Some("wp_viewporter"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (32, Some("wp_single_pixel_buffer_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (33, Some("wp_content_type_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (34, Some("wp_fractional_scale_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (35, Some("wp_tearing_control_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (36, Some("zxdg_exporter_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (37, Some("zxdg_importer_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (38, Some("zxdg_exporter_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (39, Some("zxdg_importer_v2"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (40, Some("xdg_activation_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (41, Some("wp_cursor_shape_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (42, Some("zwp_virtual_keyboard_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (43, Some("zwlr_virtual_pointer_manager_v1"), 2)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (44, Some("zwp_keyboard_shortcuts_inhibit_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (45, Some("zwp_pointer_gestures_v1"), 3)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (46, Some("ext_transient_seat_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (47, Some("wl_seat"), 9)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (49, Some("zwp_primary_selection_device_manager_v1"), 1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (73, Some("wl_output"), 4)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (0, 0, 600, 340, 2, Some("LG Electronics"), Some("LG Ultra HD"), 0)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (1, 3840, 2160, 60000)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (1)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (Some("DP-1"))
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (Some("LG Electronics LG Ultra HD 0x0006C184 (DP-1)"))
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ()
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (Some("DP-1"))
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (Some("LG Electronics LG Ultra HD 0x0006C184 (DP-1)"))
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (0, 0)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (3840, 2160)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ()
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Geometry { x: 0, y: 0, physical_width: 600, physical_height: 340, subpixel: Value(HorizontalRgb), make: "LG Electronics", model: "LG Ultra HD", transform: Value(Normal) }
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Mode { flags: Value(Mode(Current)), width: 3840, height: 2160, refresh: 60000 }
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Scale { factor: 1 }
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Name { name: "DP-1" }
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Description { description: "LG Electronics LG Ultra HD 0x0006C184 (DP-1)" }
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Done
18:21:56 [DEBUG] (1) wl_screenrec: zxdg-output event: ObjectId(zxdg_output_v1@7, 7) Name { name: "DP-1" }
18:21:56 [DEBUG] (1) wl_screenrec: zxdg-output event: ObjectId(zxdg_output_v1@7, 7) Description { description: "LG Electronics LG Ultra HD 0x0006C184 (DP-1)" }
18:21:56 [DEBUG] (1) wl_screenrec: zxdg-output event: ObjectId(zxdg_output_v1@7, 7) LogicalPosition { x: 0, y: 0 }
18:21:56 [DEBUG] (1) wl_screenrec: zxdg-output event: ObjectId(zxdg_output_v1@7, 7) LogicalSize { width: 3840, height: 2160 }
18:21:56 [DEBUG] (1) wl_screenrec: wl-output event: ObjectId(wl_output@6, 6) Done
18:21:56 [INFO] output probe complete: {ObjectId(wl_output@6, 6): Some(OutputInfo { global_name: 73, name: "DP-1", loc: (0, 0), logical_size: (3840, 2160), size_pixels: (3840, 2160), refresh: Rational(60000/1000), output: WlOutput { id: ObjectId(wl_output@6, 6), version: 4, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, transform: Normal })}
18:21:56 [INFO] Using output DP-1
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected] (28, Some("zwlr_screencopy_manager_v1"), 3, zwlr_screencopy_manager_v1@8)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected] (2, Some("zwp_linux_dmabuf_v1"), 4, zwp_linux_dmabuf_v1@9)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected]_default_feedback (zwp_linux_dmabuf_feedback_v1@10)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Sending [email protected]_output (zwlr_screencopy_frame_v1@11, 1, wl_output@6)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ([54, 1, 0, 0, 0, 0, 0, 0])
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (4, 3152)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ([54, 1, 0, 0, 0, 0, 0, 0])
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (0)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ([0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 30, 0, 31, 0, 32, 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47, 0, 48, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56, 0, 57, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 63, 0, 64, 0, 65, 0, 66, 0, 67, 0, 68, 0, 69, 0, 70, 0, 71, 0, 72, 0, 73, 0, 74, 0, 75, 0, 76, 0, 77, 0, 78, 0, 79, 0, 80, 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, 0, 86, 0, 87, 0, 88, 0, 89, 0, 90, 0, 91, 0, 92, 0, 93, 0, 94, 0, 95, 0, 96, 0, 97, 0, 98, 0, 99, 0, 100, 0, 101, 0, 102, 0, 103, 0, 104, 0, 105, 0, 106, 0, 107, 0, 108, 0, 109, 0, 110, 0, 111, 0, 112, 0, 113, 0, 114, 0, 115, 0, 116, 0, 117, 0, 118, 0, 119, 0, 120, 0, 121, 0, 122, 0, 123, 0, 124, 0, 125, 0, 126, 0, 127, 0, 128, 0, 129, 0, 130, 0, 131, 0, 132, 0, 133, 0, 134, 0, 135, 0, 136, 0, 137, 0, 138, 0, 139, 0, 140, 0, 141, 0, 142, 0, 143, 0, 144, 0, 145, 0, 146, 0, 147, 0, 148, 0, 149, 0, 150, 0, 151, 0, 152, 0, 153, 0, 154, 0, 155, 0, 156, 0, 157, 0, 158, 0, 159, 0, 160, 0, 161, 0, 162, 0, 163, 0, 164, 0, 165, 0, 166, 0, 167, 0, 168, 0, 169, 0, 170, 0, 171, 0, 172, 0, 173, 0, 174, 0, 175, 0, 176, 0, 177, 0, 178, 0, 179, 0, 180, 0, 181, 0, 182, 0, 183, 0, 184, 0, 185, 0, 186, 0, 187, 0, 188, 0, 189, 0, 190, 0, 191, 0, 192, 0, 193, 0, 194, 0, 195, 0, 196, 0])
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ()
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ()
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (875709016, 3840, 2160, 15360)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] (875713112, 3840, 2160)
18:21:56 [DEBUG] (1) wayland_backend::rs::client_impl: Dispatching [email protected] ()
18:21:56 [DEBUG] (1) wl_screenrec::cap_wlr_screencopy: zwlr-screencopy-frame event: ObjectId(zwlr_screencopy_frame_v1@11, 11) Buffer { format: Value(Xbgr8888), width: 3840, height: 2160, stride: 15360 }
18:21:56 [DEBUG] (1) wl_screenrec::cap_wlr_screencopy: zwlr-screencopy-frame event: ObjectId(zwlr_screencopy_frame_v1@11, 11) LinuxDmabuf { format: 875713112, width: 3840, height: 2160 }
18:21:56 [DEBUG] (1) wl_screenrec: Supported capture formats are [DmabufPotentialFormat { fourcc: DrmFourcc(XR24), modifiers: [0x00000000 = NONE_LINEAR] }]
[file @ 0x48d069424100] Setting default whitelist 'file,crypto,data'
18:21:56 [INFO] capture pixel format is XR24
18:21:56 [INFO] encode pixel format is Vaapi(NV12)
Opening libva device from DRM device /dev/dri/card0
[AVHWDeviceContext @ 0x48d069419280] libva: VA-API version 1.22.0
Xlib:  extension "DRI2" missing on display ":0".
[AVHWDeviceContext @ 0x48d069419280] libva: vaGetDriverNames() failed with operation failed
[AVHWDeviceContext @ 0x48d069419280] Failed to initialise VAAPI connection: 1 (operation failed).
[AVIOContext @ 0x48d0694db3c0] Statistics: 0 bytes written, 0 seeks, 0 writeouts
18:21:56 [ERROR] failed to create encoder(s): Failed to load vaapi device: Input/output error. This is likely *not* a bug in wl-screenrec, but an issue with your vaapi installation. Follow your distribution's instructions. If you're pretty sure you've done this correctly, create a new issue with the output of `vainfo` and if `wf-recorder -c h264_vaapi -d /dev/dri/card0` works.
18:21:56 [DEBUG] (1) wl_screenrec::cap_wlr_screencopy: zwlr-screencopy-frame event: ObjectId(zwlr_screencopy_frame_v1@11, 11) BufferDone

@russelltg
Copy link
Owner

Hmm OK. The hack is working as intended, but

            let node = node
                .node_with_type(drm::node::NodeType::Render)
                .unwrap()
                .unwrap();

isn't properly converting it into a render node (/dev/dri/renderD*), I'll have to look at why....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants