Firefox Nightly 86 and VDPAU / Nvidia

Hello all,

in order to attempt a new start with this topic while also trying to avoid as much confusion as possible:

How will it be possible to get hardware accelerated video playback to work in Firefox in a system with the Nvidia 390 proprietary driver?

To be clear:

  • No Intel/Nvidia hybrid system
  • No Intel onboard solution

Configuration:

  • Graphics card:
Graphics:  Device-1: NVIDIA GF116 [GeForce GTX 550 Ti] vendor: Gigabyte driver: nvidia v: 390.141 
           alternate: nouveau,nvidia_drm bus ID: 01:00.0 chip ID: 10de:1244 
           Display: x11 server: X.Org 1.20.10 compositor: picom v: git-dac85 driver: nvidia display ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 3600x1080 s-dpi: 96 s-size: 953x286mm (37.5x11.3") s-diag: 995mm (39.2") 
           Monitor-1: DVI-I-2 res: 1920x1080 hz: 60 dpi: 82 size: 598x336mm (23.5x13.2") diag: 686mm (27") 
           Monitor-2: DVI-I-3 res: 1680x1050 hz: 60 dpi: 90 size: 474x296mm (18.7x11.7") diag: 559mm (22") 
           OpenGL: renderer: GeForce GTX 550 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 390.141 direct render: Yes 
LIBVA_DRIVER_NAME=vdpau
VDPAU_DRIVER=nvidia
  • Mozilla environment:
MOZ_X11_EGL=1
MOZ_ACCELERATED=1
MOZ_WEBRENDER=1
  • Firefox installed package:
local/firefox-nightly-de 86.0a1.20201223-1
    Standalone Web Browser from Mozilla — Nightly build (de-DE)
  • Firefox about:config options:
gfx.canvas.azure.accelerated    true
gfx.canvas.azure.backends   skia
gfx.content.azure.backends  skia
gfx.webrender.all   true
gfx.webrender.enabled   true
gfx.webrender.layers-free   true
gfx.webrendest.enabled  true
gfx.webrender.blob-images true
gfx.xrender.enabled true

layers.async-pan-zoom.enabled false
layers.accelerate-all   true
layers.acceleration.force-enabled   true
layers.force-active true

webgl.force-enabled true
webgl.msaa-force    true
layers.acceleration.force-enabled true
layers.gpu-process.enabled true
layers.gpu-process.force-enabled false

media.ffmpeg.vaapi.enabled true
media.ffmpeg.dmabuf-textures.enabled true
media.ffvpx.enabled false  

If I start firefox-nightly with MOZ_LOG=PlatformDecoderModule:5, I get the following log while trying to play a video from HTML5 Video Test Page | Tek Eye :

[Child 17734: Main Thread]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[Child 17734: Main Thread]: D/PlatformDecoderModule Sandbox RDD decoder rejects requested type
[Child 17734: MediaSupervisor #2]: D/PlatformDecoderModule Sandbox GPU decoder rejects requested type
[Child 17734: MediaSupervisor #2]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[Child 17734: MediaSupervisor #2]: D/PlatformDecoderModule Sandbox RDD decoder rejects requested type
[Child 17734: MediaSupervisor #2]: D/PlatformDecoderModule Sandbox GPU decoder rejects requested type
[Child 17734: MediaSupervisor #2]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[Child 17734: MediaSupervisor #2]: D/PlatformDecoderModule Sandbox RDD decoder rejects requested type
[Child 17734: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox GPU decoder rejects requested type
[Child 17734: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[Child 17734: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder rejects requested type
[Child 17734: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox GPU decoder rejects requested type
[Child 17734: MediaPDecoder #1]: D/PlatformDecoderModule Initialising FFmpeg decoder.
[Child 17734: MediaSupervisor #1]: D/PlatformDecoderModule Agnostic decoder rejects requested type
[Child 17734: MediaSupervisor #1]: D/PlatformDecoderModule Sandbox RDD decoder rejects requested type
[Child 17734: MediaPDecoder #2]: D/PlatformDecoderModule Initialising VA-API FFmpeg decoder
[Child 17734: MediaPDecoder #1]: D/PlatformDecoderModule FFmpeg init successful.
[Child 17734: MediaPDecoder #1]: D/PlatformDecoderModule AudioTrimmer[0x7fecec16e420] ::PrepareTrimmers: sample[0,23219] no trimming information
[Child 17734: MediaPDecoder #3]: D/PlatformDecoderModule AudioTrimmer[0x7fecec16e420] ::HandleDecodedResult: sample[0,23219] (decoded[0,23219] no trimming needed

Right after that, the Firefox tab with the video in it crashes, and it asks me to file a crash report.

At a first glance, it looks like Firefox is initializing the FFmpeg VA-API decoder which apparently fails on the VDPAU configuration described above.

Remark: Hardware acceleration in chromium and mpv works without errors.

Does anybody know what is missing in order to get Firefox working?

IIRC, NVIDIA proprietary drivers doesn’t support VAAPI

With a translation layer, they do. Just refer to Hardware video acceleration - ArchWiki .

Here’s what vainfo says when the Nvidia driver is installed together with the translation layer:

vainfo: VA-API version: 1.10 (libva 2.10.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG4Simple            :	VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD

Looks like only Mozilla does not care, apparently also because some morons spammed the bug: 1210729 - Add VDPAU or NVDEC hardware decoding support on Linux