Hi — first time posting here. I’m working with the Arducam OV9281 1MP Monochrome Global Shutter Camera on a Raspberry Pi 3B. I got it working by installing the Legacy OS for the Pi 3B, and I’m using the arducam_mipicamera libraries and examples (after some modification they work well).
I edited the “capture_raw.c” example to take consecutive images as fast as possible — basically calling save_image in a loop with no delay. The camera responds at over 120fps, which is exactly what I want. But when I run the program longer than ~10 seconds, I occasionally get a ‘capture timeout’. I’m running at 640x400 since that’s the minimum resolution I need to identify the object I’m tracking.
A few questions:
What is actually happening to the camera when ‘capture timeout’ occurs?
How can I reset the camera on the fly from within the program, without restarting it?
Support mentioned the problem may be caused by ‘limited data capacity’. Does that refer to the camera, or to the processor (the Pi 3B)?
Is there a link for this camera on Robotshop or any other Canadian supplier? I’m in Canada and already have 3 cameras enroute.
Welcome, and thanks for the detailed write-up. Let me unpack this.
The ‘capture timeout’ you’re seeing is most likely being caused by limited data capacity — in practice that means the CSI/MIPI pipeline and its buffers can’t sustain that capture rate indefinitely, so a frame eventually misses its deadline. First thing I’d try: drop to a smaller resolution if you haven’t already.
Important heads-up: the MIPI camera library (arducam_mipicamera) is no longer supported, so I can only give limited advice on that side now. The supported path today is libcamera. Install steps:
Then enable Glamor: sudo raspi-config → 6 Advanced Options → A8 Glamor → enable it. Reboot your Pi, then try to access the camera by libcamera command:
libcamera-still -t 0 (preview)
libcamera-still -t 5000 -o test.jpg (save a picture)
For the OV9281 with the Arducam userland MIPI camera driver, see the doc I’ll link below and give it a try again.
Thanks. I dropped the resolution and I still get the occasional capture timeout after ~10s, so it’s not fully solved. The pattern seems random — sometimes it runs fine for a while, sometimes it stalls. I attached a screenshot of the error.
I still need a way to recover from the timeout inside the program instead of killing it. Is there a reset call I can use on the fly?
Also on the libcamera side — do I need to edit config.txt at all?
That will output an arducam-bug-report.txt in the current directory — send that file as an attachment here. If you’d prefer, I can also connect to the Pi directly to look; I’ve sent the remote support details to you privately, so please check your messages.
Will run the bug report and turn it back shortly. Meanwhile, a couple more things.
My actual requirement is 120fps RAW out of the camera. I don’t need the full 640x480 — I only need about 50 rows of it. Is there any way to get RAW at 320x240, or to capture only certain rows? Would picamera2 help with speeding up RAW mode?
RAW mode at 320x240, or capturing only certain rows, is theoretically possible — but right now it would require a customization by us (there’s an NRE cost). It’s not something you can just flip on with a parameter.
For speeding up RAW mode generally, picamera2 is the direction to go. Manual:
Also, I checked with our sales colleague: at the present time there is no camera available in Canada that fulfills your need. And just to explain why we keep pointing at the OV9281 — the Raspberry Pi updated its OS and weeds out the Buster OS, so the camera driver has to be updated together with the Pi, which is why that model is the recommendation.
Yes, that’s the one: Arducam OV9281 MIPI Camera Module 1MP Monochrome Global Shutter.
Quick recap of where we stand:
The ‘capture timeout’ is attributed to limited data capacity; choosing a smaller resolution is the suggested workaround, though it didn’t fully eliminate it on your setup.
We no longer support the MIPI library, so we can’t give deep advice on the arducam_mipicamera side.
RAW at 320x240 or row cropping needs a custom build (NRE), and speeding up RAW mode points to picamera2.
No camera matching your requirement is available in Canada at present; the OV9281 above is the recommended replacement.
Send over the bug report when you have it and we can keep digging.
Picking this back up. I received the new cameras (the B0165) as recommended, installed one, and I’m on the current Pi OS now rather than the legacy one. libcamera-hello works and I can see the image — it actually went quicker this time thanks to the earlier experience.
Minor problem though: I need to process RAW images quickly. I ran
libcamera-still -r -o test.jpg
and I get the jpg file, but I do NOT get the DNG or RAW file. I tried it a few times with the same result. Any idea what’s going on?
Good progress — libcamera-hello working is a solid sign the new camera is up.
On the missing RAW: a few things to check.
Confirm your build actually supports it: libcamera-still --version
Run it with verbose output so we can see what it’s doing with the raw stream, e.g. add -v to your command.
The raw flag writes the RAW frame, but the filename and whether it’s written get printed to the console. On some builds you have to also request the raw format explicitly.
Can you paste the full console output from the run? It usually reports whether the RAW frame was saved and under which name (often test.dng or a raw file). If there’s no line about it, the RAW isn’t being written at all.
The console output just shows it saving test.jpg, nothing about a dng or raw file. I’ll try adding the verbose flag and an explicit raw format and report back what it prints.
Sounds good — paste whatever it prints, even if it looks noisy.
Also, I still need that arducam-bug-report.txt from the Pi. That will tell us exactly what libcamera is detecting and whether the sensor is coming up in the right mode, which matters for RAW capture. Attach it here when you have it.
And since your goal is to move your existing MIPI_Camera library calls over to libcamera: if you can share your current capture loop (the capture_raw.c you modified), I can point you at the libcamera/picamera2 equivalents. The old MIPI API doesn’t map 1:1, so I’ll need to see which functions you’re relying on.
Setting expectations: since the MIPI library is no longer supported, we can’t provide full support for it, but I can help you get the equivalent working under libcamera.
Will send the bug report file. And yes — the goal is to move my existing MIPI_Camera library calls over to libcamera. Are there any example programs for accessing the camera that are similar to what was available with MIPI? That would save me a lot of time.
Understood. There isn’t a drop-in MIPI-equivalent example set anymore, unfortunately — the picamera2 manual and the libcamera apps (libcamera-still, libcamera-vid) are the current references. picamera2 gives you a Python API where you can request the raw stream directly, which fits your 120fps RAW use case much better than the old save_image loop.
Current state of the thread, so we’re on the same page:
‘capture timeout’ is attributed to limited data capacity; lower resolution is the workaround, and it didn’t fully fix it for you.
MIPI library is unsupported, so we can’t fully support your existing MIPI code.
No camera matching your requirement is available in Canada right now.
Recommended replacement is the OV9281 (uctronics link above).
RAW at 320x240 or row cropping requires a custom firmware (NRE), and speeding up RAW points to picamera2.
For the new B0165: libcamera-hello works, but libcamera-still -r is not producing a DNG/RAW — send the bug report and the verbose output and I’ll dig into that next.