Is PDAF enabled on the IMX519 with the Raspberry Pi 5? If so, what are the steps to make it work on the latest version of Raspbian.
On a fresh install of Raspbian OS Lite 64 Bit (6.6.31+rpt-rpi-2712), I did the following:
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
./install_pivariety_pkgs.sh -p libcamera_apps
The autofocus is incredibly slow (10+ seconds, and appears to be CDAF). Turning on autofocus debugging shows that the PDAF confidence values are zero.
LIBCAMERA_LOG_LEVELS=RPiAf:0 libcamera-still -n -t 0
[0:12:05.098094394] [11979] INFO Camera camera_manager.cpp:316 libcamera v0.3.1+74-a65f44f4-dirty (2024-09-09T08:55:36BST)
[0:12:05.107975051] [11988] INFO RPI pisp.cpp:695 libpisp version v1.0.7 28196ed6edcf 29-08-2024 (16:33:32)
[0:12:05.248777302] [11988] INFO RPI pisp.cpp:1155 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/imx519@1a to CFE device /dev/media3 and ISP device /dev/media1 using PiSP variant BCM2712_C0
[0:12:05.249235299] [11979] WARN V4L2 v4l2_pixelformat.cpp:344 Unsupported V4L2 pixel format RPBP
Mode selection for 2328:1748:12:P
SRGGB10_CSI2P,1280x720/0 - Score: 5319.24
SRGGB10_CSI2P,1920x1080/0 - Score: 3319.24
SRGGB10_CSI2P,2328x1748/0 - Score: 1000
SRGGB10_CSI2P,3840x2160/0 - Score: 1648.24
SRGGB10_CSI2P,4656x3496/0 - Score: 2019
Stream configuration adjusted
[0:12:05.249557483] [11979] INFO Camera camera.cpp:1191 configuring streams: (0) 2328x1748-YUV420 (1) 2328x1748-RGGB_PISP_COMP1
[0:12:05.249677297] [11988] INFO RPI pisp.cpp:1451 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected CFE format: 2328x1748-PC1R
[0:12:05.249842260] [11988] DEBUG RPiAf af.cpp:779 setLensPosition: 1
[0:12:05.257678407] [11992] DEBUG RPiAf af.cpp:816 setMode: 2
[0:12:05.257724240] [11992] DEBUG RPiAf af.cpp:739 setSpeed: 0
[0:12:05.257746611] [11992] DEBUG RPiAf af.cpp:732 setRange: 0
[0:12:05.257922758] [11992] DEBUG RPiAf af.cpp:233 switchMode: statsRegion: 0,0,4656,3496
[0:12:05.463206829] [11992] DEBUG RPiAf af.cpp:517 SKIP
[0:12:05.463227718] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=0 phase=0 conf=0
[0:12:05.496766742] [11992] DEBUG RPiAf af.cpp:357 Recompute Contrast weights 8x8
[0:12:05.499591987] [11992] DEBUG RPiAf af.cpp:517 SKIP
[0:12:05.499608413] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=0 phase=0 conf=0
[0:12:05.530215007] [11992] DEBUG RPiAf af.cpp:517 SKIP
[0:12:05.530231618] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=0 phase=0 conf=0
[0:12:05.563507421] [11992] DEBUG RPiAf af.cpp:517 SKIP
[0:12:05.563523310] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=0 phase=0 conf=0
[0:12:05.596824538] [11992] DEBUG RPiAf af.cpp:517 SKIP
[0:12:05.596840446] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=0 phase=0 conf=0
[0:12:05.630143489] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=35 phase=0 conf=0
[0:12:05.663485255] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=35 phase=0 conf=0
[0:12:05.696791187] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=35 phase=0 conf=0
[0:12:05.730154379] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=35 phase=0 conf=0
[0:12:05.763472571] [11992] DEBUG RPiAf af.cpp:693 1 sst2->2 stp0->0 ft1.00->1.00 fs1.00->1.00 cont=98 phase=0 conf=0
[0:12:05.796714577] [11992] DEBUG RPiAf af.cpp:693 1 sst2->3 stp0->4 ft1.00->0.00 fs1.00->0.00 cont=98 phase=0 conf=0
[0:12:05.830048676] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp4->3 ft0.00->0.00 fs0.00->0.00 cont=95 phase=0 conf=0
[0:12:05.863351887] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp3->2 ft0.00->0.00 fs0.00->0.00 cont=87 phase=0 conf=0
[0:12:05.896730930] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp2->1 ft0.00->0.00 fs0.00->0.00 cont=88 phase=0 conf=0
[0:12:05.930068881] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp1->0 ft0.00->0.00 fs0.00->0.00 cont=88 phase=0 conf=0
[0:12:05.963404869] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp0->4 ft0.00->1.00 fs0.00->1.00 cont=89 phase=0 conf=0
[0:12:05.996773245] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp4->3 ft1.00->1.00 fs1.00->1.00 cont=91 phase=0 conf=0
[0:12:06.030121826] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp3->2 ft1.00->1.00 fs1.00->1.00 cont=98 phase=0 conf=0
[0:12:06.063637090] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp2->1 ft1.00->1.00 fs1.00->1.00 cont=98 phase=0 conf=0
[0:12:06.096816764] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp1->0 ft1.00->1.00 fs1.00->1.00 cont=98 phase=0 conf=0
[0:12:06.130143308] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp0->4 ft1.00->2.00 fs1.00->2.00 cont=98 phase=0 conf=0
[0:12:06.163456388] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp4->3 ft2.00->2.00 fs2.00->2.00 cont=101 phase=0 conf=0
[0:12:06.196762858] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp3->2 ft2.00->2.00 fs2.00->2.00 cont=110 phase=0 conf=0
[0:12:06.230071901] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp2->1 ft2.00->2.00 fs2.00->2.00 cont=110 phase=0 conf=0
[0:12:06.263406019] [11992] DEBUG RPiAf af.cpp:693 1 sst3->3 stp1->0 ft2.00->2.00 fs2.00->2.00 cont=110 phase=0 conf=0
Here is a real time video of the autofocus (continuous) in action streamed directly from the camera. As you can see it seems to be using the course step/fine step algorithm which is part of the CDAF fallback.
Dion
September 20, 2024, 6:28am
4
Hi @Nighthawk
You can stay tuned to the issue opened in the Raspberry Pi GitHub. It has not been solved so far.
opened 12:58AM - 16 Nov 23 UTC
### Describe the bug
We tested the IMX519 and found that metadata can be output… normally on Pi4, but on Pi5, the cfe driver reported "Wrong metadata width/height/code". After a simple calculation, we found that it seems that the cfe driver requires the length of Metadata to be 64bit aligned. Any ideas?
![image](https://github.com/raspberrypi/linux/assets/11016968/37a680c6-ead6-4c99-9bd6-d6a5b170bc9f)
### Steps to reproduce the behaviour
Running IMX519 on Pi5 using libcamera
### Device (s)
Other
### System
**cat /etc/rpi-issue**
Raspberry Pi reference 2023-10-10
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, fb56ad562991cf3ae5c96ab50983e1deeaefc7b6, stage4
**vcgencmd version**
2023/10/18 18:30:17
Copyright (c) 2012 Broadcom
version c2da2ae7 (release) (embedded)
**uname -a**
Linux raspberrypi 6.1.0-rpi6-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.58-1+rpt2 (2023-10-27) aarch64 GNU/Linux
### Logs
```
[ 8.020555] macb 1f00100000.ethernet: gem-ptp-timer ptp clock registered.
[ 8.051440] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[ 9.914906] Bluetooth: RFCOMM TTY layer initialized
[ 9.914919] Bluetooth: RFCOMM socket layer initialized
[ 9.914929] Bluetooth: RFCOMM ver 1.11
[ 12.126407] macb 1f00100000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[ 12.126427] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 34.596407] rp1-cfe 1f00128000.csi: WARNING: Wrong metadata width/height/code 17472x1 00007002 (remote pad set to 17460x1 00007002)
```
[dmesg.log](https://github.com/raspberrypi/linux/files/13371076/dmesg.log)
### Additional context
_No response_