-
Notifications
You must be signed in to change notification settings - Fork 3
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
Would creating a xlib emulator be better #6
Comments
Hi @lnee94, basically one Wayland protocol for each xlib function (and possibly more)? |
I don't know what you ment by that, but the core point I'm making is that pipewire dbus etc exist and are standard so make a xlib emulator so that application devs have a easier time porting apps |
On some, but not on all systems. A display server that can't work properly on its own is imho conceptually flawed. XOrg has no dependencies on those things, and not everyone will consider to use Wayland if that means that those dependencies are forced upon people. |
The problem with Xorg is exactly that it has no external dependencies for a lot of things. The behemoth that is XScreensaver is a prime example of that. |
Xorg's big benefit is that it unifies how things work across all desktop environments and window managers, regardless of what is or is not installed on the system. With Wayland, "it depends". Wayland will make for a very fragmented, generally broken desktop experience when compared with the incumbent Xorg. |
That's only half the story. Xorg itself doesn't set any policy, so with just Xorg on its own there's none of that mythical desktop environment convergence that people like to muse about. Anybody who has ever browsed for X11 window managers across the board (or anybody who ever wrote their own X11 WM) will have faced the situation of one WM not handling a particular application the way every other WM did. Heck. Even things like a simple wallpaper didn't work the same everywhere. If a modern "X11" is the goal, I suggest somebody either implement a meta compositor with some custom IPC mechanism that makes it easy to communicate with the clients and even easier to implement traditional WMs on top of it, or push for people to use Arcan or Mir more. I'd say Mir is the closest thing we have to an "Xorg-on-Wayland", currently. BTW: I feel the true beauty of Wayland lies in the fact that one can benefit from it even without actually utilizing it. |
As for software depending on the presence of other software: How is that different/worse from what we had before? This doesn't sound like a fundamentally flawed design but simply something package managers have to deal with. |
Exactly my thoughts. Mutter and Kwin both require Xorg in order to run an X11 session but they can run Wayland sessions "natively". They may use Pipewire, Dbus, and Portals but those aren't specific to a Wayland session anyway. All three can and are used in X11 sessions as well so they might as well be used. OBS Studio can literally drop it's XShm, XComposite, PulseAudio, and V4L2 modules and still maintain the same functionality in Wayland and X11 using Pipewire + Portals. I'm not sure if they would drop their Jack input capture as well since Jack is still slightly lower latency than Pipewire but I'm not sure if that matters for capture. If not then they could drop that, too. No matter what, something is going to have dependencies but by having more dependency in the compositor/DE, it can simplify software. Why maintain separate methods of audio, video, and input capture and control for X11 and Wayland when you can use the same thing to support both? That would also allow X11 software to do those things in a Wayland session without first needing to make the software itself support Wayland. |
That's exactly what Dbus, Pipewire, and Portals are trying to do but you have a problem with them because each part has it's own name. Just pretend they're one solution with different parts. Pipewire, Dbus, and Portals unify audio playback, video capture, audio capture, and input capture across display server protocols. If your software isn't a native Wayland client then just use portals and you can support those features in Wayland, X11, and XWayland without having to support each individually. Right now I'm running Ubuntu with an X11 session in a VM on my other monitor. I have OBS open and these are my options for capture sources.
If people would adopt Dbus, Pipewire, and Portals then OBS could handle all linux capture with Pipewire which would reduce the list to this
On top of that, it could use Portals to support global hotkeys and it could support virtual camera functionality without requiring V4L2-loopback. I repeat: That same code would implement that functionality in X11 and Wayland. That's a lot of unification. Also my VM doesn't have hardware acceleration so neither screen capture method is smooth but Pipewire is noticeably smoother so XSHM doesn't even provide a performance advantage. |
@myownfriend try to see this from the perspective of someone using a lean system and has no GLib, Gtk, doesn't want D-Bus, etc. (E.g.: GNUstep, helloDesktop, FyneDesk, etc.) The display server must not force half of the Gnome stack on everyone. |
It's good that it doesn't then. But also do you not see how beneficial something like Portals and Pipewire are to applications like OBS? Do you really think it's better for OBS to support two different protocols for global hotkeys, screen capture, window capture for Wayland and X11? |
No. In fact, I think they are harmful. Because they make the OBS developers believe these things are "solved" now, instead of pushing for a proper pure-Wayland solution without all the additional Red Hat baggage.
The best solution, of course, would be to make Wayland use the same protocols as X11. If this is not possible/not wanted, the second best solution is to make Wayland use protocols conceptually very close to the ones in X11. The latter is the approach advocated by this repository. |
There's no reason whatsoever that a pure-Wayland solution is proper when you can de-couple those things from the display server protocol and get the benefit of a shared method of input, window, and screen capture in both protocols It is solved just not to your liking. If Portals had a dependency of Qt instead of Glib and if Wim Taymans wasn't payed by Redhat then you wouldn't have an issue with these things.
That would be a horrible solution. Giving everything an open door policy and having global hotkeys work identically to a keylogger will always be dumb.
It's baffling to me how incapable you are of imagining anything working differently or better than X11. Using Portals (or at least something outside of the display server protocol) is literally providing applications like OBS a way to remove code while retaining compatibility with X11 and Wayland and it's allowing X11 software to retain those features when run in a Wayland session. In another thread I even explained to you that OBS is able to screen capture with noticeably higher performance using Portals in an X11 session than it can using XSHM or XComposite. It's nuts that it has all of these benefits but you still think it should work the way X11 does it. |
@myownfriend well I guess if you like the current state of Wayland then you have no need for this repository. This repository is for the rest of us who are not satisfied with what Wayland currently has to offer. |
There's a lot that Wayland can do to improve but this repository isn't going to be the source of any of that improvement. If you're not familiar with the protocols that exists then you can't create proposals for protocols that don't break what's there. |
Always happy to learn. Best have a look at the protocols proposed in this repository and then make specific comments on why you think they are not needed because existing protocols can already do the same thing. |
Your screen-video-capture-v1 protocol says...
...but you already said you're completely unfamiliar with how Windows or macOS does video capture. That means you aren't even aware if they're similar to each other. Also it's a video capture protocol and you defined how the application should sync video with audio. Didn't you say that the display server protocol shouldn't define how an application should work? Wayland has nothing to do with audio and the whole point of the protocol is just to try to define how one client can get access to another client's buffer. Don't define what the application does with it's captured audio? Also did you know that a compositor isn't required to implement an extension? Even if this was merged into the official repo (it won't be), there's no guarantee that every DE would support it so how does this have a benefit over Portals/Pipewire? From the perspective or porting an application, what difference does it make if it's using a Wayland API call or Portal/Pipewire API call? At least with Portal/Pipewire the application can run under X11 or Wayland use the same code and implementations already exist. |
I am familiar with the desired user experience.
Of course there must be a way for the application to sync audio and video, don't you think? The display server has no business in audio but it must provide a way for the screen capturing application to sync with the audio, no matter how it acquires it.
Yes.
You are proving my point why we need this repository outside of the upstream echo chamber.
There's no guarantee that every system has Portals/Pipewire installed, so it's on par in that regard. The advantage is that usin this protocol
Under X11 my applications and desktop environments have no need for and don't support Portals/Pipewire, and I don't want to introduce that baggage just so that I can use Wayland. If you'd like to have a more structured conversation, then please open individual tickets for each protocol and each issue you have with them. |
You don't need D-Bus for a Wayland compositor. AFAIK, ravynOS' WindowServer only uses Mach IPC. |
RE I'm somewhat naive on the matter myself but isn't this already solved through GStreamer's waylandsink? |
Exactly. But things like Portals and Pipewire were deeply interwoven with D-Bus last time I checked. Hence we are proposing protocols that can do without them. |
What if you want to use e.g., ffmpeg rather than GStreamer? |
They are not even the same layer AFAIK. And GStreamer can use codecs provided by ffmpeg. |
But without Pipewire you'd end up with a single point of failure, no? |
Am looking for a solution which doesn't require GStreamer (my use case is that I want to build a GLib-free system.) |
Anyhow. I think this wlmaker project you forked looks really interesting and could very well serve as the basis of a reference compositor for what you want to do. I still think the best way to go about this would be to implement a meta compositor. Have a small but capable Wayland compositor that establishes its own IPC protocol, write a simple tutorial WM that uses this compositor like an X11 WM would use Xorg, profit. If you build it, they'll come. |
Hmm. Interesting thought. Maybe this is a direction I might take helloDesktop into. |
You could have your cake and eat it too that way. 😸 Mir went a similar direction. I think that's the secret beauty of Wayland. It doesn't actually push any particular stack requirements on people. |
The thing is pipewire and portals all ready exist but may be hard to use so for the things that can be done with wayland but require a shift in how a program works could be abstracted with a xlib emulator.
And with the protocols that exist out of the way more focus can be put on protocols that don't exist.
The text was updated successfully, but these errors were encountered: