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
[WIP] libobs-opengl: Support Wayland-EGL #2097
Conversation
Personally, a different name should be chosen for libobs/obs-nix, and libobs/obs-x11 should be --edit Also for the sake of reviewers it may be best to split this into two commits. 1 libobs modification to create a runtime platform layer only supporting existing platforms. And the 2nd commit adding in the wayland platform layer. |
@kkartaltepe: I think those are good suggestions. I will try to update this soon. |
I pulled the branch, rebased upstream/master (needed for the caption fix) and seems to be working alright for me. Debian unstable. That said, I'm still seeing quite a few of these in the console log.
If you need/want any help, I'd love to see this merged. |
There's also EGL context creation in this PR: #1758 |
I dont really see much of a reason to try and coordinate between the two PRs (this adds wayland windowing support, egl is just incidental to that cause, and such a context couldnt be shared with X11 anyway). What did you have in mind for coordinating? |
I like that you can select GLX/EGL at run-time with this PR, rather than it being a compile-time option. I'm a little intimidated by the |
Also BTW, for those who don't know, there is wlrobs that is a plugin/extension that allows to record your screen with OBS on wlroots based compositors |
Feedback:
|
The OBS window, also doesn't have an app_id. This is quite annoying, because it there is no way for me to inhibit my idle manager (screensaver), based on it. The app_id shouldn't change and should always be the same. |
Please keep in mind that some of these problems might have to be implemented by QT. And something that should be implemented by QT should definitively not be done by OBS, otherwise we have 2 layers (qt and obs) doing the same job. |
None of these sound related to this PR. Please file a bug or create a github issue for general issues you have with OBS. Bringing unrelated issues into this PR make it harder for people to review and make a proper review take even longer. (things like "Firefox also has this issue" or "this was already the case with xwayland") |
@kkartaltepe I'm sorry but all the bugs I said except this
are bugs that are related to this branch. And what I mean by "related" is that they only appear on this branch And the reason I brought it up is that it might be related to the Wayland environment. |
My personal opinons,
Provide a backtrace from GDB.
This PR does not change context menu handling, so this sounds unrelated to this PR. Have you tested the behavior under X11 and is it really unique to wayland? Perhaps you mean there is an existing issue in the handling of context menus?
This also sounds like an unrelated enhancement once wayland is supported. Notably this functionality is not at all required to begin supporting wayland so it makes this PR smaller and easier to review by leaving it out. It should be easy to submit a PR even in parallel for this functionality as it lkely can be done without any wayland support in OBS due to how Qt handles it. |
|
Nice work! I've rebased this here: https://github.com/obsproject/obs-studio/compare/master...hedgepigdaniel:wayland?expand=1 The screencopy backend works well, but the dmabuf backend only shows a black screen. I see the following in the log:
|
I just tested the dmabuf backend and it works for me on the latest commit. |
|
This would solve #2471 which didn't need to be closed prematurely, right? |
Should this PR be closed in favor of #2484? Or are there parts of this that should remain open? |
It should probably be closed. Especially considering the author of this PR has acknowledged, the existence of the new PR. |
Works for me, I'll go ahead and close this in favor. If this needs to be reopened, feel free to comment again and we can review! |
@@ -0,0 +1,66 @@ | |||
# Try to find Wayland on a Unix system |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you copied over this version of the FindWayland module. If you use the last version you'll get to use Wayland::Egl as a target removing quite some boilerplate code in the actual use of the module.
https://invent.kde.org/frameworks/extra-cmake-modules/-/blob/master/find-modules/FindWayland.cmake
Description
Enables support for EGL on wayland as a libobs-opengl backend. It supports swapping between the X11/Wayland backends on Unix-like platforms. This is for the rendering backend only, it doesn't cover the capture plugins.
Motivation and Context
Qt already supports an environment variable to change backends at program startup, by setting
QT_QPA_PLATFORM=xcb
orQT_QPA_PLATFORM=wayland-egl
. Without this PR, OBS ignores this Qt setting and instead assumes that on Unix-like platforms, X11 is always used. This causes creation of the glx context to fail and the OpenGL preview to show up blank when the Qtwayland backend is used. The relevant bug is 0001518, which this PR aims to fix. This also clears up half of 0000609.How Has This Been Tested?
I test on Ubuntu Disco with an Intel i915. The wayland compositors I've tested with are Weston, Sway, Mutter (GNOME), and KWin (KDE). It works in Weston and Sway, but there are issues in the others:
Mutter displays a blank preview windowTesting with Mutter/gnome-shell 3.34, it seems to work for me now.Note that currently this PR is not ready to merge because of those issues. It's not clear to me yet if those are bugs in OBS, in Qt, or in those compositors. Since it works fine in Weston, it leads me to believe that those are compositor issues. If you're using Sway or another wlroots compositor then you can use this PR as-is before it's merged.
I've also tested this on my machine X11 in GNOME, KDE, and with i3 to make sure nothing broke there. I have not tested on any BSDs. Some of the general backend code was touched, so this should also be tested on the non-Unix platforms to make sure nothing broke. I have not tested on Windows or MacOS.
Types of changes
New feature: Support wayland as a rendering backend.
Checklist: