GoLive said it started the outputs that push and EndStream that it
stopped them, but both only changed the state: a WHIP output kept
pushing to the service after End Stream. WHIP outputs start when they are
added (that is when the service is asked), so GoLive now says just that,
and EndStream closes every output that pushes, reporting each removal;
recording and the replay buffer keep running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two rules said when a source's input restarts: the controller's own,
and SourceKind::same_input, which nothing called and which would have
kept a text source's old picture after its text changed. Now there is
one, same_input, and it also keeps a camera running when only its
mirroring changes: that is drawn by the compositor, and restarting the
camera for it meant a second of black while PipeWire renegotiated.
A WHIP output that drops a packet because its upload stalled now asks
for a keyframe, so the service's decoder recovers when the upload does
instead of showing a broken picture until somebody else asks.
The segmenter's input_size was never called (the frame path sizes the
segmenter's copy itself) and divided the height by the clamped width;
the trait now says what the segmenter is given.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A recording and a clip start at a video keyframe, and dropped all audio
that came before it. But the video encoder is behind the audio: by the
time the keyframe of a moment arrives, the audio of that moment and of
the encoder's whole delay has already gone by. With a hardware H.264
encoder starting up, a recording's audio began 285 ms after its picture.
The recorder now keeps the last two seconds of audio while it waits and,
once the keyframe is written, writes the part not older than it. The
replay buffer keeps waiting audio the same way, and when it trims to a
keyframe it keeps the audio of the keyframe's time that arrived before
it; a clip feeds everything to a recorder, which skips video up to its
first keyframe. The same recording now starts its audio 10 ms after the
picture (one Opus frame).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The studio's pieces are tested one by one, but nothing could run a whole
scene file the way the app will. `voelinctl studio run <scenes.json>`
starts the studio from the JSON of the studio.scenes setting, encodes its
composite with the streamer as a stream would, and does any of: save the
last preview picture, record, keep a replay buffer and save it as a clip,
push to a WHIP endpoint, switch scenes halfway (live, while recording).
`studio bench` composites N sources (a 4K screen scaled down, a mirrored
and cropped camera, an image with alpha, text, then again) at the output
size and rate with no encoder, and prints the compose time and the heap
allocations per frame, counted by the process allocator that `stream
bench` already uses: 0 per frame at 1080p60 with 4 and with 16 sources.
`studio cameras` lists what a camera source can name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the hardware round-trip per encoder and size, the AV1 padding it
uncovered on this GPU (1080 rows sent as 1082, other sizes padded to
64x16) and the crop that replaced it, and that the AV1 decoder has now
decoded the streams of five encoders rather than none.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing had ever decoded the output of a hardware encoder. The round-trip
the software encoders go through (our own decoders: OpenH264 for H.264,
dav1d for AV1; keyframes where asked, timestamps kept, PSNR above 28 dB)
now runs over every usable H.264 and AV1 hardware backend, at 320x240 and
at 1920x1080, which is not a whole number of macroblocks.
h264_vaapi and h264_amf decode exactly at both sizes (the SPS crops the
coded 1088 rows). av1_vaapi and av1_amf do not: on this RX 7900 GRE the
AV1 encoder pads the width to a multiple of 64 and the height to 16, and a
height 8 more than a multiple of 16 by 2 rows, so 1366x768 comes out as
1408x768, 1600x900 as 1600x912 and 1920x1080 as 1920x1082. AV1 has no
cropping like H.264's SPS, so every viewer would show the padding.
The self-test of AV1 backends now encodes 258x258, 2 more than a power of
two, reads the frame size the sequence header declares, and derives the
alignment the encoder pads to; encoders crop frames to it, as they already
cropped odd sizes to even ones. Measured here: (64, 16) for both AV1
hardware backends, (2, 2) for the software ones, so 1920x1080 is sent as
1920x1072 and decodes as exactly that. Taking the alignment from the
stream instead of from the GPU's name keeps hardware that does not pad
uncropped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The studio composites, but nothing yet made its picture a stream or fed
its recording and replay buffer. Streamer::start_studio does both with the
smallest change to the streamer: the studio is one more capture backend,
and the packets the encoders already make are teed to the studio's outputs
where they are produced, with the frame size the recorder needs. Only the
stream codec's encoder is teed; a codec a viewer chose is never recorded.
Recording and the replay buffer must not need a live stream, so a studio's
streamer always has a sink: while no stream is attached it is one that
drops the frames after the tee. Its audio clock starts at the studio's
epoch, the clock the composite's timestamps already count from, so a
recording's audio and video start together (the test checks they do).
Outputs ask for keyframes of the layer they take only. The replay buffer
asks every two seconds while it is on: the encoders make keyframes only on
request, so without that the window could never move past the first one
and would grow for the whole session. WHIP asks once per need (start,
session up, the service's PLI) instead of on every frame until connected,
which would have made every frame a keyframe while ICE came up.
voelin_core::studio re-exports the studio, starts it from studio.scenes and
keeps the two in step both ways without echoes; studio.replay_seconds,
studio.replay_memory_mb and studio.recording_dir join the built-in keys
(with feature media). tests/studio.rs records a stream that switches scenes
live and saves a clip, and decodes both with ffmpeg: red before the switch,
blue after it, VP8 and Opus in sync.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The studio's sources commit removed nine [profile.dev.package.*] entries
(sonora's AEC, noise suppression and FFT crates, str0m-proto and its
crypto provider, libspa, x11rb-protocol, wayland-backend). Nothing in the
studio needs that, and those crates are on the audio and stream hot paths
that 1182cd9 optimised in dev builds for a reason: unoptimised, they cost
the debug client real CPU per 10 ms of audio. All nine are still in
Cargo.lock, so the entries match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
winit prefers Wayland when WAYLAND_DISPLAY is set, so `xvfb-run` in a
Wayland session still opened the window on the desktop, where the
compositor chose its size. That looked like the X server ignoring the
requested size. Remove the variable for the screenshot run, and size the
Xvfb screen like the window.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A minimum width of 1600 px was left in from a debugging session in which
the headless X server seemed to ignore the requested window size; it
made the window unusable on smaller screens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saved as found when the agent stopped; app.slint still carries a
diagnostic min-width of 1600px that must be reverted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The low screen-share frame rates on Wayland had never been reproduced here.
Record the run that did: what the broken DMA-BUF mapping did, what reading a
discrete GPU's buffers with the CPU costs against shared memory, and where
the threshold that chooses between them now sits.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The UI needs one place to drive: a Command per thing a person can do, a
stream of Events back, and a preview it reads at its own size and rate
without ever holding up the composite. Studio is that place. It keeps the
scene graph, starts and stops the inputs the live scene needs, runs one
compose thread at the output rate, and tees encoded packets to the outputs.
Making the composite a ScreenCapture backend (StudioCapture, SourceId::Studio)
is what keeps the rest untouched: the streamer's conversion, simulcast,
encoders and peers see an ordinary screen source, and recording and the replay
buffer need no stream at all.
A source is restarted only when its input really changed -- a portal token
written back into the scene is not a reason to ask the user again -- so a drag
or an opacity change costs nothing but a replan.
Background replacement runs the segmenter on its own thread at a tenth of the
video rate and takes its newest mask latest-wins, because a mask a few frames
old is still right and segmentation costs far more than a frame. The blur is a
three-pass box blur, separable and with a running sum, so its cost is flat in
the radius; it is split into bands of rows on the worker pool over pooled
buffers. The vertical pass restarts its sum per band, which costs a few reads
and keeps the pass free of unsafe.
What segments is a centred oval, not a person: no ONNX model is loaded in this
build. The Segmenter trait is the seam for one, and segment.rs says so plainly
rather than implying the blur follows a person.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Measured on a real 2560x1440 Wayland desktop through the ScreenCast portal,
which nothing here had ever run against: every captured frame was dropped
and the viewer got nothing.
Two faults, one behind the other.
The mapping length came from `mapoffset + maxsize`. Those describe a
mapping, which only shared memory has; a DMA-BUF's size lives in its buffer
object, and this compositor leaves both fields 0 (the file descriptor and
the 10240-byte stride were fine). The length was therefore 0, every map was
refused, and the capture delivered nothing for as long as it ran. Derive the
length from the rows the negotiated format describes, which is exactly what
is read afterwards.
With frames flowing, the second fault showed: reading a LINEAR DMA-BUF from
this GPU's memory took 11.95 ms per frame and 19.5 CPU cores at 1440p60,
against 0.27 ms and 0.41 cores for the same capture over shared memory — 44
times the time, 48 times the CPU. The guard that exists for this switches at
6.0 ns per pixel and the DMA-BUF path only reaches 3.24, so it never fired.
Put the threshold between the two measurements, an order of magnitude above
the shared-memory figure so a GPU whose buffers the CPU can read keeps them.
After both: 2560x1440 at 60.0 fps on 0.55 cores, no dropped frames, the
bitrate honoured. A DMA-BUF that cannot be mapped at all now also falls back
to shared memory after a few failures instead of dropping frames forever.
`stream bench` was reporting the layer size from --res, which is not what a
real source encodes; it now prints the size that was really encoded.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Going live to a broadcast service is the one output that is not a file, and
WHIP is the standard that makes it one HTTP request: post the offer, apply the
answer, delete the location to stop. str0m already drives WebRTC here, so the
session is a thread of its own fed through a bounded channel -- a slow or dead
upload drops its own packets instead of stalling an encoder.
The session offers only the codec the studio already encodes plus Opus, so the
service can never negotiate its way into a second encode.
Candidates are one host candidate on the interface that routes to the service,
found by connecting a throwaway socket: enough for a service with a public
address and for a server on this machine, not enough behind a NAT the service
cannot reach back through. STUN and TURN are not here yet.
tests/studio_whip.rs is a WHIP server built on str0m in the test: the offer is
posted, ICE and DTLS come up, real VP8 and Opus packets arrive, a refusal is
reported with the service's own words, and stopping deletes the resource.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The sample server had no groups, no stored messages and no gateway, so
none of the new screens could be seen without a real server. It now
comes with server groups and badges, a chat driven by the same
`Event::ChatHistory` a real session uses (reactions, pins, a file card,
a message in a topic), and a gateway that answers with pins and topics.
`VOELIN_OPEN` gained `voice`, `pins`, `topics`, `topic:<id>`, `member`,
`watch` and `popout`, and `scripts/shots.sh` takes a screenshot of one
of them headless, so the pictures in docs/screenshots/ are one command
each.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Recording and the replay buffer must work whether or not a stream is live,
and neither may cost a second encode, so both are fed the packets the
streamer's encoders already produce. That makes them output sinks over one
small trait rather than pipelines of their own.
The container is an own EBML writer: Matroska and WebM need so little of the
format for this (a header, one Info, one Tracks, clusters of SimpleBlocks)
that a dependency would be the larger cost. The segment size stays unknown
and there are no cues, so a recording cut short by a crash still plays; only
the duration is written back at the end, because a file of unknown length is
a poor thing to hand a player. H.264 is stored the way Matroska wants it,
length-prefixed with its parameter sets in CodecPrivate, which is why the
header waits for the first keyframe.
The replay buffer keeps whole keyframe groups so a clip always starts where a
decoder can, and a window longer than memory allows spills its oldest packets
to a temporary file it drops again once they age out -- the length is a
setting with no maximum, so it cannot be bounded by what fits in RAM.
RTMP is a seam that says what it is waiting for (the muxing side of the
FFmpeg loader) instead of dropping a stream silently.
tests/studio_record.rs runs real VP8 frames through both and reads the files
back with ffprobe: codecs, size, duration, and every frame of a clip decoded.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Separate the two halves of zero-copy that the measurements now tell apart:
the import into a VA-API encoder carries a real tiled buffer on this GPU,
while nothing from screen capture reaches it, because the portal delivers RGB
and because Ingest never accepts DMA-BUFs in the first place.
Also record the layer shape the import expects against the one a driver
exports, which the test uncovered.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The probe reported the zero-copy import as available on the strength of the
struct offsets alone, and screen capture only ever hands over RGB, which the
import refuses, so no buffer had ever gone through it on hardware.
Make a VA-API surface, export it as a DRM PRIME DMA-BUF and feed it back to
a second encoder through encode_dmabuf. On this GPU it imports and encodes,
and the buffer carries an AMD tiling modifier (0x200000028a01f04), so tiled
buffers work and not only LINEAR ones.
It also showed that the import's shape is narrower than what drivers
produce: this driver describes an NV12 surface as two DRM layers, R8 for the
luma plane and GR88 for the chroma one, while encode_dmabuf takes a single
NV12 layer with two planes, which is how a compositor hands one over. Both
name the same bytes of the same buffer object, so the test flattens the
layers; whoever wires the portal to the encoder should accept either form.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Everything about the FFmpeg encoders was written without a GPU to run them
on. Record what a Radeon RX 7900 GRE with FFmpeg 9.0.1 actually does:
software against VA-API and AMF at 1080p60 and 1440p60, a simulcast run, and
what the numbers mean (every encoder holds the frame rate, so the difference
is CPU — 0.20-0.42 cores against 1.16-2.55 — and the steady state is 1.02
allocations per encoded frame on hardware as on software).
Also record what the measurements found and changed: the H.264 level the
encoders emit against the one the offer advertises, the probe's startup cost
and the third-party output it used to print, and the libavutil 61 offsets.
The verification table now separates the hardware that was tested here from
the hardware that was not, and says plainly that the zero-copy import has
still never carried a frame because the GPU colour conversion is missing and
that the portal measurement did not run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The bench only ever ran the synthetic pattern, so the pipeline was never
measured on the source the user actually complains about: a Wayland desktop
through the ScreenCast portal.
Add --source (synthetic, portal, monitor:<n>, window:<id>). Because the
portal asks the user in a dialog and never answers on its own, the start and
the wait for the first frame both have a deadline (--start-timeout, 60 s by
default) and fail with a plain message instead of hanging; the real captured
size is printed once frames arrive.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Identities live in the ProtobufItems table of both the TeamSpeak 3 and
6 client databases, as the TS3 export string inside a typed item.
Voelin reads those databases read-only and immutable, imports .ini
exports and both clients' stores, skips duplicates by unique id, and
exports back to the .ini form so identities are never trapped here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The server page had one layout: a channel tree, a chat and a panel of
members and streams. The design asks for more of it at once, so the same
page now carries the pieces it was missing.
The chat shows reactions, a pin marker, file cards and older messages,
and every message can be reacted to, pinned or made into a topic where
the gateway offers it. A compact voice bar sits over it with the
connected channel, who is talking and the voice controls, so the sidebar
card is no longer the only way to leave or mute.
The members panel groups people by server group with the group's icon,
shows the badges and talk power a TeamSpeak client expects, and opens a
card with the person's description, groups, private chat, poke, contact
and volume. Its width is the setting `ui.members_width`, so dragging the
handle keeps it.
Pins and topics are drawers over the chat, the voice channel can be seen
as a grid of tiles with the streams in it, and the stream viewer gained
the elapsed time, the viewer count, a quality picker, a mute button, the
chat beside the player and a pop-out that hides the shell.
The quality picker stays hidden for now: the engine tells a viewer
neither which simulcast layers a streamer offers nor lets it ask for
one, so there is nothing to choose between.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Tried against a real V4L2 camera through PipeWire, three things stopped it.
A camera offers fixed frame rates (often only 30), so a rate range capped at
the wanted rate never intersects: the offer now takes any rate and the frame
pacer brings it down. Camera nodes hand out buffer types the CPU cannot map
unless asked otherwise, as screen capture already does. And PipeWire takes
the first offer that fits, so a size range alone gave the camera's smallest
size: the exact size is offered first, the range second.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The startup probe opened every encoder in the table, which took 1.77 s here
and froze the app's first use for that long, and it let the libraries behind
them print about thirty lines to standard error on every run.
Most of the time went on hardware that is not in the machine: a self-test of
a family whose vendor is absent still runs its driver's initialisation
before failing, 1.7 s for av1_nvenc and 1.2 s for vp9_qsv here. Read the PCI
vendors of the DRM render nodes once and skip those families outright; when
the vendors cannot be read nothing is skipped, so an unusual setup only pays
what it paid before. The report gains a plain reason ("no NVIDIA GPU in this
machine") in place of a CUDA error code.
FFmpeg's own log already goes to tracing, but SVT-AV1's build banner, AMF's
GetProperty warnings and Mesa's RADV_PERFTEST notice are written to the
descriptor by the libraries themselves. Point standard error at a temporary
file while the self-tests run and log what landed there as one debug record;
VOELIN_FFMPEG_PROBE_STDERR=1 leaves it alone.
Measured with `voelinctl stream encoders` (release): 1.77 s before, 0.93-1.12
s after, 12 backends tested instead of 20, and nothing on standard error.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The format description was written before the code; bring it in line with what
shipped, and be explicit about the two costs a reader would otherwise discover
the hard way: `immutable` means an identity the running client has not yet
checkpointed is not seen, and the Qt secrets file path is best-effort because
no such file existed to develop against.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A scene needs something behind each of its sources. Colour, text and image
are drawn once and put in the feed; screens, windows and the portal run the
existing capture backends through a sink that copies into pooled frames;
cameras get their own module. One broken source only sets its feed's error,
so it never stops the studio.
Text is rasterised with ab_glyph and the same Inter the UI bundles (reached
across crates rather than copied, and tools without the UI crate need it
too); images come from the `image` crate, which the tree already had.
Cameras are listed straight from V4L2 -- the card name and every pixel
format and resolution the driver reports, no hard-coded list -- but captured
through PipeWire, which already owns the devices; the connection comes from
the user's daemon or, in a sandbox, from the XDG Camera portal, and both
reuse the screen capture's PipeWire thread. Only the three read-only
enumeration ioctls are hand-written, so no bindgen build dependency joins
the tree. The test pattern is always listed as a camera, which is what the
tests use.
convert gained a borrowed-frame entry point so a capture buffer becomes RGBA
without an owned frame in between.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Import and export have to be reachable before the Profiles screen exists, and
a headless command is also how the round trip gets tested against a real
client installation without any of its data entering the repository.
The listing prints nothing but the nickname, the unique id and the security
level: all three are public — servers see them — while everything else in an
identity is the private key. `--dry-run` reads and stores nothing. `list`
comes along because `export <id>` is unusable without a way to learn the id.
Prove the imported key pair is whole rather than merely parseable: the
clients' format carries the public point next to the private scalar and
`Identity` keeps only the scalar, so signing a nonce and verifying it with the
key derived from that scalar shows the two halves belong together. The same
check runs over a real database when `VOELIN_IDENTITY_IMPORT_CHECK` points at
one, which keeps that verification repeatable without committing a fixture
that could only come from someone's own identities.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Switching to Voelin should not mean starting over on every server: the unique
id is the key pair, and a user who cannot bring it along loses every server
group they have. So read the forms the official clients keep it in — the
TeamSpeak 3 `.ini` export, the `ProtobufItems` items both clients write, and
the older `Identities/<n>/…` rows — and store them through voelin-store,
skipping unique ids the store already has instead of adding a second copy.
Export back to the `.ini` form in the same module: an importer without an
exporter traps people here, which is the thing being fixed.
The clients' databases hold private keys and may be open in a running client,
so they are opened read-only and `immutable`: no lock, no shared-memory file,
no write-ahead log replay, nothing of the user's changed to read it. The cost
is that an identity written but not yet checkpointed is not seen, which is the
right way round.
Three field numbers do not earn a protobuf dependency; the wire reader is
twenty lines and skips what it does not understand. An item is taken as an
identity only when its declared type says so, never because a field number
happens to match.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The chat view showed what `Event::Chat` reported: no ids, so nothing
could be pinned, reacted to or grouped into topics, and avatars were
always initials. Drive it from `Event::ChatHistory` instead, which
upserts messages by their local id, and keep the old path only for
sessions the engine stores no history for (it does not know the server
yet). Each tab now holds its messages and rebuilds its lines with
`vm::list::sync`, so a reaction changes one row.
Around that: the image cache decodes avatars and icons from the engine's
cache (`AvatarReady`, `IconReady`), members are grouped by server group
with badges and talk power, the member card carries contacts and
per-client volume, and file links in a message become cards that can be
downloaded. The composer's attach uses xdg-desktop-portal's file
chooser, which `voelin-platform` already had ashpd for.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The signalling computes profile-level-id from the stream's size, frame rate
and bitrate, but nothing told the encoder, so every wrapper picked its own
level. Measured on this GPU: h264_amf writes level 4.2 into the SPS of a
720p30 stream whose offer says 3.1, and 5.0 for a 1440p60 stream offered as
5.1. A viewer that sizes its decoder from our SDP can refuse a stream that
declares more than the offer did, which is what breaks official clients.
Compute the level from ITU-T Table A-1 and set it on both the codec context
and the wrapper's private option. A new test parses the SPS of every usable
H.264 backend at two sizes and both profiles and asserts profile_idc against
the offer and level_idc never above it; with the level set, all three
backends now emit exactly the offered level.
The level table is a second copy of the one in voelin-stream, because
neither crate can depend on the other, so a unit test pins them together
over a spread of sizes, rates, bitrates and profiles.
Remaining difference, only in the constraint-flag byte and left alone: the
offer claims Constrained High (0c) and Constrained Baseline (e0) as WebRTC
implementations conventionally do; the VA-API and AMF encoders emit 0c for
the former, libx264 emits 00, and all three emit 40 or c0 for the latter.
The bits do not change what a decoder can decode.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The studio needs one picture per output frame from any number of sources
that each run at their own pace, so the compositor takes each source's
newest frame through a latest-wins handoff and draws the scene back to
front into a pooled RGBA canvas, in bands of rows on a worker pool. The
plan (destination rectangles and filter weights) is kept while neither
the scene nor a source size changes, which is what lets a steady
composite allocate nothing per frame -- the property tests/studio_alloc.rs
pins down.
Frames are RGBA because alpha blending and text need it; the streamer's
existing conversion turns the canvas into I420 for the encoders in one
SIMD pass. Scaling reuses scale.rs's weight tables with an inner loop for
interleaved pixels, and a straight copy at 1:1, the common case for a
screen that already matches the canvas.
FramePool grew a format so the same recycling works for the canvas, and
the preview tap scales the canvas down through the same filter.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both official clients store identities in a `ProtobufItems` table of their
`settings.db`, not in the settings rows: one protobuf item per object, the item
type in field 6 selecting which payload field carries the body, and type 1
(field 17) holding the TeamSpeak 3 export string plus a nickname. Working that
out is the prerequisite for importing, so write it down before the code.
The myTeamSpeak account record sits in the same database and is easy to mistake
for an identity store; note that it carries no key pair and that the account
service stays out of scope, so the question is not reopened.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The DMA-BUF import reads AVFrame.buf[0] and hw_frames_ctx at offsets the
loader keeps in a table per libavutil major. The table ended in an open
range that answered every major from 60 up with 60's offsets, so on this
machine (libavutil 61) the import ran on an unverified guess, and a future
major would get the same treatment.
Compiled offsetof from the headers installed next to the library: libavutil
61 puts buf at 184 and hw_frames_ctx at 328, which is what 60 uses, so the
guess happened to hold. Record 61 explicitly and stop answering unknown
majors: AVFrame has shrunk between majors (424 bytes in 61 against 536 in
56), so an offset guessed for an unknown layout can point past the end of
the struct. An unlisted major now turns the import off with a reason and
leaves everything else working.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The studio needs a description of what it composites that survives a
restart, so the UI's scenes and sources are one serde value (the
`studio.scenes` setting) with a default for every field: adding a field
later keeps older settings files loading.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
H.264, HEVC, AV1, VP9 and VP8 on VA-API, NVENC, Quick Sync, AMF, Media
Foundation, VideoToolbox and the software encoders the system FFmpeg
has, found at runtime without a version allow-list and self-tested per
backend. Viewers get the codec they answered, with one encoder per codec
only while someone needs it, and H.264's level follows the stream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The contacts read from the database replaced the list in memory when the
read finished on the writer thread. A SetContact handled meanwhile was
lost (its write was queued behind the read), which made
contacts_are_kept_in_the_database fail under load. The engine now awaits
the read at start and after AttachHistory before its next command.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Channel files with streamed transfers, avatars and icons in a bounded
cache, file links in chat, pokes, private messages to anyone, TS3/TS6
offline messages, server details and groups, and a contacts table that
drives friends' presence, blocking and the friends stream permission.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The engine caches avatars and icons in the platform's cache directory,
which Android does not have (it would resolve to a relative path). A
host that names the data directory gets the cache in <data>/images.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
VA-API, AMF, SVT-AV1 and the other wrappers without a live bitrate change
applied a new target only at the next keyframe, so a still screen kept
the bandwidth estimate's low start value for good. An increase of half or
more now reopens the session (a keyframe) once it is five seconds old;
smaller ones still wait for a keyframe, drops below half apply at once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Against the TeamSpeak 6 dev server: the streamer offers VP9 (its stream
codec) and VP8, a viewer that decodes only VP8 answers VP8 and decodes
pictures from the encoder made for it, and the VP9 encoder, wanted by
nobody, idles.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
docs/media.md: how FFmpeg is found (VOELIN_FFMPEG_DIR, VOELIN_FFMPEG,
any major version), which struct fields are read and how they are
checked, the backends and their realtime settings, runtime bitrate and
size changes, buffers, what is zero-copy and what is missing (the GPU
colour conversion), installing FFmpeg per OS, the offer with several
codecs and an encoder per codec viewers chose, the computed H.264 level,
the new API, voelinctl, licenses and what was tested how.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
FfmpegEncoder::encode_dmabuf maps a DRM PRIME frame onto a VA-API surface
(av_hwframe_map) that the encoder reads without a copy. It needs
AVFrame.buf[0] and AVFrame.hw_frames_ctx, which have no accessor: their
offsets come from a table per libavutil major, buf[0] is checked on a
real frame at load and hw_frames_ctx on the encoder's first surface.
Only NV12 buffers are taken: screen capture delivers RGB, which needs a
colour conversion on the GPU (VA-API video processing) that is not
implemented; anything else is refused as unavailable so the caller maps
the buffer as before.
On the capture side, FrameSink::accepts_dmabuf / dmabuf let the portal
hand a buffer over before mapping it (and pass tiled ones through). No
sink accepts yet, and the portal still negotiates LINEAR buffers only.
The encoder ends its stream when dropped (SVT-AV1 logs an error
otherwise).
Untested on a GPU: this machine has no render node.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The architecture document describes what the engine now offers for the
new UI: client and server details and groups in the presence, channel
files and chat file links, the avatar and icon cache, pokes, private and
offline messages, and contacts with friends' presence and blocking, with
the protocol facts they rest on (avatar file names, icon ids, TS6 unique
ids for offline messages, the transfer port).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G