4 ms·
I already force-enabled EGL in firefox 93 on Arch Linux with the 470.74 nvidia driver, and the performance is stellar compared with what it used to be. Before E
by bno1 5y ago
I already force-enabled EGL in firefox 93 on Arch Linux with the 470.74 nvidia driver, and the performance is stellar compared with what it used to be. Before EGL all desktop applications (including firefox) would stutter when a video was playing in firefox.
I did not encounter any bugs so far.
- __s 5y agoReading linked issue, it seems like you might run into issues after suspend/resume
- bno1 5y agoNow that you mention, I did have an issue after a suspend. All text was missing inside firefox, restarting it resolved the issue. But I keep my laptop plugged in and open 99% of the time with presentation mode enabled, so this is extremely rare for me.
- fghjfghk 5y agoIt seems to pretty consistently break after suspend, with the text looking like an ms-dos machine with bad vram. I enabled EGL in response to seeing your comment this morning, then found myself having to turn it back off after the very first suspend/resume.
- vzaliva 5y agoI thought video playback is not using OpenGL.
- ronjouch 5y agoVideo playback is accelerated in many apps, for example VLC 3.x defaults to it. In web browsers, things are more delicate because videos live within the complex context that is a webpage -with its own layer of hardware acceleration!-, and failures can be brutal depending on your browser, hardware and driver quality (crashes, video corruption, etc). The pain-in-the-ass-ness to enable it on a given browser varies with time and browser/OS and along regressions, stack changes, and maintainer priorities. From personal experience during the past years, it has never been great on Linux: - In Firefox, regressions have been frequent. - In Chrome, the feature is here but Google disables it at build time in their official builds (my personal intuition is that they do enable it for their Chromebooks, but they don't want to support the wild west of broader Linux configuration and old/broken driver fun). However, out of official Chrome builds, several distributions builds (Arch, Debian) of Chromium now enable it at build time, so it's possible to try to use it. So, it's finnicky to enable, but sometimes feasible, until it's no longer :D . To give it a try on a Linux box, the well-maintained Arch wiki is what you want (and these sections are mostly not specific to Arch): - Firefox: https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration https://wiki.archlinux.org/title/Firefox#Hardware_video_acce... - Chrome: https://wiki.archlinux.org/title/Chromium#Hardware_video_acceleration https://wiki.archlinux.org/title/Chromium#Hardware_video_acc...
- freebuju 5y agoBang on! This just summarizes the experience of browser video hardware acceleration on Linux. Marred with bugs and incompatibility issues. Regressions are the norm for Firefox in this regard according to my experience using an Intel card. Since announcing support for HW video initially on Wayland, Firefox has been off to the races on this [0]. Despite requiring lots of hacks to enable flags as you linked on the Arch Wiki, one of which now suggests disabling the sandbox for content processes and a major red flag, it somehow worked. For one reason or another [1], Firefox chose to lock the video drivers to the old i965 drivers instead of choosing the newer iHD driver. A weird decision that still applies to current builds. There have been incompatibility issues with video codecs. In my experience I can play h264 videos with hardware acceleration but not vp9 with the flatpak distribution. With vanilla package, both h264 and vp9 video is hw accelerated. I could also have sworn that video acceleration support has gotten worse over time since the introduction. I now get a weird artifact at the bottom half of the screen only when watching YouTube videos. [2] Video hardware acceleration is not entirely doomed on Linux. Even if Chromium does not want to make any move toward this direction in this century. Gnome web or rather Epiphany has stellar video acceleration support by using Gstreamer plugins. So it is possible to get hw video working on a browser. [0] https://mastransky.wordpress.com/2020/06/03/firefox-on-fedora-finally-gets-va-api-on-wayland/ https://mastransky.wordpress.com/2020/06/03/firefox-on-fedor... [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1619585 https://bugzilla.mozilla.org/show_bug.cgi?id=1619585 [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1724663 https://bugzilla.mozilla.org/show_bug.cgi?id=1724663
- AnssiH 5y agoBut the video is still usually rendered to an OpenGL surface, so there is interaction between them.
- vetinari 5y agoThere are two steps in the task of hw assisted video playback: 1) video decoding, i.e. going from compressed stream to uncompressed, offscreen video frame, and 2) compositing video with all the other surfaces the video playback application uses -- the decoded frames are usually put into OpenGL (or Vulkan, whatever) texture and then composed with the rest. When you do 1) on the GPU (well, not exactly GPU, but video decode block on the videocard, but that's not really important now), you end up with decoded frame in VRAM. Reading it back to system RAM, just to push it back to VRAM elsewhere is expensive (if the graphic is not UMA, then you go via PCIE back and forth) and unnecessary in the end, it is more efficient to have some way to directly share content from 1) into 2) already in VRAM. For that, both subsystems must support some way of sharing memory buffers. VA-API (for 1) and Mesa (for 2) support DMA-BUF, so that's the reason why it is used here.
- remexre 5y agoThough Vulkan has video decoding built in, so eventually everything will hopefully unify to use that and we can avoid needing multiple separate subsystems depending on vendor...
- happymellon 5y agoWhat codecs are part of the spec? Or is it just the interface, and nothing is actually guarenteed to work?
- remexre 5y agoIt looks like [0] there currently exist extensions for H.264 and H.265. I don't know anything about Khronos politics, but I expect there's nothing that would stop e.g. Google from proposing similar extensions for VP9, AV1, etc., besides the need to actually get it implemented. (The H.264 and H.265 extensions have only AMD, Intel, and NVIDIA employees listed as Contributors.) [0]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/chap39.html#VkVideoCodecOperationFlagBitsKHR https://www.khronos.org/registry/vulkan/specs/1.2-extensions...
- Arisaka1 5y agoWasn't there friction when using nvidia's proprietary drivers, as Nvidia's video acceleration depends on VDPAU compared to Intel/AMD using VA-API? The only reason I haven't made the full change for Linux yet is because I watch a lot of Twitch.tv and the CPU usage hits 45-50% on average even at 720p.
- bno1 5y agoYes, I tried to make video accel work but didn't succeed. There's a vaapi driver for vdpau, but it crashes when I try using it. In some firefox issue there was someone mentioning that video accel needs dmabuf, which needs gbm, so the 490 driver might solve the issue.
- oynqr 5y agoHave you tried the streamlink gui client? You can play streams in mpv/vlc/whatever that way
- Arisaka1 5y agoI thought they're trying to actively block it as it allowed people to watch without ads.
- Fnoord 5y agoPihole + uBlock Origin, I never see ads on Twitch or YouTube. I only see sponsors and affiliates in YT (and I guess Twitch as well, not watching much Twitch tbh). Which usually don't work in EU the one time I am interested (LTT...)
- opan 5y agoyoutube-dl (and forks) work with twitch (using mpv). I've never understood why people use streamlink instead.
- 0xFF0123 5y agoCan youtube-dl work with live?