ohm task (b): Brave reached vaCreateContext, blocked on multiplanar libva

End-to-end status of browser HW decode:

- Built bootlin libva-v4l2-request-git from AUR with local patches:
  - HEVC stripped (old V4L2_CID_MPEG_VIDEO_HEVC_* names; kernel renamed
    them to V4L2_CID_STATELESS_HEVC_*; ohm has no HW HEVC anyway)
  - Missing #include "utils.h" in h264.c added
  - config.c probe extended to try both OUTPUT and OUTPUT_MPLANE types
  (patch archive parked on ohm at ~/fourier-test/libva-patches/)
- vainfo enumerates MPEG-2 + H.264 profiles (Main/High/ConstrainedBaseline/
  MultiviewHigh/StereoHigh) via LIBVA_DRIVER_NAME=v4l2_request
  LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video1.
- Brave with --enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,
  AcceleratedVideoDecodeLinuxGL + --use-gl=angle --use-angle=gl-egl picks
  up VAAPI in the GPU process and calls vaCreateContext on the video.
- vaCreateContext fails. Root cause: bootlin library was written for
  Allwinner sunxi-cedrus (single-plane V4L2); context.c / picture.c / v4l2.c
  hardcode single-plane paths that don't match Rockchip hantro multiplanar.
  Profile probe is now multiplanar-aware (my patch), but buffer setup and
  frame-submission paths aren't.

Decision: browser HW video decode on ohm parked until a multiplanar port
of libva-v4l2-request exists. Non-browser paths (gst v4l2codecs, ffmpeg
v4l2-request) are unaffected. Patch set on ohm is a starting point for
anyone picking up the multiplanar rework; also a candidate for a future
marfrit libva-v4l2-request-fourier PKGBUILD once multiplanar works.

Also updated the Status line with fermi CI success: first push built,
signed, and published ffmpeg-v4l2-request-git-2:8.1.r123329.b57fbbe-1
on packages.reauktion.de in one shot.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-24 20:52:09 +00:00
parent 670f2ad6ee
commit 7301067108
+53 -4
View File
@@ -160,10 +160,12 @@ picks up rkvdec2 patches.
**Status 2026-04-24**: ohm reachable; steps 1 + 2 + 3 + 4 done for H.264 on
ohm (GStreamer `v4l2slh264dec → waylandsink` at 7 % CPU with zero-copy
dmabuf NV12). Step 5 scaffold landed
(`marfrit-packages/arch/ffmpeg-v4l2-request-git/` on `main`, commit
`9994c4e`, unpushed — fermi CI build + ohm install still to run).
Immediate next: push, build, install, validate the ffmpeg path.
dmabuf NV12). Step 5 scaffold pushed; fermi CI **built + signed +
published** `ffmpeg-v4l2-request-git-2:8.1.r123329.b57fbbe-1-aarch64` on
first push. Immediate next: install on ohm via `pacman -Sy`, validate the
ffmpeg v4l2-request hwaccel path, compare CPU / fps to the GStreamer
numbers. Task (b) (Brave HW decode) blocked on multiplanar
`libva-v4l2-request` rework — see section below.
### Baseline numbers (2026-04-24, ohm, `bbb_1080p30_h264.mp4`)
@@ -203,6 +205,53 @@ Reading:
position advances 1:1 with wall clock for the full 62 s run — zero
drops, full 24 fps delivery.
### Browser HW decode (Brave / Chromium) — partially wired, library-blocked
Attempted as task (b) on 2026-04-24. State reached:
- Installed bootlin `libva-v4l2-request-git` from AUR with local patches
(patch archive on ohm: `~/fourier-test/libva-patches/fourier-local.patch`):
- HEVC stripped from the build (`h265.c` + `h265.h` removed from
`src/meson.build`, HEVC case in `picture.c` returns
`UNSUPPORTED_PROFILE`). The library's HEVC UAPI binding predates the
mainline rename (`V4L2_CID_MPEG_VIDEO_HEVC_*``V4L2_CID_STATELESS_HEVC_*`)
and ohm has no HW HEVC anyway.
- Missing `#include "utils.h"` added to `src/h264.c` (pre-existing bug
the library grew into as compilers got stricter about implicit
declarations).
- `src/config.c` probe extended to try both `V4L2_BUF_TYPE_VIDEO_OUTPUT`
and `V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE` when enumerating profiles.
- `vainfo LIBVA_DRIVER_NAME=v4l2_request LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video1`
enumerates profiles: **MPEG-2 Simple/Main + H.264 Main/High/ConstrainedBaseline/
MultiviewHigh/StereoHigh**. Library is up and talking to the hantro
decoder.
- Brave launched with `--enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,AcceleratedVideoDecodeLinuxGL --use-gl=angle --use-angle=gl-egl --ozone-platform=wayland`
visibly activates VaapiVideoDecoder in the GPU process argv and attempts
VA context creation on the video file.
Failure mode:
```
ERROR:media/gpu/vaapi/vaapi_wrapper.cc:2407] vaCreateContext failed,
VA error: operation failed
ERROR:media/gpu/vaapi/vaapi_video_decoder.cc:1219] failed creating VAContext
```
Root cause: the bootlin `libva-v4l2-request` was written for Allwinner's
sunxi-cedrus (single-plane V4L2). The probe patch gets it past format
enumeration, but `context.c` / `picture.c` / `v4l2.c` still hardcode
single-plane buffer setup, `VIDIOC_S_FMT` paths, and request-API frame
submission in ways that don't match a multiplanar decoder. A real port to
multiplanar is a side project — the upstream is effectively unmaintained
(last meaningful commit years ago; Collabora talked about a replacement
but it has not shipped).
Decision: **browser HW video decode on ohm is parked until a multiplanar
`libva-v4l2-request` rework exists**, either ours or someone else's.
Non-browser HW decode (GStreamer `v4l2codecs`, FFmpeg via
`ffmpeg-v4l2-request-git`) is unaffected and works. The patch set on
ohm is a useful starting point for anyone who wants to pick up the
multiplanar port.
### Acceptance criterion
**1080p @ 30 fps, no dropped frames.** Applies to every device and every