Merge pull request 'daemon: link daedalus-fourier + log substrate availability at startup' (#13) from noether/daemon-link-daedalus-fourier into main

Reviewed-on: #13
This commit was merged in pull request #13.
This commit is contained in:
2026-05-21 16:35:38 +00:00
2 changed files with 48 additions and 0 deletions
+24
View File
@@ -28,6 +28,20 @@ find_package(PkgConfig REQUIRED)
pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
libavformat libavcodec libavutil) libavformat libavcodec libavutil)
# daedalus-fourier — VC VII (V3D) + ARM NEON back-end kernel library.
# Linked statically. Today only the no-QPU smoke-test path is wired
# (a ctx_create_no_qpu at daemon startup, log-and-destroy at exit);
# follow-up patches (per daedalus-v4l2#11) substitute the
# `daedalus_recipe_dispatch_h264_*` family for libavcodec's per-MB
# pixel primitives, one cycle at a time.
#
# We bypass IMPORTED_TARGET and consume pkg-config's static variables
# (--static --libs path) directly so we control the link order:
# libdaedalus_core.a must precede -lvulkan because the static archive
# references vulkan symbols and the linker resolves left-to-right.
pkg_check_modules(DAEDALUS_FOURIER REQUIRED daedalus-fourier)
find_package(Vulkan REQUIRED)
add_executable(daedalus_v4l2_daemon add_executable(daedalus_v4l2_daemon
src/main.c src/main.c
src/ffmpeg_loader.c src/ffmpeg_loader.c
@@ -45,13 +59,23 @@ target_include_directories(daedalus_v4l2_daemon
src src
${CMAKE_CURRENT_SOURCE_DIR}/../include ${CMAKE_CURRENT_SOURCE_DIR}/../include
${FFMPEG_INCLUDE_DIRS} ${FFMPEG_INCLUDE_DIRS}
${DAEDALUS_FOURIER_INCLUDE_DIRS}
) )
# dl for dlopen, pthread for future threading work. # dl for dlopen, pthread for future threading work.
target_link_directories(daedalus_v4l2_daemon
PRIVATE
${DAEDALUS_FOURIER_LIBRARY_DIRS}
)
target_link_libraries(daedalus_v4l2_daemon target_link_libraries(daedalus_v4l2_daemon
PRIVATE PRIVATE
dl dl
pthread pthread
# Order matters: libdaedalus_core.a first (so its undefined
# vulkan symbols register), then -lvulkan to satisfy them.
${DAEDALUS_FOURIER_LIBRARIES}
Vulkan::Vulkan
) )
install(TARGETS daedalus_v4l2_daemon install(TARGETS daedalus_v4l2_daemon
+24
View File
@@ -22,6 +22,8 @@
#include <libavutil/log.h> #include <libavutil/log.h>
#include <daedalus.h>
static volatile sig_atomic_t g_terminate = 0; static volatile sig_atomic_t g_terminate = 0;
static void on_signal(int sig) static void on_signal(int sig)
@@ -120,6 +122,26 @@ int main(int argc, char **argv)
/* Mute FFmpeg's own chattiness unless the user asked. */ /* Mute FFmpeg's own chattiness unless the user asked. */
fm.av_log_set_level(verbose ? AV_LOG_INFO : AV_LOG_WARNING); fm.av_log_set_level(verbose ? AV_LOG_INFO : AV_LOG_WARNING);
/*
* Initialise daedalus-fourier early so we can log substrate
* availability up front. daedalus_ctx_create_no_qpu() skips
* the V3D Vulkan probe — we're not dispatching any kernels
* yet, this is just the linkage sanity check + a marker in the
* journal that the binary is wired against the right
* daedalus-fourier version. Future work (per daedalus-v4l2#11)
* promotes to daedalus_ctx_create() once shader-path resolution
* is wired through the public API.
*/
daedalus_ctx *df_ctx = daedalus_ctx_create_no_qpu();
if (df_ctx) {
log_info("daedalus-fourier: linked, ctx alive (no_qpu mode; "
"has_qpu=%d)",
daedalus_ctx_has_qpu(df_ctx));
} else {
log_warn("daedalus-fourier: ctx_create_no_qpu returned NULL "
"(out of memory?) — continuing without backend kernels");
}
int rc; int rc;
const char *cmd = argv[i++]; const char *cmd = argv[i++];
if (strcmp(cmd, "parse") == 0) { if (strcmp(cmd, "parse") == 0) {
@@ -132,6 +154,8 @@ int main(int argc, char **argv)
rc = 2; rc = 2;
} }
if (df_ctx)
daedalus_ctx_destroy(df_ctx);
ffmpeg_loader_cleanup(&fm); ffmpeg_loader_cleanup(&fm);
log_cleanup(); log_cleanup();
return rc; return rc;