Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 911941 - www-client/firefox shouldn't need USE=wayland for hardware video decoding
Summary: www-client/firefox shouldn't need USE=wayland for hardware video decoding
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL: https://forums.gentoo.org/viewtopic-p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-09 03:25 UTC by haarp
Modified: 2023-08-18 02:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description haarp 2023-08-09 03:25:50 UTC
Firefox  requires the wayland useflag to get functioning hardware video decoding, even under X. Tested on AMD hardware with amdgpu/radeonsi, VA-API and www-client/firefox-116.0:rapid (but older versions affected aswell)

If the wayland useflag is missing, it will report `Blocklisted by gfxInfo` and `FEATURE_FAILURE_VIDEO_DECODING_TEST_FAILED` in about:support (HARDWARE_VIDEO_DECODING section) and starting it with the `MOZ_LOG="PlatformDecoderModule:5"` env confirms during video playback that the string "VA-API" is nowhere to be found.

Also see https://forums.gentoo.org/viewtopic-p-8755739.html


This situation is confusing. It leads to a long evening of debugging only to hopefully find the forum thread above :) And of course the wayland useflag comes with more dependencies, (some of which) which are likely unnecessary under X.

Something in the build process seems to change when wayland is enabled. We should get to the bottom of this and fix hardware decoding without requiring the wayland useflag.

Thanks! :)
Comment 1 Joonas Niilola gentoo-dev 2023-08-12 06:02:10 UTC
Hmm 116 should have landed patches that makes it possible for hwaccel to work without wayland flag. It was indeed necessary before that. We also add a custom patch to enable vaapi on more AMD cards.
Comment 2 haarp 2023-08-12 16:13:14 UTC
I definitely had this issue with 116.0:rapid.
Comment 3 Joonas Niilola gentoo-dev 2023-08-12 16:55:02 UTC
Make sure your vaapi is working with "vainfo" in terminal. If yes, could you open an upstream bug about it? Let them know you've built Firefox with --enable-default-toolkit=cairo-gtk3-x11-only.
Comment 5 Martin 2023-08-14 21:26:19 UTC
That is claimed to be a duplicate of their bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=1843425

And that reads as:

Status: RESOLVED FIXED
Milestone: 117 Branch

... with a patch.


We're on: www-client/firefox-116.0

Hopefully fixed for the next release?

Thanks,
Martin
Comment 6 haarp 2023-08-14 22:18:47 UTC
Yes, it seems we made a mistake. The patches only landed in 117, not 116. Gonna wait and see.
Comment 7 Joonas Niilola gentoo-dev 2023-08-15 05:26:57 UTC
(In reply to haarp from comment #4)
> Done: https://bugzilla.mozilla.org/show_bug.cgi?id=1848631

Thanks!


(In reply to haarp from comment #6)
> Yes, it seems we made a mistake. The patches only landed in 117, not 116.
> Gonna wait and see.

It was _supposed_ to work in 116 but obviosly it's a bug it didn't. A follow-up fix landed in 117. I also couldn't find the upstream bug because it was RESOLVED already.

Anyone can toss the upstream patch into /etc/portage/patches to get it working right now (if it applies). If there's a reason to touch firefox-116, I'll include the patch, but if not I'll wait for 117 where it's natively included.
Comment 8 Joonas Niilola gentoo-dev 2023-08-17 06:05:16 UTC
116.0.3 is out with linux-related fixes so I'll be looking to package that today with upstream fixes for vaapi. But I also found an about:config option to try and force-enable vaapi even with this 116.0 release, 
  media.hardware-video-decoding.force-enabled -> true

could you try setting that, restart your browser and see if vaapi works before updating to 116.0.3?
Comment 9 haarp 2023-08-17 08:09:58 UTC
I had already tried that, it didn't make a difference. I'm going to try a non-wayland 116.0.3 build later
Comment 10 Larry the Git Cow gentoo-dev 2023-08-17 09:18:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8282ad68d79e95724306dfd4cd597c5bab7b71d3

commit 8282ad68d79e95724306dfd4cd597c5bab7b71d3
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2023-08-17 09:16:34 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2023-08-17 09:16:34 +0000

    www-client/firefox: add 116.0.3
    
     - include latest upstream vaapi/hwdec patches from upcoming 117 and
       118 releases.
    
    Closes: https://bugs.gentoo.org/911941
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest               |  101 ++
 www-client/firefox/firefox-116.0.3.ebuild | 1466 +++++++++++++++++++++++++++++
 2 files changed, 1567 insertions(+)
Comment 11 haarp 2023-08-18 02:28:40 UTC
116.0.3 looking good without wayland useflag :) Thanks!