How to get max resolution of 16MP IMX519 Autofocus Quad-Camera Kit with Raspberry Pi 4 model B using libcamera command?

  1. Where did you get the camera module(s)?
    https://www.amazon.com/Arducam-Autofocus-Quad-Camera-Synchronized-Compatible/dp/B09TSGMCM9

  2. Model number of the product(s)?

Arducam 16MP Autofocus Quad-Camera Kit for Raspberry Pi, 16MP IMX519 Autofocus Synchronized Raspberry Pi Camera, Compatible with Nvidia Jetson Nano/Xavier NX, SKU : B0388

  1. What hardware/platform were you working on?

Raspberry Pi 4 Computer Model B 8GB Single Board Computer

  1. Instructions you have followed. (link/manual/etc.)
    Quick Start Guide for Arducam CamArray HAT Kit - Arducam Wiki

https://docs.arducam.com/Raspberry-Pi-Camera/Multi-Camera-CamArray/quick-start/#switch-composition-mode

  1. The dmesg log from your hardware?

Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
NAME=“Debian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“Debian -- User Support
BUG_REPORT_URL=“https://bugs.debian.org/

  1. Problems you were having?

I followed the instruction above to successfully make the Quad-Camera Kit of four 16MP IMX519 cameras work with lowe speed driver on Raspberry Pi 4 model B in “macro” focus mode.

commands used:

libcamera-still -t 0 --autofocus-mode auto
libcamera-still -t 0 --autofocus-range macro

then, I tried to use “Switch Composition Mode”

i2cset -y 10 0x24 0x24 0x02
libcamera-still -t 2000 -n -o test.jpg

The image was written normally only with the warning “ERROR IPARPI cam_helper.cpp:249 Embedded data buffer parsing failed”.
However, the captured image resolution ( 2328x1748-YUV420) was half of the max resolution of the 16MP IMX519 camera (4656 × 3496) .

Questions1:

  1. Is there any command to get the max resolution of 16MP IMX519 with Arducam CamArray HAT Kit in Switch Composition Mode using “libcamera-still” command?

  2. Is there any other command to allow continuous switch channels and capture images at max resolution for each camera? My goal was to capture 4 images from each camera in max resolution,
    Now I am using a loop to switch channels and " i2cset -y 10 0x24 0x24 0x02
    libcamera-still -t 2000 -n -o test.jpg" to implement the function.

If there are better ways to achieve this goal, it will be highly appreciated.

Attached are the config, dmesg and meminfo.
config.txt
dmesg.txt
meminfo.txt

and setup of the Quad-Camera Kit and capture images at half resolution.




Thanks for your help!

@suxingliu

The resolution is actually composed of four cameras. If you use dual-channel or single-channel, the corresponding resolution becomes 1/2 and 1/4 of the original

There is currently no better solution.

Thank you @Edward

The 16MP IMX519 camera can achieve resolution at 4656 (H) × 3496 (V), according to
https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/16MP-IMX519/

So with the Arducam CamArray HAT Kit, we can only achieve 1/4 of the 4656 (H) × 3496 (V), which is
1164×874 in single-channel using Switch Composition Mode?

Is the active resolution of 16MP IMX519, in fact, a 4M pixel camera?

I guess the limitation was still in the bandwidth of the Pi port.

Another follow-up question, does the driver can only use “imx519_kernel_driver_low_speed” instead of “imx519_kernel_driver” when using Arducam CamArray HAT Kit?

./install_pivariety_pkgs.sh -p imx519_kernel_driver_low_speed

@suxingliu

yes

Not exactly, we don’t have a supported driver for that.
Our Pivariety cameras can do it all.

Yes, we now uniformly use the low-speed version, which will be much more stable and will not affect the normal use of users.

The product page indicated that “When you switch to single-channel mode, you can get 4 images at full res!”.

How to switch to the single-channel mode to get 4 images at full res?

What is the command line to test this function?

@suxingliu


The title of the switch channel, please don’t worry about the topic I share, both cameras use the same register on the switch channel.

I also want to clarify that a single channel will only allow you to save the full-resolution image of one camera. If you save four images, you need to switch to the corresponding channel for saving. Maybe the description on the product page is not very clear, I will let them revise the description.

Thank you so much @Edward!

I already tried with the commands like " i2cset -y 10 0x24 0x24 0x02
libcamera-still -t 2000 -n -o test.jpg" as mentioned in my former post,
the resolution of the images saved was not 16M. I will try again to follow your suggestions.

Follow-up questions:

1: What is the command to save the image at a specific resolution using “libcamera”?

  1. We have ordered three sets of " Arducam 16MP Autofocus Quad-Camera Kit for Raspberry Pi, 16MP IMX519 Autofocus Synchronized Pi Camera", the first set has one camera showing a black image, we returned it and replaced with a second set, the second set works, however, we got “CamHelper for embedded data usage” error similar like " [Libcamera, IMX519, Octopi stream interruptions]". However, it works fine and can switch channels and save images. although not in full resolution of 16M.
    So we ordered the third set, this set works totally fine without any errors.

Should we return the second set and get a new set? Or it is normal to have CamHelper for embedded data usage" error? We just want to make sure it will run stable and robust for our system.

This problem will not affect your use, the new version of libcamera will not parse the relevant data, there is a way to turn off the error
set environment variables:

export LIBCAMERA_NOTPARSE_EMBEDDED_DATA=1

Use –width --height to set the image resolution. Use –viewfinder-width --viewfinder-height to set preview resolution