-
Notifications
You must be signed in to change notification settings - Fork 12
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
Comments
Interesting, apparently |
|
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 |
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? |
Can you test this hack patch?
It doesn't help:
```
$ RUST_BACKTRACE=1 wl-screenrec
Opening libva device from DRM device /dev/dri/card0
Xlib: extension "DRI2" missing on display ":0".
[AVHWDeviceContext @ 0x350668a192c0] libva: vaGetDriverNames() failed with operation failed
[AVHWDeviceContext @ 0x350668a192c0] Failed to initialise VAAPI connection: 1 (operation failed).
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.
thread 'main' panicked at src/main.rs:904:51:
enc left in intermediate state
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: wl_screenrec::State<S>::on_copy_src_ready
3: wl_screenrec::cap_wlr_screencopy::<impl wayland_client::event_queue::Dispatch<wayland_protocols_wlr::screencopy::v1::generated::client::zwlr_screencopy_frame_v1::ZwlrScreencopyFrameV1,()> for wl_screenrec::State<wl_screenrec::cap_wlr_screencopy::CapWlrScreencopy>>::event
4: wayland_client::event_queue::queue_callback
5: wayland_client::event_queue::EventQueue<State>::dispatching_impl
6: wayland_client::event_queue::EventQueue<State>::blocking_dispatch
7: wl_screenrec::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```
|
What if you pass --dri-drvice /dev/dri/renderD128 (or whatever is the correct render node) |
I confirm, passing `--dri-device` makes the hack work:
```
$ wl-screenrec --dri-device /dev/dri/renderD128
Opening libva device from DRM device /dev/dri/renderD128
[h264_vaapi @ 0x548888305800] Driver does not support any RC mode compatible with selected options (supported modes: CQP).
failed to open encoder in low_power mode (Invalid argument), trying non low_power mode. if you have an intel iGPU, set enable_guc=2 in the i915 module to use the fixed function encoder. pass --low-power=off to suppress this warning
1 fps
2 fps
2 fps
8 fps
3 fps
^C
```
|
Can I get the |
|
Hmm OK. The hack is working as intended, but
isn't properly converting it into a render node ( |
Regressed by a1599ee. Other
zwp_linux_dmabuf_v1
consumers likempv --vo=dmabuf-wayland
work fine.The text was updated successfully, but these errors were encountered: