Debian packaging for Firefox with V4L2-M2M hardware video decoding prioritized over VA-API.
This repository contains Debian packaging patches for Firefox that enable V4L2-M2M hardware video decoding on ARM platforms like the CIX Sky1/Orion O6.
- Prefer-V4L2-M2M-over-VAAPI-for-hw-decode.patch: Makes Firefox try V4L2-M2M hardware decoding before falling back to VA-API
- Fix-V4L2-M2M-timestamp-handling.patch: Fixes timestamp handling for V4L2 stateful decoders that don't set proper PTS/duration on output frames
- Add-V4L2-M2M-AV1-decoder-support.patch: Adds av1_v4l2m2m to the list of V4L2-M2M decoders (Firefox only had H264, VP8, VP9, HEVC)
- Enable-V4L2-M2M-AV1-hardware-decode-check.patch: Bypasses VA-API-based gfxVars check for AV1 when V4L2 is enabled
- Get Firefox source:
apt-get source firefox
cd firefox-*/- Apply patches from this repo:
cp -r /path/to/firefox-sky1/debian .
quilt push -a- Build:
dpkg-buildpackage -us -uc -bFor incremental rebuilds after patching (2 minutes vs 3.5 hours), see docs/firefox-incremental-rebuild.md.
The package includes /usr/lib/firefox/defaults/pref/sky1.js with:
media.av1.enabled= truemedia.hardware-video-decoding.force-enabled= truemedia.ffmpeg.vaapi.enabled= false (use V4L2-M2M directly)media.ffvpx.enabled= false (use system FFmpeg)
- System FFmpeg with V4L2-M2M decoders (ffmpeg-sky1 or similar)
- V4L2 video decoder device (/dev/video0)