Arducam IMX219 camera not recognized on Raspberry Pi 2B with Raspbian Bullseye

Hi, hoping someone can help. I have an Arducam IMX219 camera (the Raspberry Pi Camera series, SKU B0395) on a Raspberry Pi 2B running Raspbian GNU/Linux 11 (bullseye). Honestly I never got it to work at all — the camera is never recognized. I’ve gone through the Quick Start guide, a bunch of YouTube videos and Pi forum threads and updated the OS and the configurator, but still nothing. Can anyone point me in the right direction?

Hi, happy to help. For the IMX219 on a Pi 2B with Bullseye, the config has to be set up in a specific way or the camera just won’t come up. A few things to check:

  1. In /boot/config.txt, disable camera auto-detect and add the IMX219 overlay:
    sudo nano /boot/config.txt
    Look for a line camera_auto_detect=1 and change it to:
    camera_auto_detect=0
    dtoverlay=imx219
    Save and reboot.

  2. Enable Glamor graphic acceleration:
    sudo raspi-config → Advanced Options → GL Driver → and enable Glamor graphic acceleration. Reboot.

  3. Select the GL (Full KMS) driver:
    sudo raspi-config → Advanced Options → GL Driver → GL (Full KMS). Reboot.

Can you try that and then paste your /boot/config.txt here? Also let me know what raspistill and libcamera-still print when you run them.

OK I tried, but here’s the problem: there is no camera_auto_detect=1 line anywhere in my config.txt. So I tried adding it manually right under the start_x=1 line and it made no difference at all. Camera still isn’t recognized.

Here’s my /boot/config.txt as it looks in the editor (GNU nano 5.4 /boot/config.txt):

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

Uncomment this to enable infrared communication.

#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Automatically load overlays for detected cameras

start_x=1

Automatically load overlays for detected DSI displays

display_auto_detect=1

Enable DRM VC4 V3D driver

dtoverlay=vc4-kms-v3d
max_framebuffers=2

Disable compensation for displays with overscan

disable_overscan=1

[cm4]

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1

[all]

[pi4]
#dtoverlay=vc4-fkms-v3d

Run as fast as firmware / board allows

arm_boost=1

[all]
gpu_mem=128

Thanks, that helps a lot. Can you run these and paste the exact output?

  • raspistill -t 5
  • libcamera-still -t 5
  • vcgencmd get_camera

And tell me whether the Legacy Camera option is currently enabled or disabled in raspi-config, because the answers between the two stacks can differ. Also let me know what happens with a Python picamera script if you’ve tried one.

Sure. Here’s what I get:

  • raspistill returns: mmal: Failed to run camera app. Please check for firmware updates
  • libcamera-still returns: Error: the system appears to be configured for the legacy camera stack

If I disable the legacy stack, libcamera-still gives:
Failed to start streaming: no such file or directory
ERROR: failed to start camera

And running raspistill with legacy camera disabled gives: ERROR: the system should be configured for the legacy camera stack

vcgencmd get_camera is weird too — without legacy camera enabled it returns supported=0, detected=0, but with legacy camera enabled it returns supported=1, detected=1.

I also tried a Python script using PiCamera while legacy camera mode was disabled and got: Camera is not enabled. Try running ‘sudo raspi-config’ and ensure the camera has been enabled. And when legacy camera mode IS enabled I get: Failed to enable connection: Out of resources.

The camera only ever shows up when the Legacy Camera is enabled in the configurator. I’ve checked the ribbon cable and it’s seated correctly. I’m starting to think this might be a hardware fault.

I went through your config.txt carefully. Two things stand out:

  1. camera_auto_detect=0 is missing entirely.
  2. You haven’t set dtoverlay=imx219 under the [all] line.

Simply adding camera_auto_detect=0 under start_x=1 is not enough — dtoverlay=imx219 has to go in the [all] section. So please add camera_auto_detect=0 manually, and put dtoverlay=imx219 under the [all] line. For example, right where you have the second [all] entry, add dtoverlay=imx219 below it. Reboot afterwards and retest with libcamera-still. Can you do that and send me the updated config.txt plus the terminal output?

Alright, I added both. I put camera_auto_detect=0 and dtoverlay=imx219 right after the display_auto_detect=1 line (so before dtoverlay=vc4-kms-v3d). Rebooted. Still not recognized. Here are my terminal outputs:

jbrunson@raspberrypi:~ $ raspistill -t 5
ERROR: the system should be configured for the legacy camera stack

jbrunson@raspberrypi:~ $ libcamera-still -t 5
Made X/EGL preview window
[0:01:21.444749063] [1071] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3544-22656360
[0:01:21.694645627] [1072] WARN RPI raspberrypi.cpp:1241 Mismatch between Unicam and CamHelper for embedded data usage!
[0:01:21.697277626] [1072] INFO RPI raspberrypi.cpp:1356 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media3 and ISP device /dev/media1
[0:01:21.699589303] [1071] INFO Camera camera.cpp:1029 configuring streams: (0) 1640x1232-YUV420
[0:01:21.701656026] [1072] INFO RPI raspberrypi.cpp:760 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
[0:01:24.309297999] [1072] WARN V4L2 v4l2_videodevice.cpp:1952 /dev/video0[16:cap]: Dequeue timer of 2476000.00us has expired!
[0:01:24.309735508] [1072] ERROR RPI raspberrypi.cpp:1794 Unicam has timed out!
[0:01:24.309868480] [1072] ERROR RPI raspberrypi.cpp:1795 Please check that your camera sensor connector is attached securely.
[0:01:24.309981087] [1072] ERROR RPI raspberrypi.cpp:1796 Alternatively, try another cable and/or sensor.

And my config.txt now looks like this:

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

Uncomment this to enable infrared communication.

#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

dtparam=audio=on

Automatically load overlays for detected cameras

start_x=1

Automatically load overlays for detected DSI displays

display_auto_detect=1
camera_auto_detect=0
dtoverlay=imx219

Enable DRM VC4 V3D driver

dtoverlay=vc4-kms-v3d
max_framebuffers=2

Disable compensation for displays with overscan

disable_overscan=1

[cm4]

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1

[all]

[pi4]
#dtoverlay=vc4-fkms-v3d

Run as fast as firmware / board allows

arm_boost=1

[all]
gpu_mem=128

I also attached a photo of the setup: image_37926902521654595034935.png

Thanks. I’ve looked through everything carefully and honestly your config.txt and the system setup look correct — there’s nothing wrong in the configuration itself. Your file now has start_x=1, display_auto_detect=1, camera_auto_detect=0, dtoverlay=imx219, dtoverlay=vc4-kms-v3d, max_framebuffers=2, disable_overscan=1 and gpu_mem=128, which is what we’d want.

But I noticed something in what you pasted. You said you ran ‘libcamera -still -t 5’ — note that with the stray space, ‘-t 5’ gets read as a preview duration of 0.005 seconds, not 5 seconds. That’s why you basically see the preview flash and then the Unicam errors/timeouts, since the pipeline gets torn down almost immediately. It’s not a sensor fault.

So the last piece here is the command. Please try the correct libcamera-still syntax:

  • To preview: libcamera-still -t 0
  • To capture a test picture: libcamera-still -t 5000 -o test.jpg

Run those and let me know what you get.

Oh wow, that was it. I was typing it wrong the whole time. With libcamera-still -t 0 the preview comes up fine, and libcamera-still -t 5000 -o test.jpg saves the picture no problem. Camera works. Thanks for sticking with me through all of this!

Glad it’s working now! To sum up for anyone finding this thread later: on an Arducam IMX219 with a Pi 2B on Bullseye, the config needs camera_auto_detect=0 (and it may not exist by default, so it has to be added manually), dtoverlay=imx219, and dtoverlay=vc4-kms-v3d, with the GL (Full KMS) driver set in raspi-config. In this case the config and system were actually fine — the remaining problem was the command itself. ‘libcamera -still -t 5’ means a 0.005s preview, which causes the Unicam timeout messages. Use ‘libcamera-still -t 0’ for preview and ‘libcamera-still -t 5000 -o test.jpg’ to capture. No hardware fault involved.