Skip to content

Sound keeps its rate, fused regions convert, feeds wait, leakies leak pictures - #5

Merged
imbcmdth merged 5 commits into
mainfrom
fixes-0292
Oct 3, 2026
Merged

imbcmdth merged 5 commits into
mainfrom
fixes-0292

Conversation

@imbcmdth

@imbcmdth imbcmdth commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Four things the second CPU measurement of the SMART demo found, none of them the switch's fault.

  • A retimed sound keeps its sample rate: asetpts and its kin do not change one, so a node clocked by its sound is no longer refused as unbounded behind them.
  • A node behind a leaky in its region is handed the format it takes: the edge into the region converts on the way in, split or not.
  • A feed's connection waits on its socket instead of spinning: on Windows a socket accepted off a nonblocking listener is nonblocking, so the reader's timeout never waited and one core went to each playing feeder. The switch sidecar drops from 0.96 cores during an ad to 0.014.
  • A leaky over packets that something decodes later leaks pictures instead, so a stall costs single frames with a frame or two of delay rather than whole groups and a keyframe wait; the packet form stays where everything downstream forwards packets.

🤖 Generated with Claude Code

imbcmdth and others added 5 commits October 3, 2026 06:50
A sound's rate was lost at asetpts, aselect, atempo and ainterleave, as a
picture's frame rate is, so a node clocked by a sound read through a
setpts (the demo's takeover switch, with only `a` bound) had no window in
time: its delay was uncounted and the plan was refused
UNBOUNDED_LIVE_INPUT naming it. A sound's rate is its sample rate, which
none of those change, so its rate is now followed through them to the
filter or input that says it. The binding hint the switch is asked with
carries it too, where it was null.

The test now asks with the published switch's shape and binds the sound
through aresample and setpts as the demo does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… takes

A region holding a leaky and the node reading its output took the
leaky's input in the default yuv420p, and nothing converted between the
leaky and the node: compose, which takes rgba, was refused at run time
("compose input 'v' accepts the pixel formats rgba, and is bound a
stream of yuv420p"). A leaky hands on the pictures it reads, as a split
does, so the edge into the region now carries the format the nodes
behind its leakies and splits take, where they agree, and the ffmpeg
writing it converts on the way in. Readers of the timing alone take
whatever arrives, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ning

The listener is nonblocking so that it can look for a second feeder
between reads, and on Windows a socket accepted off a nonblocking
listener is nonblocking too. The connection's read timeout then never
waited: with nothing on the wire the read returned at once and the
listener's loop went round again, one core for as long as a feeder was
connected and pacing itself. The accepted socket is now made blocking,
so a read waits its 50 ms for the feeder's next bytes.

Over a 10 s feed of sound into the switch the sidecar used 0.96 of a
core before and 0.01 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tures instead

ffrwd.leaky over a coded picture drops whole groups, from a late packet
to the next keyframe, which is only right in front of something that
hands the packets on (a publish, a file the stream is copied into). A
leaf's leaky sat on the subscribe's h264 and compose decoded after it,
so a stall cost the wait for a keyframe. Now a leaky reading packets
keeps them only where everything reading its output takes packets;
otherwise a decode goes ahead of it, and it drops single pictures. The
decode is an ffmpeg passing the pictures through `null`, which writes
them in the format the leaky's readers take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@imbcmdth
imbcmdth merged commit 211f100 into main Oct 3, 2026
2 checks passed
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