New Arducam 64MP camera on Raspberry Pi Zero W fails to allocate capture buffers

Hi, I just got a new 64MP camera and tried to install it on my Raspberry Pi Zero W. I followed the installation instructions and the troubleshooting guide but I still can’t get it to work. Every time I run a capture it fails with “ERROR: *** failed to allocate capture buffers ***”.

My setup:

  • Raspberry Pi Zero W
  • Arducam 64MP Camera
  • libcamera v0.0.0+3730-67300b62
  • Sensor: arducam_64mp at /base/soc/i2c0mux/i2c@1/arducam_64mp@1a
  • Unicam device /dev/media3, ISP device /dev/media0
  • kernel modules show v4l-subdev0 and /dev/video14

I ran:

pi@raspberrypi:~ $ libcamera-still --width 1280 --height 1024 image.jpg
Preview window unavailable
[0:13:46.814181689] [1175] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3730-67300b62
[0:13:46.838908660] [1177] WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for ‘arducam_64mp’
[0:13:46.840760658] [1177] WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[0:13:46.965646513] [1177] WARN RPI raspberrypi.cpp:1274 Mismatch between Unicam and CamHelper for embedded data usage!
[0:13:46.970456507] [1177] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:13:46.973493504] [1177] INFO RPI raspberrypi.cpp:1398 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media3 and ISP device /dev/media0
[0:13:46.977553499] [1175] INFO Camera camera.cpp:1029 configuring streams: (0) 4340x3472-YUV420
[0:13:46.980768495] [1177] INFO RPI raspberrypi.cpp:763 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
[0:13:46.988281487] [1177] ERROR V4L2 v4l2_videodevice.cpp:1211 /dev/video14[16:cap]: Unable to request 4 buffers: Cannot allocate memory
ERROR: *** failed to allocate capture buffers ***

Any idea what I’m missing here?

Hey, thanks for the detailed log — that helps a lot.

Looking at your output, the sensor is detected fine (it registers arducam_64mp to the Unicam device and ISP), so this isn’t a connection or driver-loading problem. The failure happens later, at the point where buffers are requested from /dev/video14:

Unable to request 4 buffers: Cannot allocate memory

One very common cause of this on a Pi Zero W is that the preview (viewfinder) resolution hasn’t been set. Even when you just want a still, libcamera still spins up the preview path, and by default it picks a large resolution — which on the Zero W is enough to blow the buffer allocation. Your command only set the still width/height, not the viewfinder size.

Can you try adding the viewfinder resolution explicitly, like this:

libcamera-still --width 1280 --height 1024 --viewfinder-width 1280 --viewfinder-height 1024 -o image.jpg

Give that a shot and paste the output if it still fails.

Okay I tried that, but I’m still getting the same error. I even tried running it without the preview window at all (using -n) to rule that out, and it still dies the same way:

pi@raspberrypi:~ $ libcamera-still -o 64mp.jpg -n
[0:09:05.201735120] [1181] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3730-67300b62
[0:09:05.226543154] [1183] WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for ‘arducam_64mp’
[0:09:05.228293156] [1183] WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[0:09:05.355816330] [1183] WARN RPI raspberrypi.cpp:1274 Mismatch between Unicam and CamHelper for embedded data usage!
[0:09:05.360689336] [1183] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:09:05.363770340] [1183] INFO RPI raspberrypi.cpp:1398 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media3 and ISP device /dev/media0
[0:09:05.369827349] [1181] INFO Camera camera.cpp:1029 configuring streams: (0) 4624x3472-YUV420
[0:09:05.374071354] [1183] INFO RPI raspberrypi.cpp:763 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
[0:09:05.387664373] [1183] ERROR V4L2 v4l2_videodevice.cpp:1211 /dev/video14[16:cap]: Unable to request 4 buffers: Cannot allocate memory
ERROR: *** failed to allocate capture buffers ***

Same setup as before: Pi Zero W, 64MP camera, libcamera v0.0.0+3730-67300b62, sensor arducam_64mp at i2c@1/arducam_64mp@1a, media3/media0, v4l-subdev0 and /dev/video14. Still stuck!

Thanks for trying that — and good call testing with -n to rule out the preview window.

A couple of things to clarify, because there are two separate angles here:

  1. The preview is still relevant even when you disable the on-screen window. Even if your device doesn’t display it, the camera still needs to be launched, and the preview path still runs at a default (larger) resolution internally. So setting the viewfinder size is still worth doing alongside your capture.

  2. More likely in your case is a CMA (contiguous memory allocator) shortage. Notice the stream is configuring at the full sensor resolution:

configuring streams: (0) 4624x3472-YUV420

On a Pi Zero W with only 512MB of RAM, when the CMA region is too small, requesting those 4 capture buffers fails exactly with “Cannot allocate memory”. That’s what’s biting you on /dev/video14.

You can fix this by increasing CMA in /boot/config.txt. Add this line:

dtoverlay=vc4-kms-v3d,cma-256

Save it, reboot, and then run your capture again (with the viewfinder size set as well):

libcamera-still --width 1280 --height 1024 --viewfinder-width 1280 --viewfinder-height 1024 -o image.jpg

Let me know how it goes.

That did it — thx, it works now! The cma-256 change in /boot/config.txt plus the viewfinder resolution did the trick. Appreciate the help!

Great to hear it’s working now. Quick recap for anyone finding this thread later:

  • Symptom: “ERROR: *** failed to allocate capture buffers ***” with “Unable to request 4 buffers: Cannot allocate memory” on /dev/video14, on a Raspberry Pi Zero W with the Arducam 64MP camera (libcamera v0.0.0+3730-67300b62).
  • The sensor itself was detected fine (registered to media3/media0), so it wasn’t a wiring or driver-load issue.
  • Two things fixed it:
    1. Set the viewfinder/preview resolution explicitly, since the preview path runs at a larger default resolution even if you disable the on-screen window:
      libcamera-still --width 1280 --height 1024 --viewfinder-width 1280 --viewfinder-height 1024 -o image.jpg
    2. Increase CMA on the memory-constrained Pi Zero W by adding this to /boot/config.txt and rebooting:
      dtoverlay=vc4-kms-v3d,cma-256

If you’re on a higher-RAM Pi you may get away with just the viewfinder setting, but on the Zero W the CMA bump is usually needed for full-resolution sensor streams.