Files
marfrit-packages/arch/libva-v4l2-request-fourier/PKGBUILD
T
marfrit 243e05ca5e libva-v4l2-request-fourier: c332d34 -> 9898331 (LIBVA-2 close)
Follow-up to libva PR #7 (merged as 9898331).  Without that commit,
H.264/VP9/AV1 profiles never got advertised on Pi 5 mixed deploys
(rpi-hevc-dec primary + daedalus_v4l2 alt) because the profile-
enumeration probe in any_fd_supports_output_format only walked
rkvdec / hantro / rpi-hevc-dec / vpu981 fds.  ffmpeg vaapi -i
h264_test.mp4 on higgs bailed with "No support for codec h264
profile 578" before the LIBVA-1 per-codec dispatch could even fire.

9898331 extends the fds[] from 5 to 6 with video_fd_daedalus as
the 6th slot (HAVE_DAEDALUS_V4L2-gated, -1 fallback otherwise).

Effect on higgs once this lands: vainfo lists VP9Profile0 +
AV1Profile0 + H264* alongside HEVCMain, and ffmpeg -hwaccel vaapi
-i h264_test.mp4 routes through the daedalus daemon (via 'd' kind
in request_switch_device_for_profile).

Both packages: pkgver 1.0.0.r380.9898331 (count from rev-list),
pkgrel reset to 1 (new upstream pin).  Backward-compatible on
RK3399/3588 — the new fd slot is gated by HAVE_DAEDALUS_V4L2 *and*
video_fd_daedalus >= 0, both false in those deployments.

Companion to the prior LIBVA-{1,ABI} bumps that landed in marfrit-
packages PRs #43, #44.  Together they close the Pi 5 stack: boot ->
modules-load.d loads daedalus_v4l2 -> daedalus-v4l2.service starts
daemon -> libva opens both decoders -> ffmpeg -hwaccel vaapi
enumerates all codecs from both -> routes per-codec.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 17:08:07 +02:00

97 lines
4.6 KiB
Bash

# Maintainer: Markus Fritsche <fritsche.markus@gmail.com>
#
# libva-v4l2-request-fourier — VA-API backend for V4L2 stateless decoders,
# multiplanar fork. Successor to the predecessor experimental package
# libva-v4l2-request-ohm-gl-fix (tarball + 18-patch stack); this package
# tracks the campaign fork's git history directly, so iteration sweeps
# (DEBUG removal, follow-up bugfixes) land in a clean linear log.
#
# Campaign: ~/src/libva-multiplanar/ (iter8 close 2026-05-06) plus
# ~/src/fresnel-fourier/ which carried the fork to iter38b — multi-device
# probe so a single libva session serves all 5 codecs (rkvdec H.264 +
# HEVC + VP9, hantro MPEG-2 + VP8) plus a bounds-check fix for
# MAX_PROFILES. Pinned below.
# Fork repo: https://git.reauktion.de/marfrit/libva-v4l2-request-fourier
# Bootlin upstream: https://github.com/bootlin/libva-v4l2-request
#
# Build target: fermi LXC actrunner-aarch64-hertz via marfrit-packages
# Gitea Actions (path=arch/libva-v4l2-request-fourier triggers the
# libva-v4l2-request-fourier-aarch64 job — wire up alongside the existing
# ffmpeg-v4l2-request-git job in .gitea/workflows/build.yml).
# Alternative: boltzmann via his subagent + marfrit-publish.
pkgname=libva-v4l2-request-fourier
epoch=1
_upstreampkg=libva-v4l2-request
# Pin the fork tip. de27e95 = "v4l2: log error_idx + failing ctrl id
# on S_EXT_CTRLS failure" — Phase 8.13 diagnostic that surfaced the
# real root cause of the libva→daedalus_v4l2 request-completion
# timeout (turned out the EINVAL libva was logging was a harmless
# H264/HEVC probe; actual VP9 stateless control SET worked all along).
#
# Prior pin (7ac934e) was iter38b — fresnel-fourier multi-device probe
# + MAX_PROFILES bounds-check fix. de27e95 added the daedalus_v4l2
# probe slot (b5b3acf), the meson option gate (2146341), and the
# S_EXT_CTRLS diagnostic (de27e95 itself). c332d34 (LIBVA-1) added
# the per-codec dispatch: rpi-hevc-dec + daedalus_v4l2 both probe each
# other as alts, VP9/AV1/H.264 route to daedalus via new 'd' kind,
# HEVC stays on 'p' (rpi-hevc-dec). 9898331 (LIBVA-2) completes that
# by adding video_fd_daedalus to any_fd_supports_output_format's probe
# array — without it, H.264/VP9/AV1 profiles never got advertised on
# Pi 5 mixed deployments (rpi-hevc-dec primary, daedalus alt) and
# ffmpeg bailed with "No support for codec h264 profile 578" before
# the per-codec dispatch could fire.
_commit=989833114a7708ad999dc68309cbc181d9913bdb
# Project version from meson.build (1.0.0) + commit count + short sha,
# matching the ffmpeg-v4l2-request-fourier convention. Recomputed at
# build time by pkgver() below; the static value here is a placeholder
# so AUR-style consumers see something coherent before src/ exists.
pkgver=1.0.0.r380.9898331
pkgrel=1
pkgdesc="VA-API backend for V4L2 stateless decoders (multiplanar fork — fourier umbrella)"
arch=('aarch64')
url="https://git.reauktion.de/marfrit/libva-v4l2-request-fourier"
license=('LGPL2.1' 'MIT')
depends=('libva' 'libdrm' 'systemd-libs')
makedepends=('meson' 'ninja' 'pkgconf' 'git')
provides=("${_upstreampkg}=${pkgver}" 'libva-driver')
conflicts=("${_upstreampkg}" 'libva-v4l2-request-ohm-gl-fix')
replaces=("${_upstreampkg}" 'libva-v4l2-request-ohm-gl-fix')
source=("git+https://git.reauktion.de/marfrit/libva-v4l2-request-fourier.git#commit=${_commit}")
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}/${_upstreampkg}-fourier"
printf '1.0.0.r%s.%s' \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short=7 HEAD)"
}
build() {
cd "${srcdir}/${_upstreampkg}-fourier"
# meson_options.txt only exposes 'kernel_headers' — leave it empty to
# use system /usr/include kernel UAPI headers. No per-codec toggles.
#
# b_lto=false: override arch-meson's wrapper default of `-D b_lto=true`,
# which the makepkg.conf OPTIONS=(..., !lto, ...) line does NOT actually
# override (arch-meson hard-codes b_lto=true). The hand-built reproducer
# from issue #17 shows: LTO/ICF kernel-folds per-codec helpers and HEVC's
# multi-control-struct chain (SPS+PPS+DECODE_PARAMS+SLICE_PARAMS) gets a
# wrong helper-instance pulled in at vaEndPicture → segfault. The 4 other
# codecs (single-control-struct) tolerate the folding by accident.
arch-meson build --buildtype=release -Db_lto=false
meson compile -C build
}
package() {
cd "${srcdir}/${_upstreampkg}-fourier"
meson install -C build --destdir "${pkgdir}"
install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
install -Dm644 COPYING.LGPL "${pkgdir}/usr/share/licenses/${pkgname}/COPYING.LGPL"
install -Dm644 COPYING.MIT "${pkgdir}/usr/share/licenses/${pkgname}/COPYING.MIT"
}