Sunday, November 15, 2026

Allwinner A733 Mainline Camera & Cedrus VPU: 1% CPU 1080p30 H.264/H.265 + libcamera ISP Pipeline

Big progress on mainline Linux 7.1 (PREEMPT_RT) for the Radxa Cubie A7A (Allwinner A733): we now have a working, zero-copy camera-to-encoder pipeline running on mainline drivers without any vendor 5.10 BSP blobs.

Highlights: Hardware H.264 & H.265 (HEVC) encoding via Cedrus VE at 1080p30 using ~0.89%–1.55% of one CPU core, hardware ISP 602 (sun60i-isp) with AE/AWB/CCM/Gamma/BLC, and a dedicated rkisp1-style libcamera pipeline handler & IPA.

1. Zero-Copy Camera → Hardware Video Encoder (H.264 & H.265)

Using the mainline sun6i-mipi-csi2 → sun6i-csi capture path with an OV5647 sensor (1080p30, NV12), CMA dma-bufs are passed zero-copy directly into the Allwinner A733 Cedrus Video Engine V4L2 stateful M2M encoder:

Codec Mode / Verification Throughput / CPU Load Decode Quality
H.264 1080p30 zero-copy CSI → VE_ENC, dynamic CAPTURE buffer sizing, EOS drain 30.02 fps live (~0.89% of 1 CPU core); 78.3 fps standalone 0 decode errors
H.265 (HEVC) Fixed-QP (cu_qp_delta_enabled_flag=0) + frame-level CBR/VBR rate control (verified at 1 Mbps & 4 Mbps CBR), v4l2-compliance 49/49 1080p30 (~1.55% of 1 CPU core) 0 decode errors or warnings in avdec_h265 & libde265dec

2. Mainline Hardware ISP 602 (sun60i-isp)

Instead of burning CPU cycles on Software ISP debayering, the A733's inline ISP 602 is driven directly in the media graph:

ov5647 (RAW10) → sun6i-mipi-csi2 → sun6i-csi-bridge → sun60i-isp → sun6i-csi-capture (NV12 /dev/video0)
                                                        ↑ sun60i-isp-params (/dev/video1)
                                                        ↓ sun60i-isp-stats  (/dev/video2)
  • UAPI & Hardware Blocks: Versioned parameter buffer (sun60i_isp_params_cfg) supporting Black Level Correction (BLC), White Balance (WB), Color Correction Matrix (CCM), Gamma, plus AE/AWB/Histogram statistics readout.
  • Dedicated libcamera Pipeline Handler & IPA: Built an rkisp1-style sun60i-isp pipeline handler and IPA module (ipa_sun60i_isp.so + sun60i_isp_ipa_proxy) rather than hacking SoftISP into simple — giving a clean, upstreamable userspace counterpart for a future linux-media RFC.

3. What's Next

  • Finish silicon verification of the sun60i-isp libcamera AE/AWB closed loop on 1080p30 captures.
  • Prepare an upstream RFC for sun60i-isp with the open libcamera pipeline handler as userspace proof.
  • Continue A7A bring-up: cpufreq OPP tables, stress_rpmsg on the E902 RISC-V co-processor, and GMAC210 TX DMA fix.

Source, Buildroot external configs, and test logs are tracked in github.com/tcmichals/cubie-a5e.

No comments:

Post a Comment