Skip to content

v2.1.4 — surface pool 128, clean allocation failure (Chrome 4K fix)

Choose a tag to compare

@defcom5-rockchip defcom5-rockchip released this 07 Sep 10:58
· 54 commits to main since this release

v2.1.4 — surface pool: 128 slots, clean failure (fixes Chrome 4K "garbled, then green")

Symptom (forum report on v2.1.3, google-chrome with the VA-API decoder, 4K 10-bit HEVC and VP9 P2):

vaapi_wrapper.cc: vaCreateSurfaces (allocate mode) failed, VA error: resource allocation failed

five times, then garbled video, then a green freeze.

Cause. The driver kept a fixed pool of 64 surfaces. Chrome's Linux VA-API decoder allocates one VA surface per output frame, sizes its pool at reference frames + 1 + a renderer estimate, and holds frames while the compositor is busy, so a 4K stream can exceed 64. Worse, when a surface's private buffer could not be allocated the driver returned success with an empty surface, and the client decoded into a half-built pool.

Fix. Pool raised to 128; exhaustion is logged loudly (RK_VAAPI_LOG); any allocation failure now rolls back and returns VA_STATUS_ERROR_ALLOCATION_FAILED, so clients fall back to software instead of corrupting.

Why 128 and not more. Every surface carries a private 3-bytes-per-pixel buffer (19.7 MB at 4K) mapped through the Rockchip DRM IOMMU, whose I/O-virtual space is 4 GB. Measured on RK3588S: ~200 live 4K surfaces hit rockchip_gem_iommu_map: out of I/O virtual memory and decode failed. 128 keeps 4K near 2.5 GB. Receipts: 89 live 4K surfaces clean; a 229-surface request fails cleanly with zero decode errors and ffmpeg falls back. Details: KNOWN-ISSUES KI-7.

Unchanged from v2.1.3: 10-bit zero-copy display (GR1616 fourcc fix), HEVC Main10 / H.264 High10 / VP9 Profile 2 advertised by default, RKVA_HIDE_10BIT=1 escape hatch, the v2.1.2 H.264 PPS fix. Zero-copy regression on this build: 4K Main10, 4K VP9 P2, 8-bit H.264 (B-frames), 8-bit HEVC — all hardware, 0 EGL import failures.

Install

wget https://github.com/defcom5-rockchip/rockchip-vaapi/releases/download/v2.1.4/rockchip-vaapi-driver_2.1.4_arm64.deb
sudo apt install ./rockchip-vaapi-driver_2.1.4_arm64.deb
vainfo --display wayland | grep "Driver version"

Requires a Rockchip BSP 6.1 kernel exposing /dev/mpp_service and librockchip-mpp1. SHA256 in SHA256SUMS.txt.