tl/dr: Because of what I read in the wiki, I tried to manually set up graphics drivers to get hardware acceleration, failed, and realized after a reinstall that it works out of the box.
This doesn’t sound like a problem and it isn’t.
But I just spent the better part of a day trying to get jitter-free video to work in Firefox and failed. Because of these entries in the wiki:
https://wiki.archlinux.org/title/Xorg#Driver_installation
The Linux kernel includes open-source video drivers and support for hardware accelerated framebuffers. However, userland support is required for OpenGL and 2D acceleration in X11.
In order for video acceleration to work, and often to expose all the modes that the GPU can set, a proper video driver is required
For Intel graphics on 4th generation and above, see Intel graphics#Installation for available drivers.
So I headed over to https://wiki.archlinux.org/title/Intel_graphics#Installation and started installing driver packages, VAAPI tools, etc… I’m sure I must have done something wrong here, cause I still couldn’t get jitter-free video in Firefox. And then I started doing stuff I found with google searches. And reinstalled twice and went through the entire process again…
In the end, I could verify that hardware acceleration actually worked on my system and was used by Firefox. But video playback was still incredibly choppy. I checked that my internet speed isn’t the problem, it was definitely something related to video decoding, since every time it jittered, CPU usage spiked.
I was about ready to give up and try it on Ubuntu, but I couldn’t bring myself to do it.
I tried one last time, reinstalled Arch and just started the video streaming site without doing anything at all to set up graphics (except enabling Wayland for Firefox). And the video runs fine! Hardware-acceleration in Firefox works, too. And I’m stumped as to why, cause my understanding from the wiki articles was that you need to set it up first.
Any ideas what I did or read wrong in the beginning? Is it because I’m not using Xorg for Firefox? Or because this is only necessary with a dedicated GPU?
Yeah it’s a bit confusing, but what’s going on there is that most desktop are 3D accelerated with OpenGL, and it’s a requirement for Wayland.
The 2D drivers are for Xorg, in particular without a compositor so that moving windows is 2D accelerated in the hardware. Except pretty much nobody needs this anymore. And it will in fact conflict with 3D acceleration when a compositor is added.
Nowadays, screen modes are handled by the kernel (Kernel ModeSetting), and all you need is the 3D drivers (typically, mesa, or the proprietary NVIDIA driver if you have NVIDIA hardware). The Xorg driver in the middle is no longer useful and it’s recommended to use
xf86-video-modesetting
which I think comes by default.i THINK the wiki is outdated, but im not sure. When i installed arch a couple of months ago it seemed to work out of the box as well(with a dedicated gpu).
As for the jitter in firefox, i have had the same problem on fedora kde(which i’m currently dailying), which happened only recently. I think its a bug in firefox, and while reinstalling arch and updating the system, a new update for firefox that fixed the issue also got installed.
I think you came to the right conclusion: it works better in native Wayland mode and apparently your default driver supports video acceleration. Firefox on Fedora has had Wayland support enabled by default for years now and while there were plenty of issues in the beginning, it runs very well now in my experience, so I don’t see any reason not to enable it.