From b470b8cbf39f6d5fe6039a5fe05ac03df911d32d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 27 May 2026 21:04:43 +0100 Subject: [PATCH] Automate OBS stem plugin SDK build --- .gitignore | 1 + docs/implementation-plan.md | 5 ++-- docs/obs-stem-plugin.md | 21 ++++++++----- .../obs_stem_source/mimir_obs_stem_source.cpp | 1 - notes/current-system-map.md | 5 ++-- scripts/build-obs-stem-plugin.ps1 | 30 +++++++++++++++++++ state/evidence.jsonl | 1 + state/map.yaml | 5 ++-- 8 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 scripts/build-obs-stem-plugin.ps1 diff --git a/.gitignore b/.gitignore index 5784991..5e96241 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ logs/ quartz-site/ calibration/runs/ artifacts/drivers/ +artifacts/obs-sdk/ artifacts/asio/ artifacts/bioacoustic-contestants/ artifacts/birdsong-reference/ diff --git a/docs/implementation-plan.md b/docs/implementation-plan.md index c0e18eb..9d0a110 100644 --- a/docs/implementation-plan.md +++ b/docs/implementation-plan.md @@ -160,8 +160,9 @@ a named invariant that the native runtime cannot protect yet. alignment-actuator OBS stem profile. `MimirObsStemSharedMemoryPublisher` now publishes those validated stems into a fixed Windows shared-memory ABI, and `native/obs_stem_source` is the first OBS source plugin that reads one named - stem and submits it to OBS as an audio source. Local plugin compilation still - needs an OBS/libobs SDK installation. + stem and submits it to OBS as an audio source. `scripts/build-obs-stem-plugin.ps1` + stages the upstream OBS plugin template SDK under `artifacts/obs-sdk/` and + builds the plugin DLL locally. - `MimirRuntime` no longer submits the legacy direct `AquariumSplineFrame` spectrum dashboard. Live spectrum visualization authority is the `AquariumFieldEvidenceFrame`: Mimir declares the rolling resource, emits a diff --git a/docs/obs-stem-plugin.md b/docs/obs-stem-plugin.md index abf9f5a..d83ae76 100644 --- a/docs/obs-stem-plugin.md +++ b/docs/obs-stem-plugin.md @@ -28,18 +28,23 @@ source lanes. ## Build -The plugin requires an OBS/libobs development package that provides -`libobsConfig.cmake`. - ```powershell -cmake -S .\native\obs_stem_source -B .\native\obs_stem_source\build -Dlibobs_DIR= -cmake --build .\native\obs_stem_source\build --config Release +.\scripts\build-obs-stem-plugin.ps1 ``` -This workstation currently does not have the libobs SDK installed, so CMake -configuration stops at `find_package(libobs)`. The managed shared-memory -publisher is still verified by: +The script stages `obsproject/obs-plugintemplate` under `artifacts/obs-sdk/`, +lets the upstream template fetch/build the matching OBS/libobs development +surface, then builds `native/obs_stem_source` against that SDK. The staged SDK +and native build products are local artifacts, not repository state. + +The managed shared-memory publisher is verified by: ```powershell dotnet run --no-build --project .\src\Mimir.BufferSmoke\Mimir.BufferSmoke.csproj -- --obs-stem-shared-memory-smoke ``` + +The local native plugin build currently succeeds and emits: + +```text +native\obs_stem_source\build\Release\mimir_obs_stem_source.dll +``` diff --git a/native/obs_stem_source/mimir_obs_stem_source.cpp b/native/obs_stem_source/mimir_obs_stem_source.cpp index f37ab97..c77a091 100644 --- a/native/obs_stem_source/mimir_obs_stem_source.cpp +++ b/native/obs_stem_source/mimir_obs_stem_source.cpp @@ -8,7 +8,6 @@ #include #include -#define WIN32_LEAN_AND_MEAN #include #include "mimir_obs_stem_ipc.h" diff --git a/notes/current-system-map.md b/notes/current-system-map.md index 4e17416..bd6eafd 100644 --- a/notes/current-system-map.md +++ b/notes/current-system-map.md @@ -321,8 +321,9 @@ reports ready, missing, and unconfigured stems against the alignment actuator stem-bus profile. `MimirObsStemSharedMemoryPublisher` writes the validated stem frames into `Local\MimirObsStemBus`, and `native/obs_stem_source` is the first OBS source plugin: one OBS source reads one named stem from that map and submits -it through libobs audio. Building it locally still requires an OBS/libobs SDK -that provides `libobsConfig.cmake`. +it through libobs audio. `scripts/build-obs-stem-plugin.ps1` stages the +upstream OBS plugin-template SDK under `artifacts/obs-sdk/` and builds the +plugin DLL locally. ## Visual Fusion diff --git a/scripts/build-obs-stem-plugin.ps1 b/scripts/build-obs-stem-plugin.ps1 new file mode 100644 index 0000000..a8f80ce --- /dev/null +++ b/scripts/build-obs-stem-plugin.ps1 @@ -0,0 +1,30 @@ +param( + [string]$Configuration = "Release", + [string]$TemplateVersion = "master" +) + +$ErrorActionPreference = "Stop" + +$root = Split-Path -Parent $PSScriptRoot +$sdkRoot = Join-Path $root "artifacts\obs-sdk" +$templateRoot = Join-Path $sdkRoot "obs-plugintemplate" +$depsRoot = Join-Path $templateRoot ".deps" +$buildRoot = Join-Path $templateRoot "build_x64_local" +$pluginBuildRoot = Join-Path $root "native\obs_stem_source\build" + +New-Item -ItemType Directory -Force $sdkRoot | Out-Null +if (-not (Test-Path $templateRoot)) { + git clone --depth 1 --branch $TemplateVersion https://github.com/obsproject/obs-plugintemplate.git $templateRoot +} + +if (-not (Test-Path (Join-Path $depsRoot "cmake\libobsConfig.cmake"))) { + cmake -S $templateRoot -B $buildRoot -G "Visual Studio 17 2022" -A x64 -DENABLE_FRONTEND_API=OFF -DENABLE_QT=OFF +} + +cmake ` + -S (Join-Path $root "native\obs_stem_source") ` + -B $pluginBuildRoot ` + -Dlibobs_DIR="$(Join-Path $depsRoot 'cmake')" ` + -DCMAKE_PREFIX_PATH="$depsRoot" + +cmake --build $pluginBuildRoot --config $Configuration --parallel diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 1920f39..0818d6a 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -190,3 +190,4 @@ {"ts": "2026-05-27T20:28:43+01:00", "type": "verification", "status": "ok", "note": "Fensalir now publishes processed streaming Faust DSP output lanes as AquariumAudioStemFrame records through an engine-owned IAquariumAudioStemBus. Mimir declares deterministic aligned-source output stems when queuing faust/mimir_alignment_actuator.dsp, so processed actuator lanes have stable stem names before OBS-facing publication consumes them. Fensalir build and Aquarium.Engine.Tests passed; Mimir build and --audio-actuator-bank-smoke passed."} {"ts": "2026-05-27T20:33:41+01:00", "type": "verification", "status": "ok", "note": "Mimir now has an OBS-facing stem publication state for the Fensalir Faust stem bus. It consumes AquariumAudioStemFrame records without copying audio, validates them against the alignment-actuator stem profile, reports ready/missing/unconfigured stems, and telemetry can print publication readiness. --audio-stem-publication-smoke passed; Mimir build passed."} {"ts": "2026-05-27T20:55:23+01:00", "type": "verification", "status": "blocked", "note": "OBS stem plugin path is now chosen and scaffolded. Mimir publishes validated stem snapshots into a fixed Windows shared-memory ABI (Local\\\\MimirObsStemBus), and native/obs_stem_source defines the first libobs audio source plugin that reads one named stem and calls obs_source_output_audio. dotnet build and --obs-stem-shared-memory-smoke passed. Local native plugin build is blocked until an OBS/libobs SDK with libobsConfig.cmake is installed or supplied via libobs_DIR."} +{"ts": "2026-05-27T21:03:27+01:00", "type": "verification", "status": "ok", "note": "The OBS/libobs SDK is now staged locally through obsproject/obs-plugintemplate under artifacts/obs-sdk. Its CMake bootstrap downloaded obs-deps, Qt deps, and OBS 31.1.1 sources, built Debug/Release libobs development components, and installed libobsConfig.cmake under .deps/cmake. native/obs_stem_source configured with libobs_DIR plus CMAKE_PREFIX_PATH and built Release/mimir_obs_stem_source.dll successfully. Added scripts/build-obs-stem-plugin.ps1 to repeat the SDK staging/build."} diff --git a/state/map.yaml b/state/map.yaml index 0631aa7..163d617 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -198,8 +198,9 @@ accepted_design: writes validated stems into the `Local\MimirObsStemBus` Windows shared-memory ABI, and `native/obs_stem_source` is the first OBS source plugin that reads one named stem from that map and submits it as libobs - audio. Local native plugin compilation still needs an OBS/libobs SDK that - provides `libobsConfig.cmake`. The synthetic + audio. `scripts/build-obs-stem-plugin.ps1` stages the upstream OBS plugin + template SDK under `artifacts/obs-sdk/` and builds the plugin DLL locally. + The synthetic codebook proof is `dotnet run --project .\src\Mimir.BufferSmoke\Mimir.BufferSmoke.csproj -- --bioacoustic-self-test`. `Mimir.BufferSmoke --render-chirp-bin-f32` plus