Where did you get the camera module(s)?
Bought it from Arducam as part of the B0402 bundle ( 64MP Autofocus Synchronized Quad-Camera Kit for Raspberry Pi).
Model number of the product(s)?
B0402 → 1x UC-512 Rev. D1 4x Arducam 64MP Autofokus Rev C (with a pink dot)
What hardware/platform were you working on?
Raspberry Pi 4 2GB
Instructions you have followed. (link/manual/etc.)
I am using a freshly installed Raspberry Pi OS and followed your tutorial:
$ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
$ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[all]
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
dtoverlay=vc4-kms-v3d,cma-512
[all]
dtoverlay=arducam-64mp
dtparam=i2c_vc=on
dtparam=i2c_arm=on
Capture at lower res behaves very much the same:
$ libcamera-jpeg -o test.jpg --width 1920 --height 1080 -v
Options:
verbose: 2
info_text:#%frame (%fps fps) exp %exp ag %ag dg %dg
timeout: 5000
width: 1920
height: 1080
output: test.jpg
post_process_file:
rawfull: 0
preview: default
qt-preview: 0
transform: identity
roi: all
metering: centre
exposure: normal
ev: 0
awb: auto
flush: false
wrap: 0
brightness: 0
contrast: 1
saturation: 1
sharpness: 1
framerate: 30
denoise: auto
viewfinder-width: 0
viewfinder-height: 0
tuning-file: (libcamera)
lores-width: 0
lores-height: 0
autofocus-range: normal
autofocus-speed: normal
autofocus-window: all
mode: unspecified
viewfinder-mode: unspecified
metadata:
metadata-format: json
encoding: jpg
quality: 93
raw: 0
restart: 0
timelapse: 0
framestart: 0
datetime: 0
timestamp: 0
keypress: 0
signal: 0
thumbnail width: 320
thumbnail height: 240
thumbnail quality: 70
latest:
immediate 0
AF on capture: 0
No connector ID specified. Choosing default from list:
Connector 32 (crtc 0): type 11, 0x0
Connector 42 (crtc 0): type 11, 0x0
Preview window unavailable
Running without preview window
Opening camera...
[0:01:46.600644676] [879] INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4226-8689dd6b
[0:01:46.619665669] [881] WARN CameraSensorProperties camera_sensor_properties.cpp:243 No static properties available for 'arducam_64mp'
[0:01:46.619719243] [881] WARN CameraSensorProperties camera_sensor_properties.cpp:245 Please consider updating the camera sensor properties database
[0:01:46.636289735] [881] WARN RPI raspberrypi.cpp:1366 Mismatch between Unicam and CamHelper for embedded data usage!
[0:01:46.637194254] [881] INFO RPI raspberrypi.cpp:1485 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media2 and ISP device /dev/media1
Acquired camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a
Configuring viewfinder...
Viewfinder size chosen is 4624x2600
[0:01:46.638772533] [879] INFO Camera camera.cpp:1028 configuring streams: (0) 4624x2600-YUV420
[0:01:46.639163459] [881] INFO RPI raspberrypi.cpp:851 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SRGGB10_1X10 - Selected unicam format: 4624x3472-pRAA
Camera streams configured
Available controls:
NoiseReductionMode : [0..4]
AeEnable : [false..true]
FrameDurationLimits : [99997..237626997]
ColourCorrectionMatrix : [-16.000000..16.000000]
ScalerCrop : [(0, 0)/128x128..(0, 0)/9248x6944]
AwbMode : [0..7]
ExposureValue : [-8.000000..8.000000]
AeMeteringMode : [0..3]
Contrast : [0.000000..32.000000]
Saturation : [0.000000..32.000000]
LensPosition : [0.000000..32.000000]
AfRange : [0..2]
ColourGains : [0.000000..32.000000]
AnalogueGain : [1.000000..64.000000]
AfMetering : [0..1]
AfPause : [0..2]
ExposureTime : [254..237625637]
AfMode : [0..2]
AeConstraintMode : [0..3]
AfTrigger : [0..1]
AfSpeed : [0..1]
AeExposureMode : [0..3]
AfWindows : [(0, 0)/0x0..(65535, 65535)/65535x65535]
Brightness : [-1.000000..1.000000]
AwbEnable : [false..true]
Sharpness : [0.000000..16.000000]
Buffers allocated and mapped
Viewfinder setup complete
Requests created
Camera started!
Initially I tried with one and two. I connected a second camera again. Now I got cameras connected to RX0 and RX1. Command output did not change (still hanging). I also tried to explicitly select one of the cameras (using i2cset -y 10 0x24 0x24 0x02 or i2cset -y 10 0x24 0x24 0x12). This still hangs.
So unfortunately no progress. We can try other RPIs (we got a bunch of them) or other SD cards with different OS if that helps. I am completely lost why this hangs and how to debug it. Should I hook up a logic analyser, scope, serial or JTAG somewhere?
Ok I understand now what you mean by two channel. So you have to populate RX0 or RX1 and RX2 or RX3? Guess that should go into the docs as it currently states that you can use “up to four cameras” which implies that a single camera should work as well.
I tried that and now it works. Thanks! I struggled a bit with the focus. Autofocus does not seem to work. Manual focus with a range of 6.5 (near infinity) to 5 (near) seems to be working.
We also bough four of those RJ45 extenders (U6248). Basically one for each of the cameras. Is there any trick to mount them on top of the hat? It seems like the upper connector on my hat is not populated. Even if it would not fit the power connector on the extender. Also stacking two extenders does not work. Looks like there is also no way to power extenders via USB like the hat. Any guidance on that?
It may be a problem caused by the center focus. We are currently trying to figure out how to have a better focus algorithm on the hat. You can try to see if autofocus works in single channel mode.
Auto focus:
I tried setting one channel via i2cset and that works fine. However, when I try autofocus I hear a loud click (similar but louder when you set a focus value above 9). It seems to drive the focus against one of the limits and fails to focus properly. This is not an issue for our usecase so don’t worry to much. We will just set focus manually.
For our use case we need to mount cameras farther away than a few centimetres. We cannot use the product without extensions. Is there any way or do we have to return it?