firefox-fourier: VAAPI/V4L2-request HW path requires 3 manual prefs on RK3399; ship as defaults #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
firefox-fourier: VAAPI/V4L2-request HW path not engaged with fresh profile — 3 additional prefs required
Summary
firefox-fourier 150.0.1-16does not engage the libva-v4l2-request-fourier HW decoder when launched with an empty user profile on RK3399 (fresnel / Pinebook Pro). The shipped prefmedia.ffmpeg.v4l2-request.enabled=true(patch0004-prefs-v4l2-request.patch) is necessary but not sufficient. Three additional prefs must be set manually before Firefox negotiates a VAAPI surface; without them it silently falls back to libavcodec software decode.Environment
linux-fresnel-fourier 7.0-14libva-v4l2-request-fourieriter38b7ac934e— vainfo lists all 10 profiles in one session, byte-exact bench verified (5/5 codecs)firefox-fourier 150.0.1-16Reproducer
Create an empty profile, set autoplay-on + file-origin-uniqueness off (so the test pages can load local video without click):
Launch firefox-fourier against an H.264 clip, capture MOZ_LOG:
Inspect
ff.log.child-*:No
Requesting pixel format VAAPI_VLD, noGot VA-API DMABufSurface, no PRIME import — Gecko bails before the VAAPI PDM.What unblocks HW (verified working)
Adding these three prefs to
user.jsand relaunching:Result with same H.264 clip, ~10s playback:
LIBVA trace from the parent process shows our backend reached,
vaInitializesucceeds, and the RDD child decodes via DMA-BUF PRIME zero-copy import. Sweep across all 5 codecs (with the extra prefs):video/mp2tsupport, never reaches PDMWhy I think the fix belongs in the package (not user config)
widget.dmabuf.force-enabledis the load-bearing pref on RK3399 / panfrost. Upstream Firefox auto-enables DMA-BUF on Mesa/iris and AMD/radv via GBM probe, but on the panfrost EGL stack the probe doesn't fire. Without the force, Gecko refuses to ask libavcodec for a VAAPI surface — the whole patch 3/4 routing never gets a chance to run.media.hardware-video-decoding.force-enabledlets Gecko pick HW even when its (Intel-tuned) cost heuristics say SW is faster. On RK3399 the heuristic is wrong (SW wins on memcpy throughput but loses on power and on real-playback FPS).media.ffvpx-hw.enabledis needed for FFvpx PDM's HW-capable variants to be selected for VP8/VP9.firefox-fourierper the package description is "V4L2 stateless HW video decode unlocked for mainline Linux Rockchip" — shipping the necessary pref set is consistent with that intent.Suggested fix
Extend
patches/0004-prefs-v4l2-request.patch(or add0006-prefs-rockchip-defaults.patch) to flip the three prefs totrueby default. They are currentlyRelaxedAtomicBoolstatic prefs inmodules/libpref/init/StaticPrefList.yaml:widget.dmabuf.force-enabled—value: false→value: truemedia.hardware-video-decoding.force-enabled— samemedia.ffvpx-hw.enabled— sameAlternative: ship them via
/usr/lib/firefox-fourier/defaults/pref/(lower-precedence default that user.js can still override).Risk / blast radius
MOZ_WIDGET_GTKin StaticPrefList.yaml).widget.dmabuf.force-enabled=trueon a host with no DMA-BUF support cleanly falls back (Gecko's DMABuf probe logs the failure and disables itself for that session — observed in earlier sweep before MOZ_ENABLE_WAYLAND was set).Logs / artefacts on fresnel
~/measurements/firefox-test/profile/user.js— repro profile (extra prefs added)~/measurements/firefox-test/logs/ff_{h264,hevc,vp8,vp9,mpeg2}.log.child-*— MOZ_LOG per codec~/measurements/firefox-test/logs/sweep.log— per-codec engagement summary~/measurements/firefox-test/libva_trace/h264.trace.*— parent-process LIBVA trace~/measurements/firefox-test/pages/play_*.html— minimal autoplay HTML per codecmarfrit/fresnel-fourier@e66c5c0Filed during fresnel-fourier post-iter38 measurement sweep (2026-05-15).