Reference in New Issue
Block a user
Delete Branch "noether/revert-parking-pr7-pr8"
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?
Why
Field test of #7 + #8 on higgs (Pi CM5) via
mpv --hwdec=vaapi-copy bbb_720p_h264.mp4reproduces issue #9: mpv shows a black window and exits withDaemon journal confirms each REQ_DECODE is processed successfully — pixels are produced — but they arrive on a DIFFERENT cookie's CAPTURE buffer than the one mpv just submitted on. Specifically:
Root cause
The V4L2 stateless decoder protocol contract is 1:1: every OUTPUT (bitstream) buffer submitted must produce exactly one CAPTURE (pixels) completion, with the kernel/decoder responsible for filling the matching CAPTURE buffer immediately. The userspace V4L2 client (libva-v4l2-request-fourier) is responsible for display-order reordering using H.264 POC values after it dequeues the CAPTURE buffers. Real HW stateless decoders (cedrus / rkvdec / hantro) decode a slice into a designated DPB CAPTURE buffer and complete it immediately, regardless of display order.
PR #7's design parked CAPTURE buffers for cookies whose pixels libavcodec hadn't yet released for display-order output. That violated the 1:1 contract: cookie M's CAPTURE buffer wouldn't complete until N requests later, leaving libva / mpv DQBUF returning EAGAIN. Firefox tolerated the resulting stale-pixel mess (which produced the visible "2 1 4 3 6 5" frame pairing the user originally reported); mpv does not — its hwaccel propagates the DQBUF EAGAIN as a hard decode failure and gives up.
PR #8 fixed the kernel panic that #7's parking model caused, but did not address the architectural mismatch.
What stays
This revert leaves only PR #4 (DECODE_MODE + START_CODE menu controls) on top of
f0d4186. PR #4 is independent — it just retires the cosmeticUnable to set control(s) error_idx=2/2warning — and stays. Last fully-working pin is now714d781(this revert's tip), behaviour-equivalent tof0d4186plus PR #4.What's next
The proper fix is option 3 in the issue #9 thread: re-architect the daemon for concurrent in-flight requests + move H.264 display-order reorder back into
libva-v4l2-request-fourierwhere the V4L2 stateless API expects it. Multi-day effort, separate issue. Userspace daemon as it stands cannot honor 1:1 without that work, so the visible "2 1 4 3" pairing in Firefox YouTube playback returns — accepted regression in exchange for unblocking mpv and other strict V4L2 stateless clients.Verified
f0d4186is exactly the PR #4 changes (kernel/daedalus_v4l2_main.c: H.264 menu ctrls registration + handler init+2capacity bump). No other deltas.6.18.29+rpt-rpi-2712.714d781(lock-step kernel + daemon, both revert to f0d4186-content; PROTO_VERSION drops 1 → 0 wire-compatibly when both halves install together).