Raspberry Pi 4B IMX219 camera fails to enable component ENOSPC

Hi all, I’m having trouble getting an IMX219 camera module working on my Raspberry Pi 4B. I’ve also tried it on a 3B+ with the same result. vcgencmd get_camera shows supported=1 and detected=1, so the Pi seems to see the camera, but any attempt to actually use it fails. I also tried streaming video through motion and that failed too.

The error I keep getting is:
mmal: mal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn’t be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

Any ideas what’s going on?

Thanks for the details. The fact that vcgencmd reports detected=1 but the MMAL component fails with ENOSPC is odd - it means the firmware sees the camera but the component can’t be enabled. Before we dig in, could you run our bug report tool so I can see the full configuration? I’ve sent you the tool via private message. The steps are:

  1. Reboot your Pi first.
  2. Download the tool I sent and make it executable: chmod +x ./arducam-camera-bug-report
  3. Run it: ./arducam-camera-bug-report

It will create an arducam-bug-report.txt file in the current directory. Please send that file back to me via private message.

Just to add some more info: I’m on a Raspberry Pi 4B following the online documentation. I’ve tested the camera on both a Pi 3B+ and the Pi 4B and get the same error on both. vcgencmd get_camera shows 1 for both supported and detected, but image capture fails with the mmal ENOSPC error above and video via motion also fails. I’ve sent the bug report file through private message.

Got the report, thanks. The IMX219 overlay doesn’t appear to be enabled in your config. Let’s add it:

  1. Open the config: sudo nano /boot/config.txt
  2. Add dtoverlay=imx219 under the [all] section at the bottom.
  3. Reboot your Pi to take effect.
  4. Then run libcamera-still -t 0 to preview the camera.

This enables the correct device tree overlay for the IMX219 module.

I added dtoverlay=imx219 to /boot/config.txt and rebooted, but libcamera-still -t 0 still fails. Now I get a different error:

libEGL warning: DRI2: failed to authenticate
Made X/EGL preview window
[0:00:53.225714263] [1102] INFO Camera camera_manager.cpp:299 libcamera v0.0.4+
ERROR: *** no cameras available ***

That’s a different failure mode - the mmal error is gone but libcamera doesn’t see any camera at all. Can you re-run the bug report tool and send me the new arducam-bug-report.txt? The overlay change should have made it visible, so I want to see what the updated config and logs look like.

Done - I’ve sent the updated bug report file through private message.

Looking at your report, I think the vc4 KMS driver overlay is the problem. You have dtoverlay=vc4-kms-v3d commented out. That needs to be enabled for the libcamera stack to detect the camera properly.

  1. Uncomment #dtoverlay=vc4-kms-v3d in /boot/config.txt. Make sure it’s vc4-kms-v3d and not vc4-fkms-v3d.
  2. Reboot your Raspberry Pi.
  3. Try libcamera-still -t 0 again after it comes back.

I uncommented vc4-kms-v3d and rebooted, but I’m still having trouble. I’ve sent another bug report file over private message.

I found it. In your config file you have three camera module drivers enabled at the same time - dtoverlay=arducam-64mp, dtoverlay=arducam-pivariety, and dtoverlay=imx219. The Pi can’t decide which camera driver to load when multiple are active, so it ends up not driving the IMX219 correctly.

You can only enable one camera overlay at a time. Comment these two out in /boot/config.txt:

dtoverlay=arducam-64mp
dtoverlay=arducam-pivariety

Then reboot and try the IMX219 preview again.

Thank you! Commenting out the other two overlays got the camera working. The main error is gone and libcamera-still shows a preview now. I’m still running into some trouble though, and I’ve sent another bug report file via private message if you can take a look.

Glad the camera is up now. To summarize what fixed it: you need only one camera overlay enabled at a time. For the IMX219, that means dtoverlay=imx219 must be present, dtoverlay=arducam-64mp and dtoverlay=arducam-pivariety must be commented out, and dtoverlay=vc4-kms-v3d must be enabled (not the fkms variant). I’ve received the new bug report and will check what the remaining issue is.