Commit graph

20 commits

Author SHA1 Message Date
Meta Vens
d11f5331fe Stamp live audio with the receive clock
The producer's presentation ticks start at zero per session and sit in its
clock domain; handed to the mixer they read as ever-growing drift, and OBS
kept adding buffering and restarting the source's audio for lagging.
OBS's own network sources stamp with the receive clock; so does this one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 02:36:35 +02:00
Meta Vens
241165770d Install the plugin where OBS 32 looks
The per-user plugin directory is not scanned by OBS 32 on Windows; it
neither loads nor logs a plugin placed there. The machine-wide one is.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 02:10:22 +02:00
Meta Vens
3a503658f4 CultLib 47b9fc4: readers do not stop at ACKs; unreliable frames are not acked
With this pin the audio and video legs share one session at full rate:
564 frames and 1,801 audio packets in 19 s, nothing expired, 3% wire
overhead, on a producer host at 93% CPU.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 01:25:40 +02:00
Meta Vens
23be36f029 The receive probe shows the transport's own accounting
wire frames and bytes, evicted fragment sets, undecodable and rejected,
beside what was delivered. It is how a producer's "everything was
acknowledged" and a receiver's "I saw nothing" were reconciled tonight:
the wire carried twice the bytes that arrived as payloads, which was the
audio resend storm.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 01:10:23 +02:00
Meta Vens
014e24f771 Size the media receive buffer like the producer's send buffer
A 12 Mbps stream is about 2,300 datagrams a second; the OS default
receive buffer holds a few milliseconds of it, and every poll gap longer
than that is loss on a wire that lost nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 01:01:12 +02:00
Meta Vens
22044a28e5 The request probe's state line names the sources
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 00:57:40 +02:00
Meta Vens
3232eb0312 A headless receive probe
Dials an advertised endpoint and reports frames, audio, bytes and feedback
per second: the whole receive path minus the renderer. First run tonight:
416 frames in 14 s from Raven to Starfire, nothing expired, nothing repaired.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 00:52:22 +02:00
Meta Vens
6e6b6ad587 A request probe beside the catalog probe
start, stop and state for one stream from the command line, over the same
request path the OBS source uses; the first stream request tonight goes
through this before OBS is involved.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 00:36:50 +02:00
Meta Vens
65a08f40f0 Odin's canonical endpoint is 17871
The operator ruled that Odin folds back to the port every consumer already
uses rather than moving the estate to a staging port; the default follows.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 00:26:44 +02:00
Meta Vens
41dbc3ade0 Point at Odin's stable route, and add a catalog probe
The OBS source defaulted to the old Odin port; Idunn publishes Odin's
rendezvous at rudp://10.77.0.1:17971 (an nginx stream route in front of the
per-release daemon port). The `catalog` example pulls the same
advertisements the picker does and prints them, for the field question
"why does the plugin show nothing".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 23:58:03 +02:00
Meta Vens
ee11c5ca07 Lock the CultLib pin move
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 23:03:51 +02:00
Meta Vens
ba47b0daec The receiver dials the producer
RatatoskrReceiver is a CultNet RUDP client towards the advertisement's
media_endpoint, known to the producer by its receiver id as the connect
payload. It redials every second until answered, pings, and treats 4 s of
silence or an explicit disconnect as a detach that it reports and redials
from. Audio arrives on its own channel. Nothing on the consumer's host
listens, so it needs no firewall rule or port forward.

The request no longer carries a receiver endpoint; the OBS source asks
first, then dials. ratatoskr_receiver_local_port is replaced by
ratatoskr_receiver_attached, and the "This host, as the producer reaches
it" setting is gone. CultLib pin c84cb2e.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 23:03:30 +02:00
Meta Vens
8bee11a866 The OBS source, and the mesh side it needs
A new source type, "CultMesh Media Stream". Its properties pull every
gamecult.media_stream_advertisement Odin holds and offer each stream's
video sources, audio sources and codecs from the advertisement, with
bitrate and latency budget; activating publishes a
gamecult.media_stream_request naming this receiver's endpoint. Nothing
in the picker comes from configuration or from Muninn.

The core grows the mesh half (catalog.rs): pull the advertisements,
publish a request, read the producer's answer, all over cultmesh-rs and
tested against an Odin-shaped RUDP catalog server on loopback. The C ABI
gains the catalog and request calls, a video relay that copies each
whole access unit to a loopback UDP port as a raw byte stream, and the
producer's presentation time on every payload.

The plugin itself owns only the OBS lifecycle. Video is drawn from a
private ffmpeg_source child reading the relay — the arrangement the
previous plugin proved in the field, minus the 2,500 lines of transport
it hand-rolled underneath. Audio is PCM straight to
obs_source_output_audio.

Built against a libobs-only build of obs-studio 32.2.2 with obs-deps
2026-07-15 under .sdk/ (git-ignored; the README says how). Installed to
the per-user OBS plugins directory. Not yet exercised with a live stream.

  cargo test -p ratatoskr-core -> 31 passed
  abi_smoke.exe ratatoskr_core.dll -> ABI SMOKE PASSED

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 22:23:05 +02:00
Meta Vens
01e8df4072 Tell the producer what was lost
The return path. A frame still waiting is asked for by chunk after 64 ms,
then every 32 ms, three times, on the previous receiver's field-tested
cadence; a repair request never asks for a keyframe, since it exists so
that one is not needed. A frame given up on is reported late, and once
per 500 ms a keyframe is requested, because whatever depended on it
cannot be decoded either. Records are built by CultLib's
build_receiver_feedback and sent down the producer's own session on the
media channel; with nobody attached they are counted as not sent rather
than lost quietly.

The loopback test runs the whole path over real sockets: a producer
connects, loses one chunk, is asked for exactly that chunk with no
keyframe request, and when the frame ages out hears it was late and
that a keyframe is wanted.

  cargo test -p ratatoskr-core -> 28 passed

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 21:39:33 +02:00
Meta Vens
261818408a Reassemble video here, where the renderer is
Chunks and parity in, whole access units out. The erasure code is the
contract's: XOR stripe parity as gamecult.media_video_parity_shard.v2
describes it, one recovered chunk per stripe. What this crate adds is
receiver policy the contract cannot carry — giving up on an incomplete
frame after 250 ms on this clock or under pressure from 64 newer ones,
remembering completed frames so late chunks do not reopen them, and
holding everything back after a loss until the next keyframe.

The C ABI now hands a renderer whole access units; RATATOSKR_KIND_VIDEO
means that and VIDEO_PARITY is gone, since no renderer has any use for a
parity shard. ratatoskr_receiver_video_stats reports completed frames,
chunks given back by parity, and frames given up on.

The C++ receiver's GF(256) block solver reads fields the v2 record does
not carry and belongs to the July-era muninn.* wire; it stays in Mimir.
Its audio erasure code had no producer on any contract.

  cargo test -p ratatoskr-core -> 20 passed

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 21:21:47 +02:00
Meta Vens
98377b4359 Pin CultLib at the receiver that survives loss
05e0925 carried the fragment-set fuse: a receiver that lost 64 fragments
returned an error on every later fragmented payload and stopped. 89687fc
evicts the stalest incomplete set instead, counts it, and wraps the
fragment id. Ratatoskr consumes that session; nothing here changes.

  cargo test -p ratatoskr-core -> 9 passed

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 21:06:22 +02:00
Meta Vens
98e5f57a5a Pin CultLib main now that the contract has merged
05e0925 carries the media contract, wire envelope and channel delivery, so this
no longer tracks a feature branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 02:35:03 +02:00
Meta Vens
3e1a827aaf Take the validating decoder
CultLib 96138ff moved record validation and the record-key consistency check into
the shared decoder, so this inherits both rather than trusting whatever arrives.
A record whose envelope key disagrees with its own contents is now refused here
without Ratatoskr implementing a single check itself.

Worth noting what did not happen: no dependency conflict. Muninn hit a diamond
on this same bump because it still links odin-core, which pins an older CultLib.
This repo depends on nothing but the contract, so the bump was a one-line change
and the suite stayed green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 02:30:07 +02:00
Meta Vens
1d5d1e6aa7 Decode the envelope instead of handing over opaque bytes
The media wire envelope now lives in CultLib, so this side can use it rather
than reimplement it. The receiver decodes each media-channel payload into a
GameCultMediaWireRecord, and the ABI carries a kind alongside the bytes so a
caller routes video and audio without parsing anything itself. That was the
last piece stopping this repo from reading a real stream.

A payload that arrives and fails to decode becomes Undecodable and increments a
counter reachable from C. It is not dropped. A consumer that silently discards
what it cannot parse leaves a producer no way to discover its stream is
unreadable — which is exactly how the previous receiver and sender drifted apart
while both were being maintained.

Feedback records decode but yield no payload: they travel the other way and
carry no media, so a caller asking for payloads is not handed one.

Pinned to CultLib a3e6877 on claude/cultmesh-media-stream-contract, which is a
branch rather than main. That pin moves when the branch does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 02:03:41 +02:00
Meta Vens
58210c99fd The squirrel, carrying messages it does not own
Ratatoskr subscribes to a CultMesh media stream and hands frames to a renderer.
First lowering target is OBS.

It exists because the receiver it replaces hand-rolled CultNet RUDP in C++
inside Mimir: acknowledgement, fragment reassembly, sockets, cultmesh:// URL
parsing, wire framing and two erasure codes, in 973 lines of headers linking no
CultLib. That made the receiving end of a protocol a separate implementation
from the sending end, in another language and another repository, and every
CultNet fix from August and September reached cultnet-rs and cultnet-ts without
reaching it.

So the constraint this repo holds is that it implements no transport. It
consumes CultNet. A sequence number or an ACK mask appearing here means
something belongs upstream in CultLib instead, where both ends can share it.

What works: the core opens a subscription over cultnet-rs, drains it, and hands
payloads across a C ABI. Nine Rust tests and fourteen C checks, the latter
loading the cdylib and verifying the header tells the truth rather than assuming
it. The MSVC staticlib is what the plugin will link; the C smoke test loads the
cdylib dynamically so the ABI is checkable with any compiler.

What does not: no reassembly, no FEC, no receiver feedback, and no plugin. It
cannot decode a real Muninn stream yet, because the wire envelope
(MuninnMediaWireRecord, encode_media_wire_record) still lives in Muninn and
needs to move to CultLib where both ends can reach it. README says so plainly
rather than implying more than exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 01:41:30 +02:00