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

Quentin Schulz quentin.schulz at cherry.de
Mon Apr 14 09:08:04 UTC 2025


Hi Peter,

On 4/10/25 3:54 PM, Peter Seiderer wrote:
> 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.
> 

OK so this "works".

The issue is that meson still believes it's looking for a runtime 
dependency (though it finds the binaries and runs them on Buildroot host 
machine).

I guess this is possibly more acceptable for Buildroot (and in any case 
not exclusive with the meson patch) as /libexec stores binaries that 
could be executed? Though [1] says "internal binaries that are not 
intended to be executed directly by users or shell scripts".

[1] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

> 
>>
>> 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
> 

Removed all the BSP parts and could generate a rootfs for my PX30 
Ringneck that displayed everything...

Looking into which exact package/symbol is actually required to make 
this work so I can add it as a dependency. Or... is that expected from 
the user to figure out what exactly is needed and compile the app with 
broken font-rendering (though working camera preview)?

Thanks for the hints,
Quentin


More information about the buildroot mailing list