I'm currently working on integrating libcamera-apps into a Buildroot environment for a Raspberry Pi Zero 2W. My end goal is to successfully run the uvc-gadget while utilizing libcamera for camera functionality. However, I keep running into a persistent error: "No cameras detected".
Here's the relevant things I've done so far:
Started with Buildroot Defconfig:
- I used the
raspberrypizero2w_64_defconfigas my base configuration.
- I used the
Modified Toolchain:
- Adjusted the toolchain settings to include the necessary headers and dependencies required by
libcamera-apps.
- Adjusted the toolchain settings to include the necessary headers and dependencies required by
Enabled Required Packages:
- Enabled
libcameraandlibcamera-appsin the Buildroot configuration. - Set
/devmanagement to use theeudevoption, as it seemed necessary for device detection.
- Enabled
Version Pinned Dependencies:
- I manually updated the
.mkfiles for bothlibcameraandlibcamera-appsto use specific commits that I know are compatible. These commits were tested successfully on Raspberry Pi OS Lite. Specific commit hashes are below.
- I manually updated the
Modified libcamera Source Repository:
- Configured the
libcamerapackage in Buildroot to pull directly from theraspberrypi/libcameraGitHub repository instead of the official upstream repository.
- Configured the
Verified Compatibility on Raspberry Pi OS:
- Using the same versions of
libcameraandlibcamera-apps, I was able to successfully compile and run the applications on Raspberry Pi OS Lite. This confirms that the versions and configuration are compatible, but the issue seems isolated to Buildroot.
- Using the same versions of
Observed Behavior
When running the UVC gadget in my Buildroot setup—before I changed the toolchain and tried compiling libcamera-apps—I consistently encountered the error:
"No cameras detected", as well as a "no IPA modules found" warning.
After changing the toolchain, enabling libcamera-apps, and making the changes mentioned above to the .mk files, I encounter a new error when I run make:
../core/rpicam_app.cpp: In member function ‘void RPiCamApp::StartCamera()’:
../core/rpicam_app.cpp:642:78: error: ‘controls::rpi’ has not been declared
642 | if (!controls_.get(controls::ScalerCrop) && !controls_.get(controls::rpi::ScalerCrops))
| ^~~
../core/rpicam_app.cpp:673:49: error: ‘controls::rpi’ has not been declared
673 | controls_.set(controls::rpi::ScalerCrops, libcamera::Span<const Rectangle>(crops.data(), crops.size()));
| ^~~
[11/33] Compiling C++ object rpicam_app.so.1.7.0.p/image_jpeg.cpp.o
Questions
- Is there any additional configuration required in Buildroot to ensure proper camera detection?
- Has anyone successfully integrated
libcamera-appswith Buildroot? I don't understand why it fails to build in Buildroot when I'm using two compatible versions. Is changing the version not enough?
Any help or guidance would be greatly appreciated! If additional logs or specifics are needed, let me know, and I'll provide them.
Thanks in advance!
Additional Context
libcameraCommit:d83ff0a4ae4503bc56b7ed48cd142c3dd423ad3blibcamera-appsCommit:5a3f5965aca96c2d575261e4e4045f0e0481279b