IMX219 camera detected but libcamera Unicam timeout on Raspberry Pi 4 Bullseye

Hi, I’m stuck with an IMX219 camera module on my Raspberry Pi 4B and I can’t get it working at all. The camera seems to be detected, but libcamera keeps reporting errors and I never got a single image out of it. I followed the setup instructions from the docs link I was given (did the whole ‘Which instruction are you following?’ thing) and it did not change anything. This is what keeps showing up:

[0:09:25.457448458] [1344] ERROR RPI raspberrypi.cpp:1794 Unicam has timed out!
[0:09:25.457501844] [1344] ERROR RPI raspberrypi.cpp:1795 Please check that your camera sensor connector is attached securely.
[0:09:25.457553545] [1344] ERROR RPI raspberrypi.cpp:1796 Alternatively, try another cable and/or sensor.

Any idea how to get it working? I never got it to run once.

Sorry to hear it’s giving you trouble, let’s dig in. Can you share a few things with me:

  1. Exactly which module/size you’re using
  2. The output of uname -a
  3. The output of these two commands:
    cat /etc/os-release
    cat /boot/config.txt

Also, just to confirm you’re on the right steps, the setup guide is here:
https://www.arducam.com/docs/cameras-for-raspberry-pi/native-raspberry-pi-cameras/8mp-imx219-standard-camera-modules/

Since you’re on a Pi 4, the part you need is:

  1. sudo nano /boot/config.txt
  2. Find the line camera_auto_detect=1 and change it to camera_auto_detect=0
  3. Add dtoverlay=imx219
  4. Save and reboot

Let me know what those outputs show and we’ll go from there.

Sure. It’s an IMX219 CAM for RPI, running on a Raspberry Pi 4B, Bullseye, 5.15.32-v7l+.

uname -a:
Linux my-printer 5.15.45-v7l+ #1561 SMP Mon Jun 6 15:24:26 BST 2022 armv7l GNU/Linux

cat /etc/os-release:
PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL=“http://www.raspbian.org/”
SUPPORT_URL=“http://www.raspbian.org/RaspbianForums”
BUG_REPORT_URL=“http://www.raspbian.org/RaspbianBugs”

The doc I’m following is the software setup section of that same page you linked.

Thanks, that helps. Can you paste your /boot/config.txt as well? I want to see the overlay lines and make sure nothing there is conflicting with the camera.

Here’s the config.txt:

dtparam=i2c_arm=on
dtparam=i2s=on
#dtparam=spi=on
dtparam=audio=off
camera_auto_detect=0
display_auto_detect=1
dtoverlay=vc4-kms-v3d (I also tried adding ,cma-256 to it)
max_framebuffers=2
disable_overscan=1
[cm4] otg_mode=1
[pi4] arm_boost=1
[all] start_x=1 (tried with and without this line)
gpu_mem=128
dtoverlay=imx219
#enable_uart=1

That config actually looks correct — camera_auto_detect=0 plus dtoverlay=imx219 is exactly what we’d want for this module on a Pi 4. So the software setup side seems fine.

Can you walk me through what you’ve already tried physically, and anything else you changed?

  • Have you tried swapping the ribbon cable?
  • Is the connector fully seated, and in the right orientation on both ends?
  • Any other OS images or settings you tested?

Yeah, I’ve done a lot already:

  • Tried both of the included cables
  • Checked multiple times that the cable is in the correct orientation
  • Tried different OS images
  • Set camera_auto_detect from 1 to 0 with dtoverlay=imx219 — no change
  • Tried vc4-kms-v3d with and without cma-256
  • Tried with and without start_x=1

Nothing makes any difference. Same Unicam timeout every single time.

OK, thanks for being thorough. Here’s where I’m at: we’ve tested this camera model ourselves and it works normally, so the module itself isn’t incompatible with a Pi 4.

Given that your config is correct and libcamera still times out, that error almost always comes down to the sensor connection path — the connector not being seated properly, or a bad cable/sensor. Since you’ve ruled out orientation and tried both cables and multiple OS images, can you confirm for me that the connection itself is definitely good and that at least one cable works?

If both of those check out, then the issue is most likely with the camera itself.

Just to be clear about the problem: the camera IS detected, but it still reports those errors in the logs.

Environment: Raspberry Pi 4B, and I powered the Pi on only after connecting the camera.

Attempts:

  • The camera was connected properly and I verified it before powering the Pi on
  • I can’t 100% confirm both supplied cables work, but since the camera doesn’t work on either of them, the cables are probably fine
  • Already tried both cables and different OS images (same logs as I posted earlier)

So it’s not looking good for the camera.

Thanks for confirming all of that. Putting it together:

  • Your config already has the recommended settings (camera_auto_detect=0 and dtoverlay=imx219), and libcamera still reports Unicam has timed out
  • You’ve swapped both cables, re-checked orientation multiple times, and tried different OS images
  • The same camera model works fine when tested on our side

The Unicam timeout errors point to the sensor connector/connection path or a faulty cable/sensor. Since the connection checks out and the recommended software settings are already in place, this points to a hardware fault in the camera module itself rather than a configuration or software issue. There isn’t a config change that will fix a sensor that isn’t responding at the driver level, so at this point the fault is on the hardware side.