proto: bump PROTO_MAX_PAYLOAD 64 KiB → 1 MiB (closes #19) #20
Reference in New Issue
Block a user
Delete Branch "noether/issue-19-bump-proto-payload-1mib"
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?
Fixes #19.
Bug
Real H.264 access units routinely exceed the previous 64 KiB wire-protocol cap (720p worst-case I-frame ~200 KiB; 1080p ~500 KiB). libva-v4l2-request-fourier detects the under-sized OUTPUT_MPLANE buffer and asks for
sizeimage=147456viaVIDIOC_S_FMT, butdaedalus_fill_output_fmtunconditionally pins it toDAEDALUS_MAX_BITSTREAM(65484) — Firefox loses the slice and falls back to libmozavcodec SW. Trace:Fix
Bump
DAEDALUS_PROTO_MAX_PAYLOADininclude/daedalus_v4l2_proto.hfrom 64 KiB to 1 MiB.DAEDALUS_MAX_BITSTREAMis derived from the same #define, so the kernel's reportedsizeimagelifts with it.Allocations (
kmemdup,kmalloc, daemonmallocof read buffer, vb2 plane backing) are sized per-payload at runtime; the only growth is the daemon's startup read buffer (one ~1 MiB allocation per daemon process) and V4L2 OUTPUT_MPLANE per-buffer size.KMALLOC_MAX_SIZEon aarch64 SLUB is several MiB; 1 MiB is well within bounds. Other V4L2 stateless decoders (cedrus, rkvdec, hantro) report 1-4 MiB sizeimage — this puts daedalus at the conservative end of normal.Compatibility
#define-only change; struct layout unchanged. But the effective cap is the smaller of (kernel cap, daemon cap):Lock-step install of
daedalus-v4l2+daedalus-v4l2-dkmsis required. Mirrors the PR-#7/#8 cadence.NOT covered (deferred)
daedalus_fill_output_fmtstill hardcodessizeimage = DAEDALUS_MAX_BITSTREAMregardless of userspace request. Acceptable for now: vb2 allocates up to that, and libva's resize-test now sees the kernel report a sizeimage at-least-as-large as what it asked for. A future cleanup could respect userspace'sS_FMT.sizeimageclamped to the cap, to save memory on small-bitrate streams.kmalloc→kvmallocswap. Only matters aboveKMALLOC_MAX_SIZE, not at 1 MiB.Verify post-merge
marfrit/marfrit-packages/{debian,arch}/daedalus-v4l2{,-dkms}to this tip — both packages atomically.codec_store_buffer_ensure_capacity: kernel returned sizeimage 65484 < required Nin libva trace.decoder: OKlines in daemon journal while playing.Refs