IMX519 PDAF Release

Is there any hardware difference between cameras built before the PDAF support was added and ones built after? I have two cameras, one made long before PDAF support was integrated and another that I think was made after PDAF support (I received it a few weeks ago) and the two behave differently with AF. The newer camera appears to be using PDAF while the older one appears to be using CDAF as I can see the motor “stepping” and focusing takes longer.


The hardware is the same, and if there is a difference, it’s not about the focusing part.
pdaf will be much faster than cdaf.

The new algorithm is actually a combination of pdaf and cdaf.


Interesting. I’m using the updated PDAF drivers and software with both, and one performs much faster than the other. It pretty much seems like one is favoring PDAF, while the other is favoring CDAF.

I have both hooked up to a CM4 with a Stereo-Pi carrier board (which exposes both MIPI CSI ports of the CM4). I’ve switched the port each camera is connected to and still have the same results. Any recommendations?


You mean you run two cameras with cm4, but their focus speed is very different, is that right
This state is really interesting, can you record a video for me to see?

I’ve been able to determine that the state of the hardware doesn’t affect the focus speed, it’s more of a software issue.

Here is a link to a video showcasing the difference in the focus speeds. The left camera focuses a lot slower than the right and you can see the lens motor stepping through positions.


I need a meeting to talk about this.
Tomorrow is the weekend and I will give you the results on Monday or Tuesday.

I’m struggling with similar issues here. I think it may be because I ran rpi-update trying to resolve another issue with my starvis camera on my rpi zero 2. I did try to roll it back but I fear I may be having continuous problems. On my 16mp autofocus imx519, I get the following from libcamera-hello

> e X/EGL preview window
> [0:6:52.609075591] [2376] e[1;32m INFO e[1;37mCamera e[1;34mcamera_manager.cpp:299 e[0mlibcamera v0.0.4+22-923f5d70
> [0:06:52.736604448] [2378] e[1;32m INFO e[1;37mRPI e[1;34mraspberrypi.cpp:1476 e[0mRegistered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media2 and ISP device /dev/media0
> [0:06:52.737976041] [2376] e[1;32m INFO e[1;37mCamera e[1;34mcamera.cpp:1028 e[0mconfiguring streams: (0) 2048x1536-YUV420
> [0:06:52.738562877] [2378] e[1;32m INFO e[1;37mRPI e[1;34mraspberrypi.cpp:851 e[0mSensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
> [0:06:52.762926758] [2382] e[1;33m WARN e[1;37mIPARPI e[1;34mraspberrypi.cpp:801 e[0mCould not set AF_MODE - no AF algorithm

uname -r

When I try to in stall arducam libcamera, I get some errors that seem to relate to the version of kernel I’m on:

E: Unsupported file ./libcamera0_0_git20230512+8689dd6b-1_armhf given on commandline


Sorry for this brief mistake.

This problem has been fixed now.

Ok – so go ahead and refresh the pivariety install like this?

wget -O
chmod +x


and then -l -p libcamera -p libcamera_apps
1 Like


Has there been any update on the different focusing speeds of the two IMX519 cameras?


Sorry for being late.

Although the focusing speed of the two is different, it is certain that the same algorithm is used. In the previous cdaf state, the focusing speed will be much slower than this. This may be related to factors such as the scene.

Is this part bothering you at the moment?

As a hack to avoid dependency put in camera-streamer you can try to do this:

cd /tmp
sudo dpkg -i libcamera0_0_git20230512+8689dd6b-1_armhf.deb

This will install ArduCam libcamera, but ignore what dependencies are set in camera-streamer.

The reason why camera-streamer is sticking to given libcamera release is that it already happened once that RaspberryPI released binary incompatible binary and it broke existing installations that did apt-get update.

Unfortunately the ArduCam does not distribute package via debian repository that would allow me to compile camera-streamer for arducam in a reproducible way that users could use. The script that they provide always installs only latest version, so this will naturally break camera-streamer each time they release new version.

I was able to get my arducam 16mp running again on my raspi zero 2. I did it by reverting back to an older sdram I had where I ran the from a previous version (about 2-3 weeks back). Before doing that, I tried to run the current install and I got some errors such as:

N: Download is performed unsandboxed as root as file '/home/pi/libcamera-dev_0_git20230512+8689dd6b-1_armhf.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

So, I wonder whether the current install routines are working correctly.


This error looks like a permissions issue. Try sudo

Your problem is not related to the installation script. For some reason, you do not have permission to install the deb package. This is a situation we have not encountered before.


We have also considered the plan you responded to, but there are still some difficulties that have not been resolved, and many details still need to be considered.

Thanks. I will keep eye on this.

If you could:

  • make the libcamera0 and libcamera-dev to be package of different name, but do Provides: libcamera0 and Provides: libcamera-dev. Then they could be explicitly built against, currently those packages are almost identical to ones distributed by RPI, and have exactly the same versioning
  • provide a clear approval to redistribute binaries in another distros and repos
  • make the installation script to not be confusing, since today there’s: libcamera_dev, libcamera, and libcamera_apps and libcamera_apps_new. It is mishmash, and as a result there’s no way to install dev libraries that are for libcamera package, which is a new and desired package that everyone should install on bullseye.

libcamera0, libcamera-dev

Package: libcamera0-arducam
Provides: libcamera0
Conflicts: libcamera0
Replaces: libcamera0

Package: libcamera-arducam-dev
Provides: libcamera-dev
Conflicts: libcamera-dev
Replaces: libcamera-dev


The different focusing speeds are definitely a concern for my purposes. I’m using the two to create a VR headset, where different focusing speeds can cause headaches, both figuratively and literally. Is there any way to fix the different focusing speeds?


Sorry. The two cameras are not synchronized, and their states cannot be synchronized.


I will optimize this part in the next update

I still need to think about these two, thank you for your advice