Raspberry Pi 5 and Arducams

Hi i just pre-ordered a couple new RPi5’s that are set to ship end of october.

My thought is that they would work even better for the 64MP camera since the RPi4 can just barely run them.
I ordered the cable converters that let you attach older cameras to the new kind, is there anything else I would need. Do you think the 64MP arducam will work with the new RPI5?

1 Like

Depends on a lot of factors.
If you plan on recording anything, you’ll be surprised to see that the RaspberryPi foundation removed all encoder’s so don’t expect it to do a better job than the pi4, it will actually be worse.
If you want to do AI or capturing photos, it should work.

Just don’t expect it to encode/record videos

1 Like

Almost all tasks should perform significantly better on RPi5 than on RPi4.

Even for encoding (recording) the processing speed of the RPi5 should be on par with the hw encoding speed of the RPi4 (see this video).

I hope ArduCam will support RPi5 with its new RP1 soon.

1 Like

I just tested RPI5 8GB bookworm LITE with dual arducam-64mp hawkeyes. The capture speed with max res 9152x6944 using libcamera-jpeg is ~3 seconds vs 5-7 seconds on RPI4.

  • on RPI4 it was not possible to use two cameras on one device at max res due to some IO issue couldnt make some buffer so i had to have two RPI4 one for each camera. RPI5 doesent have such issue.

the commands i had to run first:

wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh 
chmod +x install_pivariety_pkgs.sh
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
sudo apt -y update && sudo apt -y upgrade

added this to /boot/config.txt
[all]
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam-64mp

sudo reboot

just fyi for dual cam:

sudo nano /boot/config.txt
add following: 
[all]
dtoverlay=vc4-kms-v3d,cma-512
dtoverlay=arducam-64mp,cam0
dtoverlay=arducam-64mp,cam1

sudo reboot

for testing: 
libcamera-still --list-cameras 
libcamera-still --camera 0 
libcamera-still --camera 1 

for capture: 
libcamera-jpeg --camera 0 --width 9152 --height 6944 -o test0.jpg -n -t 1
libcamera-jpeg --camera 1 --width 9152 --height 6944 -o test1.jpg -n -t 1
2 Likes

Way to go!!!
Thanks so much for posting all your code too! I was worried there was going to a lot more time needed to get the pi5’s doing 64mp pics!

I assume this doesn’t work for the imx519?

1 Like

Side question: Can you take photos simultaneously? or do they take one after another?

simultanneously by running each command in separate terminal that are connected to PI5 over ssh.
libcamera-jpeg --camera 0 --width 9152 --height 6944 -o test0.jpg -n -t 1
libcamera-jpeg --camera 1 --width 9152 --height 6944 -o test1.jpg -n -t 1

that was not possible on PI4 with max res 9152x6944.

I havent tested yet with my C++ code, but i think it will work there also now.

1 Like

Now i noticed there are horizontal “scan lines” on images though every ~145 pixels gamma is alternating. I dont know what else to call them. Any ideas how to fix this? @Edward

this is the command i used to shoot this picture:
libcamera-still --camera 0 --width 9152 --height 6944 -o L2.jpg -n
i scaled this image down for faster upload/download. + tested that autofocus works. The scan lines appeared both with manual focus and autofocus.

1 Like

i’ve seen those too!

sometimes they happen when my battery is getting low? see if a different power supply helps?

ok ill try that. I dont have battery but my screen is full of same message:

hwmon hwmon2: Undervoltage detected!

What kind of power supply should i get?

1 Like

the scan lines could also be due to the lighting of the room

Raspberry Pi manufactures two different USB-C power supplies.

The first is the Raspberry Pi 15W USB-C Power Supply, which is the recommended supply for Raspberry Pi 4 and Raspberry Pi 400. The second is the Raspberry Pi 27W USB-C Power Supply, which provides up to 5A current at +5.1V, and is the recommended supply for Raspberry Pi 5.

The USB-C standard, used by the Raspberry Pi 4 supply, is limited to 5V at 3A, for a total power output of 15W. The USB-PD standard allows higher voltages and currents to be negotiated via software but requires an appropriate Power Management Integrated Circuit (PMIC) which is only present on Raspberry Pi 5. These supplies require that you use suitable USB-PD compatible cables.

NOTE It’s not possible to use older USB “dumb” cables and connectors to provide more than 15W, even with a USB-PD capable supply.

While USB-PD capable phone chargers advertise greater than 15W of power, virtually all of them achieve this by increasing the voltage instead of providing more current at +5V. If you are using a power supply that cannot provide 5A at +5V on first boot you will be warned by the operating system that the current draw to peripherals will be restricted to 600mA.

2 Likes

Over here they say the streaks can be caused by denoising
from number 9

https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/Troubleshooting/

  • Solution

This problem may be related to the noise reduction function of the Raspberry Pi platform ISP, and the solution is as follows:

Add the --denoise cdn_off parameter when taking pictures, such as:

libcamera-still -t 5000 --denoise cdn_off --viewfinder-width 2312 --viewfinder-height 1736 --wid
1 Like

just tested. --denoise cdn_off didnt help

@henri were you able to use them on bookworm with picamera2 in python at all?
because for some reason picamera2 no longer works for my arducams on the pi4 in bullseye. I get memory errors (where i used to not)

i tested with:
libcamera-still --camera 0 --width 9152 --height 6944 -o L2.jpg -n --denoise cdn_off
command

i also tested with GitHub - henrihallik/libcamera-cpp-demo-dual-cam: libcamera c++ demo
comment out line 52 in Libcamera.cpp to get it to compile (this test was without the denoise parameter though). they renamed transform variable to Orientation i havent made the fix yet so temporary workaround is just to comment it out.

it compiled and ran. its based on edwards example GitHub - edward-ardu/libcamera-cpp-demo: libcamera c++ demo u can use that instead also if u want to.

cd libcamera-cpp-demo
mkdir build
cd build
cmake …
make -j4

also i would reccommend u to upgrade ur pi4 to bookworm. and 64-bit if u want to take full use of your device.

i made scripts for QT cross compilation setup for 64-bit os GitHub - henrihallik/qt-cross-compile-pi5_aarch64: QT cross compile setup scripts for 64-bit Rasperry Pi 4&5. for 32-bit u can find instructions here Qt cross compile setup scripts for Raspberry Pi 4

2 Likes

cool! I’m wondering more specifically though if you can make any picamera2 with python examples work. I can do libcamera things, but unfortunatley not any picamera2

for instance from this example used to work for me in march, and now no longer does

#!/usr/bin/python3
# To run this example, update libcamera-dev to version 0.0.12.

import time
from picamera2 import Picamera2, Preview

picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)
preview_config = picam2.create_preview_configuration()
picam2.configure(preview_config)

picam2.start()
time.sleep(1)

# AfMode: Set the AF mode (manual, auto, continuous)
# LensPosition: Manual focus, Set the lens position.

picam2.set_controls({"AfMode": 0, "LensPosition": 10}) #focus nearby - like 10 cm
time.sleep(5)
picam2.set_controls({"AfMode": 0, "LensPosition": 6}) #focus a meter or so away from lens
time.sleep(5)
1 Like

my quess is that it doesent work anymore because libcamera has been updated. in march the latest version was 0.0.4 now its 0.1.0. Things have changed. like for example my c++ code didnt work anymore because the Transform transform variable in cameraconfiguration class didnt exist anymore. they had replaced it with Orientation orientation variable and they added functionolity to it before it was only possible to have rotation 0 and 180 degrees, now u can have 0,-90,90,180 and mirrored versions of all these 4 rotations.

I dont use pycamera, i dont use libcamera from python at all. Since u didnt post the error that crashes your app i cant help u much more. only reccommendation i can give u is to use chatgpt to convert my c++ code to python and try to run that python app.

it says at the top of your picamera python code:

# To run this example, update libcamera-dev to version 0.0.12.

so check which libcamera version you have installed

pi@pi5:~ $ dpkg -l | grep libcamera
ii  libcamera-apps                                   1.4.1-1                              all          transitional package
ii  libcamera-dev:arm64                              0.1.0+rpt20231205-1                  arm64        complex camera support library (development files)
ii  libcamera-ipa:arm64                              0.1.0+rpt20231205-1                  arm64        complex camera support library (IPA modules)
ii  libcamera-tools                                  0.1.0+rpt20231122-1                  arm64        complex camera support library (tools)
ii  libcamera0.1:arm64                               0.1.0+rpt20231205-1                  arm64        complex camera support library
ii  pipewire-libcamera:arm64                         0.3.65-3+rpt3                        arm64        PipeWire libcamera plugin
ii  python3-libcamera                                0.1.0+rpt20231122-1                  arm64        complex camera support library (Python bindings)

or check some specific folder if u compiled and installed libcamera from source.
for example libcamera i use is in this folder

pi@pi5:/usr/lib/aarch64-linux-gnu $ ls -la | grep libcamera
drwxr-xr-x   2 root root      4096 Dec  7 19:59 libcamera
lrwxrwxrwx   1 root root        21 Dec  5 12:00 libcamera-base.so -> libcamera-base.so.0.1
lrwxrwxrwx   1 root root        23 Dec  5 12:00 libcamera-base.so.0.1 -> libcamera-base.so.0.1.0
-rw-r--r--   1 root root    198832 Dec  5 12:00 libcamera-base.so.0.1.0
lrwxrwxrwx   1 root root        16 Dec  5 12:00 libcamera.so -> libcamera.so.0.1
lrwxrwxrwx   1 root root        18 Dec  5 12:00 libcamera.so.0.1 -> libcamera.so.0.1.0
-rw-r--r--   1 root root   1841464 Dec  5 12:00 libcamera.so.0.1.0
lrwxrwxrwx   1 root root        13 Nov 27 09:49 libcamera_app.so -> rpicam_app.so
2 Likes

I just installed a version of bookworm and also got it working with the arducam 64 based on your instructions above.

The libcamera commands work, which is great!

but yeah unfortunatley the picamera commands do not (which is unfortunate, because i need more control over the camera startup and photo taking than libcamera offers)

my error from that example code is below

[0:05:43.386779735] [2106] ERROR V4L2 v4l2_videodevice.cpp:1241 /dev/video0[18:cap]: Unable to request 1 buffers: Cannot allocate memory
[0:05:43.386875385] [2106] ERROR RPI pipeline_base.cpp:683 Failed to allocate buffers
Traceback (most recent call last):
  File "/home/pi/Desktop/Mothbox_Python_Scripts/basicPicam.py", line 13, in <module>
    picam2.start()
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1155, in start
    self.start_()
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1123, in start_
    self.camera.start(controls)
RuntimeError: Failed to start camera: Cannot allocate memory
1 Like