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
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:
Reboot your Pi first.
Download the tool I sent and make it executable: chmod +x ./arducam-camera-bug-report
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.
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.
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.
Uncomment #dtoverlay=vc4-kms-v3d in /boot/config.txt. Make sure it’s vc4-kms-v3d and not vc4-fkms-v3d.
Reboot your Raspberry Pi.
Try libcamera-still -t 0 again after it comes back.
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:
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.