Burst mode timelapse with Arducam 16MP on Pi Zero 2W captures only 2 pics

Hey all, hoping someone can help. I’m using an Arducam B0371 (AC2-203710) 16MP autofocus camera module on a Raspberry Pi Zero 2W and I can’t get it to run at full resolution. Every attempt throws “no preview windows available” and “failed to allocate capture buffer”. Anyone seen this combo before?

Those two errors together on a Zero 2W usually point to the capture buffers not being allocatable, so memory/GPU related. Can you share what you’ve changed so far? Which driver are you running for the imx519, and what does your config.txt look like?

I downloaded a new kernel driver for the imx519, the the_low_speed version. Then I edited config.txt with vnc=off, cma=128 and also tried cma=256, gpu=256, plus various combos. Also tried different commands. I did get one capture to succeed at very low resolution, but I never managed to verify the image. Full res keeps failing with the same errors.

Thanks for the details. The short version is that running this 16MP module at full resolution on a Pi Zero is a hardware limitation of the platform, not the camera. The Zero just doesn’t reliably have the headroom to allocate the capture buffers needed for full-res frames. My first recommendation would be to test the camera on a Raspberry Pi 4 instead.

So I moved it over to a Pi 4 and gave it another try. It now works at full resolution. I basically restarted from scratch with a very simple SETTINGS […] configuration and didn’t reuse all those config.txt tweaks, and full-res is fine now.

Next thing I’m trying is a burst mode when triggering the camera. I tested: Libcamera-still -t 5000 –datetime -n –timelaps 1000. In theory that’s one pic every second for 5 seconds, so 5 pictures. But I only get 2 pictures back. Other parameter combos also return a different number of pics than I’d expect from the theory.

Would allocating a higher amount of memory to CMA fix this?

That’s actually a good lead. CMA allocation can limit the speed at which the camera takes and saves pictures. The buffers have to be allocated per frame, and if space is tight the pipeline stalls between captures. That would explain getting 2 pictures instead of 5 in the timelapse window.

Try bumping up the cma value in config.txt, then rerun the exact same timelapse command and see whether the take/save rate improves.

Will do. If the cma bump doesn’t get it to 5 pics, is the Zero itself just too slow for burst mode at 16MP?

For now the conclusion is: increase cma and retest the timelapse to see if the speed of taking and saving pictures improves. Beyond that, Arducam still recommends using a Raspberry Pi 4 for this camera rather than the Pi Zero. Full-resolution capture and rapid burst shooting really benefit from the extra platform headroom.