Verify Muninn OBS source registration

This commit is contained in:
Meta Vens 2026-06-19 23:06:20 +01:00
commit aa4ac6760b
2 changed files with 43 additions and 1 deletions

View file

@ -211,6 +211,9 @@ bool obs_module_load(void)
obs_register_source(&mimir_stem_source_info);
mimir_register_program_texture_source();
mimir_register_muninn_source();
blog(LOG_INFO, "Mimir OBS sources loaded");
blog(
LOG_INFO,
"Mimir OBS sources loaded: mimir_audio_stem_source, mimir_program_texture_source, "
"muninn_stream_source, muninn_video_source, muninn_audio_source");
return true;
}

View file

@ -96,6 +96,44 @@ function Get-LatestObsLog {
Select-Object -First 1
}
function Assert-LatestObsLogWitness {
param(
[string]$ConfigRoot,
[int]$WaitSeconds = 30
)
$requiredPatterns = @(
"Mimir OBS sources loaded: mimir_audio_stem_source, mimir_program_texture_source, muninn_stream_source, muninn_video_source, muninn_audio_source",
"mimir_obs_stem_source.dll"
)
$deadline = (Get-Date).AddSeconds($WaitSeconds)
do {
$latestLog = Get-LatestObsLog -ConfigRoot $ConfigRoot
if ($latestLog) {
$missing = @()
foreach ($pattern in $requiredPatterns) {
if (-not (Select-String -LiteralPath $latestLog.FullName -SimpleMatch -Pattern $pattern -Quiet)) {
$missing += $pattern
}
}
if ($missing.Count -eq 0) {
Write-Host "Verified OBS log witness: $($latestLog.FullName)"
return
}
}
Start-Sleep -Seconds 1
} while ((Get-Date) -lt $deadline)
if (-not $latestLog) {
throw "OBS started, but no OBS log file was found to verify Muninn source registration."
}
Write-Host "Newest OBS log: $($latestLog.FullName) ($($latestLog.Length) bytes)"
if ($latestLog.Length -gt 0) {
Get-Content -LiteralPath $latestLog.FullName -Tail 60 | Write-Host
}
throw "OBS log is missing the expected Mimir Muninn source registration witness after waiting ${WaitSeconds}s: $($requiredPatterns -join '; ')."
}
if (-not (Test-Path -LiteralPath $ObsExe)) {
throw "OBS executable was not found at '$ObsExe'."
}
@ -147,3 +185,4 @@ Write-Host "OBS process:"
$obs | Select-Object Id, ProcessName, StartTime, Responding | Format-Table -AutoSize
Write-Host "Observed Muninn UDP listeners:"
$listeners | ForEach-Object { Write-Host $_ }
Assert-LatestObsLogWitness -ConfigRoot $ObsConfigRoot