Cubie A7Z + Camera 4K (IMX415): 4K stitched mode produces corrupted chroma; encoder needs io-mode=2

Two problems with the Radxa Camera 4K (IMX415) on Cubie A7Z. 1080p works
perfectly; 4K does not.

Environment

  • Radxa Cubie A7Z + Radxa Camera 4K (IMX415)
  • radxa-a733_bullseye_kde_r6, kernel 5.15.147-21-a733
  • libisp-dev commit 665dc2e (2024-12-18)
  • libcedarc stable_v1.3.0_common (2022-08-22)
  • libcedarc-dev-2.0.0-arm64 1.0.1, libawispapi-isp-602-arm64 1.0.1

=== Problem 1: 4K stitched mode corrupts chroma ===

At 3840x2160 with en-largemode=1 (STITCH_2IN1_LINNER), the luma plane is
correct and sharp — small text is readable — but chroma is corrupted into
vertical bands with hard edges aligned to the stitch boundary.

Reproduce:
gst-launch-1.0 -e v4l2src device=/dev/video1 io-mode=2 en-awisp=1
en-largemode=1 ! video/x-raw,format=NV12,width=3840,height=2160,
framerate=30/1 ! jpegenc ! multifilesink location=out_%03d.jpg

Formats tested at 4K:
NV12 - corrupted (blue/orange wash)
I420 - corrupted (identical to NV12)
NV21 - corrupted (bright green vertical bands)
NV16 - corrupted (red/blue/green vertical blocks)
YUY2 - rejected, S_FMT Invalid argument

Logs, repeating continuously:
[ISP_WARN]can not use sync mode.(buffer0 = 0x…, buffer1 = (nil))
[ISP_ERR]isp_dev_start: unable to subscribe to tdm event:
Inappropriate ioctl for device (25)
[ISP_ERR]isp_stat_process_buffer: AEWB: stats error, skipping buffer

buffer1 is never allocated.

1920x1080 with en-largemode=0 is completely clean — sharp, correct
exposure, correct colour. So the sensor and single-ISP path are fine.

Additional findings:

  • /dev/video0 with en-largemode=1 at 4K reaches PLAYING but delivers no
    frames at all
  • en-largemode=0 at 4K is rejected: “device returned size 3264x2160”
  • 3264x2160 has no ISP config (“cannot find imx415_mipi_3264_2160_30_0_0”,
    falls back to 1080p profile) and delivers no frames
  • Raw 4K capture to fakesink runs steady at ~22fps with zero dropped frames

Note this is NOT the same as GitHub issue #19. Here the IMX415 profile IS
found (“find imx415_mipi_3840_2160_30_0”), so it isn’t the missing-profile
problem — the corruption is structural.

=== Problem 2: encoder fails on v4l2src DMABuf (workaround found) ===

omxh264videoenc fails on the first frame with default v4l2src buffers:

ERROR : cedarc h264EncFrame:6956: h264 encoder wait interrupt overtime
ERROR : OpenMAX component in error state Hardware (0x80001009)

Adding io-mode=2 fixes it entirely. Reproduced at 720p, 1080p and 4K.
videotestsrc into the same encoder works without io-mode=2, so it is
specific to the DMABuf buffers v4l2src exports.

Possibly related, from dmesg:
sunxi-cedar 1c10000.ve2: supply ve not found, using dummy regulator

Suggest documenting io-mode=2 on the camera docs page in the meantime — it
isn’t mentioned and the failure gives no hint of the cause.

=== Question ===

GitHub issue #19 reports libcedarc-dev 1.0.7 and libAWIspApi working
correctly, but the a733-bullseye repo only offers 1.0.1 for both, and there
is no a733-trixie repo (404). Where can newer A733 libraries be obtained?

Happy to run diagnostics or test builds.