17 ms·
Gaming on Wayland
- smoldesu 5y agoThis is a neat and helpful comparison, but to me the issue was never really latency; it's more the fact that Wayland isn't neccesarily a direct upgrade over x11 in a lot of ways. Now, I can anticipate a number of responses to this. Firstly, a lot of people will (correctly) point out that x11 isn't a very good window server, and doesn't account for things like compositing, security or proper window management. Fair enough, they're all valid complaints. Wayland's solution to the dog bite seems to be pulling the teeth off the dog though, and I don't really agree with a lot of the design philosophy that went into making it. It reminds me of the recent GNOME releases, where their solution to inconsistent user theming and poor extension support was just to remove both features altogether. The trap that a lot of modern Linux developers seem to fall into is fragmenting their userbase under the guise of "finally fixing" some pain point or bug, and cutting off the users who disagree with them instead of Doing One Thing, and Doing It Well. Everyone is big-picture these days, wanting to take giant leaps for the Linux desktop experience without really considering how extensible or feature-complete their program is, and slamming the "f*ck it, ship it" button before it's ready. Admittedly, there's not an elegant solution to any of this. However, in this specific example, I think the best course of action would have been to just outright plagiarize Apple's Quartz. The development cycle for Wayland has been painful to say the least, and a lot of it came from wildly unnecessary breaking changes, vendor apprehension and arguments about ideology that really shouldn't have wasted our time in the first place. Now that it's "ready", there's a couple hundred asterisks following every feature, and the experience is generally shaky enough to keep me fearful of God and contented with x11, no matter how bad it is. Edit: Quick shoutout to PipeWire while I'm here, for actually creating a crowd-pleasing solution where nobody had to be thrown under the bus. They were given a herculean task of unifying 4 different audio standards, and they shipped it when it was ready instead of letting it languish in development hell. The result was fantastic, and distro uptake was almost immediate. If more projects were like PW, we wouldn't be here having this conversation right now.
- encryptluks2 5y agoThat is a lot of writing without linking to actual detailed issues you are having. It is complaining while making it near impossible for anyone to help you or figure out exactly what your issues are to try to resolve them.
- GhettoComputers 5y agoI read it fine, it removes/isolates a lot of useful features, and doesn't seem better in many real world use cases it is worst, like clipboard, screen warmers like redshift, global hotkeys, and VNC. I have tried these as addons, and they basically suck, and its complex to change them, and for what benefit? Some smoother graphics? I am on Linux, that is the least important thing. Basically if it doesn't give me real world benefits, I am unlikely to want to switch, and if it gives me more issues and less features for things that matter and isn't a drop in replacement it might as well be a scooter to my car.
- craftinator 5y ago> and for what benefit? Some smoother graphics? I am on Linux, that is the least important thing. This really sums up this side of the argument for me (though it doesn't address the security features of Wayland). If I want to watch an ultra high definition movie, or play a game, rebooting to windows is a miniscule price. Almost all of my work is done on Linux, and I value it because everything can be made to work, usually with little effort. Wayland adds some severe overhead to that work.
- GhettoComputers 5y agohttps://old.reddit.com/r/VFIO/comments/n3mjj3/native_vs_vm_benchmarks_using_passthrough_for_gpu/ https://old.reddit.com/r/VFIO/comments/n3mjj3/native_vs_vm_b... you can also do this. If you want to use wayland without issues GNOME works well if you wanna login to another session, VFIO will give you full windows game support (Win VM will use the GPU in windows driver mode). For anyone who wants a functional desktop on any DE, x.org is the best, and cannot be replaced currently by wayland in features or software compatibility.
- leni536 5y agoIt's cool and all, but many games I play don't have direct wayland support, and performance through xwayland is not great.
- GhettoComputers 5y agoTry VFIO for full Windows game support. https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF
- Jnr 5y agoI'm not so sure it works like it is explained in the article, or maybe I missed something. When using Gnome + Xorg + proprietary Nvidia driver with multiple monitors, with different refresh rates (144 and 60), they do not limit both to 60. Each monitor has different refresh rate and it is clearly visible that 144hz monitor is running correctly. And while Gnome is obviously running the compositor, I can turn off vsync for fullscreen game and remove fps limit and it does seem like it's not using vsync. Maybe I just don't notice it with my monitor and games anymore, but it certainly doesn't feel like I'm locked in and delayed with vsync. I read that Nvidia is adding some Wayland and Xwayland support for their proprietary driver but I haven't tested it yet. I wonder if I'll notice any difference there.
- zamadatix 5y agoIf the compositor isn't synchronizing rendering it'll work fine. Options there are GPU level vsync or no sync. I think these are the "workarounds for this problem but none of them can remove all problems at the same time." being referred to though at this point I forget the downside of GPU level vsync (tearing is the obvious downside of no sync). I don't remember if GPU level sync with compositor sync off solves VRR with a compositor on X11 though or if it did but with side effects. Been a while since I've messed with it.
- heftig 5y agoI think the entire desktop is running at the highest refresh rate, which is not only wasteful but can cause glitches when the lower refresh rates don't cleanly divide the highest.
- vbphprubyjsgo 5y agomyth.
- 3836293648 5y agoI've heard two conflicting explanations for this a) Both screens are receiving a 144Hz signal and your 60Hz screen just happens to accept this and drop the extra frames b) It works as long as it can actually hit 144Hz. As soon as anything drops it will drop to 60 instead of whatever is appropriate for a 144Hz screen. (This comes from the article on how mutter finally split the frame clock on Wayland)
- xrd 5y agoI'm getting increasingly frustrated with Wayland. I cannot share my screen with Zoom. I cannot use applications like gcolor2. It is often that I find an application just does not work with Wayland and I have no idea how to troubleshoot. I know a lot of people complain about Linux being much more complicated to use, but my experience for the last ten years is that Linux almost always works better than Windows and OSX for the basic 90% of things. But, Wayland has changed that for me entirely, now it feels like 50% does not work.
- hulitu 5y agoDon't use it then. At this stage Wayland looks more like an unfortunate experiment than a serious thing. Of course it is secure when it does nothing.
- seniorivn 5y agowho forced you to use Wayland? just switch back to x11 as most conservative users, it's like with winxp users, that survived vista years just don't forget to check if Wayland is up to your standard every year or so
- wanderingmind 5y agoMost new linux users don't know this and will give up., Ubuntu really shot in their foot when they made Wayland default in 21.04 and beyond. It's going to lose a lot of new users.
- GhettoComputers 5y agoNever had that issue myself, but it can crash and lose all my work? Wayland sounds like 100% regression on functionality for some lame graphic benefits.
- Spivak 5y agoIf the X.org crashes then you lose all of your work. Same as your compositor. The difference is that your WM is just a client to the X server and so can crash and restart without affecting other clients.
- kllrnohj 5y agoThe starting description of how displays work isn't entirely accurate. "The GPU sends some image to the display, beginning from the pixel on the top left and going through them line by line" This isn't necessarily accurate. On many SoCs (like the entire ARM ecosystem), it's the DPU that sends the image to the display, not the GPU. They are different hardware blocks. That DPU then also takes its input in the form of a list of buffers, not a single buffer, and does composition during scanout. Hardware overlays are very much alive & well, after all (hence their support in DRM/KMS, as well as Android's HWC HAL) Which in this case isn't pedantry and is really important, since we're talking about compositors. It's really important for power, performance, and features (assuming DRM'd video is a feature you want, anyway) for the window compositor to be able to farm out to the hardware compositor for various things.
- Lammy 5y agoIt's also not entirely accurate in the case of newer DisplayPort interfaces offering Panel Self Refresh / Panel Replay, where only the changed area is sent over the interface and static refreshes come from the panel's own memory https://vesa.org/press/vesa-publishes-displayport-2-0-video-standard-enabling-support-for-beyond-8k-resolutions-higher-refresh-rates-for-4k-hdr-and-virtual-reality-applications/ https://vesa.org/press/vesa-publishes-displayport-2-0-video-...
- kllrnohj 5y agoI thought about including PSR but the article's take is still mostly accurate in that you do still send pixel by pixel, row by row, in the case of a panel with PSR. Just the panel then remembers those pixels. On something like an ARM SoC where this is all unified memory, I couldn't entirely remember where exactly PSR sat. In that case you could argue the transfer is an atomic switch to a different buffer, but I thought the PSR memory was still a different segment even in that case.
- voldacar 5y agoSome questions from someone who is obsessed with getting 0 frames of latency: >the one frame of added latency with compositing and game VSync does not apply to Wayland I thought that on X with vsync disabled, a fullscreen game will write pixels directly to the framebuffer on the gpu without going through the x server / compositor, so there will be 0 frames of delay. Is this correct? > application contents can be put directly on the screen with the display hardware (which is called “direct scanout”. You may have heard the X related term “unredirection” used for the same thing, too). So on a machine running wayland, direct scanout would let a fullscreen game render directly to the framebuffer without any copying, compositing, color remapping, etc etc, just pure pixel data to the screen without any intermediate steps, right? And how does this work exactly, like does the program that wants to render to the screen have to call some API function to explicitly opt-in to direct scanout? Because most games, even the ones designed to run on linux, are not aware of wayland. Also I think something is up with the final measurements, on his 120hz monitor one frame of latency is about 8 ms, but the lowest he ever measured was 19ms so it seems like something is adding at least a frame of latency.
- heftig 5y agoThese days, a game has at least double buffering. This means one frame is currently displayed on the monitor (front buffer) and one frame is being drawn by the game (back buffer). In a classic "fullscreen game" situation, whenever a back buffer is finished, the game would configure the GPU's CRTC (the hardware that generates the data stream that goes to the monitor) to read from this back buffer instead. This turns the back buffer into the current front buffer and releases the old front buffer to act as the next back buffer ("page flipping"). When this happens without any synchronization with the monitor, the buffer can be changed in the middle of the frame, causing the characteristic tearing. With VSync, the game delays the swap until the monitor is between frames. With Wayland, the game swaps buffers with the compositor instead. Direct scanout means that the compositor will configure the CRTC to read from the game's front buffer. So this is really similar to the "classic" situation, except it involves a bit of inter-process communication. Otherwise, the compositor has its own set of front and back buffer, and the game's front buffer is copied (composited) into the compositor's back buffer first. So we have another buffer swap that has to be done, and this is what causes the composition lag. Whether direct scanout happens or not is transparent to the game, which does not need to care. Wayland enforces VSync by default, though there's a protocol being designed (`zwp_tearing_control_unstable_v1`) so a game can request asynchronous flipping.
- blindmute 5y agoI'm just not going to use it. X works fine and it will still be working fine in 10 years. I don't care or even know what purported benefits Wayland will bring, because I don't need any benefits over what X is already doing. You're just installing bugs by switching to this thing.
- jagrsw 5y agoPlaying fast FPS games under wayland/xwayland (and under Gnome/gnome-shell/mutter) is currently suboptimal. It's because gnome-shell will pass mouse moves only at the speed of your monitor refresh rate (see https://blogs.gnome.org/shell-dev/2021/12/08/an-eventful-instant/ https://blogs.gnome.org/shell-dev/2021/12/08/an-eventful-ins... for the explanation) I have a 240Hz monitor, so gnome-shell passes data to xwayland and then to applications at ~220Hz (as seen in the event-freq from https://blogs.gnome.org/shell-dev/2021/12/08/an-eventful-instant/ https://blogs.gnome.org/shell-dev/2021/12/08/an-eventful-ins...) So, my expensivish 1kHz (or even 8kHz mice - as these exist) will pass mouse movements with 4ms+ delay and only <240 times per second. Under Xorg, the xinput proto will pass data at the ~usb polling speed. For my 2kHz mouse, the tool (event-freq) shows ~1700 events / second. By the way, this ~220Hz is the speed at which gnome-shell passes data to clients (via XWayland or directly). The libinput accepts and passes data at correct 2kHz - and it's only gnome-shell aggregates it under wayland - this can be seen e.g. in the evhz tool (direct /dev/input access) vs event-freq tool (gnome-shell in wayland session, and xinput in xorg session).
- GhettoComputers 5y agoDamn, I thought gamers would find it useful. What is wayland even good for?
- kevingadd 5y agoFor crashing your games if you move the mouse too fast https://gitlab.freedesktop.org/wayland/wayland/-/issues/159 https://gitlab.freedesktop.org/wayland/wayland/-/issues/159
- GhettoComputers 5y agoThanks, now I know for sure the steam deck will just be another windows computer that came with linux. Even these assumptions about its use case were wrong. How could anyone in good conscious support switching to this? I can see noobs who think newer is better, but wow, horrid. Android is pretty smooth, I wonder if running the framework of it on linux could work lol.
- badsectoracula 5y agoThe descriptions in the article are very handwavy (especially on the X side) and they blame X for things it doesn't do yet while at the same praises Wayland for things... it doesn't do yet either (HDR). However the measurements at least are good (interestingly i was actually planning to do the exact same thing at some point using pretty much the same approach) and basically show what most people expect: X without a compositor (or with the compositor being disabled for fullscreen gaming, though note that not everyone may want to play games in fullscreen - e.g. i often play games in a window myself) and vsync disabled provides the best responsiveness. Also one thing that should be made very clear is that these are about KWin/X11 and KWin/Wayland, not X11 and Wayland in general. For example last time i checked XFWM allows disabling vsync in the compositor, which would certainly affect the results here. Also it isn't made clear (and actually i don't know myself) if KWin disabled the compositor for fullscreen Wayland applications or not: i'd guess it doesn't because under X in my laptop where i use KDE i had to explicitly disable it even for fullscreen games (there is a shortcut key for that), so i'd expect the same behavior in Wayland too.
- GhettoComputers 5y agoI wonder why there is so much hype with wayland, in use its mostly terrible unless you choose GNOME. Have these people ever used linux or xorg? Are they all just hyped from what it can do than what it does do, and will steam deck gamers also hype it up just reading that its faster?
- GeorgeWBasic 5y ago> I wonder why there is so much hype with wayland, in use its mostly terrible unless you choose GNOME Ah, but then you have two problems.
- GhettoComputers 5y agoMostly agree. GNOME sucks but it was good on my Surface Pro, its such a bad DE if you can't use touch. Rotation and interface were made for touch.
- sh4un 5y agoSometimes Linux is about just doing because you can, not because it makes any sense.
- vbphprubyjsgo 5y agoFirst of all, why would you want the game to interact with your display server what so ever (aside from alt+tab)? This is why full screen exists. >[In VRR] Whenever an application is slower than the displays maximum refresh rate the display will wait for the next frame before it updates the pixels and thus you don’t see any stutter Nothing so simple. VRR means your framerate fluctuates, which means you have stutter, by definition. Perhaps if you can bound it within a sufficiently small range that it wont be perceptible. If game framerates _did_ have predictably small variance, everyone would just generate the new frame right before VBI and have perfect (practically) latency free, no tear, no stutter, no motion blur (via BFI/CRT) rendering. >Not all displays have this functionality (yet) because it’s difficult to make it work well: In many displays with different refresh rates the brightness changes a lot, so if the refresh rate jumps around you’ll see the display constantly flicker in brightness. The brightness only changes if you are using Black Frame Insertion (on old monitors you can't use VRR at the same time as BFI; on newer ones this is supposedely fixed, i have no idea how or if it's valid). One big issue though is that VRR makes liquid crystal transitions even harder than it already is to happen fast and artifact-free. These measurements are bad for various reasons. There's also the obvious question: how does Wayland actually change the framebuffer? Direct scanout is a term I've never heard that could mean many things... I guess you get control over scanout, so you could render during VBI and have zero latency in this part of the loop, in which case why even measure it.