Repository navigation
Conversation
There was no research behind M-06's "deferred research": PLAN.md held a crate name, and nothing had evaluated licensing, pixel formats, frame cost or failure handling. docs/research/m06-ndi-spout.md does that now, and records what it changes: neither output needs an SDK at build time (an NDI 6 runtime is loaded at runtime, Spout's library by the loader), NDI's licence asks for a link beside every place NDI is chosen, UYVY is half of BGRA's bytes and Spout copies nothing through the CPU. strobe-output is the tested core the senders plug into: the output frame, BGRA and UYVY 4:2:2 packing, one destination per Output with the show's failure policy (one line per outage, sink closed and dropped, frames dropped rather than queued), and probes that find the runtime without loading it. Spout sends the renderer's texture with nothing read back: it loads the installed SpoutLibrary.dll through libloading and calls the four mangled exports its C++ ABI exposes, each a private safe leaf with one unsafe block (D570). NDI is behind the `ndi` feature, sending RGBA from the existing readback. strobe-gfx lends the texture from the post stage, the compositor or the player, and the app taps it after the post stage on the picture rather than the letterboxed window: `--spout NAME` and `--ndi NAME`, or the new Sharing group in Settings > Output. Neither output is bundled, and neither has been seen on a receiver: this machine's only SpoutLibrary.dll is 32-bit and refused by the 64-bit loader, no x64 NDI runtime is installed, and the readback's frame cost is unmeasured (M-06).
lnorton89
force-pushed
the
feat/m06-ndi-spout
branch
from
November 26, 2026 06:52
e004ca0 to
6580e19
Compare
…ut (D571) The only SpoutLibrary.dll on the development machine was the 32-bit copy inside Synesthesia, so the loader refused it and no frame was ever shared. Spout's own 64-bit library could not have worked through D570 either: 2.007 exports only GetSpout and hands out an object whose methods live in a vtable, with no mangled exports at all. The sender now takes ReleaseSender (2), SendTexture (4), IsInitialized (6), GetName (8), GetWidth/GetHeight (9/10), GetFps (11) and CreateSender (70) from that vtable, numbers read from the offsets the vendor's own compiled calls dispatch to, because the shipped header is one slot out from the shipped binary. The sender also gives a size on the first frame (Spout fixes a sender's size when it is created), and reports Spout's own view of the result: that it is live, under which name and at what size, and the frame rate Spout measures. Verified here with the 64-bit 2.007.018 library beside the executable: --spout logs a live 960x540 sender and 75.0 fps, and a separate process built against the vendor's header and .lib lists StrobeProbe at 960x540 BGRA with a live share handle. No receiver application was attached, and NDI has still not run: this machine has no NDI 6 runtime.
…, UYVY on the GPU (D572, M-06) A survey of how Synesthesia, Resolume, TouchDesigner, MadMapper, OBS, vMix and Millumin expose Spout and NDI (now in docs/research/m06-ndi-spout.md) set the feature list, and a review of the first cut found its faults. Settings > Output > Sharing is saved: Spout and NDI on or off with editable names, NDI groups and a frame-rate cap, and a shared size that follows the picture or stays fixed. --spout, --ndi, --ndi-groups, --ndi-fps and --share-size override it for one run without being written back. The final picture is shared and blackout now blackens it, reversing D569. A status line gives names, size, NDI receivers and rate; each sender's failure is said on its own row; NDI's trademark line and links sit beside the choice and in About. strobe_gfx::share::ShareStage scales or blacks out the picture and, for NDI, packs UYVY 4:2:2 on the GPU and reads it back through a fenced ring, so the frame never waits. NDI submits asynchronously from a borrowed frame and does nothing while no receiver is connected. Spout shares the picture's own texture at its own size. Fixed from the first cut: the Spout object was never released and its DLL was unloaded under it (Release, slot 174, now runs on drop, and a resize uses UpdateSender); NDI made three full-size allocations and a synchronous readback a frame; toggling one sender rebuilt both; three strings had broken line continuations; grafton-ndi sat in the Windows-only table and broke the Linux build; Texture::share broke the wasm build. D571's slot reason was wrong: MSVC groups a virtual's overloads, which shifts the slots, and every slot is now the one cl itself emits. Verified on LIGHTNING: --spout at --share-size 1280x720 is listed at that size by a receiver-side probe and is gone after a clean exit; --ndi with no runtime gives one line with the NDI Tools link. The UYVY packing matches its BT.709 reference in both dialects on Mesa. Not verified: a receiver application on screen, NDI with a runtime, the T480's frame cost.
…--share (D573, M-06) Issue #116 asks for several named Spout senders, and Resolume, MadMapper and OBS each offer more than one. A second sender is only useful with a different picture, so the clean feed carries the scene before the post stage (master, colour, mirrors) and blackout leaves it alone: a mixer can apply its own look, or keep a picture while the projector is dark. It has its own name (refused if it matches the main sender's), its own share stage for the shared size, a switch and name field in Settings > Output > Sharing (saved), and --spout-clean NAME for one run. strobe-bench --share times each sharing path on the context it opens. On the RX 580 at 1080p the NDI path (UYVY pack plus asynchronous readback) costs the frame 0.54 ms of CPU against the first cut's synchronous readback at 5.8 ms (45 ms worst), and paced at 60 Hz it delivers a picture every frame from the third with none dropped. Recorded in BENCHMARKS.md. Verified on LIGHTNING: --spout StrobeMain --spout-clean StrobeRaw at --share-size 1280x720 lists two senders at 1280x720 on the receiver-side probe, and both are gone after a clean exit.
…once (M-06) A receiver that connected before a scene was chosen listed the source but got no frames; both senders now send black at the output's size until a scene plays. When the main and clean Spout feeds fail for the same reason, the note says it once. The NDI cap's timing is a function with tests. Verified on LIGHTNING with independent receivers: Spout pixels on both feeds, blackout over OSC on the main feed only, Spout and NDI upright and alike, NDI groups, idle black, and senders gone after exit.
…ame> (D574, M-07) The input half of issue #116. A Spout sender or an NDI source is a live media choice beside camera:<name>, from the Inspector's Media row (Spout, NDI), --media, a cue or a preset; --list-spout and --list-ndi print the names. Both run on strobe-capture's supervisor as two more backends, so reconnect by name, the watchdog and a failure said once (black, type 0) are the webcam's. One upload a frame into one reused texture, syn_MediaType 3 (Q22). Spout reads on the capture thread through Spout's own hidden GL context, with receiver vtable slots read from cl's listing; NDI asks for RGBX/RGBA. An idle sender keeps its last picture. Verified on LIGHTNING Strobe to Strobe over Spout: upright and exact, lost said once and black, back by itself when the sender starts.
… test card (M-06)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #116. Backlog M-06 (output) and M-07 (input).
What this does
Output: the finished picture leaves Strobe over Spout and NDI.
strobe-outputis the seam (D569). It holds the frame, the layouts (RGBA, UYVY 4:2:2), oneOutputper named destination following the show's failure policy, and the senders.Spout shares the picture's own texture with zero copies (D570). It calls the installed 64-bit
SpoutLibrary.dllthrough Spout 2.007's real vtable slots, read from the shipped binary (D571).UpdateSenderhandles a resize,Releaseruns on drop, and nothing is read back.NDI goes through
grafton-ndi3.0, with the NDI 6 runtime loaded at run time and no SDK needed at build time. The picture is packed to UYVY on the GPU and read back through a fenced three-buffer ring, so the frame thread never waits. It is sent asynchronously, and nothing is done while no receiver is connected (D572).Sharing works the way the surveyed tools do (D572). Settings > Output > Sharing is saved and offers:
The same options exist as one-run flags:
--spout,--ndi,--ndi-groups,--ndi-fpsand--share-size. The survey (Resolume, TouchDesigner, MadMapper, OBS, vMix, Millumin, Synesthesia) is indocs/research/m06-ndi-spout.md.Blackout blackens what goes out. While no scene plays, black goes out, so a receiver that connects first shows black rather than nothing.
Clean feed (D573). A second Spout sender carries the picture before the output's look and mirrors, under its own name. Blackout leaves it alone. Set it in Settings or with
--spout-clean.Cost:
strobe-bench --sharetimes every path. On the RX 580 at 1080p, the NDI path costs the frame 0.54 ms of CPU. The first cut's synchronous readback cost 5.8 ms (45 ms worst).Input: a Spout sender or an NDI source as the scene's media (D574, M-07).
spout:<name>orndi:<name>besidecamera:<name>. They can be chosen in the Inspector's Media row, with--media, by a cue or by a preset.--list-spoutand--list-ndiprint the names.Verified on LIGHTNING (Windows 10, RX 580)
ReceiveImage): both feeds' pixels.--ndigives one line linking NDI Tools, and the show runs on.Not verified
cargo denyand the site job fail here for the shared reasons that ci: clear the cargo-deny advisories and the site job's onnxruntime 404 #122 fixes.