Arducam_64mp Driver Support for Subject Distance?

I’ve got the Arducam64mp camera connected to my Raspberry Pi4. I’ve also got Raspberry Camera Module 3 on other Raspberry Pis.

I’m using libcamera-still to capture images on each platform. I’m currently setting the focus manually to 0, which is infinity focus.

The Raspberry module embeds the Subject Distance in the exif data.
The Arducam64mp module does not.

Can this information be added in future module updates?

0x9206 SubjectDistance

@WCBonner

I tested and found this information.

dpkg -l | grep libcamera

There are two things I immediately notice different. You get the details that I was interested in, plus your Camera Model name is a less decorated name.

wim@WimPi4-Dev:~ $ libcamera-still --nopreview --hflip --vflip --thumb none --lens-position 0.0 --output test-default.jpg
[27:02:34.050000537] [69720]  INFO Camera camera_manager.cpp:299 libcamera v0.0.0+4135-f8a5e271
[27:02:34.054885231] [69722]  WARN CameraSensorProperties camera_sensor_properties.cpp:190 No static properties available for 'arducam_64mp'
[27:02:34.054957934] [69722]  WARN CameraSensorProperties camera_sensor_properties.cpp:192 Please consider updating the camera sensor properties database
[27:02:34.092141737] [69722]  WARN RPI raspberrypi.cpp:1308 Mismatch between Unicam and CamHelper for embedded data usage!
[27:02:34.093129020] [69722]  INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media3 and ISP device /dev/media4
[27:02:34.093928047] [69720]  INFO Camera camera.cpp:1026 configuring streams: (0) 4624x3472-YUV420
[27:02:34.094317875] [69722]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
Stream configuration adjusted
[27:02:39.561485776] [69720]  INFO Camera camera.cpp:1026 configuring streams: (0) 4624x3472-YUV420 (1) 4624x3472-SBGGR10_CSI2P
[27:02:39.567934654] [69722]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
Still capture image received
wim@WimPi4-Dev:~ $ exiftool test-default.jpg
ExifTool Version Number         : 12.16
File Name                       : test-default.jpg
Directory                       : .
File Size                       : 2.3 MiB
File Modification Date/Time     : 2023:03:30 20:34:16-07:00
File Access Date/Time           : 2023:03:29 20:53:10-07:00
File Inode Change Date/Time     : 2023:03:30 20:34:16-07:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : Raspberry Pi
Camera Model Name               : /base/soc/i2c0mux/i2c@1/arducam_64mp@1a
Software                        : libcamera-apps
Modify Date                     : 2023:03:30 20:34:16
Exposure Time                   : 1/10
ISO                             : 607
Date/Time Original              : 2023:03:30 20:34:16
Create Date                     : 2023:03:30 20:34:16
Image Width                     : 4624
Image Height                    : 3472
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 4624x3472
Megapixels                      : 16.1
Shutter Speed                   : 1/10
wim@WimPi4-Dev:~ $ dpkg -l | grep libcamera
ii  libcamera-apps                       0.0.11                           arm64        libcamera-apps
ii  libcamera-dev                        0.0.11                           arm64        libcamera
ii  libcamera0:arm64                     0~git20230302+923f5d70-1         arm64        complex camera support library

So I ran the following commands:

sudo apt remove libcamera-apps-lite libcamera-apps libcamera-dev
sudo apt install --reinstall -y libcamera-apps libcamera-dev libcamera0 raspberrypi-kernel

and now I get:

wim@WimPi4-Dev:~ $ dpkg -l | grep libcamera
ii  libcamera-apps                       0~git20230301+54a781d-1          arm64        libcamera-apps
ii  libcamera-dev:arm64                  0~git20230302+923f5d70-1         arm64        complex camera support library (development files)
ii  libcamera0:arm64                     0~git20230302+923f5d70-1         arm64        complex camera support library
wim@WimPi4-Dev:~ $ libcamera-still --list-cameras
No cameras available!

@WCBonner

what is your kernel version

uname -a

Could you please upgrade your kernel version to 5.15.84 or 6.1.19.

Then use our install script.

libcamera 0.0.11 probably didn’t add this information.

I ran your script, first installing the dev package, then the app package. Now it’s finding the camera again, but not getting version 0.11 from your servers… It also seems to not support the lens-position option of the newer standard part of libcamera-apps options.

sudo ./install_pivariety_pkgs.sh -p libcamera_dev
sudo ./install_pivariety_pkgs.sh -p libcamera_apps

wim@WimPi4-Dev:~ $ libcamera-still --list-cameras
Available cameras
-----------------
0 : arducam_64mp [9248x6944] (/base/soc/i2c0mux/i2c@1/arducam_64mp@1a)
    Modes: 'SRGGB10_CSI2P' : 1280x720 [120.03 fps - (2064, 2032)/5120x2880 crop]
                             1920x1080 [60.04 fps - (784, 1312)/7680x4320 crop]
                             2312x1736 [30.00 fps - (0, 0)/9248x6944 crop]
                             3840x2160 [20.00 fps - (784, 1312)/7680x4320 crop]
                             4624x3472 [10.00 fps - (0, 0)/9248x6944 crop]
                             9152x6944 [2.70 fps - (0, 0)/9248x6944 crop]
wim@WimPi4-Dev:~ $ libcamera-still --nopreview --hflip --vflip --thumb none --lens-position 0.0 --output test-default.jpg
Closing Libcamera application(frames displayed 0, dropped 0)
Camera stopped!
Tearing down requests, buffers and configuration
Camera closed
ERROR: *** unrecognised option '--lens-position' ***
wim@WimPi4-Dev:~ $ dpkg -l | grep libcamera
ii  libcamera-apps                       0.0.10                           arm64        libcamera-apps
ii  libcamera-dev                        0.0.10                           arm64        libcamera
wim@WimPi4-Dev:~ $ libcamera-still --nopreview --hflip --vflip --thumb none --output test-default.jpg
[12:12:32.291023872] [32948]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3897-c3c878a9
[12:12:32.298228274] [32950]  WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for 'arducam_64mp'
[12:12:32.298279902] [32950]  WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
[12:12:32.317244957] [32950]  WARN RPI raspberrypi.cpp:1280 Mismatch between Unicam and CamHelper for embedded data usage!
[12:12:32.318028410] [32950] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[12:12:32.318200500] [32950]  INFO RPI raspberrypi.cpp:1404 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media4 and ISP device /dev/media2
[12:12:32.318893083] [32948]  INFO Camera camera.cpp:1035 configuring streams: (0) 4624x3472-YUV420
[12:12:32.319339336] [32950]  INFO RPI raspberrypi.cpp:765 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
Stream configuration adjusted
[12:12:37.784723624] [32948]  INFO Camera camera.cpp:1035 configuring streams: (0) 4624x3472-YUV420 (1) 4624x3472-SBGGR10_CSI2P
[12:12:37.790333492] [32950]  INFO RPI raspberrypi.cpp:765 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 4624x3472-SBGGR10_1X10 - Selected unicam format: 4624x3472-pBAA
Still capture image received
wim@WimPi4-Dev:~ $ exiftool test-default.jpg
ExifTool Version Number         : 12.16
File Name                       : test-default.jpg
Directory                       : .
File Size                       : 1936 KiB
File Modification Date/Time     : 2023:03:31 09:25:51-07:00
File Access Date/Time           : 2023:03:29 20:53:10-07:00
File Inode Change Date/Time     : 2023:03:31 09:25:51-07:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Make                            : Raspberry Pi
Camera Model Name               : /base/soc/i2c0mux/i2c@1/arducam_64mp@1a
Software                        : libcamera-apps
Modify Date                     : 2023:03:31 09:25:51
Exposure Time                   : 1/100
ISO                             : 169
Date/Time Original              : 2023:03:31 09:25:51
Create Date                     : 2023:03:31 09:25:51
Image Width                     : 4624
Image Height                    : 3472
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 4624x3472
Megapixels                      : 16.1
Shutter Speed                   : 1/100
wim@WimPi4-Dev:~ $ uname -a
Linux WimPi4-Dev 6.1.19-v8+ #1637 SMP PREEMPT Tue Mar 14 11:11:47 GMT 2023 aarch64 GNU/Linux

@WCBonner

That shouldn’t be the case. Version 6.1.19 should install a new set of libcamera.
We have now upgraded the version number of libcamera.

Like this:

Are you sure you reinstalled libcamera after upgrading the kernel?

./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps