Files
marfrit 365764fffb Phase 0 amendment: hantro writes zeros, sentinel test cache-buggy
Re-baselined libva-v4l2-request decode path with kernel-side
observability (ftrace v4l2/vb2/dma_fence + dmesg + dynamic_debug)
and visual disambiguator (mpv --vo=gpu in operator's live Plasma
session).

Findings:

1. Kernel reports successful CAPTURE buffer write every frame:
   ftrace vb2_buf_done shows bytesused=3655712 (full NV12 1920x1088
   + hantro tile padding). dmesg completely silent — no
   hantro/vpu/decode/error/warn messages.

2. Visual disambiguator: mpv --hwdec=vaapi-copy --vo=gpu shows a
   solid GREEN frame; --hwdec=vaapi --vo=gpu shows solid BLUE.
   Neither shows the sentinel mid-beige (NV12 Y=0xab,UV=0xab would
   render cream). Both colors are consistent with the kernel
   writing all-zero NV12 (Y=0,UV=0 → green via BT.709 limited; same
   buffer GL-imported as DMA-BUF with different colorspace → blue).

3. Patch 0011 sentinel test has a cache-coherency bug: writes
   0xab via cached surface_object->destination_map[0] mmap, never
   invalidates cache before readback. So the readback always
   shows the stale sentinel even when kernel DMA-overwrote it
   with zeros. vaapi-copy and Mesa DMA-BUF GL import correctly
   invalidate cache and see the real (zero) contents.

This corrects the previous Phase 0 verdicts twice in one day:
- Original commit f15ba8b ("the 2026-04-26 picture holds") was
  wrong: clean contract trace, never checked pixel content.
- Revised commit e892cea ("kernel produces no decoded pixel
  output, sentinel survives") was half right: kernel does write,
  writes zeros, and the sentinel test was reading stale cache.
- Now: kernel writes ALL ZEROS to the CAPTURE buffer. Hantro is
  silently failing the bitstream parse or some control validation.

This is consistent with patch 0011's own commit message hypothesis:
"All zeros → kernel did write 0x00s (overwriting our sentinel),
and the apparent 'no picture' output is the kernel-side decode
actually producing zeros (e.g. parser rejected the bitstream)."
That hypothesis was right; we just couldn't confirm it via the
sentinel test (cache bug) and went down the wrong rabbit hole.

Phase 6 direction sharpens substantially. Bug isn't "we can't
engage hantro" — it's "hantro engages but its parser produces
zeros." Bisect the control submission: VIDIOC_G_EXT_CTRLS
readback to verify writes stick, diff against FFmpeg's
v4l2_request_h264.c (proven working on hantro), verify SPS
completeness, resolve patch 0008's slice_header bit_size open
question, dyndbg the hantro module, etc. Phase 1 boolean-
correctness criterion needs a working pixel-content check before
lock; fix patch 0011's cache sync first.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 11:39:42 +00:00

108 lines
6.9 KiB
Plaintext

[cplayer] Command line options: '--hwdec=vaapi-copy' '--vo=null' '--no-audio' '--frames=2' '--msg-level=all=v' '--no-config' '/home/mfritsche/fourier-test/bbb_1080p30_h264.mp4'
[cplayer] mpv v0.41.0 Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
[cplayer] built on Feb 14 2026 00:53:08
[cplayer] libplacebo version: v7.360.1
[cplayer] FFmpeg version: n8.0.1 (runtime n8.1)
[cplayer] FFmpeg library versions:
[cplayer] libavcodec 62.11.100 (runtime 62.28.100)
[cplayer] libavdevice 62.1.100 (runtime 62.3.100)
[cplayer] libavfilter 11.4.100 (runtime 11.14.100)
[cplayer] libavformat 62.3.100 (runtime 62.12.100)
[cplayer] libavutil 60.8.100 (runtime 60.26.100)
[cplayer] libswresample 6.1.100 (runtime 6.3.100)
[cplayer] libswscale 9.1.100 (runtime 9.5.100)
[cplayer] Configuration: -Db_lto=false -Db_pie=true -Dpython.bytecompile=1 -Dlibmpv=true -Dgl-x11=enabled -Dcaca=disabled -Dcdda=enabled -Ddrm=enabled -Ddvbin=enabled -Ddvdnav=enabled -Dlibarchive=enabled -Dopenal=enabled -Dsdl2-audio=enabled -Dsdl2-video=enabled -Dsdl2-gamepad=enabled -Dprefix=/usr -Dlibexecdir=lib -Dsbindir=bin -Dauto_features=auto -Dbuildtype=plain -Dwrap_mode=nodownload
[cplayer] List of enabled features: alsa build-date cdda cplugins cuda-hwaccel cuda-interop dmabuf-interop-gl dmabuf-wayland drm dvbin dvdnav egl egl-drm egl-wayland egl-x11 ffmpeg ffnvcodec gbm gl gl-x11 glibc-thread-name glob glob-posix gpl iconv jack javascript jpeg lcms2 libarchive libass libavdevice libbluray libdl libplacebo linux-fstatfs luajit memfd-create memrchr openal pipewire posix posix-shm ppoll pthread-condattr-setclock pulse rubberband rubberband-3 sdl2-audio sdl2-gamepad sdl2-video sixel sndio sndio-1-9 uchardet vaapi vaapi-drm vaapi-wayland vaapi-x11 vapoursynth vdpau vdpau-gl-x11 vector vk-khr-display vt.h vulkan wayland wayland-protocols-1-32 wayland-protocols-1-38 wayland-protocols-1-39 wayland-protocols-1-41 wayland-protocols-1-44 wayland-protocols-1-47 x11 x11-clipboard xv zimg zimg-st428 zlib
[cplayer] Setting option 'hwdec' = 'vaapi-copy' (flags = 8)
[cplayer] Setting option 'vo' = 'null' (flags = 8)
[cplayer] Setting option 'audio' = 'no' (flags = 8)
[cplayer] Setting option 'frames' = '2' (flags = 8)
[cplayer] Setting option 'msg-level' = 'all=v' (flags = 8)
[cplayer] Setting option 'config' = 'no' (flags = 8)
[clipboard] Initialized vo clipboard backend.
[cplayer] Waiting for scripts...
[cplayer] Set property: user-data/osc/visibility="auto" -> 1
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[cplayer] Done loading scripts.
[cplayer] Running hook: auto_profiles/on_before_start_file
[cplayer] Failed sending hook command auto_profiles/on_before_start_file. Removing hook.
[cplayer] Running hook: auto_profiles/on_load
[cplayer] Failed sending hook command auto_profiles/on_load. Removing hook.
[cplayer] Running hook: ytdl_hook/on_load
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] playlist hook
[ifo_dvdnav] Opening /home/mfritsche/fourier-test/bbb_1080p30_h264.mp4
[bdmv/bluray] Opening /home/mfritsche/fourier-test/bbb_1080p30_h264.mp4
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[file] Opening /home/mfritsche/fourier-test/bbb_1080p30_h264.mp4
[demux] Trying demuxers for level=normal.
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1
[osd/libass] libass API version: 0x1704000
[osd/libass] libass source: commit: 0.17.4-0-gbbb3c7f1570a4a021e52683f3fbdf74fe492ae84
[osd/libass] Shaper: FriBidi 1.0.16 (SIMPLE) HarfBuzz-ng 14.2.0 (COMPLEX)
[osd/libass] Setting up fonts...
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[file] stream level seek from 131072 to 724711446
[file] stream level seek from 725125156 to 48
[file] stream level seek from 131120 to 725125156
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: /home/mfritsche/fourier-test/bbb_1080p30_h264.mp4
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[find_files] Loading external files in /home/mfritsche/fourier-test/
[cplayer] Running hook: auto_profiles/on_preloaded
[cplayer] Failed sending hook command auto_profiles/on_preloaded. Removing hook.
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
● Video --vid=1 --vlang=eng (h264 1920x1080 24 fps) [default]
○ Audio --aid=1 --alang=eng (aac 6ch 48000 Hz 438 kbps) [default]
[vd] Container reported FPS: 24.000000
[vd] Codec list:
[vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd] h264_amf (h264) - H264 AMD AMF video decoder
[vd] Opening decoder h264
[vd] Looking at hwdec h264-vaapi-copy...
[vaapi] libva: VA-API version 1.23.0
[vaapi] libva: User environment variable requested driver 'v4l2_request'
[vaapi] libva: Trying to open /usr/lib/dri/v4l2_request_drv_video.so
[vaapi] libva: Found init function __vaDriverInit_1_23
[vaapi] libva: va_openDriver() returns 0
[vaapi] Initialized VAAPI: version 1.23
[vd] Trying hardware decoding via h264-vaapi-copy.
[vd] Requesting 4 threads for decoding.
[vd] Selected decoder: h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vf] User filter list:
[vf] (empty)
[cplayer] Starting playback...
[file] stream level seek from 725125156 to 52
[vd] Pixel formats supported by decoder: vdpau vulkan drm_prime vaapi yuv420p
[vd] Codec profile: Main (0x4d)
[vd] Requesting pixfmt 'vaapi' from decoder.
Using hardware decoding (vaapi-copy).
[vd] Decoder format: 1920x1080 [0:1] nv12 bt.709/bt.709/bt.1886/limited/auto CL=uhd crop=1920x1080+0+0 A=none
[vf] [in] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
[vf] [userdeint] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
[vf] [userdeint] (disabled)
[vf] [autovflip] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
[vf] [autovflip] (disabled)
[vf] [autorotate] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
[vf] [autorotate] (disabled)
[vf] [convert] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
[vf] [convert] (disabled)
[vf] [out] 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
VO: [null] 1920x1080 nv12
[cplayer] VO: Description: Null video output
[vo/null] reconfig to 1920x1080 nv12 bt.709/bt.709/bt.1886/limited/display CL=uhd crop=1920x1080+0+0 A=none
[cplayer] first video frame after restart shown
[cplayer] playback restart complete @ 0.000000, audio=eof, video=playing
V: 00:00:00 / 00:09:56 (0%)
[cplayer] EOF code: 1
V: 00:00:00 / 00:09:56 (0%)
[vf] dropping frame due to pin disconnect
V: 00:00:00 / 00:09:56 (0%)
[cplayer] finished playback, success (reason 0)
[cplayer] Running hook: ytdl_hook/on_after_end_file
Exiting... (End of file)
[cplayer] Set property: user-data/osc/margins={"l":0,"t":0,"b":0,"r":0} -> 1