Skip to content

v0.4.3 - Zero-Stutter Scene Adaptation, HEVC Hardware Conformance & Steam CPU Fix

Choose a tag to compare

@github-actions github-actions released this 20 Sep 06:30
· 211 commits to main since this release

馃殌 Highlights & Critical Bug Fixes

1. Sunshine Low Latency & Frame Pacing Stabilization

  • Eliminated 0.5 / 32 / 22 ms Latency Oscillation:
    • Root-caused the latency oscillation reported by testers: the dynamic governor's 15.5ms Tier 3 emergency spike trip-wire was false-triggering under real-time streaming loads, causing every alternate frame to bypass GPU submission and emit a 0.5ms P_Skip failover frame followed by a 32ms full encode.
    • Auto-tuned dynamic governor thresholds for Sunshine streaming (program_invocation_short_name == "sunshine") to 14ms (Tier 1 Fast ME), 22ms (Tier 2 Offload), and 45ms (Tier 3 Failover).
    • Added user/tester tunable environment variables: BC250_GOVERNOR_TIER1_MS, BC250_GOVERNOR_TIER2_MS, BC250_GOVERNOR_TIER3_MS.
  • Targeted Multi-Threading for Sunshine (Restoring Sub-10ms Latency):
    • Sunshine configures multi-slice network packetization (typically 4 slices). Hardcoding 1 thread forced slice entropy coding sequentially onto a single core (~14ms).
    • Automatically grants 2 threads to Sunshine (program_invocation_short_name == "sunshine") for parallel CAVLC and CABAC slice encoding, slashing encode latency by ~50% down to sub-10ms.
    • Keeps FFmpeg transcodes and Steam Link at a lean 1 thread baseline to preserve 100% of host Zen 2 CPU headroom.
  • Vulkan Fence Wait in bc250_SyncSurface():
    • Restored non-blocking GPU fence synchronization in bc250_SyncSurface() when a GPU slot is submitted, ensuring smooth frame pacing and preventing EGL surface reuse collisions.

2. HEVC Real-Time Transcoding Acceleration & Visual Fixes

  • Eliminated Redundant 15ms GPU Shader Dispatch:
    • Removed an unnecessary H.264 GPU compute shader dispatch pass from hevc_encoder_encode_frame() that was executing 10 stages of unused shaders and waiting on fences, saving 15ms of GPU time per frame.
  • Fixed Merge Candidate Motion Vector Rejection:
    • Removed an aggressive parity filter that discarded odd-pixel displacement vectors, which previously forced up to 90% of moving blocks into slow INTRA NxN mode.
  • DC Intra Fast Path for Transcoding (quality_level >= 4):
    • In balanced/speed transcoding modes, directly selects spec-compliant DC intra prediction, bypassing over 500,000 directional mode predictions and SAD searches per second at 1080p.
  • Zero-Residual Transform Bypass:
    • Bypasses 4x4 DST-VII and DCT-II inverse transforms and dequantization when transform blocks contain all zero coefficients, accelerating CPU reconstruction by up to 4x.
  • Spec-Compliant Spatial Merge Candidate Derivation (ITU-T H.265 Section 8.5.3.2.2):
    • Strict Z-scan raster decoding order rank checking (hevc_cu_rank()), fixed CTU boundary candidate availability ($B_0$, $A_0$), and candidate $B_2$ pruning.
  • 8-Bit Picture Order Count (POC) & CABAC Low-Register Overflow Fix:
    • 8-bit POC (log2_max_pic_order_cnt_lsb_minus4 = 4) prevents 16-frame DPB reference desync, while CABAC multi-byte bypass loop prevents arithmetic register overflow.
  • Access Unit Delimiters (AUD):
    • Emits NAL unit type 35 (NAL_UNIT_AUD) before every frame for Android and Qualcomm OMX hardware decoders.

3. FFmpeg & Steam Link CPU Optimization

  • Relaxed Driver Locks During Synchronous Encode:
    • Unlocked DRIVER_LOCK during synchronous encode in bc250_EndPicture() (with surface pinning), preventing FFmpeg worker threads (vf#0:0) from locking up.
  • Persistent Surface Memory Mapping:
    • bc250_DeriveImage() directly aliases persistently mapped surface memory, eliminating per-frame vkMapMemory/vkUnmapMemory page table churn.
  • Fast Path for Internal Non-Exported Surfaces:
    • Bypasses DMA_BUF_IOCTL_EXPORT_SYNC_FILE on non-exported surfaces.
  • OpenMP Passive Waiting:
    • Enforced OMP_WAIT_POLICY=PASSIVE and GOMP_SPINCOUNT=0 to prevent libgomp core spinning in Steam.

馃摝 Bundled Release Assets

  • bc250-driver-linux-x86_64.tar.gz: 64-bit VA-API driver (bc250_drv_video.so) with precompiled SPIR-V compute shaders and install scripts.
  • bc250-driver-linux-i386.tar.gz: 32-bit companion driver for 32-bit Steam Link / Steam Remote Play gaming environments.