Hi, I’m pretty new to the Linux world and am a bit confused atm as I’m looking into the hole rabbit hole that is Xorg vs Wayland. I’ve found a lot of different explanations on the matter, but they are kind if hard to understand for me.
Can anyone explained the above mentioned terms as easy as possible?
And also how do Xorg an Wayland compare? I do get that Wayland ist supposed to be the new standard, but why does it need Wayland exactly, what are the benefits?
And as I have an all AMD build (AMD Ryzen 5 2600x, Radeon RX 590), what would work best for me (Xorg or Wayland)?
Comments
fox_in_unix_socks • 11 points • 2023-09-21
To cover some of the X/Wayland stuff:
We’ve had the X display server for decades now, which at a most basic level just provides a way to render rectangular windows on a screen. The X server handles a lot of things, but it doesn’t natively support transparency effects and vsync, which are important for a lot of people.
This is where you could insert a compositor into the mix. Applications would communicate with the X server, the X server would pass the information on to a compositor, where various effects can be applied, and then the compositor would pass back the frame ready to be rendered.
The X display server is old, and it really does show its age. There are fundamental issues with its design that would be near impossible to work around without starting the project back from the ground up. One example of this being multi-monitor support.
The X server renders all of the content for all monitors into one large rectangle, before splitting that rectangle up and sending the data off to where it needs to be. This creates an issue with mixed refresh rate monitors and monitors that need individual scaling levels. As far as X knows, everything is just one giant frame, so every monitor ends up synced to one refresh rate, and scaling the content in the frame can only be done across the entire frame all at once.
This is where Wayland steps in. Wayland isn’t a Display Server like X11, but instead just describes a way for applications to communicate with a compositor directly. Wayland attempts to fix many of the problems of X, and for most it’s at a stage of being a complete replacement (and even a solid improvement in some areas).
Although there are still plenty of apps that don’t play nice with Wayland (most Windows-centric Electron apps seem to hate playing nicely with screen sharing, for example). Also Nvidia drivers are an infamously bad combination with Wayland. For quite a while Nvidia actually refused to support a thing called GBM which is basically a necessity for Wayland to work.
track me
jonoxis • 1 points • 2023-09-21
That does clear a lot of stuff up for me, thank you :)
Can say something on the performance and input latency between X11 and Wayland? I know that Wayland hast forced vsync (mailbox) which is supposed to be able to turn off soon. Appart from that I heard that Wayland is always frame behind of X11 (always has 1 frame of input lag). Is that because of the forced vsync or this an extra thing on top of that?
MasterGeekMX • 6 points • 2023-09-21
You may already heard a Linux OS is made of a bunch of programs working together. Some work in parallel while others work in a stack, with one being the basis of the next. Well, the latter is the case when you want to have graphical apps on your computer.
The most basic interaction form you can have with a Linux box is the terminal: simple white text over a black background. It may be antiquated but it is functional because you don’t need a GPU or anything fancy to get it working, as you can get it working by the serial port or even remotely via the network. I mean, this guy used Linux with a 1930’s electromechanic teletypewriter.
But using only the terminal can get you so far, as you can only render text. In order to draw anything interesting on the screen, you need the so called “display server”, with X and Wayland being the two Linux use. X is the “old’n’reliable”, but with time is getting more older and less reliable. Wayland aims to be a modern replacement for X. it is not based on X at all, instead it is a complete rework from the ground up on how to do things.
Because display servers only offer ways of drawing stuff onscreen, you need a program on top of it to use that in order to manage windows, and that is the job of a Window Manager. They keep track of how many windows you have open, which one is the focused one, where on the screen they are, and take all that info to the display server in order to be drawn onscreen. Some window managers can be used standalone as a minimalist yet streamlined experience (like OpenBox, i3wm, IceWM, etc.), while others are an integral part of a more complete desktop environment (like KWin from KDE Plasma, Mutter from GNOME, Xfwm from Xfce, and so on).
Now, compositors change a bit on definition if we are talking about X or Wayland. In the X world, they refer to a piece of software that works alongside a window manager to add fancy effects like animations, transparency, and make windows wobble like if they were made of jelly when you drag them around. Popular ones are picom and compiz. In the Wayland realm, it is the name given to a window manager itself as wayland requires that the window manager takes care of that instead of a separate companion program.
Let me do a small tangent and talk about a concept we need to clear: implementation. In computing, an implementations is when you take something abstract but defined, like an idea, a protocol, an algorithm, etc, and make it into something real. Take for example web browsers. The concept of one is abstract: a program that can visualize web pages. In contrast, Firefox, Chrome, Safari, and others are implementations of the idea of a web browser, each doing it slightly different but in the end adhering to the core idea.
That being said, both X and Wayland are protocols (established ways of doing something, in this case, render stuff on the screen). X is the protocol (currently in version 11, reason why you often see X11 listed as the folder where the settings for it reside), with X.org being the “reference” implementation (the default one that everyone uses and takes as model). There are others like Xenocara and the former XFree86, but those are fringe or obsolete. In contrast, Wayland is only a protocol. No reference implementation, as the window managers are the ones implementing the protocol themselves. Big projects like GNOME and Plasma are making their own implementation, while others more smaller are using wlroots, developed by the folks at the Sway window manager (basically the i3wm but for Wayland).
If you want to dive deeper, the wikipedia article on the subject is quite good, and you can read the links to the X and Wayland pages aswell if you like:
https://en.wikipedia.org/wiki/Windowing_system
Now onto your hardware:
X is the establishment, and the only option if you want to use certain desktops, as for the moment only GNOME, Plasma, and some window managers like Hyprland and Sway support wayland (Xfce and MATE are working on it, but they are slow paced projects so don’t wait on them).
Wayland is still under development, and although it is quite usable, it has some sharp edges here and there, but every day they are getting smoothed out. One of the caveats of Wayland is that some software strongly depends on X (like NVidia drivers), and although Wayland provides a backwards compatibility module called Xwayland, it can cause troubles sometimes (like with screen sharing and stuff).
In the end, if it works for you, use them. I for example use GNOME under wayland on my laptop, but KDE Plasma under X.org on my desktop, and I don’t have problems. Try them out, and check if some has a feature that breaks the deal.
Original_Soft6035 • 3 points • 2024-04-13
Thanks a lot man. Not op but this really cleared up for me. I know my comment doesnt add anything to the discussion but if this makes you feel better I wanted to say it. I write long comments a lot of times (in my previous accounts) and always felt happy when someone appreciated me. Thanks again!
[deleted] • 3 points • 2024-10-09
thx man, im from brazil learning english and linux and our text is easy to understand and direct to the point :D
jonoxis • 2 points • 2023-09-21
Wow a million thanks to you! This is the best explanation on this matter I’ve heard so far and you made it really easy to understand for someone new to Linux :)
ColonelRuff • 2 points • 2025-01-09
Thanks man! I know its really old comment but this is the Best explanation I have read on this topic. Really cleared a lot of things for me.
AutoModerator • 1 points • 2023-09-21
There’s a resources page in our wiki you might find useful!
Try this search for more information on this topic.
✻ Smokey says: take regular backups, try stuff in a VM, and understand every command before you press Enter! :)
Comments, questions or suggestions regarding this autoresponse? Please send them here.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.