diff --git a/native/obs_stem_source/mimir_obs_stem_source.cpp b/native/obs_stem_source/mimir_obs_stem_source.cpp index 8f2f0a6..5ebcbd1 100644 --- a/native/obs_stem_source/mimir_obs_stem_source.cpp +++ b/native/obs_stem_source/mimir_obs_stem_source.cpp @@ -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; } diff --git a/scripts/restart-obs-muninn-source.ps1 b/scripts/restart-obs-muninn-source.ps1 index 83fccb0..64a3eb6 100644 --- a/scripts/restart-obs-muninn-source.ps1 +++ b/scripts/restart-obs-muninn-source.ps1 @@ -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