Expose NDI discovery error details

This commit is contained in:
Codex
2026-08-15 11:17:40 -07:00
parent 74a5a252c8
commit aed8105d84
2 changed files with 3 additions and 4 deletions
@@ -36,7 +36,7 @@ class NDIReceiver(threading.Thread):
except Exception as exc: except Exception as exc:
self.state.ndi_connected = False self.state.ndi_connected = False
self.state.error_code = "NDI_DISCONNECTED" self.state.error_code = "NDI_DISCONNECTED"
LOG.warning("NDI receive session ended: %s", type(exc).__name__) LOG.warning("NDI receive session ended: %s: %s", type(exc).__name__, str(exc)[:300])
self.stop_event.wait(2.0) self.stop_event.wait(2.0)
def _receive_session(self) -> None: def _receive_session(self) -> None:
@@ -66,7 +66,7 @@ class NDIReceiver(threading.Thread):
source = finder.get_source(self.source_name) source = finder.get_source(self.source_name)
break break
if source is None: if source is None:
raise RuntimeError("configured NDI source not discovered") raise RuntimeError(f"configured NDI source not discovered; last_sources={names}")
receiver = Receiver(color_format=RecvColorFormat.BGRX_BGRA, receiver = Receiver(color_format=RecvColorFormat.BGRX_BGRA,
bandwidth=RecvBandwidth.highest) bandwidth=RecvBandwidth.highest)
video = VideoFrameSync() video = VideoFrameSync()
@@ -94,4 +94,3 @@ class NDIReceiver(threading.Thread):
if receiver is not None and receiver.is_connected(): if receiver is not None and receiver.is_connected():
receiver.disconnect() receiver.disconnect()
finder.close() finder.close()
@@ -126,7 +126,7 @@ services:
healthcheck: healthcheck:
test: ["CMD", "python", "-c", "import json,pathlib,urllib.request; t=pathlib.Path('/run/secrets/api-token').read_text().strip(); r=urllib.request.Request('http://127.0.0.1:18120/v1/health',headers={'Authorization':'Bearer '+t}); raise SystemExit(0 if json.load(urllib.request.urlopen(r,timeout=3))['ready'] else 1)"] test: ["CMD", "python", "-c", "import json,pathlib,urllib.request; t=pathlib.Path('/run/secrets/api-token').read_text().strip(); r=urllib.request.Request('http://127.0.0.1:18120/v1/health',headers={'Authorization':'Bearer '+t}); raise SystemExit(0 if json.load(urllib.request.urlopen(r,timeout=3))['ready'] else 1)"]
interval: 15s interval: 15s
timeout: 5s timeout: 10s
retries: 6 retries: 6
start_period: 180s start_period: 180s