Merge pull request #1 from GameCult/codex/triage-odin-worktree
[codex] Rework Odin transport ownership and service names
This commit is contained in:
commit
aaf4d737ac
19 changed files with 2270 additions and 1433 deletions
|
|
@ -30,4 +30,5 @@ windows-sys = { version = "0.59", features = [
|
|||
"Win32_Storage_FileSystem",
|
||||
"Win32_System_IO",
|
||||
"Win32_System_Threading",
|
||||
"Win32_UI_Input_XboxController",
|
||||
] }
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -714,7 +714,9 @@ impl AudioPcmStreamSendState {
|
|||
.checked_mul(self.config.packet_duration_ticks as usize)
|
||||
.ok_or_else(|| anyhow!("PCM stream sender bytes_per_packet overflow"))?;
|
||||
if bytes_per_packet == 0 {
|
||||
return Err(anyhow!("PCM stream sender bytes_per_packet must be non-zero"));
|
||||
return Err(anyhow!(
|
||||
"PCM stream sender bytes_per_packet must be non-zero"
|
||||
));
|
||||
}
|
||||
let complete_packets = self.pending.len() / bytes_per_packet;
|
||||
if complete_packets == 0 {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ microphones, cameras, and future sensors.
|
|||
|
||||
```powershell
|
||||
cargo build -p muninn-daemon
|
||||
muninn serve --store C:\Meta\Odin\state\muninn.telemetry.cc --interval-seconds 15 --idunn-rudp-health 127.0.0.1:17870 --idunn-daemon starfire-muninn --idunn-health-contract muninn.cultnet-rudp-local-telemetry-and-quest-access
|
||||
muninn serve --store C:\Meta\Odin\state\muninn.telemetry.cc --interval-seconds 15 --idunn-rudp-health $env:IDUNN_RUDP_HEALTH --idunn-daemon starfire-muninn --idunn-health-contract muninn.cultnet-rudp-local-telemetry-and-quest-access
|
||||
muninn --health --store C:\Meta\Odin\state\muninn.telemetry.cc
|
||||
```
|
||||
|
||||
|
|
@ -31,35 +31,28 @@ muninn --health --store C:\Meta\Odin\state\muninn.telemetry.cc
|
|||
without starting FFmpeg, screen capture, microphone capture, or loopback
|
||||
capture.
|
||||
|
||||
Muninn also writes an OBS stream catalog as typed CultCache state inside:
|
||||
Muninn writes its stream affordance catalog as typed CultCache state inside:
|
||||
|
||||
```text
|
||||
C:\Meta\Odin\state\muninn.telemetry.cc
|
||||
```
|
||||
|
||||
The record is type `muninn.obs_stream_catalog` with schema
|
||||
`muninn.obs_stream_catalog.v1` at key `obs`. On Starfire, `health-muninn.ps1`
|
||||
syncs Raven's `.cc` store to the same local path so the OBS plugin can read
|
||||
CultCache directly without learning Raven SSH.
|
||||
`muninn.obs_stream_catalog.v1` at key `obs`. Consumers discover the catalog
|
||||
through Odin/CultMesh; Muninn does not publish a parallel OBS RUDP catalog.
|
||||
|
||||
The current Raven A/V path is a compatibility proof, not the final hot media
|
||||
shape. Its rebuild map lives in
|
||||
[`docs/muninn-media-streaming.md`](muninn-media-streaming.md): Muninn should
|
||||
publish encoded video access units and audio packets as typed CultMesh media
|
||||
frames with frame ids, deadlines, receiver feedback, and explicit audio/video
|
||||
policy instead of treating MPEG-TS bytes as the transport's unit of truth.
|
||||
|
||||
Activation is explicit:
|
||||
Activation is explicit typed state:
|
||||
|
||||
```powershell
|
||||
.\scripts\activate-muninn-raven-av-srt.ps1
|
||||
muninn request-stream --target-host cultmesh://odin/media/muninn-raven-av --media-transport rudp
|
||||
```
|
||||
|
||||
That Raven activation starts the requested screen and Realtek loopback stream
|
||||
and publishes `muninn.capture_stream.v1`. It is still a background-only Raven
|
||||
actuator: the remote scheduled task must launch through the hidden WScript /
|
||||
noninteractive PowerShell trampoline and must not create visible terminal
|
||||
windows on Raven. Mimir and OBS are stream consumers; they do not own Muninn.
|
||||
`target_host` in the legacy command record field is a CultMesh URI, not a host
|
||||
or IP. The activation child resolves `muninn.media.rudp.v1` endpoints from
|
||||
Odin's provider catalog before opening the CultNet RUDP media lane. SRT, OBS
|
||||
target flags, and standalone Raven activation scripts are archived; Mimir,
|
||||
OBS, and other renderers are consumers of Odin/CultMesh discovery, not transport
|
||||
owners.
|
||||
|
||||
## Quest Access And Unity Return Video
|
||||
|
||||
|
|
@ -105,7 +98,8 @@ E:\Projects\Odin\scripts\health-starfire-muninn.cmd
|
|||
```
|
||||
|
||||
The restart script launches Muninn hidden with `--host starfire --quest-adb`,
|
||||
`--idunn-rudp-health 127.0.0.1:17870`, `--idunn-daemon starfire-muninn`, and
|
||||
`--idunn-rudp-health` from explicit `-IdunnRudpHealth` or
|
||||
`IDUNN_RUDP_HEALTH`, `--idunn-daemon starfire-muninn`, and
|
||||
`--idunn-health-contract muninn.cultnet-rudp-local-telemetry-and-quest-access`.
|
||||
If the CultCache store at `C:\Meta\Odin\state\starfire.muninn.telemetry.cc`
|
||||
fails MessagePack decode on boot, the restart path archives the corrupt file,
|
||||
|
|
@ -210,32 +204,23 @@ missing or the Quest is unavailable, Muninn publishes `muninn.quest_access` as
|
|||
## Host Deployments
|
||||
|
||||
Raven runs Muninn from `C:\Meta\Odin\Muninn`. `scripts/restart-muninn.ps1`
|
||||
recreates the `GameCult-Muninn` scheduled task with `wscript.exe` as the task
|
||||
action and `start-muninn-serve-hidden.vbs` as its argument. It also repairs
|
||||
`GameCult-Muninn-Activate` and `GameCult-Muninn-VideoProof` to execute hidden
|
||||
VBS launchers whose bodies call PowerShell entrypoints directly, not `.cmd`
|
||||
payloads. The serve VBS launches `start-muninn-serve.ps1` with noninteractive hidden
|
||||
PowerShell. The PowerShell launcher starts `muninn.exe` with
|
||||
`-WindowStyle Hidden`, passes `--idunn-rudp-health 192.168.1.66:17870`,
|
||||
`--idunn-daemon muninn`, and
|
||||
recreates only the `GameCult-Muninn` scheduled task. It also unregisters the
|
||||
obsolete `GameCult-Muninn-Activate` and `GameCult-Muninn-VideoProof` tasks if
|
||||
they are present. The serve launcher starts `muninn.exe` with
|
||||
`-WindowStyle Hidden`, requires `--idunn-rudp-health` from explicit
|
||||
`-IdunnRudpHealth` or `IDUNN_RUDP_HEALTH`, passes `--idunn-daemon muninn`, and
|
||||
`--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-health`, and
|
||||
requires `-MediaTargetUri` / `MUNINN_MEDIA_TARGET_URI` to be a `cultmesh://`
|
||||
URI resolved through Odin at activation time. It
|
||||
redirects logs under `C:\Meta\Odin\logs\muninn`.
|
||||
Raven is an operator-consented host: Muninn operations on Raven must be
|
||||
background-only and must not create visible terminal windows. `.cmd` files may
|
||||
exist only as manual compatibility entrypoints that call the same hidden VBS
|
||||
launchers; neither Task Scheduler nor the hidden VBS layer may route through a
|
||||
`cmdPath` trampoline on Raven.
|
||||
The standalone repair actuator for live Raven task drift is
|
||||
`E:\Projects\Odin\scripts\repair-raven-muninn-task-actions.ps1`. It must
|
||||
register `GameCult-Muninn`, `GameCult-Muninn-Activate`, and
|
||||
`GameCult-Muninn-VideoProof` with `wscript.exe` as the task action and the
|
||||
corresponding `*-hidden.vbs` launcher as arguments while also verifying that the
|
||||
hidden VBS bodies reference `.ps1` launchers instead of `.cmd` payloads. If
|
||||
Raven is unreachable, the repo is prepared but the live scheduler is not clean.
|
||||
Run `scripts\verify-muninn-media-profile.ps1` after changing Raven media
|
||||
startup scripts; it verifies that the video proof path still uses the same
|
||||
low-latency NVENC profile as Muninn's RUDP media lane instead of drifting back
|
||||
to legacy buffered encoder settings.
|
||||
Health must fail if the obsolete activation or video-proof tasks still exist on
|
||||
Raven. If Raven is unreachable, the repo is prepared but the live scheduler is
|
||||
not clean.
|
||||
|
||||
Nightwing Muninn is kept alive by the single Idunn supervisor through the
|
||||
`nightwing-muninn` daemon target. Idunn learns that target through Odin's typed
|
||||
|
|
@ -246,7 +231,8 @@ actuators only, not lifecycle owners. The binary is installed at
|
|||
`/home/metacrat/.local/state/gamecult/muninn/muninn.telemetry.cc`, and the
|
||||
restart actuator launches `serve --host nightwing --interval-seconds 15` with
|
||||
`--move-state move-usb=/dev/input/by-id/usb-Sony_Computer_Entertainment_Motion_Controller-joystick`,
|
||||
`--idunn-rudp-health 10.77.0.2:17870`,
|
||||
`--idunn-rudp-health` supplied by explicit `-IdunnRudpHealth` or
|
||||
`IDUNN_RUDP_HEALTH`,
|
||||
`--idunn-daemon nightwing-muninn`,
|
||||
`--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-and-move-hid`,
|
||||
PID, and logs under
|
||||
|
|
@ -259,6 +245,6 @@ pairing collection and Bluetooth joystick can expose the same controller as
|
|||
separate `/dev/input/js*` paths; `nightwing-move-state-sources.sh` prefers the
|
||||
Bluetooth `HID_ID=0005:0000054C:000003D5` path so Idunn health does not demand
|
||||
fresh records from two faces of the same controller. The Nightwing health
|
||||
actuator publishes `nightwing-muninn` health over RUDP to Starfire Idunn at
|
||||
`10.77.0.2:17870`, but that command is fallback proof only; the live keepalive
|
||||
contract is now published by the long-running Nightwing `serve` process.
|
||||
actuator requires the same configured Idunn RUDP endpoint, but that command is
|
||||
fallback proof only; the live keepalive contract is now published by the
|
||||
long-running Nightwing `serve` process.
|
||||
|
|
|
|||
|
|
@ -1,243 +0,0 @@
|
|||
param(
|
||||
[string] $RavenHost = "raven",
|
||||
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
|
||||
[string] $StorePath = "C:\Meta\Odin\state\muninn.activate.cc",
|
||||
[string] $LoopbackScript = "C:\Meta\Odin\Muninn\scripts\wasapi-loopback-capture.ps1",
|
||||
[string] $LogRoot = "C:\Meta\Odin\logs\muninn",
|
||||
[string] $Ffmpeg = "C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe",
|
||||
[string] $TargetHost = "10.77.0.2",
|
||||
[int] $Port = 5204,
|
||||
[string] $MediaTransport = "rudp",
|
||||
[string] $ObsTargetHost = "10.77.0.2",
|
||||
[int] $ObsPort = 5204,
|
||||
[string] $AudioDevice = "Realtek",
|
||||
[switch] $NoObsTarget
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
function Set-AsciiFile {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $Path,
|
||||
[Parameter(Mandatory = $true)] [string] $Content
|
||||
)
|
||||
|
||||
[System.IO.File]::WriteAllText($Path, ($Content -replace "`r?`n", "`r`n"), [System.Text.Encoding]::ASCII)
|
||||
}
|
||||
|
||||
function ConvertTo-PowerShellStringLiteral {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $Value
|
||||
)
|
||||
|
||||
return "'" + $Value.Replace("'", "''") + "'"
|
||||
}
|
||||
|
||||
function ConvertTo-PowerShellArrayLiteral {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string[]] $Values
|
||||
)
|
||||
|
||||
$lines = $Values | ForEach-Object { " {0}" -f (ConvertTo-PowerShellStringLiteral $_) }
|
||||
return "@(`r`n{0}`r`n)" -f ($lines -join ",`r`n")
|
||||
}
|
||||
|
||||
function New-HiddenPowerShellVbsLauncherContent {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $PsPath
|
||||
)
|
||||
|
||||
return (@'
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
scriptDir = fso.GetParentFolderName(WScript.ScriptFullName)
|
||||
psLauncher = "{0}"
|
||||
Set shell = CreateObject("WScript.Shell")
|
||||
shell.CurrentDirectory = scriptDir
|
||||
shell.Run "powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -File """ & psLauncher & """", 0, False
|
||||
'@) -f $PsPath
|
||||
}
|
||||
|
||||
function New-WscriptCmdLauncherContent {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $WorkingDirectory,
|
||||
[Parameter(Mandatory = $true)] [string] $VbsPath
|
||||
)
|
||||
|
||||
return (@'
|
||||
@echo off
|
||||
cd /d "{0}"
|
||||
wscript.exe //B //Nologo "{1}"
|
||||
'@) -f $WorkingDirectory, $VbsPath
|
||||
}
|
||||
|
||||
function Invoke-RavenUploadedPowerShell {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $RavenHost,
|
||||
[Parameter(Mandatory = $true)] [string] $RemoteScriptContent,
|
||||
[Parameter(Mandatory = $true)] [object[]] $UploadSpecs,
|
||||
[Parameter(Mandatory = $true)] [string] $TempPrefix
|
||||
)
|
||||
|
||||
$uploadId = [guid]::NewGuid().ToString("N")
|
||||
$localTempRoot = Join-Path $env:TEMP "$TempPrefix-$uploadId"
|
||||
$localRemoteScript = Join-Path $localTempRoot "$TempPrefix-$uploadId.ps1"
|
||||
$localSftpBatch = Join-Path $localTempRoot "$TempPrefix-$uploadId.sftp"
|
||||
$remoteSftpPath = "C:/Windows/Temp/$TempPrefix-$uploadId.ps1"
|
||||
$remotePsPath = "C:\Windows\Temp\$TempPrefix-$uploadId.ps1"
|
||||
|
||||
try {
|
||||
New-Item -ItemType Directory -Force -Path $localTempRoot | Out-Null
|
||||
Set-AsciiFile -Path $localRemoteScript -Content $RemoteScriptContent
|
||||
|
||||
$batchLines = @()
|
||||
foreach ($spec in $UploadSpecs) {
|
||||
$batchLines += 'put "{0}" "{1}"' -f $spec.LocalPath, $spec.RemotePath
|
||||
}
|
||||
$batchLines += 'put "{0}" "{1}"' -f $localRemoteScript, $remoteSftpPath
|
||||
Set-AsciiFile -Path $localSftpBatch -Content ($batchLines -join "`r`n")
|
||||
|
||||
& sftp.exe -b $localSftpBatch $RavenHost
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
$remoteRunner = @"
|
||||
`$ErrorActionPreference = "Stop"
|
||||
try {
|
||||
& "$remotePsPath"
|
||||
`$code = `$LASTEXITCODE
|
||||
} finally {
|
||||
Remove-Item -LiteralPath "$remotePsPath" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
exit `$code
|
||||
"@
|
||||
$encodedRunner = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($remoteRunner))
|
||||
& ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $RavenHost "powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand $encodedRunner"
|
||||
} finally {
|
||||
Remove-Item -LiteralPath $localTempRoot -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
$muninnDir = Split-Path -Parent $MuninnExe
|
||||
$activateCmdPath = Join-Path $muninnDir "activate-raven-av-srt.cmd"
|
||||
$activatePsPath = Join-Path $muninnDir "activate-raven-av-srt.ps1"
|
||||
$activateVbsPath = Join-Path $muninnDir "activate-raven-av-srt-hidden.vbs"
|
||||
|
||||
$activateArguments = @(
|
||||
"request-stream",
|
||||
"--store", $StorePath,
|
||||
"--host", "raven",
|
||||
"--stream", "muninn.raven.av.rudp",
|
||||
"--stream-action", "start",
|
||||
"--target-host", $TargetHost,
|
||||
"--port", $Port.ToString(),
|
||||
"--media-transport", $MediaTransport
|
||||
)
|
||||
if ($NoObsTarget.IsPresent -or $MediaTransport -ne "srt" -or ($TargetHost -eq $ObsTargetHost -and $Port -eq $ObsPort)) {
|
||||
$activateArguments += "--no-obs-target"
|
||||
} else {
|
||||
$activateArguments += @("--obs-target-host", $ObsTargetHost, "--obs-port", $ObsPort.ToString())
|
||||
}
|
||||
$activateArguments += @(
|
||||
"--audio-device", $AudioDevice,
|
||||
"--ffmpeg", $Ffmpeg,
|
||||
"--loopback-script", $LoopbackScript,
|
||||
"--log-root", $LogRoot
|
||||
)
|
||||
|
||||
$activatePsContent = (@'
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path -Parent {0}) | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path {1} | Out-Null
|
||||
$arguments = {2}
|
||||
function Quote-NativeArgument([string] $Value) {{
|
||||
if ($Value -match '[\s"]') {{
|
||||
return '"' + $Value.Replace('"', '\"') + '"'
|
||||
}}
|
||||
return $Value
|
||||
}}
|
||||
$argumentLine = ($arguments | ForEach-Object {{ Quote-NativeArgument $_ }}) -join ' '
|
||||
$process = Start-Process -FilePath {3} -ArgumentList $argumentLine -WindowStyle Hidden -PassThru -RedirectStandardOutput {4} -RedirectStandardError {5}
|
||||
$process.Id | Set-Content -Encoding ASCII -LiteralPath {6}
|
||||
'@) -f
|
||||
(ConvertTo-PowerShellStringLiteral $StorePath),
|
||||
(ConvertTo-PowerShellStringLiteral $LogRoot),
|
||||
(ConvertTo-PowerShellArrayLiteral $activateArguments),
|
||||
(ConvertTo-PowerShellStringLiteral $MuninnExe),
|
||||
(ConvertTo-PowerShellStringLiteral (Join-Path $LogRoot "muninn-activate.out.log")),
|
||||
(ConvertTo-PowerShellStringLiteral (Join-Path $LogRoot "muninn-activate.err.log")),
|
||||
(ConvertTo-PowerShellStringLiteral (Join-Path $LogRoot "muninn-activate.pid"))
|
||||
|
||||
$uploadRoot = Join-Path $env:TEMP ("odin-raven-muninn-activate-" + [guid]::NewGuid().ToString("N"))
|
||||
|
||||
try {
|
||||
New-Item -ItemType Directory -Force -Path $uploadRoot | Out-Null
|
||||
|
||||
$localActivatePs = Join-Path $uploadRoot "activate-raven-av-srt.ps1"
|
||||
$localActivateVbs = Join-Path $uploadRoot "activate-raven-av-srt-hidden.vbs"
|
||||
$localActivateCmd = Join-Path $uploadRoot "activate-raven-av-srt.cmd"
|
||||
|
||||
Set-AsciiFile -Path $localActivatePs -Content $activatePsContent
|
||||
Set-AsciiFile -Path $localActivateVbs -Content (New-HiddenPowerShellVbsLauncherContent -PsPath $activatePsPath)
|
||||
Set-AsciiFile -Path $localActivateCmd -Content (New-WscriptCmdLauncherContent -WorkingDirectory $muninnDir -VbsPath $activateVbsPath)
|
||||
|
||||
$remoteScript = @"
|
||||
`$ErrorActionPreference = "Stop"
|
||||
`$ProgressPreference = "SilentlyContinue"
|
||||
if (-not (Test-Path -LiteralPath "$MuninnExe")) {
|
||||
throw "Muninn executable not found at $MuninnExe"
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath "$LoopbackScript")) {
|
||||
throw "Muninn loopback script not found at $LoopbackScript"
|
||||
}
|
||||
if (-not (Test-Path -LiteralPath "$Ffmpeg")) {
|
||||
throw "FFmpeg executable not found at $Ffmpeg"
|
||||
}
|
||||
foreach (`$path in @(
|
||||
"$activatePsPath",
|
||||
"$activateVbsPath"
|
||||
)) {
|
||||
if (-not (Test-Path -LiteralPath `$path)) {
|
||||
throw "Required launcher path not found at `$path"
|
||||
}
|
||||
}
|
||||
|
||||
Get-CimInstance Win32_Process |
|
||||
Where-Object {
|
||||
(`$_.Name -like "muninn*.exe" -and `$_.CommandLine -like "*activate*") -or
|
||||
(`$_.Name -ieq "ffmpeg.exe" -and `$_.CommandLine -like "*srt://$TargetHost*") -or
|
||||
(`$_.Name -ieq "powershell.exe" -and `$_.CommandLine -like "*wasapi-loopback-capture.ps1*")
|
||||
} |
|
||||
ForEach-Object {
|
||||
& taskkill.exe /PID `$_.ProcessId /T /F | Out-Null
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path "$LogRoot" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path -Parent "$StorePath") | Out-Null
|
||||
|
||||
`$vbs = Get-Content -LiteralPath "$activateVbsPath" -Raw
|
||||
if (`$vbs -match 'cmdPath\s*=') {
|
||||
throw "GameCult-Muninn-Activate hidden launcher at $activateVbsPath still routes through a cmdPath trampoline"
|
||||
}
|
||||
if (`$vbs -notmatch '\.ps1') {
|
||||
throw "GameCult-Muninn-Activate hidden launcher at $activateVbsPath does not reference a PowerShell launcher"
|
||||
}
|
||||
if (Get-ScheduledTask -TaskName "GameCult-Muninn-Activate" -ErrorAction SilentlyContinue) {
|
||||
Unregister-ScheduledTask -TaskName "GameCult-Muninn-Activate" -Confirm:`$false | Out-Null
|
||||
}
|
||||
Start-Process -FilePath "wscript.exe" -ArgumentList "//B //Nologo ""$activateVbsPath""" -WindowStyle Hidden | Out-Null
|
||||
"@
|
||||
|
||||
$uploadSpecs = @(
|
||||
@{ LocalPath = $localActivatePs; RemotePath = ($activatePsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localActivateVbs; RemotePath = ($activateVbsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localActivateCmd; RemotePath = ($activateCmdPath -replace "\\", "/") }
|
||||
)
|
||||
|
||||
Invoke-RavenUploadedPowerShell -RavenHost $RavenHost -RemoteScriptContent $remoteScript -UploadSpecs $uploadSpecs -TempPrefix "odin-raven-muninn-activate"
|
||||
} finally {
|
||||
Remove-Item -LiteralPath $uploadRoot -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
exit $LASTEXITCODE
|
||||
1
scripts/activate-muninn-raven-media.ps1
Normal file
1
scripts/activate-muninn-raven-media.ps1
Normal file
|
|
@ -0,0 +1 @@
|
|||
throw "activate-muninn-raven-media.ps1 archived: Muninn media activation is daemon-owned and target resolution is through Odin/CultMesh. Redeploy Muninn through Idunn and publish a typed muninn.capture_stream_command with a cultmesh:// media target URI."
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
param(
|
||||
[string] $RavenHost = "raven",
|
||||
[string] $RavenHost = "raven.Home",
|
||||
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
|
||||
[string] $LocalMuninnExe = "",
|
||||
[int] $ConnectTimeoutSeconds = 10,
|
||||
[string] $SshUser = "",
|
||||
[string] $IdentityFile = "",
|
||||
[string] $SshUser = "madman's lullaby",
|
||||
[string] $IdentityFile = "C:\Users\Meta\.ssh\id_ed25519_192_168_1_84",
|
||||
[switch] $SkipBuild,
|
||||
[switch] $SkipRestart,
|
||||
[switch] $PreflightOnly
|
||||
|
|
@ -251,7 +251,8 @@ if (Test-Path -LiteralPath `$target) {
|
|||
Copy-Item -LiteralPath `$target -Destination `$backup -Force
|
||||
}
|
||||
|
||||
Move-Item -LiteralPath `$incoming -Destination `$target -Force
|
||||
Copy-Item -LiteralPath `$incoming -Destination `$target -Force
|
||||
Remove-Item -LiteralPath `$incoming -Force -ErrorAction SilentlyContinue
|
||||
`$item = Get-Item -LiteralPath `$target
|
||||
Write-Output ("muninn.exe deployed length={0} path={1}" -f `$item.Length, `$item.FullName)
|
||||
`$global:LASTEXITCODE = 0
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\health-muninn.ps1
|
||||
echo health-muninn.cmd archived: Raven Muninn health is daemon-published over CultNet/RUDP as muninn.cultnet-rudp-remote-telemetry-health. Use health-muninn.ps1 only as an explicit witness inspection, not Idunn health truth.
|
||||
exit /b 2
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ param(
|
|||
[string] $ActivateStorePath = "C:\Meta\Odin\state\muninn.activate.cc",
|
||||
[string] $LogRoot = "C:\Meta\Odin\logs\muninn",
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = "192.168.1.66:17870",
|
||||
[string] $CaptureCommandRudpBind = "0.0.0.0:17883",
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[int] $ConnectTimeoutSeconds = 10,
|
||||
[string] $SshUser = "madman's lullaby",
|
||||
[string] $IdentityFile = ""
|
||||
|
|
@ -14,6 +13,10 @@ param(
|
|||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
|
||||
function Set-AsciiFile {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $Path,
|
||||
|
|
@ -97,8 +100,7 @@ if (-not (Test-Path -LiteralPath "$MuninnExe")) {
|
|||
}
|
||||
`$muninnDir = Split-Path -Parent "$MuninnExe"
|
||||
`$taskExpectations = @(
|
||||
@{ Name = "GameCult-Muninn"; Launcher = "powershell"; Vbs = Join-Path `$muninnDir "start-muninn-serve-hidden.vbs"; Ps = Join-Path `$muninnDir "start-muninn-serve.ps1" },
|
||||
@{ Name = "GameCult-Muninn-VideoProof"; Launcher = "wscript"; Vbs = Join-Path `$muninnDir "muninn-raven-video-to-starfire-obs-hidden.vbs"; Ps = Join-Path `$muninnDir "muninn-raven-video-to-starfire-obs.ps1" }
|
||||
@{ Name = "GameCult-Muninn"; Launcher = "powershell"; Vbs = Join-Path `$muninnDir "start-muninn-serve-hidden.vbs"; Ps = Join-Path `$muninnDir "start-muninn-serve.ps1" }
|
||||
)
|
||||
foreach (`$expectation in `$taskExpectations) {
|
||||
`$task = Get-ScheduledTask -TaskName `$expectation.Name -ErrorAction Stop
|
||||
|
|
@ -137,33 +139,6 @@ foreach (`$expectation in `$taskExpectations) {
|
|||
if (`$psContent -notmatch 'Start-Process') {
|
||||
throw "`$(`$expectation.Ps) does not launch a hidden process"
|
||||
}
|
||||
if (`$expectation.Name -eq "GameCult-Muninn-VideoProof" -and `$psContent -notmatch 'ffmpeg\.exe') {
|
||||
throw "`$(`$expectation.Ps) does not launch ffmpeg.exe"
|
||||
}
|
||||
if (`$expectation.Name -eq "GameCult-Muninn-VideoProof" -and `$psContent -notmatch 'srt://.+:\d+\?mode=caller') {
|
||||
throw "`$(`$expectation.Ps) does not carry the expected SRT caller target"
|
||||
}
|
||||
if (`$expectation.Name -eq "GameCult-Muninn-VideoProof") {
|
||||
foreach (`$requiredPair in @(
|
||||
@("'-c:v'\s*,\s*'h264_nvenc'", "h264_nvenc video encoder"),
|
||||
@("'-preset'\s*,\s*'p1'", "NVENC p1 preset"),
|
||||
@("'-tune'\s*,\s*'ull'", "ultra-low-latency tune"),
|
||||
@("'-zerolatency'\s*,\s*'1'", "zero-latency encoder flag"),
|
||||
@("'-bf'\s*,\s*'0'", "disabled B-frames"),
|
||||
@("'-delay'\s*,\s*'0'", "zero encoder delay"),
|
||||
@("'-rc'\s*,\s*'cbr'", "CBR rate control"),
|
||||
@("'-rc-lookahead'\s*,\s*'0'", "disabled lookahead"),
|
||||
@("'-bufsize'\s*,\s*'400k'", "one-frame VBV buffer"),
|
||||
@("'-forced-idr'\s*,\s*'1'", "forced IDR keyframes")
|
||||
)) {
|
||||
if (`$psContent -notmatch `$requiredPair[0]) {
|
||||
throw "`$(`$expectation.Ps) does not carry `$(`$requiredPair[1])"
|
||||
}
|
||||
}
|
||||
if (`$psContent -match "'-preset'\s*,\s*'p4'|24000k") {
|
||||
throw "`$(`$expectation.Ps) still carries legacy buffered NVENC settings"
|
||||
}
|
||||
}
|
||||
`$vbs = Get-Content -LiteralPath `$expectation.Vbs -Raw
|
||||
if (`$vbs -match 'cmdPath\s*=') {
|
||||
throw "`$(`$expectation.Vbs) still routes through a cmdPath trampoline"
|
||||
|
|
@ -175,6 +150,9 @@ foreach (`$expectation in `$taskExpectations) {
|
|||
if (Get-ScheduledTask -TaskName "GameCult-Muninn-Activate" -ErrorAction SilentlyContinue) {
|
||||
throw "Obsolete GameCult-Muninn-Activate task is still present on Raven"
|
||||
}
|
||||
if (Get-ScheduledTask -TaskName "GameCult-Muninn-VideoProof" -ErrorAction SilentlyContinue) {
|
||||
throw "Obsolete GameCult-Muninn-VideoProof task is still present on Raven"
|
||||
}
|
||||
`$servePidPath = Join-Path "$LogRoot" "muninn-serve.pid"
|
||||
`$servePid = `$null
|
||||
if (Test-Path -LiteralPath `$servePidPath) {
|
||||
|
|
@ -200,7 +178,6 @@ if (`$null -eq `$process) {
|
|||
foreach (`$pattern in @(
|
||||
"--host raven",
|
||||
"--activate-store $ActivateStorePath",
|
||||
"--capture-command-rudp-bind $CaptureCommandRudpBind",
|
||||
"--idunn-rudp-health $IdunnRudpHealth",
|
||||
"--idunn-daemon muninn",
|
||||
"--idunn-health-contract muninn.cultnet-rudp-remote-telemetry-health"
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\health-nightwing-muninn.ps1
|
||||
echo health-nightwing-muninn.cmd archived: Nightwing Muninn health is daemon-published over CultNet/RUDP as muninn.cultnet-rudp-remote-telemetry-and-move-hid. Use health-nightwing-muninn.ps1 only as an explicit witness inspection, not Idunn health truth.
|
||||
exit /b 2
|
||||
|
|
|
|||
|
|
@ -6,11 +6,15 @@ param(
|
|||
[string[]] $MoveState = @(),
|
||||
[int] $IntervalSeconds = 15,
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = "10.77.0.2:17870"
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no WireGuard endpoint default is allowed."
|
||||
}
|
||||
|
||||
function Set-AsciiFile {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)] [string] $Path,
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
@echo off
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\health-starfire-muninn.ps1
|
||||
echo health-starfire-muninn.cmd archived: Starfire Muninn health is daemon-published over CultNet/RUDP as muninn.cultnet-rudp-local-telemetry-and-quest-access. Use health-starfire-muninn.ps1 only as an explicit witness inspection, not Idunn health truth.
|
||||
exit /b 2
|
||||
|
|
|
|||
|
|
@ -4,11 +4,15 @@ param(
|
|||
[string] $LogRoot = "C:\Meta\Odin\logs\starfire-muninn",
|
||||
[string[]] $MoveState = @(),
|
||||
[int] $MaxStoreAgeSeconds = 180,
|
||||
[string] $IdunnRudpHealth = "127.0.0.1:17870"
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $MuninnExe)) {
|
||||
throw "Muninn executable not found at $MuninnExe"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,10 @@
|
|||
@echo off
|
||||
if not "%IDUNN_ACTUATOR%"=="1" (
|
||||
echo restart-muninn.cmd is an Idunn actuator wrapper. Redeploy by poking Idunn; direct service restart is not an owned path. 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
if /I not "%IDUNN_COMMAND_AUTHORITY%"=="idunn-daemon" (
|
||||
echo restart-muninn.cmd is an Idunn actuator wrapper. Redeploy by poking Idunn; direct service restart is not an owned path. 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-muninn.ps1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
param(
|
||||
[string] $RavenHost = "raven-local",
|
||||
[string] $RavenHost = "raven.Home",
|
||||
[string] $MuninnExe = "C:\Meta\Odin\Muninn\muninn.exe",
|
||||
[string] $StorePath = "C:\Meta\Odin\state\muninn.telemetry.cc",
|
||||
[string] $ActivateStorePath = "C:\Meta\Odin\state\muninn.activate.cc",
|
||||
|
|
@ -7,32 +7,42 @@ param(
|
|||
[string] $LocalLoopbackScript = (Join-Path $PSScriptRoot "wasapi-loopback-capture.ps1"),
|
||||
[string] $LoopbackScript = "C:\Meta\Odin\Muninn\scripts\wasapi-loopback-capture.ps1",
|
||||
[string] $Ffmpeg = "C:\Users\Madman's Lullaby\AppData\Local\Microsoft\WinGet\Links\ffmpeg.exe",
|
||||
[string] $TargetHost = "192.168.1.66",
|
||||
[int] $Port = 5204,
|
||||
[string] $MediaTransport = "rudp",
|
||||
[string] $ObsTargetHost = "192.168.1.66",
|
||||
[int] $ObsPort = 5204,
|
||||
[string] $MediaTargetUri = $env:MUNINN_MEDIA_TARGET_URI,
|
||||
[string] $AudioDevice = "Realtek",
|
||||
[string[]] $VideoSources = @(),
|
||||
[string[]] $AudioSources = @(),
|
||||
[string] $IdunnRudpHealth = "192.168.1.66:17870",
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[string] $IdunnDaemon = "muninn",
|
||||
[string] $IdunnHealthContract = "muninn.cultnet-rudp-remote-telemetry-health",
|
||||
[string] $OdinCultMeshRudp = "",
|
||||
[string] $CaptureCommandRudpBind = "0.0.0.0:17883",
|
||||
[string] $CaptureCommandRudpTarget = "127.0.0.1:17883",
|
||||
[string] $ObsCatalogRudpTarget = "192.168.1.66:17874",
|
||||
[string] $OdinCultMeshUri = $(if ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
|
||||
[string[]] $MoveStates = @("xbox-raven=xinput://0"),
|
||||
[string] $HidControllerRudpTarget = "",
|
||||
[string] $HidControllerRudpBind = "0.0.0.0:17887",
|
||||
[string] $HidControllerRudpAdvertise = $env:MUNINN_HID_CONTROLLER_RUDP_ADVERTISE,
|
||||
[int] $ConnectTimeoutSeconds = 10,
|
||||
[int] $ServeStartTimeoutSeconds = 20,
|
||||
[string] $SshUser = "madman's lullaby",
|
||||
[string] $IdentityFile = ""
|
||||
[string] $IdentityFile = "C:\Users\Meta\.ssh\id_ed25519_192_168_1_84"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daemon") {
|
||||
throw "restart-muninn.ps1 is an Idunn actuator body. Redeploy by poking Idunn; direct service restart is not an owned path."
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $LocalLoopbackScript)) {
|
||||
throw "Local Muninn loopback script not found at $LocalLoopbackScript"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($MediaTargetUri) -or -not $MediaTargetUri.StartsWith("cultmesh://", [System.StringComparison]::OrdinalIgnoreCase)) {
|
||||
throw "Muninn media target URI must be supplied by -MediaTargetUri or MUNINN_MEDIA_TARGET_URI and must start with cultmesh://."
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind) -and [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
throw "HID controller RUDP advertise endpoint must be supplied by -HidControllerRudpAdvertise or MUNINN_HID_CONTROLLER_RUDP_ADVERTISE when HID RUDP bind is enabled; no Raven LAN default is allowed."
|
||||
}
|
||||
|
||||
function Set-AsciiFile {
|
||||
param(
|
||||
|
|
@ -356,12 +366,6 @@ $muninnDir = Split-Path -Parent $MuninnExe
|
|||
$serveCmdPath = Join-Path $muninnDir "start-muninn-serve.cmd"
|
||||
$servePsPath = Join-Path $muninnDir "start-muninn-serve.ps1"
|
||||
$serveVbsPath = Join-Path $muninnDir "start-muninn-serve-hidden.vbs"
|
||||
$activateCmdPath = Join-Path $muninnDir "activate-raven-av-srt.cmd"
|
||||
$activatePsPath = Join-Path $muninnDir "activate-raven-av-srt.ps1"
|
||||
$activateVbsPath = Join-Path $muninnDir "activate-raven-av-srt-hidden.vbs"
|
||||
$videoProofCmdPath = Join-Path $muninnDir "muninn-raven-video-to-starfire-obs.cmd"
|
||||
$videoProofPsPath = Join-Path $muninnDir "muninn-raven-video-to-starfire-obs.ps1"
|
||||
$videoProofVbsPath = Join-Path $muninnDir "muninn-raven-video-to-starfire-obs-hidden.vbs"
|
||||
|
||||
$serveArguments = @(
|
||||
"serve",
|
||||
|
|
@ -370,12 +374,20 @@ $serveArguments = @(
|
|||
"--log-root", $LogRoot,
|
||||
"--host", "raven",
|
||||
"--stream", "muninn.raven.av.rudp",
|
||||
"--target-host", $TargetHost,
|
||||
"--port", $Port.ToString(),
|
||||
"--media-transport", $MediaTransport
|
||||
"--target-host", $MediaTargetUri,
|
||||
"--media-transport", "rudp"
|
||||
)
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshRudp)) {
|
||||
$serveArguments += @("--odin-cultmesh-rudp", $OdinCultMeshRudp)
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshUri)) {
|
||||
$serveArguments += @("--odin-cultmesh-uri", $OdinCultMeshUri)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpTarget)) {
|
||||
$serveArguments += @("--hid-controller-rudp-target", $HidControllerRudpTarget)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind)) {
|
||||
$serveArguments += @("--hid-controller-rudp-bind", $HidControllerRudpBind)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
$serveArguments += @("--hid-controller-rudp-advertise", $HidControllerRudpAdvertise)
|
||||
}
|
||||
foreach ($videoSource in $VideoSources) {
|
||||
$serveArguments += @("--video-source", $videoSource)
|
||||
|
|
@ -383,18 +395,20 @@ foreach ($videoSource in $VideoSources) {
|
|||
foreach ($audioSource in $AudioSources) {
|
||||
$serveArguments += @("--audio-source", $audioSource)
|
||||
}
|
||||
foreach ($moveState in $MoveStates) {
|
||||
if (-not [string]::IsNullOrWhiteSpace($moveState)) {
|
||||
$serveArguments += @("--move-state", $moveState)
|
||||
}
|
||||
}
|
||||
$serveArguments += @(
|
||||
"--audio-device", $AudioDevice,
|
||||
"--ffmpeg", $Ffmpeg,
|
||||
"--loopback-script", $LoopbackScript,
|
||||
"--interval-seconds", "15",
|
||||
"--capture-command-rudp-bind", $CaptureCommandRudpBind,
|
||||
"--obs-catalog-rudp-target", $ObsCatalogRudpTarget,
|
||||
"--idunn-rudp-health", $IdunnRudpHealth,
|
||||
"--idunn-daemon", $IdunnDaemon,
|
||||
"--idunn-health-contract", $IdunnHealthContract
|
||||
)
|
||||
|
||||
$serveDynamicArgumentsScript = @'
|
||||
function Test-LikelyVirtualDisplayToken {
|
||||
param([Parameter(Mandatory = $true)] [string] $Token)
|
||||
|
|
@ -664,68 +678,6 @@ if (-not $hasExplicitAudioSources) {
|
|||
}
|
||||
'@
|
||||
|
||||
$activateArguments = @(
|
||||
"request-stream",
|
||||
"--store", $StorePath,
|
||||
"--activate-store", $ActivateStorePath,
|
||||
"--capture-command-rudp-target", $CaptureCommandRudpTarget,
|
||||
"--host", "raven",
|
||||
"--stream", "muninn.raven.av.rudp",
|
||||
"--stream-action", "start",
|
||||
"--target-host", $TargetHost,
|
||||
"--port", $Port.ToString(),
|
||||
"--media-transport", $MediaTransport
|
||||
)
|
||||
if ($MediaTransport -ne "srt" -or ($TargetHost -eq $ObsTargetHost -and $Port -eq $ObsPort)) {
|
||||
$activateArguments += "--no-obs-target"
|
||||
} else {
|
||||
$activateArguments += @("--obs-target-host", $ObsTargetHost, "--obs-port", $ObsPort.ToString())
|
||||
}
|
||||
$activateArguments += @(
|
||||
"--audio-device", $AudioDevice,
|
||||
"--ffmpeg", $Ffmpeg,
|
||||
"--loopback-script", $LoopbackScript,
|
||||
"--log-root", $LogRoot
|
||||
)
|
||||
|
||||
$videoProofFramerate = 30
|
||||
$videoProofBitrateKbps = 12000
|
||||
$videoProofVbvKbits = [Math]::Ceiling($videoProofBitrateKbps / $videoProofFramerate)
|
||||
|
||||
$videoProofArguments = @(
|
||||
"-hide_banner",
|
||||
"-loglevel", "info",
|
||||
"-fflags", "nobuffer",
|
||||
"-flags", "low_delay",
|
||||
"-thread_queue_size", "1024",
|
||||
"-f", "lavfi",
|
||||
"-i", ("ddagrab=framerate={0}:output_idx=0:draw_mouse=1" -f $videoProofFramerate),
|
||||
"-thread_queue_size", "1024",
|
||||
"-f", "lavfi",
|
||||
"-i", "anullsrc=channel_layout=stereo:sample_rate=48000",
|
||||
"-map", "0:v:0",
|
||||
"-map", "1:a:0",
|
||||
"-c:v", "h264_nvenc",
|
||||
"-preset", "p1",
|
||||
"-tune", "ull",
|
||||
"-zerolatency", "1",
|
||||
"-bf", "0",
|
||||
"-delay", "0",
|
||||
"-rc", "cbr",
|
||||
"-rc-lookahead", "0",
|
||||
"-b:v", ("{0}k" -f $videoProofBitrateKbps),
|
||||
"-maxrate", ("{0}k" -f $videoProofBitrateKbps),
|
||||
"-bufsize", ("{0}k" -f $videoProofVbvKbits),
|
||||
"-g", $videoProofFramerate.ToString(),
|
||||
"-forced-idr", "1",
|
||||
"-c:a", "aac",
|
||||
"-b:a", "192k",
|
||||
"-ar", "48000",
|
||||
"-ac", "2",
|
||||
"-f", "mpegts",
|
||||
("srt://{0}:{1}?mode=caller&latency=120000&timeout=30000000" -f $ObsTargetHost, $ObsPort)
|
||||
)
|
||||
|
||||
$servePsContent = New-HiddenNativeLauncherPowerShellContent `
|
||||
-StorePath $StorePath `
|
||||
-LogRoot $LogRoot `
|
||||
|
|
@ -736,24 +688,6 @@ $servePsContent = New-HiddenNativeLauncherPowerShellContent `
|
|||
-PidPath (Join-Path $LogRoot "muninn-serve.pid") `
|
||||
-DynamicArgumentsScript $serveDynamicArgumentsScript
|
||||
|
||||
$activatePsContent = New-HiddenNativeLauncherPowerShellContent `
|
||||
-StorePath $ActivateStorePath `
|
||||
-LogRoot $LogRoot `
|
||||
-Arguments $activateArguments `
|
||||
-FilePath $MuninnExe `
|
||||
-StdoutPath (Join-Path $LogRoot "muninn-activate.out.log") `
|
||||
-StderrPath (Join-Path $LogRoot "muninn-activate.err.log") `
|
||||
-PidPath (Join-Path $LogRoot "muninn-activate.pid")
|
||||
|
||||
$videoProofPsContent = New-HiddenNativeLauncherPowerShellContent `
|
||||
-LogRoot $LogRoot `
|
||||
-Arguments $videoProofArguments `
|
||||
-FilePath $Ffmpeg `
|
||||
-StdoutPath (Join-Path $LogRoot "muninn-video-proof.out.log") `
|
||||
-StderrPath (Join-Path $LogRoot "muninn-video-proof.err.log") `
|
||||
-PidPath (Join-Path $LogRoot "muninn-video-proof.pid") `
|
||||
-WorkingDirectory $muninnDir
|
||||
|
||||
$uploadRoot = Join-Path $env:TEMP ("odin-raven-muninn-launchers-" + [guid]::NewGuid().ToString("N"))
|
||||
|
||||
try {
|
||||
|
|
@ -762,22 +696,10 @@ try {
|
|||
$localServePs = Join-Path $uploadRoot "start-muninn-serve.ps1"
|
||||
$localServeVbs = Join-Path $uploadRoot "start-muninn-serve-hidden.vbs"
|
||||
$localServeCmd = Join-Path $uploadRoot "start-muninn-serve.cmd"
|
||||
$localActivatePs = Join-Path $uploadRoot "activate-raven-av-srt.ps1"
|
||||
$localActivateVbs = Join-Path $uploadRoot "activate-raven-av-srt-hidden.vbs"
|
||||
$localActivateCmd = Join-Path $uploadRoot "activate-raven-av-srt.cmd"
|
||||
$localVideoProofPs = Join-Path $uploadRoot "muninn-raven-video-to-starfire-obs.ps1"
|
||||
$localVideoProofVbs = Join-Path $uploadRoot "muninn-raven-video-to-starfire-obs-hidden.vbs"
|
||||
$localVideoProofCmd = Join-Path $uploadRoot "muninn-raven-video-to-starfire-obs.cmd"
|
||||
|
||||
Set-AsciiFile -Path $localServePs -Content $servePsContent
|
||||
Set-AsciiFile -Path $localServeVbs -Content (New-HiddenPowerShellVbsLauncherContent -PsPath $servePsPath)
|
||||
Set-AsciiFile -Path $localServeCmd -Content (New-WscriptCmdLauncherContent -WorkingDirectory $muninnDir -VbsPath $serveVbsPath)
|
||||
Set-AsciiFile -Path $localActivatePs -Content $activatePsContent
|
||||
Set-AsciiFile -Path $localActivateVbs -Content (New-HiddenPowerShellVbsLauncherContent -PsPath $activatePsPath)
|
||||
Set-AsciiFile -Path $localActivateCmd -Content (New-WscriptCmdLauncherContent -WorkingDirectory $muninnDir -VbsPath $activateVbsPath)
|
||||
Set-AsciiFile -Path $localVideoProofPs -Content $videoProofPsContent
|
||||
Set-AsciiFile -Path $localVideoProofVbs -Content (New-HiddenPowerShellVbsLauncherContent -PsPath $videoProofPsPath)
|
||||
Set-AsciiFile -Path $localVideoProofCmd -Content (New-WscriptCmdLauncherContent -WorkingDirectory $muninnDir -VbsPath $videoProofVbsPath)
|
||||
|
||||
$remoteScript = @"
|
||||
`$ErrorActionPreference = "Stop"
|
||||
|
|
@ -794,11 +716,7 @@ if (-not (Test-Path -LiteralPath "$Ffmpeg")) {
|
|||
}
|
||||
foreach (`$path in @(
|
||||
"$servePsPath",
|
||||
"$serveVbsPath",
|
||||
"$activatePsPath",
|
||||
"$activateVbsPath",
|
||||
"$videoProofPsPath",
|
||||
"$videoProofVbsPath"
|
||||
"$serveVbsPath"
|
||||
)) {
|
||||
if (-not (Test-Path -LiteralPath `$path)) {
|
||||
throw "Required launcher path not found at `$path"
|
||||
|
|
@ -809,6 +727,10 @@ foreach (`$path in @(
|
|||
if (`$null -ne `$obsoleteActivateTask) {
|
||||
Unregister-ScheduledTask -TaskName "GameCult-Muninn-Activate" -Confirm:`$false | Out-Null
|
||||
}
|
||||
`$obsoleteVideoProofTask = Get-ScheduledTask -TaskName "GameCult-Muninn-VideoProof" -ErrorAction SilentlyContinue
|
||||
if (`$null -ne `$obsoleteVideoProofTask) {
|
||||
Unregister-ScheduledTask -TaskName "GameCult-Muninn-VideoProof" -Confirm:`$false | Out-Null
|
||||
}
|
||||
|
||||
Get-CimInstance Win32_Process |
|
||||
Where-Object { `$_.Name -like "muninn*.exe" } |
|
||||
|
|
@ -818,9 +740,12 @@ Get-CimInstance Win32_Process |
|
|||
|
||||
New-Item -ItemType Directory -Force -Path "$LogRoot" | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path -Parent "$StorePath") | Out-Null
|
||||
`$captureCommandUdpPort = ([string] "$CaptureCommandRudpBind").Split(':')[-1]
|
||||
& netsh.exe advfirewall firewall delete rule name="GameCult Muninn Capture Command RUDP" | Out-Null 2>`$null
|
||||
& netsh.exe advfirewall firewall add rule name="GameCult Muninn Capture Command RUDP" dir=in action=allow protocol=UDP localport=`$captureCommandUdpPort | Out-Null
|
||||
if (-not [string]::IsNullOrWhiteSpace("$HidControllerRudpBind")) {
|
||||
`$hidControllerUdpPort = ([string] "$HidControllerRudpBind").Split(':')[-1]
|
||||
& netsh.exe advfirewall firewall delete rule name="GameCult Muninn HID Controller RUDP" | Out-Null 2>`$null
|
||||
& netsh.exe advfirewall firewall add rule name="GameCult Muninn HID Controller RUDP" dir=in action=allow protocol=UDP localport=`$hidControllerUdpPort | Out-Null
|
||||
}
|
||||
|
||||
function Register-HiddenVbsTask {
|
||||
param(
|
||||
|
|
@ -902,10 +827,8 @@ function Assert-HiddenPowerShellTask {
|
|||
}
|
||||
|
||||
Register-HiddenPowerShellTask -TaskName "GameCult-Muninn" -PsPath "$servePsPath"
|
||||
Register-HiddenVbsTask -TaskName "GameCult-Muninn-VideoProof" -VbsPath "$videoProofVbsPath"
|
||||
|
||||
Assert-HiddenPowerShellTask -TaskName "GameCult-Muninn" -PsPath "$servePsPath"
|
||||
Assert-HiddenVbsTask -TaskName "GameCult-Muninn-VideoProof" -VbsPath "$videoProofVbsPath" -PsPath "$videoProofPsPath"
|
||||
|
||||
Start-ScheduledTask -TaskName "GameCult-Muninn"
|
||||
|
||||
|
|
@ -938,13 +861,7 @@ foreach (`$pattern in @(
|
|||
@{ LocalPath = $LocalLoopbackScript; RemotePath = ($LoopbackScript -replace "\\", "/") },
|
||||
@{ LocalPath = $localServePs; RemotePath = ($servePsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localServeVbs; RemotePath = ($serveVbsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localServeCmd; RemotePath = ($serveCmdPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localActivatePs; RemotePath = ($activatePsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localActivateVbs; RemotePath = ($activateVbsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localActivateCmd; RemotePath = ($activateCmdPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localVideoProofPs; RemotePath = ($videoProofPsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localVideoProofVbs; RemotePath = ($videoProofVbsPath -replace "\\", "/") },
|
||||
@{ LocalPath = $localVideoProofCmd; RemotePath = ($videoProofCmdPath -replace "\\", "/") }
|
||||
@{ LocalPath = $localServeCmd; RemotePath = ($serveCmdPath -replace "\\", "/") }
|
||||
)
|
||||
|
||||
Invoke-RavenUploadedPowerShell -RavenHost $RavenHost -RemoteScriptContent $remoteScript -UploadSpecs $uploadSpecs -TempPrefix "odin-raven-muninn-restart"
|
||||
|
|
@ -952,39 +869,4 @@ foreach (`$pattern in @(
|
|||
Remove-Item -LiteralPath $uploadRoot -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$restartExit = $LASTEXITCODE
|
||||
if ($restartExit -eq 0) {
|
||||
Start-Sleep -Seconds 2
|
||||
$healthScript = Join-Path $PSScriptRoot "health-muninn.ps1"
|
||||
$healthArgs = @(
|
||||
"-NoProfile",
|
||||
"-ExecutionPolicy",
|
||||
"Bypass",
|
||||
"-File",
|
||||
$healthScript,
|
||||
"-RavenHost",
|
||||
$RavenHost,
|
||||
"-MuninnExe",
|
||||
$MuninnExe,
|
||||
"-StorePath",
|
||||
$StorePath,
|
||||
"-ActivateStorePath",
|
||||
$ActivateStorePath,
|
||||
"-IdunnRudpHealth",
|
||||
$IdunnRudpHealth,
|
||||
"-CaptureCommandRudpBind",
|
||||
$CaptureCommandRudpBind,
|
||||
"-ConnectTimeoutSeconds",
|
||||
$ConnectTimeoutSeconds.ToString(),
|
||||
"-MaxStoreAgeSeconds",
|
||||
([Math]::Max(180, $ServeStartTimeoutSeconds + 60)).ToString()
|
||||
)
|
||||
if (-not [string]::IsNullOrWhiteSpace($SshUser)) {
|
||||
$healthArgs += @("-SshUser", $SshUser)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($IdentityFile)) {
|
||||
$healthArgs += @("-IdentityFile", $IdentityFile)
|
||||
}
|
||||
& powershell.exe @healthArgs
|
||||
}
|
||||
exit $restartExit
|
||||
exit $LASTEXITCODE
|
||||
|
|
|
|||
|
|
@ -1,2 +1,10 @@
|
|||
@echo off
|
||||
if not "%IDUNN_ACTUATOR%"=="1" (
|
||||
echo restart-nightwing-muninn.cmd is an Idunn actuator wrapper. Redeploy by poking Idunn; direct service restart is not an owned path. 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
if /I not "%IDUNN_COMMAND_AUTHORITY%"=="idunn-daemon" (
|
||||
echo restart-nightwing-muninn.cmd is an Idunn actuator wrapper. Redeploy by poking Idunn; direct service restart is not an owned path. 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-nightwing-muninn.ps1 -DiscoverMoveState -ClaimUsbMoves
|
||||
|
|
|
|||
|
|
@ -8,14 +8,27 @@ param(
|
|||
[switch] $ClaimUsbMoves,
|
||||
[string] $MoveEvidenceStream = "muninn:nightwing:move-evidence",
|
||||
[int] $IntervalSeconds = 15,
|
||||
[string] $IdunnRudpHealth = "10.77.0.2:17870",
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[string] $IdunnDaemon = "nightwing-muninn",
|
||||
[string] $IdunnHealthContract = "muninn.cultnet-rudp-remote-telemetry-and-move-hid",
|
||||
[string] $OdinCultMeshRudp = "10.77.0.2:17871"
|
||||
[string] $OdinCultMeshUri = $(if ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
|
||||
[string] $HidControllerRudpBind = "0.0.0.0:17888",
|
||||
[string] $HidControllerRudpAdvertise = $env:MUNINN_HID_CONTROLLER_RUDP_ADVERTISE
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daemon") {
|
||||
throw "restart-nightwing-muninn.ps1 is an Idunn actuator body. Redeploy by poking Idunn; direct service restart is not an owned path."
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind) -and [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
throw "HID controller RUDP advertise endpoint must be supplied by -HidControllerRudpAdvertise or MUNINN_HID_CONTROLLER_RUDP_ADVERTISE when HID RUDP bind is enabled; no Nightwing LAN default is allowed."
|
||||
}
|
||||
|
||||
function Quote-ShSingle([string] $Value) {
|
||||
return "'" + ($Value -replace "'", "'\''") + "'"
|
||||
}
|
||||
|
|
@ -85,10 +98,18 @@ if ($moveStateSpecs.Count -gt 0) {
|
|||
$moveRuntimeSetLines += "set -- ""`$@"" --move-evidence-stream $(Quote-ShSingle $MoveEvidenceStream)"
|
||||
}
|
||||
$moveRuntimeSetBlock = ($moveRuntimeSetLines -join "`n")
|
||||
$odinCultMeshRudpSetBlock = ""
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshRudp)) {
|
||||
$odinCultMeshRudpSetBlock = "set -- ""`$@"" --odin-cultmesh-rudp $(Quote-ShSingle $OdinCultMeshRudp)"
|
||||
$odinCultMeshUriSetBlock = ""
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshUri)) {
|
||||
$odinCultMeshUriSetBlock = "set -- ""`$@"" --odin-cultmesh-uri $(Quote-ShSingle $OdinCultMeshUri)"
|
||||
}
|
||||
$hidControllerRudpSetLines = @()
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind)) {
|
||||
$hidControllerRudpSetLines += "set -- ""`$@"" --hid-controller-rudp-bind $(Quote-ShSingle $HidControllerRudpBind)"
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
$hidControllerRudpSetLines += "set -- ""`$@"" --hid-controller-rudp-advertise $(Quote-ShSingle $HidControllerRudpAdvertise)"
|
||||
}
|
||||
$hidControllerRudpSetBlock = ($hidControllerRudpSetLines -join "`n")
|
||||
|
||||
$remoteScript = @"
|
||||
set -eu
|
||||
|
|
@ -114,7 +135,8 @@ set -- "`$@" \
|
|||
--idunn-rudp-health '$IdunnRudpHealth' \
|
||||
--idunn-daemon '$IdunnDaemon' \
|
||||
--idunn-health-contract '$IdunnHealthContract'
|
||||
$odinCultMeshRudpSetBlock
|
||||
$odinCultMeshUriSetBlock
|
||||
$hidControllerRudpSetBlock
|
||||
nohup '$MuninnExe' "`$@" \
|
||||
> '$LogRoot/muninn-serve.out.log' \
|
||||
2> '$LogRoot/muninn-serve.err.log' \
|
||||
|
|
|
|||
|
|
@ -1,2 +1,10 @@
|
|||
@echo off
|
||||
if not "%IDUNN_ACTUATOR%"=="1" (
|
||||
echo restart-starfire-muninn.cmd is an Idunn actuator wrapper. Redeploy by poking Idunn; direct service restart is not an owned path. 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
if /I not "%IDUNN_COMMAND_AUTHORITY%"=="idunn-daemon" (
|
||||
echo restart-starfire-muninn.cmd is an Idunn actuator wrapper. Redeploy by poking Idunn; direct service restart is not an owned path. 1>&2
|
||||
exit /b 1
|
||||
)
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\restart-starfire-muninn.ps1
|
||||
|
|
|
|||
|
|
@ -6,17 +6,29 @@ param(
|
|||
[string] $MoveBluetoothHost = "5C:93:A2:9C:A8:A8",
|
||||
[string[]] $MoveState = @(),
|
||||
[switch] $EnableUsbMoveState,
|
||||
[string] $IdunnRudpHealth = "127.0.0.1:17870",
|
||||
[string] $IdunnRudpHealth = $env:IDUNN_RUDP_HEALTH,
|
||||
[string] $IdunnDaemon = "starfire-muninn",
|
||||
[string] $IdunnHealthContract = "muninn.cultnet-rudp-local-telemetry-and-quest-access",
|
||||
[string] $OdinCultMeshRudp = "127.0.0.1:17871"
|
||||
[string] $OdinCultMeshUri = $(if ($env:ODIN_CULTMESH_URI) { $env:ODIN_CULTMESH_URI } else { "cultmesh://odin/rendezvous/provider-catalog" }),
|
||||
[string] $HidControllerRudpBind = "0.0.0.0:17888",
|
||||
[string] $HidControllerRudpAdvertise = $env:MUNINN_HID_CONTROLLER_RUDP_ADVERTISE
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if ($env:IDUNN_ACTUATOR -ne "1" -or $env:IDUNN_COMMAND_AUTHORITY -ne "idunn-daemon") {
|
||||
throw "restart-starfire-muninn.ps1 is an Idunn actuator body. Redeploy by poking Idunn; direct service restart is not an owned path."
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $MuninnExe)) {
|
||||
throw "Muninn executable not found at $MuninnExe"
|
||||
}
|
||||
if ([string]::IsNullOrWhiteSpace($IdunnRudpHealth)) {
|
||||
throw "Idunn RUDP health endpoint must be supplied by -IdunnRudpHealth or IDUNN_RUDP_HEALTH; no Starfire LAN default is allowed."
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind) -and [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
throw "HID controller RUDP advertise endpoint must be supplied by -HidControllerRudpAdvertise or MUNINN_HID_CONTROLLER_RUDP_ADVERTISE when HID RUDP bind is enabled; no Starfire LAN default is allowed."
|
||||
}
|
||||
|
||||
Get-CimInstance Win32_Process |
|
||||
Where-Object {
|
||||
|
|
@ -50,8 +62,14 @@ $arguments = @(
|
|||
"--idunn-daemon", $IdunnDaemon,
|
||||
"--idunn-health-contract", $IdunnHealthContract
|
||||
)
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshRudp)) {
|
||||
$arguments += @("--odin-cultmesh-rudp", $OdinCultMeshRudp)
|
||||
if (-not [string]::IsNullOrWhiteSpace($OdinCultMeshUri)) {
|
||||
$arguments += @("--odin-cultmesh-uri", $OdinCultMeshUri)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpBind)) {
|
||||
$arguments += @("--hid-controller-rudp-bind", $HidControllerRudpBind)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($HidControllerRudpAdvertise)) {
|
||||
$arguments += @("--hid-controller-rudp-advertise", $HidControllerRudpAdvertise)
|
||||
}
|
||||
if (-not [string]::IsNullOrWhiteSpace($MoveBluetoothHost)) {
|
||||
$arguments += @("--move-host", $MoveBluetoothHost)
|
||||
|
|
@ -142,6 +160,3 @@ foreach ($pattern in @(
|
|||
throw "Starfire Muninn serve command line is missing ${pattern}: $($processCheck.CommandLine)"
|
||||
}
|
||||
}
|
||||
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot "health-starfire-muninn.ps1") `
|
||||
-MuninnExe $MuninnExe `
|
||||
-StorePath $StorePath
|
||||
|
|
|
|||
Loading…
Reference in a new issue