Which OS for Arducam B0411 high FPS register access on Raspberry Pi Zero 2 W?

Hi all, I’m trying to squeeze the maximum framerate out of an Arducam B0411 (OV9281) on a Raspberry Pi Zero 2 W. I originally tried reading and writing the registers directly to push the FPS up, but I’m not sure if there’s any register info or proprietary SDK available for it, and the camera has honestly never worked properly for me. I’m running 32-bit Raspberry Pi OS Lite (bullseye). Is there a recommended OS for this? Any help getting the FPS up would be great.

To get the max framerate you need to disable the media controller. In /boot/config.txt, add this under [all]:

dtoverlay=ov9281,arducam,media-controller=0

Then reboot and run:

v4l2-ctl -d 0 -c vertical_blanking=22
v4l2-ctl -d 0 --set-fmt-video=width=640,height=480,pixelformat=‘GREY’ --stream-count=-1 --stream-mmap

With GREY 640x480 that should get you up to around 296 fps. Closing the media controller is the important part here. OS-wise, 32-bit bullseye Lite is fine for this test — I’d stay on it so the numbers line up with what’s been measured.

Thanks for that. I tried it, but the stream command keeps overriding vertical_blanking. After I set it, v4l2-ctl -d 0 -l shows the value I just set. But once I run the stream command, stop the stream, and list again, it’s back to the default. So I can’t actually control the framerate through VBLANK.

Right, that’s the current behavior — the VBLANK value gets reset to the default when the stream actually starts, so you can’t hold a framerate by setting VBLANK. I don’t have a fix for that yet. What FPS are you actually seeing when it streams on your current OS?

While I was testing this I noticed FPS is faster on bullseye than bookworm. Same setup: bookworm gives 296 fps, bullseye gives 311 fps. Any idea why there’s a difference?

That VBLANK reset on stream start is likely at the driver level, and that code is maintained by Raspberry Pi official. The bullseye vs bookworm FPS difference is probably from changes in that driver/V4L2 stack between the two releases. You might get a better answer on the Raspberry Pi forum for this one — the people there have dug into the official driver behavior and may have specific guidance.

Separate issue: outdoor shots on sunny days are badly overexposed, and it’s worst radially in the center of the image. I tried changing exposure but the results were inconsistent and non-linear. Is there any documentation on changing the sensor tuning, and which values I should be adjusting?

The official Raspberry Pi camera guide is a good place to start for the tuning side: https://datasheets.raspberrypi.com/camera/raspberry-pi-camera-guide.pdf. It walks through exposure and the camera tuning controls that are available. Some of the tuning values for this sensor aren’t fully documented, but the guide should give you the knobs to experiment with.

Two more questions on exposure. I’m capturing raw Bayer frames through libcamera and I’m having trouble characterizing how analogue_gain and exposure actually behave — the mapping isn’t obvious. Also, I want to convert a light meter reading into an exposure setting. What’s the base ISO of this camera? I know the pixel clock from the pixel rate and I know the horizontal/vertical blanking, so I can convert ms to exposure — I just need the base ISO to make the light meter useful.

Quick recap of where this has landed: with the media controller disabled and GREY 640x480 you should see roughly 296 fps on bookworm and around 311 fps on bullseye. The VBLANK reset on stream start is a driver-level behavior in the Raspberry Pi official driver, so that one’s best raised on the Pi forum. For the overexposure, start with the camera guide I linked above. As for analogue_gain/exposure in raw Bayer and the base ISO — the base ISO isn’t published in the public docs and the gain/exposure mapping isn’t fully characterized, so I don’t have confirmed values for those yet. You may need to ask Arducam directly for the OV9281 tuning/register details if you need exact numbers.