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

Add option to not use vaapi for allocator and pixel format conversion #15

Open
jbeich opened this issue Jul 3, 2023 · 2 comments
Open

Comments

@jbeich
Copy link
Contributor

jbeich commented Jul 3, 2023

VA-API drivers may not be available for some GPUs nor installed by default. Found while testing in a pristine jail with Wayland socket passed through.

$ wl-screenrec --no-hw
Using output DP-1
[AVHWDeviceContext @ 0x3f654ad931c0] Failed to initialise VAAPI connection: -1 (unknown libva error).
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `-5`,
 right: `0`', src/avhw.rs:34:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Abort trap
@russelltg
Copy link
Owner

Yeah, that's a good point. The way it's currently written uses vaapi to allocate and do pixel format conversion, even if --no-hw is passed.

Honestly, in this case with no vaapi driver this project has no benefit over wf-recorder, and it would be a decent bit of work to support this. Potential ways this could be done are:

  • Allocate the dmabuf surfaces ourselves, and then do our own upload
  • Add a path to do shared memory frame copies instead of dmabuf. This is probably the way to go, as it could also enable using this when capturing a small area of a large display (as currently dmabuf copies have to be entire displays)

@russelltg russelltg changed the title --no-hw crashes without VA-API drivers Add option to not use vaapi for allocator and pixel format conversion Jul 3, 2023
@russelltg
Copy link
Owner

Note that #90 will "fix" this by allowing you to use vulkan as an allocator instead.

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