Firefox 75 on Wayland now to have full WebGL, working VA-API acceleration
phoronix.com
phoronix.com
[1] https://www.bountysource.com/issues/55506502-add-va-api-hard...
> (In reply to lilydjwg from comment #30)
>> I'm glad to here that, but what about support for Firefox on X11? Is it given up?
> Hardware decoding is platform independent so it generally works under X11 as it's implemented as Bug 1616185.
> For whole playback chain see Bug 1610199 what's needed to be done fox X11.
> I was closing this one as it refers to HW decode only, not the playback.
> The overall video playback is tracked at Bug 1210726.
Current downsides: worse support for screen recording/sharing (e.g. not supported in Skype), a bug in the compositor (e.g. GNOME Mutter) can bring your whole session down, not-as-good NVIDIA support (also depending on the compositor).
I have been using Wayland for two years or so an wouldn't want to go back. I do miss wide screen sharing support, because I am working remotely and Skype is the primary means of communication.
permit setenv { HOME LC_ALL TERM XDG_RUNTIME_DIR WAYLAND_DISPLAY } greg as root
and I can just run 'doas wireshark'.
Eg previously I would execute DISPLAY=:0 mplayer foo.avi to play remotely or ssh -X root@foo xcalc to display xcalc on my local monitor but execute on rhost
What if i want this as a feature? Does wayland allow this per app?
A malicious application on your host can still do anything at the executing privilege level (read .ssh, inject malware into .bashrc) but can’t sniff your gksudo password
I know this is not how security works (a theoretical hole is often as bad as a practical one) but it's a bit like saying you should have antivirus software, to which I might say: where are the viruses?
People care about docker escapes so they’re getting more difficult, at least.
Edit: Plus, I’d rather $app_i_dont_fully_trust be sitting in a container rather than on my host. And no, not running apps i don’t fully trust is not something which is at all viable for me.
True for Gnome, no issue for KDE. Their arguably better design decisions led them to proceed slower though.
I hear other configurations have more issues.
Core Xlib is entirely ignorant of vsync or anything relating to completed frames. It's an immediate mode rendering model in that everything you draw just gets thrown on-screen by the display server whenever.
Compositors were then bolted on w/redirect and damage extensions and basically randomly snapshot the client window contents before compositing a desktop frame, within that snapshot you can easily have tearing of half-drawn updates.
Further extensions and hacks have tried to fix this like Present and frame clocks from the gtk/gnome folks, but it's all opt-in by X clients and non-uniformly supported by compositing WMs or not at all in classical non-compositing WMs where the X server just draws things directly on-screen as the protocol requests arrive from clients.
You clearly don't know what you're talking about.
I tried using it over a decade ago on XOrg and it didn't seem to do anything useful...
[0] https://www.x.org/releases/X11R7.6/doc/libXext/dbelib.html
Edit:
It's definitely there in the Xorg xserver [1]. My memory is fuzzy as it was a long time ago but I distinctly remember wasting a day trying to use this extension and becoming frustrated with its ineffectiveness. Maybe it was just for lack of any vsync mechanism to schedule the swap?
[1] https://gitlab.freedesktop.org/xorg/xserver/-/tree/master/db...
1.:https://www.phoronix.com/scan.php?page=article&item=gnome-32...
In fact Weston since 2015 has had a clever delay algorithm that allows clients to hit the very next frame if they sync to presentation-time feedback:
https://ppaalanen.blogspot.com/2015/02/weston-repaint-schedu...
(And Sway has a configurable delay; since Sway is so simple to render, the recommended max_frame_time value is 1ms — i.e. the compositor has the very last millisecond before vblank to composite, and everything before that is for the apps.)
Not really fair to compare with non-vsync systems — tearing is completely unacceptable ;)
I still don't understand why I need Wayland.
So, if you think about what the tearing is it makes sense, your getting a partially drawn frame because the application didn't provide the full frame in time for the vsync, waiting to display the update for and additional one or two frames simply to assure a complete frame can only slow things down.
If you are coming from i3 the move to sway is a no-brainer and works great (sway is wayland only). Firefox, thunderbird, Libreoffice all work great and look great, i.e. sharp when you need scaling for example. Sway is to thank for base work they did for other distros like a wayland clipboard protocol all the others are using.
Second comes Gnome. No issues. Gnome laid the gruntwork of porting gtk3 to wayland which works great.
Third maybe KDE. Still two years to come. KDE plasma is suffering from arguably better design decisions like client side decorations vs. Gnome serverside decorations but as many users use GTK based apps those GTK apps do not yet play nicely with the KDE design decisions. As such the brave KDE folks have to implement things themselves while those relying on GTK are done. QT is fine with wayland but not everything is QT.
That's all only true if you are not using NVidia hardware.
It may work great, but it's not as well packaged by/for upstream as i3.
I recently started running wayland+gnome (rather than i3) on my Ubuntu 18.04 at work - because less bad support for fractional scaling looks a bit better on my two 24" with different dpi.
But there didn't appear to be a "no effort" way to install sway (yet). Especially not with automatic (security) patches.
I'm hopeful it'll be in 20.04?
They'll generally be frozen at the point 18.04 was frozen - so api and versions from 2017 or so. With 20.04 around the corner, I'd rather wait than faff around.
I was thinking of waiting another year to jump as I'm having no issues with i3, what are the advantages?
Then there are the wayland advantages: very little screen tearing if any, no blanking the screen when connecting to a new display, better security properties.
There's disadvantages as well. There's no xdotool support, and if you want to use any sophisticated keybindings or remapping keys, you'll be forced to rely on Sway's configuration language to do that for you. On i3 I was able to bind ctrl_r to right click, but that is — as far as I know — not possible on sway without rewriting the libinput event stream, which is very painful.
There's no xdotool support
Have you looked at ydotool?https://github.com/ReimuNotMoe/ydotool
Also, do you know about the "i3 Migration guide"?
Also not exactly maintained
>Since Jun, 2019, I have little time to maintain this project because I'm striving to start an undertaking (instead of working 996).
Personally, the one real gain I've read about previously is no tearing when watching videos or scrolling fast and security improvements. Also now these Firefox performance improvements. But that's about it.
Are there any other benefits that a normal user would see?
Finally, my Ubuntu box has screen tearing all the time. I'm on good hardware with pretty standard 1080p monitors so I've been absolutely baffled that screen tearing is so frequent in standard desktop use.
I think Wayland is supposed to have better support for various DPI settings and mixed DPI settings.
I would be surprised if this weren't as true in 2030 as it is in 2020.
The OS with the best isolation primitives is probably Solaris. It would be hilarious if 2020 Solaris was still better than 2020 Linux.
Sure, if your adversary is some literal hacker. But you also have to worry about legit companies that use aggressive "analytics". VSCode most likely logs keystrokes. It would suck if it also logs keystrokes that you type into other applications.
Your point still stands, though.
* Fractional scaling of monitor outputs
* Multi-touch gestures for e.g. switching desktops
* Security sand-boxing of apps
* Tear-free video
As the original link shows, though, the architecture has much better abstractions for software engineers to work with so developer quality-of-life is improved, too.Because X is deprecated. The question isn't Why switch to Wayland, but When. You have mentioned some benefits too.
About shorcuts, I also like having the GUI there to configure the keyboard layout (like set capslook as Escape) rather then edit xorg configs. Also it makes sense to have a section for Global shortcuts and a section for regular shortcuts. If you do not know what Global shortcuts are maybe you don't need them.
Probably GHOME users complain about Firefox's "about:config" because it has too many options and their brain can't fit that many options. The point is the distro gives you some defaults and if you are competent(you know to read and use google) you can change the distro defaults. if you are not competent you find the distro that looks cool and use it as the developers intended and adapt to it not it to you.
Anything hidden in Tweaks or about:config like settings can be classed as "here be dragons".
That's one reason GNOME has less settings (not the main one). Less Settings = less to test, less to support.
I am a developer and I understand the part of more coptions and more code paths means more things to test, but with robust code it is not a big deal. Imagine the wallpaper would be hard coded because the developers are lazzy and won't test with a different wallpaper. As a person with dsabilities I contributed a few patches and it would suck to have them rejected because I would need to bring a proof that there is a majority of users that need those things addressed.
Anyway i was not complaining about GNOME removing options or hidding them but complaining that some insecure person for some reason had to complain about KDE into a topic about Wayland support.
I don’t think it’s supposed to be an upgrade from the users perspective, just a new display driver. Maybe a few new native things like rotatable windows etc which if exist in X11 are probably emulated.
X11 by modern standards is a shitshow of dirty hacks, I spent the weekend researching ‘how can I not have notifications pop over my lock screen using openbox and any composite manager’ and it ended up in the top hard basket. Also repeat this story for screen tearing, DPI, acceleration, weird bugs, etc etc.
Wayland is maturing which is nice, but you really won’t notice many changes, but youll be much cleaner / less buggy in the long run.
Edit: to me, it seems like wayland isn't fundamentally better. It's just a "new and improved" version of the same system architecture paradigm X is built with. I'd be more interested in something that follows the 'everything is a file' paradigm that made Unix so great to begin with.
This isn't true.
This is kind of a joke answer but the real answer is: This depends on the compositor you're using. So Wayland may not be network transparent, but it's possible to implement equivalent functionality on another layer of the stack.
On the other hand it turns out streaming video is super easy, entirely agnostic of the actual rendering stack in use, and not really that expensive in terms of bandwidth anymore.
regarding the video streaming: meh, i can do X forwarding out of the box with just ssh, mostly out of the box, no other software required.
- Apps which use toolkits like GTK and QT will “just work” since they did the porting grunt work.
- X11 apps can run unmodified using XWayland but this just runs an X.org server and directs the output.
But the literal answer is “no”. Wayland and X11 are incompatible and apps will need to port.
If you use Nvidia gpus don't bother.
This results in some ugly behavior of WebEx for instance, which blocks video in its WebRTC calls, since it assumes that "CPU is too weak" to handle it. Cisco never fixed this issue.
https://mastransky.wordpress.com/2020/03/03/webgl-and-fgx-ac...
1) GPU 1 writes to CPU RAM, GPU 2 reads from CPU RAM
2) GPU 1 writes to GPU 2 RAM via PCI Express (DMA between devices)
3) GPU 2 reads from GPU 1 RAM via PCI Express (DMA between devices)
Since GPU 2 is most often an Intel iGPU, that happens to also be CPU RAM.
Linux finally has a graphics stack on which this isn't as much of a problem, and it's received enough adoption that Firefox is now making changes for it. And on that news you decide to comment that Wayland is a tech demo? This news should tell you it's completely the opposite! Wayland seems to be finally delivering.
1) Wayland isn't a replacement for all of X.org. It's a replacement for much of X11, the protocol. "Wayland is just a protocol" - there's no wayland binary on your computer like there is an xorg binary. All the problems/limitations people commonly perceive with Wayland are actually problems/limitations within Wayland implementations like Mutter (Gnome) or KWin (KDE) and lacking application support. There's really not that much that "Wayland" as a project could deliver as it's just a protocol [1]!
2) Replacing something like your entire graphics stack requires a widespread, coordinated effort to unify the various Linux distro's under it. That widespread coordinated effort is not actually possible in the (by "design") extremely fragmented Linux market. The only approach is to slowly let Wayland implementations evolve, and there we have it.
Hot take: Wayland will not fully replace X11 the coming 10 years. There is no fundamental solution to the two problems above. Many popular desktops (Xfce, Cinnamon) have no plan to support Wayland at all. Some don't even want to. In the future, there will be choices for graphics stacks on Linux leading to further fragmentation.
[1]: The projects that should deliver here are: Gnome, KDE, other open source desktops. Although I think using Gnome with Wayland is superior in many ways to X11, it still has certain quite major shortcomings. It's also application toolkits: Qt and Gtk work luckily, but Electron is waiting for some Chrome renovations before supporting Wayland, and then there's stuff like Wine and Java where the refactor/reward balance simply doesn't favor them. And sometimes applications have to be updated to stop relying on using hardcoded X11 stuff, and use agnostic Gtk/Qt/Freedesktop functionality.
There's a lot of history with X11 that we have to move away from, and the incentives and coordination only allow for slow movement.
No they are deep philosophical problems. The lack of necessary protocols that allow a unified implementation for things like screen sharing, hotkey daemons, window managers, xdotools or clipboard managers are the problem.
As long as there is no standardized way to do essential tasks that are typical for a desktop use case Wayland will eternally cause problems.
But there's no standard interopability with a standard X11 socket anymore. There's interopability with KWin and Mutter and wlroots and a bunch of other things through FreeDesktop standards (Wayland being among them).
You might consider it a philosophical problem that Wayland is not trying to solve all the problems that X11 tried to solve. You might attach a lot of philosophical value to that architecture. But Windows, macOS, ChromeOS and Android seem to be doing extremely well on an architecture that is a lot less like X11 and a lot more like Wayland.
> screen sharing:
- Security problem, untrusted access to display, explicitly denied by design.
> hotkey daemons
- Security problem, untrusted input, denied by design.
> window managers
- Messing about with windows without authorization, denied by design.
> xdotools
- Untrusted input.
> clipboard managers
- Untrusted access to clipboard.
Either the compositor application has to do it, or it has to delegate it to a trusted application.
So yeah, deep philosophical problems. If you wanted Wayland to work exactly like X11 it won't because that is explicitly against its security design.
Wayland is trying to do less than X11. The things you mention are not solved at the display protocol level on any platform but X11. Your security strawman never comes in to play.
Yeah, it's not like anyone needs that functionality to do work or anything. In fact, why not just refuse to boot the computer in the first place? That'll stop a lot of security problems.
Sometimes I boot my Linux native installation as a raw disk VM in Windows 10 with VMware Workstation and then use Windows's remote desktop. That is surprisingly more responsive and a better overall experience than either VNC, X2Go, or X11 forwarding can deliver. I'd love to see something on par for Linux desktops.
Why is this taking so long on the """Wayland desktop"""? Screen sharing/remote desktop is a problem that Wayland as a protocol does not try to solve (this problem is also not solved by the display protocols on any other platform for the record). And because of that, it requires central coordination in the Linux world to standardize solve. And central coordination in the Linux world always turns out to be a total mess.
In practice if all/most implementations are buggy, I think it's fair to lump them all together and say that Wayland (as used by the software actually running on my machine) has problems. You know the meme about how whenever someone tries Desktop Linux and has trouble, someone pops up and says "just use this other distro, with this particular set of software and this exact configuration, and it'll just work!"? Wayland feels like that. Sure, if I want to go all in on GNOME (on Fedora), it'll probably work. Sure, if I use Sway with the right set of compatible programs it'll work. But... I could also just stay on X where all my programs work now with no tinkering, where I can drop in any screenshot program, any clipboard manager, any screen sharing program, any keyboard configuration/emulation tool (I'm really fond of xdotool), and it will work.
Fair enough. I think it's a bit unfair to label the collective failure of the Linux community/ecosystem to actually make change happen as "Wayland has problems". But it's true that in 2020 you will still lose use cases when using anything Wayland based.
Wayland will never replace the X11 based workflows you describe though, because it isn't X11. Although X11 has a lot of fundamental problems, flexibility isn't one. And some flexibility you will have to give up moving to any Wayland based desktop.
Yah, you don't get to be a hero, and product arch, etc for making X work better. I have yet to see a convincing argument that X couldn't have been made more secure by bolting on another opt-in extension. Then once in place, like GL ES, you start deprecating all the features used by basically no-one.
So I can totally see the appeal for a clean break from having to maintain strict backwards compatibility with a stack that has its roots in the 1980's.
This makes it really hard to implement in current browser architectures without resorting to a solution that causes you to e.g. have to copy video frames from GPU memory to main memory, causing performance drops and stutter. With Wayland, it's "easier" to actually access the GPU's video frames directly (like on Windows and macOS), enabling this implementation.
Also this "news" does not tell that Wayland is finally delivering. It tells us that the Wayland implementation of Firefox has reached feature party to X11 for very specific subsystems.
This is about being able to play web videos without causing you to lose CPU performance and battery life. This has not really been supported on Linux or X11, whereas it has been supported on Windows and Mac by almost all browsers for over a decade.
The fact that this will be officially supported by a major browser vendor on Wayland first should tell you something.
All video players on X11 have VDPAU support since ages. This is a Firefox specific problem which could be solved more easy on X11.
> The fact that this will be officially supported by a major browser vendor on Wayland first should tell you something.
It just tells me that Mozilla/Firefox really doesn't care about Linux because it took them 14 years since VDPAU works reliably on Linux to implement it.
I think you should reconsider how easy it is to smoothly get an accelerated video buffer from a specific GPU component into an already heavily GPU optimized and dynamic web page. Web browsers have a lot more complicated graphics rendering problems to solve than VLC does.
This is simply not true. I've regularly used hardware accelerated video on linux+X11 for over a decade. There are multiple ways for video playback to be accelerated, including hardware-specific video acceleration libraries like VDPAU and VAAPI, and hardware-agnostic acceleration using OpenGL (GLX). All of these options accelerate generic video playback steps like colorspace conversion, scaling. Most of these methods also provide direct hardware decoding of specific video codecs (h.264, mpeg1/2, vc1, wmv3).
Also, just like Wayland, hardware accelerated compositing (2D, not 3D!) of windows has been possible with X11 for more than a decade. Even my ancient window manager (Enlightenment DR16!) can manage X11's compositing.
Wayland was never required for any of these features.
> they don't have complicated browser UI problems
While not as complex, they do have a UI that overlays the video. However, the complexity of the UI doesn't affect video acceleration. Using libvdpau as an example, the X11 client provides[1] a separate child window[2]:
>> VDPAU expects to own the entire drawable [...] it is recommended that applications create a dedicated window for the presentation queue target, as a child (grand-child, ...) of their top-level application window.
The video playback happens in its own sandbox. Other non-video part of the UI should use their own child windows, isolated and independent of the video playback. The UI's child windows can be as complex as necessary, including overlaying the video[1]:
>> Applications may also create child-windows of the presentation queue target, which will cover any presented video in the normal fashion. VDPAU implementations will not manipulate such child windows in any fashion.
The child windows can even be alpha blended[3] with the video or other UI layers.
Reading back video data (to implement features like CanvasRenderingContext2D.getImageData()) is easy: read the video window like you would read any X11 Drawable.
What, exactly, was the "complicated UI problem" that supposedly wasn't possible to implement in X11?
[1] https://vdpau.pages.freedesktop.org/libvdpau/group__api__win...
[2] "window" is used in the X sense: a drawing context on an X server: https://www.x.org/releases/X11R7.6/doc/libX11/specs/libX11/l...
[3] X Render Extensison, section 8 https://www.x.org/releases/current/doc/renderproto/renderpro...
By the way, if you would read the actual base of the story here, you would know why it took Firefox's Wayland refactoring to actually pull this off [1].
[1]: https://mastransky.wordpress.com/2020/03/03/webgl-and-fgx-ac...
mpv and kodi have no trouble rendering hardware accelerated video on Linux under X11 though
both Kodi and MPV have UI overlays that are composited on top of the video. Also, hardware decoding APIs (vdpau, vaapi...) are mostly unrelated to rendering - see for instance https://github.com/NVIDIA/vdpau-hevc-example/blob/master/mai...
In order to run Firefox under Wayland, you have to be able to run Wayland session in your compositor (Clutter in case of Gnome). AFAIK, currently no compositor has working/stable Wayland support with NVidia proprietary drivers due to GBM/EGLStreams thing[1]. At the same time, open-source Nvidia driver Nouveau is in a terribly poor condition. Which, hopefully, may change soon[2][3]. Thus, if system is running off the Nvidia graphics card with proprietary drivers, there's no way to use Gnome Wayland session and Firefox 75 acceleration at the moment [corrected and specified]. Please correct me, if I'm wrong.
A separate case is where the system uses Intel/AMD graphics card and drivers, and NVidia is used for render offloading (Optimus/PRIME/Bumblebee). This may be a laptop with discrete GPU or Virtual Machine setup with GPU passthrough. Since I don't have such a setup, I can't check if it works with Firefox 75 [corrected]. But there're some discussions[4] on the matter and experimental works on implementing NVIDIA VDPAU-VAAPI wrapper[5].
[1] https://blogs.gnome.org/uraeus/2019/04/03/preparing-for-fedo...
[2] https://www.forbes.com/sites/jasonevangelho/2019/12/06/nvidi...
[3] https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-O...
[4] https://old.reddit.com/r/archlinux/comments/a94zzj/state_of_...
My previous machine had an NVIDIA GPU and despite all the great work, nouveau was almost unworkably buggy. The proprietary NVIDIA drivers did not work with Wayland at all. I bought an AMD card, Wayland worked with open source drivers and everything was butter-smooth.
I now use a NUC with an Intel GPU. Similarly to ADM GPUs, it works great with open source drivers.
I support AMD and Intel for their open-source efforts, but still hold hopes for GTC 2020 announces.
† AMD Radeon VII was super overpriced and unavailable in my area, and it still released nearly two years later.
AMD Radeon is an amazing choice in low/mid GPU market segment though.
Do you use it for a specific professional application, or do you simply want the best performance ?
Not intended to be snarky just purely curious.
- Gaming. I expect playing current AAA-titles on 4K@75-100fps. And, oh boy, I'm an avid Linux gamer (Valve Proton/DXVK)! This is probably the most GPU performance consuming activity in the long term;
- GPGPU/ML/Hashcat/Pyrit/mining. Some ML hobby/educational projects, occasional hash-cracking, mining and other fun activities. From time to time I stumble (on Github or elsewhere) at weird, but interesting experimental CUDA/OpenCL-accelerated solutions for a variety of tasks. Hey, even my terminal emulator is GPU-accelerated nowadays[1];
- Video transcoding. Encoding 4K+ video content in the background, while keeping up with my general activity. Occasionally lending my GPU to a (professional video guy) friend for CUDA-accelerated DaVinci Resolve for A/V post-production.
I certainly don't upgrade GPU every two years, more like 3-5 years for every decently improved generation. As for Nvidia, going from 16nm EV (Pascal) to (supposedly) 7nm EUV[2], might yield in up to +40-60% performance comparing to current gen Turing; so I'm pretty hyped to upgrade from the already aging GTX1080Ti with no ray-tracing. Or perhaps AMD will be finally able to pull out some ground-breaking GPU performance boost with their so-called "Big Navi", based on the new RDNA2 architecture. But I'm afraid that it will be a competitor for the current gen of Nvidia graphic cards, and not future ones. In any case, 2020 promises to be interesting for GPU/APU market. As usual, I will look at the specifications, benchmarks and price tags — and make my consumer choice.
[1] https://github.com/alacritty/alacritty
[2] https://www.sammobile.com/news/win-samsung-nvidia-7nm-proces...
When you are using wayland best is to bet on a roling distro as of now.
btw I use archlinux /s