Firefox with VA-API for brave Fedorans

A rocket propelled butterfly? – https://bugzilla.mozilla.org/show_bug.cgi?id=1772028

It’s been a long journey since the first VA-API implementation in Firefox. Two years ago Firefox 77.0 come to Fedora with accelerated video playback on Wayland which was more a tech preview than a working solution.

Since then X11 support was added, fixed many bugs, AV1 decoding was implemented so we can claim VA-API code as mature enough to enable it for testing in Firefox Nightly 103. As we don’t want to scare peaceful Ubuntu users and grandmas watching their favorite show, VA-API is enabled in Nightly channel only and stock Firefox 103 won’t be shipped with that.

But ‘Real Men‘ wants more challenge. ‘Quiche Eaters’ can use polished software, LTS distros or even Mac. That’s nothing for adventurers running on the edge. Thus new Firefox updates (Fedora 35, Fedora 36) has VA-API enabled by default ahead of upstream to get what you asked for, brave Fedorans.

Along with a bunch of upstream VA-API backports I also added a fix for mozbz#1735929 to make life easier for those who did a life mistake with NVIDIA hardware. I hope you’ve got a lesson and your next card will be AMD.

And how to fruitify it? It’s embarrassing it doesn’t need any complicated, cryptic, powerful, unforgiving and dangerous edits of Firefox about:config preferences, setting env variables on terminal or midnight vows. If VA-API is configured property Firefox just takes it and claims at about:support page.

VA-API is enabled

More details are available at https://fedoraproject.org/wiki/Firefox_Hardware_acceleration

11 thoughts on “Firefox with VA-API for brave Fedorans

  1. Nice work!

    How will this work for ubuntu (etc.) in the future? Will the Va-api packages be inside the snap/flatpak package? Or will it have some sort of dependency and installed during the installation of firefox?

    Just interested how the “normal” user will get vaapi.

    Like

    1. I hope Firefox 104 may enabled it by default if everything goes well. You need working VA-API environment for it which depends on your scenario. I’m not sure how VA-API is supported by snap/flatpak, that depends on actual distro or flatpak runtime.

      Like

  2. Thanks for the article.

    I am a non-Fedora user, but I use Firefox developer edition (currently on 102.0b9), I think I cannot have access yet to that experimental feature, am I reading it correctly?

    Or is there a way for me to enable that? I think I have all the relevant packages installed, here’s the output of vainfo (using the Intel iHD driver for Intel(R) Gen Graphics v.22.4.2):
    https://paste.sr.ht/~jman/50c780f913063b8898f7f8e0c18858b661db19e6

    Like

  3. Hello Martin, I’m reaching you here because I saw you’re (one of the very few?) who works on Firefox for Linux.
    Have you seen the regression that has occurred exactly since v.102?

    https://bugzilla.mozilla.org/show_bug.cgi?id=1780972
    and:
    https://bugzilla.mozilla.org/show_bug.cgi?id=1781167

    reported and actively followed by users in Mint Mate:
    https://forums.linuxmint.com/viewtopic.php?f=47&t=376770
    was also reported here for the Solus distro:
    https://discuss.getsol.us/d/8515-firefox-102-hangs-from-time-to-time/18

    Seems to affect much older machines. Like a few others in Linux Mint forum, I’m running Mate no 3D compositing, old Core 2 Duo, integrated G41 chipset GPU (ancient i915) Firefox at default tuneables, all hardware acceleration off, software rendering and am hitting the issue

    Like

  4. I don’t see any VAAPI in about:support, neither in Nightly 109, nor in the Fedora build. Is it broken? It would be nice to have it upstream.

    And another question: I’m curious what kind of Firefox patches Fedora is carrying. Is there some place I can read about these, or should I just look at the Fedora rpmspec?

    Like

  5. Just for the record, this works also for brave “Ubuntuans”. 😉 Tested with Firefox 102.7.0esr on Kubuntu 22.04 LTS with FF from the Mozilla PPA because the FF snap variant is “not so nice”. :-P.

    I can confirm that “MOZ_DISABLE_RDD_SANDBOX=1” is no longer necessary. In FF 102+ only “media.ffmpeg.vaapi.enabled = true” has to be set. That should be enough. And so far it looks great. Will try / test this during the next time a little more closely.

    Many thanks @Martin Stransky for your great work in this matter!

    Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started