Quality of life issue: firefox-vaapi prebuilt in Manjaro repo?

Hardware acceleration on by default? Hell yes.
Although manjaro decided to kill HW acceleration for certain codecs in mesa, I still would like manjaro to include vaapi patches to Firefox by default.
With the current Manjaro default firefox package I get in about:support:
FEATURE_HARDWARE_VIDEO_DECODING_DISABLE ( Firefox - ArchWiki ) so I am always forced to compile firefox myself from AUR firefox-vaapi. Could you please include those vaapi patches to Manjaro default build? Please?

while on the subject of Firefox, another quality of life thing I would like to ask is some sort of … MOZ_ENABLE_WAYLAND=1 introduced to some default profile, if you are using wayland session…
https://wiki.archlinux.org/title/Firefox#Wayland
maybe add somewhere some part of this script that comes with either wayland-session of firefox:

if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
    export MOZ_ENABLE_WAYLAND=1
fi

Seems like its a problem of your hardware (/ blacklisted).
FF is compiled with vaapi ability already.

image

(are you sure you have tried all the relevant toggles for enabling?)

…did you read the thread you linked?

media.hardware-video-decoding.force-enabled=true

When I compile the firefox-vaapi from AUR, I don’t have this problem. apparently also firefox in Arch does not have those patches included, thus the AUR firefox-vaapi exists in the first place…

Compositing: Websrender was present already by default yes. Meaning firefox itself was using some kind of HW acceleration, sure.
By default in addition to this I had this FEATURE_HARDWARE_VIDEO_DECODING_DISABLE present at the same time. Meaning video decoding from youtube and the likes, did not actually use HW decoding.

How does your about:support show this section?
Mine now with firefox-vaapi does look like this (where it’s not blocked/disabled):


Just because you “force-enable” it, doesn’t mean it actually works this way and doesn’t get blocked anyway…

Here VP9, H.264, were being used.

That section of mine looked like this now:

But … digging around the logs I was able to find failed vaapi initialization.

13:42:08 kded5[17703]: [RDD 17703: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Initialising VA-API FFmpeg decoder
13:42:08 kded5[17703]: [RDD 17703: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Failed to create VA-API device context

So maybe…

No such thing. Like with most packages available in the Manjaro repos, firefox is inherited from Arch. Occasionally it may be rebuilt for the Manjaro testing or stable branch if there is a security update. Other than that, the package is identical.

“Somewhere”? Where have you added it?

Are you sure that’s necessary anymore?

Take a look here. It may shed some light:

https://bbs.archlinux.org/viewtopic.php?id=281398

Post#18 summarizes the issue.

I myself added just MOZ_ENABLE_WAYLAND=1 to /etc/environment, because I don’t intend to jump between xorg and wayland and stick to the latter.

Sadly yes. Because without it, Firefox was using xwayland as “Window protocol” in about:support instead of wayland

It was linked in the first post.

Thing is … I just compiled firefox-vaapi, made sure to flip that media.hardware-video-decoding.force-enabled switch… and …

sure the webrender output is now missing the stated error (though unsure whether if previously it was being overridden by the config option as is supposedly the design)

But setting firefox to log and checking va-api … I get the same intialization and error messages:

kded5[1982]: [RDD 1982: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Initialising VA-API FFmpeg decoder
kded5[1982]: [RDD 1982: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Failed to create VA-API device context

So … I’m not sure if any difference has been made.

I can find a similar thread here:
https://bbs.archlinux.org/viewtopic.php?id=262124

But the option missing by the user there and used to ‘fix’ this no longer exists …

EDIT… re-investigated switches. layers.acceleration.force-enabled=true with firefox-vaapi appeared to get it going again. (on top of the current vaapi/webrender/etc options)
For some reason it seems the big browsers are always making this a moving target on linux.

[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Initialising VA-API FFmpeg decoder
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   codec vp9 : Google VP9
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: FFmpegVideoDecoder::GetAcceleratedFormats()
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Profile H264ConstrainedBaseline:
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format p010le            3         15
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Profile H264Main:
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format p010le            3         15
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Profile H264High:
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec h264 format p010le            3         15
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Profile VP9Profile0:
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec vp9 format nv12              3         12
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Profile VP9Profile2:
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     codec vp9 format p010le            3         15
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:     vp9 target pixel format is not supported!
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   Supported accelerated formats:
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:       h264
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:       vp9
[RDD 7502: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX:   VA-API FFmpeg init successful

To summarize:

  • PKG
    firefox-vaapi

  • about:config
    media.ffmpeg.vaapi.enabled = true
    gfx.webrender.all = true
    layers.acceleration.force-enabled = true

2 Likes

+if you have AMD GPU, then mesa with hardware decoders actually enabled (Manjaro default are disabled as far as I know) – mesa-git from AUR for example.
+if you are on Wayland, then somewhere in environment variables set MOZ_ENABLE_WAYLAND=1 ( can be in /etc/environment or just run firefox from command line with MOZ_ENABLE_WAYLAND=1 firefox (or edit the Firefox launch icon accordingly on your desktop/menu) )

Oh yeah. I am using nonfree.eu for the mesa+etc.