Hi10P + Main10 enumeration: kernel/HW ready, ffmpeg-v4l2request userspace plumbing missing — Option B applied iter39 #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
iter39 Phase 7 (2026-05-17) shipped the H.264 Hi10P + HEVC Main10 sub-profile support to the backend then dropped them from
RequestQueryConfigProfiles(commit6bc12fe, Option B). Goal of this issue: track when upstream conditions allow re-enabling the profiles.Why dropped
The Rockchip HW + the mmind v7.0 kernel can both do 10-bit H.264 (RK3399 + RK3588 datasheets advertise it; kernel ctrl table registers
cfg.max=HIGH_422_INTRAwithbit_depth_luma_minus8==2path live inrkvdec-h264-common.c:196;rkvdec_h264_decoded_fmts[]includesNV15/NV20; Karlman v6→v10 patch series merged). But our backend ANDkdirect(ffmpeg-v4l2-request-fourier) BOTH fail equivalently on Hi10P input:EINVALand writes 0 bytes.-vf format=p010le) decodes the same fixture to 222 unique luma values — content is real.Karlman's series cover letter explicitly notes "to fully runtime test this series you may need ... FFmpeg patches" (lwn.net/Articles/950434). The userspace half of the new V4L2 uAPI controls (NV15 stride handling, image_fmt-aware decoder selection) hasn't landed in
ffmpeg-v4l2-request-fourieryet.What's retained in our backend
All iter39 infrastructure stays in tree, just not advertised:
codec.c::pixelformat_for_profile— Hi10P + Main10 casesconfig.c::RequestCreateConfig+RequestQueryConfigEntrypoints— profile casesconfig.c::RequestGetConfigAttributes—VA_RT_FORMAT_YUV420_10for 10-bit profilescontext.c::RequestCreateContext— NV15 CAPTURE pix_fmt, synthetic-SPS bit_depth=2, video_format invalidation on bit-depth transitionimage.c::RequestCreateImage+RequestDeriveImage+RequestQueryImageFormats— P010 reporting (P010 unconditionally advertised)image.c::copy_surface_to_image— NV15→P010 unpack callsurface.c— RT_FORMAT_YUV420_10 admission guard, NV15 PRIME fourccnv15.c+nv15.h— NV15→P010 plane unpack (self-tested viatests/test_nv15_unpack.c, all assertions pass)request.h—is_10bitflag ondriver_dataRe-enable when the gap closes: uncomment the two
profiles[index++]lines and bump the H264 guard from(-5)back to(-6)inconfig.c::RequestQueryConfigProfiles.Re-enablement criteria
Triggers for closing this issue:
ffmpeg-v4l2-request-fourierupstreams Hi10P/Main10 userspace plumbing, OR our local fork patches it in.ffmpeg -hwaccel v4l2request -hwaccel_output_format drm_prime -i bbb_hi10p.mp4 -vf hwdownload,format=p010le -frames:v 5 -f rawvideo /tmp/k.yuvproduces non-zero, real-content output on fresnel.fresnel-fourier/phase7_iter39_test_rig.sh) PASSes against the iter39-restored backend.References
6bc12fe662f887marfrit/fresnel-fourier:phase7_iter39_close.md@a4855f7feedback_rk3399_h264_hi10p_advertised_not_functional.mdTriage refresh 2026-05-18 — re-enablement is partially unlocked, decision needed.
Re-enablement criteria status
7542989f). Patch: NV15 → P010 unpack inhwcontext_v4l2request.c::transfer_data_from+transfer_get_formats.ffmpeg -hwaccel v4l2request -vf hwdownload,format=p010le ...produces non-zero, real-content output on fresnel7d9b66d48d8f17b2281da1881c663ecc31722bb218aba1ae23bf28d07aa66b08. (This also overturnedfeedback_rk3399_h264_hi10p_advertised_not_functional— RK3399 silicon DOES decode Hi10P, the original "all zeros" was the fadein.)phase7_iter39_test_rig.shPASS against iter39-restored backendMain10 fixture blocker
bbb_main10.mp4atfresnel:~/measurements/encoded/is actually 8-bit HEVC Main:The phase 7 test rig's auto-encode step (
libx265 ... -pix_fmt yuv420p10le -profile:v main10) silently produced 8-bit output because the systemx265build lacks HBD (high-bit-depth) support — exactly the gap noted inphase7_iter39_close.md's "Open follow-ups #1". So Main10 still can't be empirically validated without a real Main10 fixture. Options:a) Install
x265-hbdfrom AUR (no Arch ALARM package; would need local build via marfrit-packages).b) Download a Main10 sample from public sources (e.g.,
https://4ksamples.com/, Big Buck Bunny project's UHD encodes).c) Re-encode locally with
ffmpeg -c:v libx265 -pix_fmt yuv420p10leonly iflibx265library was built with--enable-hbd-12bitand--enable-hbd-10bit— check withx265 --version 2>&1 | grep "12bit support".Operator decision paths
a) Partial-revert: re-enable Hi10P only, leave Main10 dropped. Revert only the H264 lines in iter39 Option B commit
6bc12fe. ~5 LOC. Ship as a small libva-v4l2-request-fourier PR + bumpmarfrit-packages/arch/libva-v4l2-request-fourier/PKGBUILDto a new_commit. Hi10P advertised + functional + bit-exact verified; Main10 untouched.b) Full-revert: re-enable both Hi10P and Main10. Revert the entire
6bc12fe. Main10 enumerated in vainfo, decode path runs unverified. Risk: an early Main10 consumer hits a silent issue we haven't caught (the Main10 codepath shares ~90% of code with Hi10P, but the HEVC vs H.264 control populations differ —feedback_va_st_rps_bits_is_slice_field,feedback_vaapi_blind_to_some_hevc_sps_fieldsregions). Then again, those are the same risks any HEVC iter39 path already carries, and Main10 is just bit-depth-extended HEVC.c) Wait for Main10 fixture, then full-revert. Source a fixture via path (a/b/c) above, run the full phase 7 test rig, then ship. Cleanest.
Recommend (a) as the immediate ship for the Hi10P win (small, fully verified), then (c) as the followup to close the Main10 leg cleanly once a fixture is in hand.
Out of scope for this triage
This issue is not scoped out — both criteria 1 and 2 are concretely met, so the re-enablement work IS the next move. Just waiting on operator pick between (a), (b), (c). I have not done the libva rebuild because that's a code-change PR and your earlier triage directive scoped this pass to "find duplicates and verify might-be-fixed-by-now"; this one is "ready to fix, please pick a path".
Triage update 2026-05-18 — partial-revert attempted, blocked by separate libva-side Hi10P decode bug.
What I tried
Per the earlier triage's path (a) "partial-revert Hi10P-only", I applied a 3-file change on top of master tip (
9bb5a5a) and built+tested on fresnel:src/config.c: Re-addedprofiles[index++] = VAProfileH264High10;and bumped the H264 guard from(-5)back to(-6)— reverts the H.264 half of commit6bc12fe. Main10 stays dropped (no fixture).src/surface.c: MadeRequestQuerySurfaceAttributesconfig-aware — forVAProfileH264High10config, advertiseVA_FOURCC_P010; for everything else (includingVAProfileHEVCMain), advertiseVA_FOURCC_NV12. This addresses thec9f32afSEGV concern by giving HEVCMain a NV12-only surface format hint.src/image.c: Revertedc9f32af— advertiseVA_FOURCC_P010unconditionally inRequestQueryImageFormatsso ffmpeg-vaapi's pre-CreateContext catalog query acceptsp010leas a valid hwframes sw_format. The per-config logic in (2) keeps HEVCMain from picking it.Result: vainfo correct, decode broken
✅
vainfonow listsVAProfileH264High10correctly.✅ Build clean, 8-bit baseline preserved (NV12 hwdownload still works for plain H.264).
❌ Hi10P decode through libva path fails at the kernel level:
vs kdirect on the same fixture (working bit-exact):
Root cause (from strace diff)
The libva backend submits the same NV15 CAPTURE format to the kernel (sizeimage=2188800 byte-identical to kdirect), but the kernel rejects libva's decode requests:
Every libva dequeue comes back with V4L2_BUF_FLAG_ERROR. Same kernel, same hardware, same CAPTURE pixfmt as kdirect — but the V4L2 controls libva submits trigger kernel-side rejection. Likely culprits (controls submitted differently):
V4L2_CID_STATELESS_H264_SPS/ 0xa40902) —bit_depth_luma_minus8value vs offset0xa40a95/0xa40a96— non-standard CID range, could be backend-private flags that need an opt-in the kernel doesn't seeConclusion: partial-revert blocked, NOT shipped
Rolled back all three file changes on fresnel + noether-local. Master tip unchanged. The earlier triage's claim that "criterion 2 is met" was true only for kdirect; for the libva path it's still false. Repointing this issue at:
Real next step: deep-dive into libva H.264 ctrl-population for Hi10P. Compare byte-by-byte against what ffmpeg's V4L2 H.264 hwaccel sends. Strace both, dump full SPS/PPS/decode_params struct bytes, diff. Likely a small fix (one struct field offset or one flag bit) once isolated. Scope: 2–4h with ampere kept out of scope (use fresnel only).
Memory entry updated:
feedback_rk3399_h264_hi10p_advertised_not_functionalnow marked PARTIALLY OVERTURNED — silicon + kernel + kdirect ✓, libva backend ✗.No shipping change yet: master tip stays at
9bb5a5a, PKGBUILD pin stays at7ac934e(iter38b), published pkg stays atcf8cd9d(iter39 with Option B). Hi10P remains unadvertised in vainfo on fresnel until the libva-side decode bug is fixed.Keeping issue open. Reopen criteria are now narrowed: just the libva ctrl-submission bug (kdirect side and ffmpeg side are both done).
EWONTFIX 2026-05-18. Per scoping discussion with @marfrit: Hi10P (H.264 High 10) on the libva backend is scoped out indefinitely. Same shape as the HEVC-on-ampere EWONTFIX decision earlier today — fleet workloads (YouTube + Mediathek ARD) don't use Hi10P.
Rationale
Hi10P is essentially confined to the historic 2012-2018 anime fansub scene (
x264 --profile high10for banding-free animation gradients). Outside that niche it's effectively nonexistent — even pirated 4K BluRay rips are HEVC or AV1, not Hi10P. Modern streaming (YouTube, Netflix, etc.) never uses it. The fleet's actual codec mix is H.264 8-bit (legacy / Mediathek) + VP9 (YouTube 1080-4K) + AV1 (newer YouTube). Hi10P would land 0% of real consumption.What stays unfixed
V4L2_BUF_FLAG_ERRORfor Hi10P decode requests (kernel rejects libva's ctrls while accepting kdirect's same-fixture). Full strace evidence in the prior comment. Fix would be a 2-4h deep-dive into the H.264 SPS / decode_params / slice_params bytes diff against ffmpeg-vaapi's submission.VAProfileH264High10+VAProfileHEVCMain10not enumerated inRequestQueryConfigProfiles.What still works for Hi10P, if you ever need it
ffmpeg -hwaccel v4l2request): fixed earlier today via marfrit-packages#21 / PR #26. Bit-exact HW==SW on fresnel for 20-frame mid-fixture (sha7d9b66d48d8f17b2281da1881c663ecc31722bb218aba1ae23bf28d07aa66b08). Useffmpeg -hwaccel v4l2request -i some.hi10p.mp4 -vf hwdownload,format=p010le ...from the command line.--hwdec=v4l2request(not=vaapi) — same path, works.-hwaccelflag) — always available, costs CPU.What does NOT work (and won't, autonomously): browser-side VAAPI consumption of Hi10P via firefox-fourier / chromium-fourier on RK3399 or RK3588.
Reopen criteria (operator-stated)
Memory entry feedback_hevc_out_of_scope_ampere extended to cover Hi10P too — same out-of-scope rule.
Closing.