Hey everyone, I’m trying to get the Arducam 64MP Hawkeye (SKU B0399) working on a Raspberry Pi Zero 2 W, but I keep hitting a memory allocation error whenever I try to capture anything. The camera is detected but as soon as I run any capture command it fails.
Could you share the exact error message you’re seeing? Also, what OS are you running on the Pi Zero 2 W?
Sure. The main error is a dmaHeap allocation failure. I also see “Unable to request 1 buffers: Cannot allocate memory” on some OS versions. Here’s what I’ve tested so far:
- Raspberry Pi OS 64-bit (bookworm)
- Pi OS 64-bit Lite (bookworm)
- Pi OS 32-bit Lite (bookworm)
All flashed fresh from the RPI imager app. I’m controlling everything via SSH, no desktop.
Thanks for the details. The Pi Zero 2 W only has 512MB of RAM so memory allocation for a 64MP sensor is going to be tight. Let’s start with some basics — have you run a full update/upgrade on the OS? Sometimes there are camera stack fixes in newer packages.
Tried that on the 64-bit standard OS. After sudo apt update && sudo apt upgrade and a reboot, the Pi wouldn’t boot at all. Had to reflash. So that went nowhere.
Alright, that’s odd but let’s move on. The dmaHeap errors usually point to CMA (Contiguous Memory Allocator) being too small. Can you try adding cma=400M to your /boot/firmware/cmdline.txt? Append it to the existing line, don’t start a new one.
Tried that — and several other CMA values. The problem is that as soon as I add anything to cmdline.txt, the Pi loses network connectivity after boot. Can’t SSH in at all. I have to pull the SD card and revert the file on another machine. So that’s a dead end.
Frustrating. OK, another approach — try adding this to /boot/config.txt instead:
dtoverlay=vc4-kms-v3d,cma-512
This sets CMA via the device tree overlay rather than the kernel command line.
No luck with that either. Same dmaHeap allocation failure. I also tried lowering the capture resolution with rpicam-apps to see if that would reduce the memory footprint, but still the same error.
What about GPU memory split? Try setting gpu_mem=128, then gpu_mem=256, and gpu_mem=512 in /boot/firmware/config.txt. The camera stack uses GPU memory for buffer allocation so this might shift things around enough.
OK this is where things get interesting. On the 64-bit standard Pi OS, changing gpu_mem actually fixed the “Unable to request 1 buffers: Cannot allocate memory” error — but then the dmaHeap error shows up right after instead. On the Lite versions (both 64-bit and 32-bit), I never saw the “Unable to request buffers” error at all, just the dmaHeap failure from the start.
Also — I did manage to capture a short video and some low-res photos ONCE on the 64-bit standard OS. But I haven’t been able to reproduce it since. No idea what was different that time.
That one-time success is actually telling us something important — the hardware is capable under just the right memory conditions, but it’s right on the edge. Here’s what’s going on:
The Raspberry Pi Zero 2 W has only 512MB of RAM total. The Arducam 64MP Hawkeye at full resolution (64MP / 48MP modes) needs enormous contiguous memory blocks for the frame buffers. Between the OS, the GPU, and the camera pipeline, there simply isn’t enough headroom — the dmaHeap allocator can’t find large enough contiguous blocks, and tuning CMA and gpu_mem just shuffles the problem around without solving it.
This is a fundamental hardware limitation of the Pi Zero 2 W for this camera at full resolution.
So there’s no way to get full 64MP captures on the Zero 2 W? Is there any workaround at all?
Correct — full 64MP or 48MP captures are not reliably achievable on the Pi Zero 2 W with the standard OS, even with all the memory tuning we’ve tried. The hardware just doesn’t have enough RAM.
But here’s what you can do to get it working at lower resolutions:
- Use the
-nflag when capturing to disable the preview window. The preview consumes additional buffers you don’t have memory for. - Choose a resolution below 48MP when using rpicam-apps. Stick to something reasonable given the 512MB constraint.
For example:
rpicam-still -n --width 3840 --height 2160 -o test.jpg
The -n flag is key — it skips the preview entirely and frees up enough memory for the capture to complete at moderate resolutions. That’s likely why your one successful attempt worked, even if you didn’t realize what was different at the time.
Unfortunately if you need full 64MP stills, you’ll need to look at a Pi with more RAM — a Pi 4 or Pi 5 would handle this without issues.
That makes sense. I’ll stick with lower resolutions and the -n flag for now. Thanks for walking through all this — at least now I know it’s not some config mistake I was making. The memory tuning dead ends were driving me crazy.