Hi everyone, I’m stuck trying to get an Arducam 64MP camera working with a Raspberry Pi Zero 2W running Bullseye OS. Whenever I try to capture it just dies with:
Unable to request 1 buffers: Cannot allocate memory
ERROR: *** failed to allocate capture buffers ***
The camera looks detected but nothing actually works. Has anyone hit this before?
Sure. My environment is a Raspberry Pi Zero 2W, Bullseye OS, Arducam 64MP camera. I amended /boot/config.txt following the instructions I found. Here’s the whole file:
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
start_x=1
#start_x=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d,cma-512
#dtoverlay=imx219
max_framebuffers=2
# Disable compensation for displays with overscan
disable_overscan=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
#dtoverlay=vc4-fkms-v3d,cma-512
[all]
gpu_mem=128
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam_64MP
I also tried adding dtoverlay=vc4-kms-v3d,cma-512 but CmaTotal is still 8192kB.
Thanks, that helps. I can see dtoverlay=vc4-kms-v3d,cma-512 sitting in the general section and again under [all], alongside dtoverlay=arducam_64MP, gpu_mem=128, start_x=1 and display_auto_detect=1.
Before I go further, can you paste the raw output of these two commands so we know exactly what the board is reporting?
Okay, that’s the key detail: CmaTotal is still 8192 kB, which means the cma-512 setting isn’t actually taking effect on your board.
Here’s what’s happening:
The Pi Zero 2W can’t use cma-512. On this board the CMA value has to be reduced, i.e. cma-128.
Separately, 64MP cameras aren’t really recommended on anything other than a Pi 4. If you do run a 64MP on a non-Pi4 device, you have to lower the resolution.
So please:
Change cma-512 to cma-128 in /boot/config.txt (remove the duplicate/leftover entries so only one vc4-kms-v3d line with cma-128 remains).
Okay, thanks, that makes sense. But I actually want to use this camera with motioneyeos. How do I add the Arducam 64MP to motioneyeos at a lower resolution, less than 1920x1080?
Just to make sure we’re on the same page: we currently don’t have an adaptation for motioneyeos - there’s no official support for it with Arducam cameras, so integration there isn’t something we can help configure.
When you say you want a lower resolution, do you mean you’re already able to use large resolutions on motioneyeos? How exactly are you using it? That’ll help me understand your use case.
Alright. If motioneye isn’t supported by Arducam, then how do I stream video using libcamera over HTTP? Ideally without VLC Player, since VLC is banned in India.
For context, my setup is Arducam on a Raspberry Pi Zero 2W with Bullseye OS, with motioneye OS installed. My plan is to do face recognition using a CNN on a separate Raspberry Pi 3B - images captured by motion detection on the Zero would be sent over to the Pi 3 for the actual recognition.
Got it - so motioneye/motioneyeos isn’t something we support for the Arducam camera, which means you’ll want a different streaming path. For HTTP streaming with libcamera/Arducam (instead of motioneyeos or VLC), have a look at our mjpg-streamer project:
That’s the approach we’d recommend for serving the camera stream over HTTP. If you run into trouble getting it built for the Pi Zero 2W, post the errors here and we can take a look.