Again - "Unable to request 6 buffers: Cannot allocate memory" in full resolution

  1. Where did you get the camera module(s)?
    Directly from ArduCam - preorder

  2. Model number of the product(s)?
    B0399

  3. What hardware/platform were you working on?
    Raspberry Pi Compute Module CM4, 4GB on Waveshare IO Board
    Hardware: BCM2835
    Revision: c03140

  4. Instructions you have followed. (link/manual/etc.)
    www.arducam.com/downloads/arducam_64mp_pi_camera_manual.pdf

  5. Problems you were having?
    I can successfully capture “full” resolution images using libcamera-still for jpg and for yuv420.
    However, when I attempt to run it as full stream, i.e. using “–mode 9152:6944:10:U” instead of the 4624x3472 format, a “failed to allocate buffers error” occurs.
    Similarly, attempting to capture footages using libcamera-vid and segment at full resolution results in an error “Unable to request 6 buffers: Cannot allocate memory”, while at 16MP it works perfectly

  6. The dmesg log from your hardware?
    [ 679.210946] unicam fe801000.csi: dma_alloc_coherent of size 79552512 failed
    [ 1360.943044] cma: cma_alloc: linux,cma: alloc failed, req-size: 31031 pages, ret: -12
    [ 1360.943091] unicam fe801000.csi: dma_alloc_coherent of size 127102976 failed

  7. Troubleshooting attempts you’ve made?
    Reducing GPU memory, maximizing cma-size by adjusting the config.txt:
    dtoverlay=vc4-kms-v3d
    dtoverlay=cma,cma-size=738197504

  8. What help do you need?
    Pi / memory configuration to allow jpeg encoding at full resolution and quality, i.e. no errors when:
    libcamera-vid -n -t 500 --segment 1 --width 9152 --height 6944 -o test_%04d.jpeg --codec mjpeg

Software:
[email protected]:~ $ cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
NAME=“Debian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=debian

config.txt:
[all]
arm_boost=1
#dtoverlay=dwc2,dr_mode=host
dtoverlay=vc4-kms-v3d
#gpu-mem=128
dtoverlay=arducam_64mp
#dtoverlay=arducam_64mp,cam0
#dtoverlay=cma,cma-size=805306368 # 768MB not boot
#dtoverlay=cma,cma-size=671088640
dtoverlay=cma,cma-size=738197504