defcom5-rockchip / rockchip-vaapi · update 2026-08-30
Odd-resolution VP9 — non-16-aligned widths like 2970×2160 (Academy-ratio video) — used to hardware-decode into a solid green frame. Root-caused to a surface-stride alignment bug, fixed, and packaged as a one-line apt install. No more building the driver by hand.
Same Orange Pi 5B · same video · same 2160p — green box → clean 4K, hardware-decoded.
The fix uses the RK3588 VPU, which needs the vendor BSP kernel.
ls /dev/mpp_service # must exist. "No such file" = mainline; guide doesn't apply.Includes the VP9 green-frame fix. Grab it from the release.
cd /tmp wget https://github.com/defcom5-rockchip/rockchip-vaapi/releases/download/v1.0.11-defcom5.vp9align1/rockchip-vaapi-driver_1.0.11+defcom5.vp9align1_arm64.deb sudo apt install ./rockchip-vaapi-driver_1.0.11+defcom5.vp9align1_arm64.deb
Deps complaint? sudo apt install -f. Or download from the Releases page.
.deb, not the snapThe snap build won't hardware-decode here — use the mozillateam PPA build if needed.
firefox --version # if it says "snap", switch to the .deb buildWrap Firefox so it always gets the two required env vars:
sudo tee /usr/local/bin/firefox-hw >/dev/null <<'EOF' #!/bin/sh export LIBVA_DRIVER_NAME=rockchip export MOZ_DISABLE_RDD_SANDBOX=1 exec /usr/bin/firefox "$@" EOF sudo chmod +x /usr/local/bin/firefox-hw
Then set these in Firefox about:config:
media.ffmpeg.vaapi.enabled = true media.hardware-video-decoding.enabled = true media.hardware-video-decoding.force-enabled = true
Run firefox-hw (or point your dock/menu shortcut at it). No logout needed — it sets the env every launch.
Play Simple Minds — Don't You (Forget About Me) at 2160p. Right-click → Stats for nerds: codec reads vp09… at 2970×2160@25 — the exact odd-width stream that used to render green.
sudo fuser /dev/mpp_service # a Firefox RDD process, single-digit %CPU = real HW decodeInstall enhanced-h264ify and tick only "Block AV1." RK3588 hardware-decodes VP9 but not AV1 — this keeps 4K on the VPU instead of dropping to software.
Instead of firefox-hw you can bake the env into the launcher — but /usr/share/applications/firefox.desktop is overwritten on Firefox updates, so copy it to your user dir and edit that:
mkdir -p ~/.local/share/applications sed 's|^Exec=/usr/bin/firefox|Exec=env LIBVA_DRIVER_NAME=rockchip MOZ_DISABLE_RDD_SANDBOX=1 /usr/bin/firefox|' \ /usr/share/applications/firefox.desktop > ~/.local/share/applications/firefox.desktop
Then fully quit and reopen Firefox from the menu. If your build's Exec= path differs, adjust it.
The driver exported its NV12 surface at a 16-aligned stride. For a coded width that isn't a multiple of 16 (2970 → 2976), the RK3588 Mali/EGL DMA-BUF importer expects a 64-aligned pitch, so the chroma plane landed at the wrong offset → green. The fix aligns the export stride to 64 (2970 → 3008), matching the canonical Rockchip pattern.
mppvideodec (MPP core) & software; green only via VA-API → the bug was the shim, not the VPU or the file.
Verified: Orange Pi 5B (RK3588S) · panfork Mesa 23 · Firefox 154 · kernel 6.1.0-1027.