Carry Mimir branding through repo

This commit is contained in:
Meta Vens 2026-05-21 10:27:09 +01:00
commit 5960c700db
62 changed files with 937 additions and 142 deletions

View file

@ -1,4 +1,4 @@
import argparse
import argparse
import importlib.util
import json
import math
@ -2027,7 +2027,7 @@ def foa_weights(mic):
def main():
parser = argparse.ArgumentParser(description="Build and calibrate the LocalCastBridge six-mic Ambisonic audio field.")
parser = argparse.ArgumentParser(description="Build and calibrate the Mimir six-mic Ambisonic audio field.")
sub = parser.add_subparsers(required=True)
p = sub.add_parser("devices", help="List PortAudio devices as JSON.")
@ -2096,7 +2096,7 @@ def main():
p.add_argument("--mic-id", default="mic_focusrite_neighbor")
p.add_argument("--ssh-target", default="madman's lullaby@192.168.1.84")
p.add_argument("--ffmpeg", default=r"C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe")
p.add_argument("--remote-dir", default=r"C:\Meta\LocalCastBridge\calibration\remote-captures")
p.add_argument("--remote-dir", default=r"C:\Meta\Mimir\calibration\remote-captures")
p.add_argument("--device", default="Analogue 1 + 2 (Focusrite USB Audio)")
p.add_argument("--dshow-device", help=argparse.SUPPRESS)
p.add_argument("--seconds", type=float, default=8.0)

View file

@ -1,4 +1,4 @@
import argparse
import argparse
import json
import subprocess
import sys
@ -321,7 +321,7 @@ def audio_smoke(args):
def main():
parser = argparse.ArgumentParser(description="Probe LocalCastBridge calibration devices.")
parser = argparse.ArgumentParser(description="Probe Mimir calibration devices.")
sub = parser.add_subparsers(required=True)
p = sub.add_parser("discover")

View file

@ -1,4 +1,4 @@
from __future__ import annotations
from __future__ import annotations
import argparse
import json
@ -29,11 +29,11 @@ def main() -> int:
parser.add_argument("--sample-rate", type=int, default=48000)
parser.add_argument("--ssh-target", default="madman's lullaby@192.168.1.84")
parser.add_argument("--ffmpeg", default=r"C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe")
parser.add_argument("--remote-dir", default=r"C:\Meta\LocalCastBridge\calibration\remote-captures")
parser.add_argument("--remote-dir", default=r"C:\Meta\Mimir\calibration\remote-captures")
parser.add_argument("--focusrite-device", default="Analogue 1 + 2 (Focusrite USB Audio)")
parser.add_argument("--loopback-device", default="")
parser.add_argument("--loopback-capture", choices=("wasapi", "dshow"), default="wasapi")
parser.add_argument("--remote-wasapi-script", default=r"C:\Meta\LocalCastBridge\scripts\wasapi-loopback-capture.ps1")
parser.add_argument("--remote-wasapi-script", default=r"C:\Meta\Mimir\scripts\wasapi-loopback-capture.ps1")
parser.add_argument("--remote-wasapi-role", choices=("Console", "Multimedia", "Communications"), default="Console")
parser.add_argument("--local-loopback-query", default="Scarlett")
parser.add_argument("--max-lag-ms", type=float, default=3000.0)
@ -165,7 +165,7 @@ def remote_loopback_command(args: argparse.Namespace, output: str) -> str:
raise SystemExit("--loopback-device is required when --loopback-capture dshow")
return remote_ffmpeg_command(args, args.loopback_device, output, channels=2)
log = output.rsplit(".", 1)[0] + ".log"
task = "LocalCastWasapiLoopbackCapture"
task = "MimirWasapiLoopbackCapture"
return (
"powershell -NoProfile -ExecutionPolicy Bypass -Command "
+ quote_for_cmd(

62
scripts/obs_smoke_test.py Normal file
View file

@ -0,0 +1,62 @@
import argparse
import json
from pathlib import Path
import sys
ROOT = Path(__file__).resolve().parents[1]
if str(ROOT) not in sys.path:
sys.path.insert(0, str(ROOT))
from localcast.obs_smoke import load_config_endpoints, read_events_jsonl, summarize_events, write_event_template
def main() -> None:
parser = argparse.ArgumentParser(description="Create the bounded OBS v1 smoke-test witness ledger.")
parser.add_argument("--config", default="config/localcast.json")
parser.add_argument("--events", default="calibration/runs/obs-v1-smoke-events.jsonl")
parser.add_argument("--ledger", default="calibration/runs/obs-v1-smoke-ledger.json")
parser.add_argument("--max-abs-drift-ppm", type=float, default=100.0)
parser.add_argument("--max-latency-ms", type=float, default=500.0)
sub = parser.add_subparsers(dest="command", required=True)
sub.add_parser("plan", help="Print planned OBS-facing endpoints from the Mimir config.")
sub.add_parser("template-events", help="Write an editable JSONL event template for one smoke pass.")
sub.add_parser("summarize", help="Summarize recorded events into the smoke-test ledger.")
args = parser.parse_args()
config_path = Path(args.config)
endpoints = load_config_endpoints(config_path)
if args.command == "plan":
print(
json.dumps(
{
"config": str(config_path),
"endpoints": [endpoint.__dict__ for endpoint in endpoints],
"requiredStages": ["sender_capture", "srt_receive", "obs_present"],
},
indent=2,
)
)
return
events_path = Path(args.events)
if args.command == "template-events":
write_event_template(events_path, endpoints)
print(f"Wrote smoke event template: {events_path}")
return
ledger_path = Path(args.ledger)
events = read_events_jsonl(events_path)
ledger = summarize_events(
endpoints,
events,
max_abs_drift_ppm=args.max_abs_drift_ppm,
max_latency_ms=args.max_latency_ms,
)
ledger_path.parent.mkdir(parents=True, exist_ok=True)
ledger_path.write_text(json.dumps(ledger, indent=2, sort_keys=True) + "\n", encoding="utf-8")
print(json.dumps(ledger, indent=2, sort_keys=True))
if __name__ == "__main__":
main()

View file

@ -1,4 +1,4 @@
param(
param(
[string]$LogDirectory = ".\logs"
)
@ -17,7 +17,7 @@ $ffmpegProcesses = Get-CimInstance Win32_Process |
}
if (-not $ffmpegProcesses) {
Write-Host "No LocalCastBridge-looking ffmpeg SRT processes found."
Write-Host "No Mimir-looking ffmpeg SRT processes found."
return
}

View file

@ -1,4 +1,4 @@
from __future__ import annotations
from __future__ import annotations
import argparse
import json
@ -25,7 +25,7 @@ RAW_UNSYNCED_INPUTS = (
def main() -> int:
parser = argparse.ArgumentParser(
description=(
"Build synchronized LocalCastBridge OBS audio stems from the aligned "
"Build synchronized Mimir OBS audio stems from the aligned "
"program timeline and hide raw unsynchronized OBS inputs."
)
)
@ -39,7 +39,7 @@ def main() -> int:
parser.add_argument(
"--disable-other-scene-items",
action="store_true",
help="Disable every scene item except the synchronized LocalCastBridge program sources.",
help="Disable every scene item except the synchronized Mimir program sources.",
)
args = parser.parse_args()
@ -99,7 +99,7 @@ def build_stems(run: Path, stem_dir: Path) -> dict[str, Any]:
stems = [
stem_spec(
"LocalCastBridge - Host Voice",
"Mimir - Host Voice",
"host_voice.wav",
host_voice,
field_rate,
@ -108,7 +108,7 @@ def build_stems(run: Path, stem_dir: Path) -> dict[str, Any]:
position_m=[0.0, 0.0, 1.2],
),
stem_spec(
"LocalCastBridge - CoStreamer Voice",
"Mimir - CoStreamer Voice",
"co_streamer_voice.wav",
co_streamer_voice,
field_rate,
@ -117,7 +117,7 @@ def build_stems(run: Path, stem_dir: Path) -> dict[str, Any]:
position_m=[0.0, 2.0, 1.2],
),
stem_spec(
"LocalCastBridge - Ambient",
"Mimir - Ambient",
"ambient.wav",
ambient,
field_rate,
@ -126,7 +126,7 @@ def build_stems(run: Path, stem_dir: Path) -> dict[str, Any]:
position_m=None,
),
stem_spec(
"LocalCastBridge - Transients",
"Mimir - Transients",
"transients.wav",
transients,
field_rate,
@ -135,7 +135,7 @@ def build_stems(run: Path, stem_dir: Path) -> dict[str, Any]:
position_m=None,
),
stem_spec(
"LocalCastBridge - CoStreamer Loopback",
"Mimir - CoStreamer Loopback",
"co_streamer_loopback.wav",
co_streamer_loopback,
field_rate,
@ -144,7 +144,7 @@ def build_stems(run: Path, stem_dir: Path) -> dict[str, Any]:
position_m=None,
),
stem_spec(
"LocalCastBridge - Local Loopback",
"Mimir - Local Loopback",
"local_loopback.wav",
local_loopback,
field_rate,
@ -217,7 +217,7 @@ def configure_obs(
mute_input(client, raw_name)
disable_scene_item(client, scene, scene_items, raw_name)
allowed_scene_items = {"LocalCastBridge Point Cloud"} | {
allowed_scene_items = {"Mimir Point Cloud"} | {
str(stem["obs_name"]) for stem in stem_manifest["stems"]
}

View file

@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop"
$ErrorActionPreference = "Stop"
$root = "C:\Meta\LocalCastBridge"
$root = Split-Path -Parent (Split-Path -Parent $PSCommandPath)
$soundVolumeView = "C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\SoundVolumeView.exe"
$ffmpeg = "C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe"
$config = Join-Path $root "config\localcast.json"

View file

@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop"
$ErrorActionPreference = "Stop"
$root = "C:\Meta\LocalCastBridge"
$root = Split-Path -Parent (Split-Path -Parent $PSCommandPath)
$soundVolumeView = "C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\SoundVolumeView.exe"
$senderStop = Join-Path $root "scripts\sender-stop.ps1"
@ -16,4 +16,3 @@ if (Test-Path -LiteralPath $soundVolumeView) {
}
Get-Process voicemeeter_x64 -ErrorAction SilentlyContinue | Stop-Process -Force

View file

@ -15,7 +15,7 @@ using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
namespace LocalCastBridge {
namespace Mimir {
public static class WasapiLoopbackCapture {
const int eRender = 0;
const int eConsole = 0;
@ -277,4 +277,4 @@ namespace LocalCastBridge {
"@
Add-Type -TypeDefinition $source
[LocalCastBridge.WasapiLoopbackCapture]::Capture($Output, $Seconds, $SampleRate, $Channels, $Role)
[Mimir.WasapiLoopbackCapture]::Capture($Output, $Seconds, $SampleRate, $Channels, $Role)