Autofocus fails on three IMX519 cameras in quad mode on CAM Array HAT

Having a strange issue with autofocus on my multi-camera setup. I’ve got 4x 16MP IMX519 cameras connected through the CAM Array HAT. Everything was working fine in single-camera mode — autofocus was solid on all of them. Then I switched to quad mode configuration. Had to remove one camera (powered down the system before doing that), and ever since, autofocus doesn’t work on any of the three remaining cameras.

Each camera is positioned at a different angle, capturing objects at different distances, so I need independent autofocus per camera. The autofocus library is installed and was working before the mode switch. Anyone run into something like this?

Quick heads-up — the quad-cam kit doesn’t support individual autofocus settings per camera when you’re running in quad mode. All cameras share the same focus value in that configuration. If you need independent autofocus for each camera, you’d have to run them in single-camera mode.

Can you switch back to single mode and test each camera one at a time? Let me know what you see.

Alright, so I went through all four cameras (still have the one I removed) in single-camera mode, trying to adjust focus manually through the library. Here’s the result:

Only one camera out of four can actually autofocus. The other three — nothing. The focus motor doesn’t even seem to activate on them.

I then tried swapping cameras across different MIPI ports on the HAT to rule out a port issue. The one working camera autofocuses fine no matter which port it’s plugged into. The three non-working cameras fail on every port. So the problem follows the individual cameras, not the ports.

Is there any software or code-level tweak that could address this, or do those three cameras sound like they have a hardware fault?

From what you’re describing, this definitely follows the specific camera hardware and not the MIPI ports or the software layer. If autofocus works consistently on one camera across all ports but fails on the other three regardless of where they’re connected, that strongly points to a hardware problem with those three camera modules.

Before drawing final conclusions though, I’d like to take a closer look at your setup remotely to rule out anything subtle on the configuration side. I’ve sent you details via private message — please check when you can.

Thanks — I’m trying to get the remote session set up but I’m running into an OS issue on the Pi that’s blocking things. Working on getting that resolved now. Will send the connection details as soon as it’s ready.

No problem. I’ve sent you an alternative remote session link via PM as well in case the first option helps.

In the meantime, if you could share some photos of your physical setup — how the cameras are connected, the HAT positioning, cable routing — that would help me get oriented before we connect.

Just sent over the setup photos. Should show the full layout — all cameras, the HAT, and how everything is cabled up. Let me know if you need close-ups of anything specific.

Thanks for the photos and for connecting to the remote session today. After going through diagnostics on your system, here’s the finding:

The root cause is the Camarray HAT board itself — specifically the Rev D version in your kit. It’s defective, and that fault is what’s preventing autofocus from working on those three IMX519 cameras. The one camera that still manages to autofocus is likely working despite the HAT issue, not because everything is fine with the board.

This isn’t something a software or configuration change can fix — the HAT hardware needs replacement. I’ve sent you the next steps and details via private message.