defcom5-rockchip / rockchip-vaapi · update 2026-08-30

Firefox 4K, no green screen.

v1.0.11-defcom5.vp9align1 RK3588 / RK3588S ubuntu-rockchip BSP H.264 · HEVC · VP9

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.

Firefox playing the video as a solid green frame — the bug
Before 2970×2160 · vp09 · solid green
Same video decoding cleanly in 4K after the fix
After vp09 · HW ✓ · RDD ~9% CPU

Same Orange Pi 5B · same video · same 2160p — green box → clean 4K, hardware-decoded.

Install

  1. Confirm you're on the BSP kernel

    The fix uses the RK3588 VPU, which needs the vendor BSP kernel.

    check
    ls /dev/mpp_service   # must exist. "No such file" = mainline; guide doesn't apply.
  2. Install the packaged VA-API driver

    Includes the VP9 green-frame fix. Grab it from the release.

    bash
    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.

  3. Use the real Firefox .deb, not the snap

    The snap build won't hardware-decode here — use the mozillateam PPA build if needed.

    check
    firefox --version   # if it says "snap", switch to the .deb build
  4. Turn on hardware decode

    Wrap Firefox so it always gets the two required env vars:

    /usr/local/bin/firefox-hw
    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:

    about:config
    media.ffmpeg.vaapi.enabled                  = true
    media.hardware-video-decoding.enabled       = true
    media.hardware-video-decoding.force-enabled = true
  5. Launch through the wrapper

    Run firefox-hw (or point your dock/menu shortcut at it). No logout needed — it sets the env every launch.

  6. Verify on the video that used to break

    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.

    while it plays
    sudo fuser /dev/mpp_service   # a Firefox RDD process, single-digit %CPU = real HW decode

Keep it on the fast path

Optional · YouTube

Install 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.

Advanced · alternative to the wrapper

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:

bash
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.

What the fix is

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.

Layer-isolated: clean via 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.