[Buildroot] [PATCH RFC 0/2] add initial support for libcamera's qcam

Peter Seiderer ps.report at gmx.net
Thu Apr 10 13:54:31 UTC 2025


Hello Quentin,

On Tue, 08 Apr 2025 17:16:39 +0200, Quentin Schulz <foss+buildroot at 0leil.net> wrote:

> This adds initial support for qcam example GUI from libcamera. It is
> based on Qt6 and uses openGL.
>
> Sadly, the qt module from meson is currently broken (see first patch in
> the series) and requires patching. Upstream isn't really happy with what
> I suggested but I haven't understood what they don't like about it so
> cannot currently suggest anything better, hence the RFC.

The following buildroot patch works for me (for the qcam case):

diff --git a/Makefile b/Makefile
index 5bf5abfe3b..8787a9065f 100644
--- a/Makefile
+++ b/Makefile
@@ -468,7 +468,7 @@ $(STAGING_DIR_SYMLINK): | $(BASE_DIR)
        ln -snf $(STAGING_DIR) $(STAGING_DIR_SYMLINK)

 # Quotes are needed for spaces and all in the original PATH content.
-BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"
+BR_PATH = "$(HOST_DIR)/libexec:$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"

 # Location of a file giving a big fat warning that output/target
 # should not be used as the root filesystem.


>
> While qcam currently renders the camera liveview, all characters of the
> GUI are squares. I have enabled fontconfig and UTF-8 locales but after
> building everything (though I dircleaned qt6base once), so not entirely
> sure what's missing or if it's PEBKAC, hence the RFC. Though that may be
> acceptable? Do not know. Would appreciate pointers on how to debug this
> (assumed) font issue.

Font rendering (and video output from a cheap USB cam) seems to work with
the following RPi4 defconfig (and additional 'dtoverlay=vc4-kms-v3d-pi4'):

BR2_arm=y
BR2_cortex_a72=y
BR2_ARM_FPU_NEON_VFPV4=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_BINUTILS_VERSION_2_44_X=y
BR2_GCC_VERSION_14_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_HOST_GDB=y
BR2_GDB_VERSION_16=y
BR2_ENABLE_DEBUG=y
BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches"
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
BR2_SYSTEM_DHCP="eth0"
BR2_GENERATE_LOCALE="C en_US"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi4/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi4/post-image.sh"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,576cc10e1ed50a9eacffc7a05c796051d7343ea4)/linux-576cc10e1ed50a9eacffc7a05c796051d7343ea4.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2711"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2711-rpi-4-b broadcom/bcm2711-rpi-400 broadcom/bcm2711-rpi-cm4 broadcom/bcm2711-rpi-cm4s"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_STRACE=y
BR2_PACKAGE_DEJAVU=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_V3D=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_QT6=y
BR2_PACKAGE_QT6BASE_GUI=y
BR2_PACKAGE_QT6BASE_EGLFS=y
BR2_PACKAGE_QT6BASE_DEFAULT_QPA="eglfs"
BR2_PACKAGE_QT6BASE_FONTCONFIG=y
BR2_PACKAGE_QT6BASE_HARFBUZZ=y
BR2_PACKAGE_QT6BASE_GIF=y
BR2_PACKAGE_QT6BASE_JPEG=y
BR2_PACKAGE_QT6BASE_PNG=y
BR2_PACKAGE_QT6BASE_WIDGETS=y
BR2_PACKAGE_QT6BASE_NETWORK=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi4/config_4.txt"
BR2_PACKAGE_LIBEXIF=y
BR2_PACKAGE_TIFF=y
BR2_PACKAGE_LIBV4L=y
BR2_PACKAGE_LIBV4L_UTILS=y
BR2_PACKAGE_LIBXKBCOMMON=y
BR2_PACKAGE_LIBCAMERA=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_BASH=y
BR2_PACKAGE_SUDO=y
BR2_PACKAGE_KMOD_TOOLS=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="256M"
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_DOSFSTOOLS=y
BR2_PACKAGE_HOST_GENIMAGE=y
BR2_PACKAGE_HOST_KMOD_XZ=y
BR2_PACKAGE_HOST_MTOOLS=y

The UTF-8 locale warning vanishes if I start qcam with

	$ LANG=C.UTF-8 qcam

or

	$ LANG=en_US.UTF-8 qcam

Regards,
Peter

>
> I'm not planning on actively working on this as the only product we have
> that could use this is currently stuck on qt5 so cannot use new qcam and
> it would anyway only be for debug firmware releases. See this as a code
> dump essentially. If there are hints or limited work required to have
> this merged, I'll happily try to find time doing it but feel free to
> take over the series or disregard it entirely.
>
> This is based on top of
> https://lore.kernel.org/buildroot/20250404-libcamera-0-5-0-v1-0-e2ca9d029aeb@cherry.de/T/#t
>
> Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
> ---
> Quentin Schulz (2):
>       package/meson: look for qt6 tools on Buildroot host machine
>       package/libcamera: initial support for Qt6 qcam
>
>  package/libcamera/libcamera.mk                     |  5 ++
>  ...e-look-for-qt-tools-only-on-build-machine.patch | 56 ++++++++++++++++++++++
>  2 files changed, 61 insertions(+)
> ---
> base-commit: 43abcd4c7dd8ad65d2f2012f3d4292362550a3ed
> change-id: 20250404-libcamera-qcam-e8269c47e2f9
> prerequisite-change-id: 20250404-libcamera-0-5-0-b9ecf899ddb4:v1
> prerequisite-patch-id: 854e58d76fc57aa774ca0d315ecae56b67c00c8a
> prerequisite-patch-id: 4873ac99203f0d789d64aec048249d9ba6a15a82
> prerequisite-patch-id: c4d504c6563a911ba550be263063cfd7bf04bcbe
> prerequisite-patch-id: 4a74788db759d3b67650f1456ee4d64f9394f50a
> prerequisite-patch-id: 73a4b5a3204b1a901da74a3ffe1672055404dd2f
> prerequisite-patch-id: 90b567b9a37abb58747d965ea2e0fef41358844b
> prerequisite-patch-id: 946aac34b70f001c24fc6fe86caab759a4591359
> prerequisite-patch-id: cee428a4219c83704347f6f194694f21093034da
> prerequisite-patch-id: 6bbbdc80dc639a1b2918d79ae101e1030f3312bd
>
> Best regards,



More information about the buildroot mailing list