Skip to content

Gate Syphon validity on actual support; minor follow-ups#2

Merged
ktamas77 merged 1 commit into
masterfrom
fix/syphon-validity
Apr 26, 2026
Merged

Gate Syphon validity on actual support; minor follow-ups#2
ktamas77 merged 1 commit into
masterfrom
fix/syphon-validity

Conversation

@ktamas77

Copy link
Copy Markdown
Owner

Follow-up to #1 addressing the substantive review comments.

Real bug fixed

valid() (main process, vingester-browser.js:154) and the renderer-side mirror (vingester-control.js:336) both treated cfg.s = true as satisfying the Output 2 sink requirement, without checking whether Syphon is actually available on this host.

Effect: a YAML config imported on Linux/Windows — or on a macOS host where node-syphon is not installed — with Output2SinkSyphonEnabled: true and both NDI and FFmpeg disabled would:

  • pass valid() → instance starts
  • worker reaches the publish path with syphonServer === null → every frame is silently dropped
  • UI continues to show the instance as healthy

Fix:

  • vingester-browser.js: try-require node-syphon at module load (mirroring the worker's pattern), set a syphonAvailable flag, and require it in valid().
  • vingester-control.js: gate browser.s on this.support.syphon (already populated from main via ipcRenderer.invoke("support")).

Trivial cleanup

  • vingester-browser-worker.js: short comment on the BGRA endianness normalization block explaining that FFmpeg is intentionally excluded — it receives a JPEG from nativeImage.toJPEG() and handles pixel format itself, so the raw buffer endianness is irrelevant for it. (codemouseai Add Syphon sink (macOS) alongside NDI/FFmpeg #1.)

Skipped

  • codemouseai's note about per-frame log.error flooding on Syphon publish failures: NDI has the same pattern. Fixing only Syphon would create the opposite asymmetry. Left as-is; a real fix would be symmetric across all sinks and is out of scope here.

Verified

  • macOS / arm64 build: support.syphon=true, syphonAvailable=true, validity behavior unchanged on this platform. Smoke run with the same Syphon-only test config (s: true, n: false, m: false) still autostarts, spawns the worker, creates a SyphonMetalServer, and publishes frames.
  • The fix is dead code on a working macOS install (the gate's right-hand side is always true there). Its only effect is correctness for source builds on non-macOS hosts and macOS hosts where node-syphon was not installed.

Without this, a config imported on Linux/Windows (or a macOS host
without node-syphon installed) with `Output2SinkSyphonEnabled: true`
and both NDI and FFmpeg disabled would pass valid() and start
capture, but the worker would silently drop every frame because
SyphonMetalServer is null. The renderer-side check in
vingester-control.js had the same bug — the UI would happily show
the instance as ready to start.

Also: short comment in the worker clarifying that FFmpeg is
intentionally absent from the BGRA endianness normalization
(it gets a re-encoded JPEG from nativeImage and handles pixel
format itself).

Addresses codemouseai PR #1 review comments.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@ktamas77 ktamas77 merged commit 529cc1a into master Apr 26, 2026
@ktamas77 ktamas77 deleted the fix/syphon-validity branch April 26, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant