From fb6dbe53ebbf0a043845b51691859ddb17bb11b6 Mon Sep 17 00:00:00 2001 From: Alex P Date: Fri, 21 Nov 2025 22:40:30 +0200 Subject: [PATCH] Disable assertions in ALSA static library build Production builds should not include debug assertions. ALSA's assert() calls cause aborts when internal invariants are violated, even for recoverable error conditions. The crash occurred when snd_pcm_close() was called with a NULL pointer, triggering assertion failure at pcm.c:779 instead of graceful error handling. Stack trace: pcm.c:779: snd_pcm_close: Assertion `pcm' failed SIGABRT in jetkvm_audio_capture_init() Adding -DNDEBUG disables all assert() calls in ALSA, Opus, and SpeexDSP libraries for production robustness. --- .devcontainer/install_audio_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/install_audio_deps.sh b/.devcontainer/install_audio_deps.sh index d0ebf58a..bfc46120 100755 --- a/.devcontainer/install_audio_deps.sh +++ b/.devcontainer/install_audio_deps.sh @@ -38,7 +38,7 @@ cd "$AUDIO_LIBS_DIR" [ -d speexdsp-${SPEEXDSP_VERSION} ] || tar xf speexdsp-${SPEEXDSP_VERSION}.tar.gz # ARM Cortex-A7 optimization flags with NEON support -OPTIM_CFLAGS="-O2 -mfpu=neon -mtune=cortex-a7 -mfloat-abi=hard" +OPTIM_CFLAGS="-O2 -mfpu=neon -mtune=cortex-a7 -mfloat-abi=hard -DNDEBUG" export CC="${CROSS_PREFIX}-gcc" export CFLAGS="$OPTIM_CFLAGS"