No conflicts. From the development branch: stream connections step down
when they connect but carry no media or never decode (another codec,
H.264 profiles, SRTP fallback), mDNS host candidates, larger stream
sockets, and the smoke test waiting for clients instead of pausing.
Nothing in the UI crate changed; this wave's screens are as they were.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user's rule for every negotiation: try the best option first and step
down for compatibility when it is not accepted.
- H.264 is offered in Constrained High, then Constrained Baseline; the
streamer encodes each viewer in the profile its answer took (headless
Chromium, which answers Baseline only, now decodes our H.264 streams).
- A connection that connects but carries nothing steps down at runtime:
the viewer reconnects without the failing SRTP profile, or without the
codec when audio came; the streamer offers a new connection when its
viewer reports nothing; video of one codec that never decodes makes the
viewer ask for another codec. Proven with a UDP relay that breaks SRTP
and against Chromium.
- mDNS host candidates (`<uuid>.local`) are resolved, so peers that hide
their addresses still connect on a LAN.
- Peer sockets get 4 MB send and receive buffers: bursts at 9 Mbit/s no
longer drop datagrams in the kernel; NACK and retransmission repair
losses before frames reach the pipeline.
- docs/architecture.md, "Negotiation: best first, then fall back": every
negotiation point, its ladder, what counts as refused, and why AES_CM
stays first for SRTP and DTLS stays at 1.2 until the official client is
shown to take the alternatives.
Checked on the merged tree (with the decoders and servers work): fmt,
clippy, the tests of stream, media, core, ui, voelinctl, gateway and
tsclientlib, the browser interop tests (7 and 3) and scripts/it-smoke.sh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides kept. From the development branch: the add-server dialog
asks for the address and an optional password (the rest under Advanced
when editing), servers are found through TSDNS and their gateways in
DNS, wss:// gateways, the official client's identities imported on
every start, and a bookmark built from the form over the old one.
The dialog keeps this wave's join mode for Home's "Join a Server": its
title says so, the button reads Join and connects once saved; adding
and editing read as on the development branch. Saving takes the
development branch's bookmark_from_form, which keeps the bookmark's
identity as this wave's code did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gateway client was built without TLS, so every wss:// gateway, the
setup docs/gateway-admin.md recommends and what a _tsgws._tcp record
names, failed with "TLS support not compiled in". tokio-tungstenite now
uses rustls with the system's certificates; rustls and its crates were
in the tree already (reqwest), so nothing new is downloaded.
Checked end to end against the TeamSpeak 6 dev server: tsgw behind a
TLS terminator with a certificate from a throwaway CA, the login over
wss:// works when the CA is trusted (SSL_CERT_FILE) and is refused with
UnknownIssuer when it is not. Android has no system store to read, so
wss:// stays out of reach there; the docs say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides kept. From the development branch: the phone's voice channel
screen, the pages over it (pins, topics, members), the voice button in
the phone's top bar, the quick share's mixer and picker, invite links,
viewer counts, the studio's cameras and RTMP output, and the Android
pieces.
The phone's top bar keeps this wave's search button next to the voice
button and the bell (the bell opens the notifications panel); its tabs
mark Home also on the friends, messages and Library pages and Servers on
a server's events page. The phone shell shows both sides' pages: this
wave's friends, messages, events and Library pages with their back
button, and the development branch's voice channel screen, which hides
the bottom navigation as before.
Home keeps this wave's page, which maps the design onto TeamSpeak as
decided for it (friends' presence across servers, the latest chats of
every server, live streams of all servers); the development branch's
interim home (people on the current server, its chats, its streams)
gives way to it. Its server cards still switch the phone to the Servers
tab through Nav.show. A server item keeps this wave's detail and flavor
with the development branch's wording of `live` (streams on the server).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The base moved on (the phone and Android wave, the quick share's sound,
voelinctl subscribing to every channel); it merges without conflicts
and the negotiation changes build and pass on top of it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Users should not have to type a gateway URL: a server added by its address
should bring its tsgw along, the way TeamSpeak finds the voice server with
SRV _ts3._udp and TSDNS. voelin_core::discover::gateway looks at the
address's host and then each parent domain down to the registered domain,
the most specific first, for SRV _tsgws._tcp (wss) and _tsgw._tcp (ws)
records, TLS first at the same name, with the path from an optional TXT
record ("path=/v1" by default).
Without records, as TSDNS has its port 41144, the gateway itself is asked
on tsgw's default port: tsgw now answers GET /.well-known/tsgw with the URL
apps should use (listen.public_url, else the address the request came in
on), so a tsgw next to the server is found with no setup at all.
docs/gateway-admin.md says which records to publish, with examples. The
DNS lookups are injectable in the module: tests with fake SRV/TXT answers
and a local responder; the gateway's own test fetches the well-known URL
from the real router and logs in there. hickory-resolver is the version
the voice resolver already uses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phone's voice channel screen (mockup 02), Home and bottom navigation;
Android cameras through Camera2, the screen shared into MediaCodec's input
surface without a copy, notifications with working actions, "Share to
Voelin"; the multi-select audio picker with app icons; and, asked by the
user, the quick share's sound: the share dialog shows the studio's mixer
rows (meter, gain, mute) for `stream.audio_sources` and its picker, and a
running share follows changes live. docs/android.md rewritten.
Conflicts: both waves gave studio cameras a new backend (Windows Media
Foundation from Wave 6A, Android Camera2 here); both are kept, in the
docs and code. The Windows build caught what the merge could not: each
side's `Capture` initializers lacked the other's field, and Media
Foundation cameras lacked `Camera::mirrored` (webcams face the user, so
true). Checked: fmt, clippy (host, x86_64-pc-windows-gnu for voelin-media,
both Android runs), and the tests of stream, media, core, ui, android and
voelinctl.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watching an official client's 1440p60 H.264 stream (6-9 Mbit/s) showed a
very bad frame rate. The peer sockets used the system's default buffers
(208 KB on Linux, about 90 full-size packets once the kernel's per-packet
overhead is counted), so a keyframe of hundreds of packets that arrives
while the peer task is busy overflows them, and every packet the kernel
drops costs the viewer a retransmission or a keyframe.
Each peer socket now asks for 4 MB of receive and send buffer
(PeerConfig::udp_buffer; the kernel caps it at rmem_max/wmem_max). What
the system granted is logged, and once per process with a sysctl hint
when it is less than asked.
Measured on loopback, 9 Mbit/s of noise at 60 fps with a 400 KB keyframe
every second, unpaced (high_bitrate_bursts, --ignored): with the default
buffers the kernel dropped 118-209 datagrams per 5 s and 3 of 300 frames
arrived after a gap; asking for 212992 bytes (what a default rmem_max
allows, doubled by Linux) or for 4 MB, nothing was dropped and every
frame arrived whole.
Also checked: our answer to a real libwebrtc offer (headless Chromium
152, H.264 first, stored as a fixture) keeps nack, nack pli,
transport-cc and an RTX payload type for every H.264 variant, and a relay
that loses one media packet in 25 shows str0m's NACK and retransmissions
repairing every loss before its depacketizer gives up (30 frames). The
relay (tests/relay) also serves the fallback tests that follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides kept. From the development branch: the share dialog's portal
rows ("Same as last time" restores the portal's last choice), the Share
button's menu with the Stream Studio in it instead of a button of its
own in the desktop top bar and the phone header, the codec order,
person segmentation for the studio, and streams of every channel.
The phone header keeps this wave's search button next to the bell; the
studio button goes as on the development branch. video.rs keeps the
development branch's imports without EncoderReport, which the
Integrations page now asks the codecs for itself. The Devices page
lists the capture sources without the restore row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the Share button's menu (Share screen / Stream Studio) and the
removal of the separate Stream Studio button from the headers, the
codecs every TeamSpeak client decodes ahead of H.264, the portal fix
and person segmentation.
The phone header keeps this branch's voice-channel button and hides the
bell on the voice screen, and loses the Stream Studio button as the
development branch wants. The studio's test table takes the
segmentation rows and the Android camera row. MediaCodec follows the new
codec order with no code change (Codecs orders every hardware factory's
codecs); its description and docs/media.md now say so, including what
that means on a phone without a hardware VP8, VP9 or AV1 encoder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the portal dialog entry, the studio's person segmentation
(tract-onnx) and the Share button's menu. In docs/studio.md's status
table the segmentation rows join this branch's camera and RTMP rows
(RTMP is no longer a seam). docs/ui.md no longer says the engine cannot
tell a viewer the layers (a Voelin streamer lists them) nor that the
background effect has no segmentation model.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blur, image and colour backgrounds were cut around a centred oval: no
segmentation model was in the build. `segment::HumanSeg` (feature
`segment`, on by default) now runs PP-HumanSeg, PaddleSeg's portrait
segmentation model as OpenCV Zoo ships it (Apache-2.0, 6 MB, bundled in
crates/voelin-media/models with its licence and SHA-256), on the CPU with
tract-onnx: the frame squeezed to 192x192 RGB, the probability of a person
per pixel out as the mask. It is the default segmenter; the model is
parsed and optimised once per process on the segmentation thread, and if
it does not load the oval stands in. Builds without the feature keep the
oval.
One mask takes about 50 ms on one core (tract is optimised in dev builds
too, as voelin-media already is; unoptimised it took 430 ms), so the 10
masks a second cost about half a core. A new test checks the model loads,
the mask size, that an empty evenly lit room has next to nobody in it, and
the time per mask; the frame-path tests now use the oval explicitly, since
they need a mask known in advance. On a photo of a person the mask
follows the silhouette, arms and legs included (checked by eye; the photo
is not committed). Not yet tried with a camera.
The notices list the model and its licence; THIRD_PARTY_NOTICES.md is
regenerated for tract and its dependencies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The voice service's notification said "In voice on <server>" with Mute
and Disconnect, and the screen-sharing one only "Sharing your screen".
The voice notification now shows what the app's voice card shows: the
channel as its title, the server and how many are there ("Home · 3 in
voice", "just you"), the time in voice as a chronometer, and Mute,
Deafen and Leave, which act on every voice session as the old Mute did.
Several servers at once read "In voice on 2 servers" with their names.
Tapping it opens the voice channel screen (the activity forwards the
action to Rust, which queues it until the window runs). While our
stream is live the screen-sharing notification says where it goes and
how many watch ("Live in Chill Zone", "Home · 2 watching"). Both use
the app's accent colour.
The window takes such platform requests through a small inbox in
voelin-ui (`voelin_ui::request`), handled on the window's thread and
outside the app's borrow, since navigating calls back into Rust.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Many USB cameras offer their large sizes only as MJPEG (the Fifine K420:
2560x1440 and 1920x1080 compressed, raw only up to 1280x720), and the
studio camera offered PipeWire raw formats only, so it was stuck at 720p.
MJPEG is now offered and decoded with zune-jpeg (already in the tree
through `image`) straight into pooled RGBA frames, on a thread of its own:
the camera thread copies each picture into a recycled buffer and hands it
over latest-wins, so a slow decode drops pictures instead of holding up
the camera, and nothing is allocated per picture once running. The offers
come from what V4L2 lists for the camera: the wanted size at the wanted
rate in a raw format first (no decoding), then the wanted size with MJPEG
first, then every format at the sizes it lists; PipeWire's V4L2 source
otherwise took a size on trust and failed to set NV12 at 1440p.
zune-jpeg is built optimised in dev builds like the other per-pixel code:
unoptimised, a 1440p picture took most of a second.
Tested on the Fifine K420: 2560x1440, 1920x1080 and 1280x720 arrive at
the right size at 10 fps, which is what the camera sends in this light
(v4l2-ctl measures the same); a camera-like 1440p picture decodes in about
30 ms.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RTMP output was a seam that refused every rtmp:// URL. Broadcast
services (Twitch, YouTube, nginx-rtmp) take RTMP, so the studio could only
reach the few that speak WHIP.
The connection is libavformat's own rtmp:// and rtmps:// protocols,
loaded at runtime with the rest of FFmpeg and never linked. Its RTMP
writer takes an FLV byte stream and sends each tag as a message, so the
FLV is ours (onMetaData, AVC and AAC sequence headers, a tag per frame)
and no muxer struct (AVFormatContext, AVStream, codec parameters, which
all moved between releases) is used: five avio functions and
AVIOInterruptCB. Write errors only land in AVIOContext.error, which moved
too (120 bytes in libavformat 58, 84 in 63); it is found at load by
flushing a context whose write callback fails with a sentinel.
Video is the studio's H.264 of one layer as encoded; other codecs are
refused with the reason. Audio is the studio's Opus decoded and encoded
as AAC-LC by FFmpeg's own codecs on the output's thread. The encoder's
sample format has no AVOption, so AVCodecContext.sample_fmt is located
from its neighbours' option offsets like hw_frames_ctx; its 1024-sample
frames are a reference to the first decoded frame (FFmpeg filled in the
channel layout, whose field moved) with only the leading fields pointed
at our planes.
The stream key comes from the URL or the token (sent as the play path)
and never shows in the output's name. The first connection is made when
the output is added, so a wrong address fails there; later failures are
reconnected with backoff (1 s doubling to 30 s), each new connection
starting at a keyframe it asks for, and the stats show why it is down.
EndStream unpublishes; a dead network is cut off after three seconds.
Tested against FFmpeg's own RTMP server (ffmpeg -listen 1): a studio
stream through the hardware H.264 encoder and a 440 Hz tone arrives as
h264 320x180 and aac 48 kHz stereo per ffprobe, starts at a keyframe,
decodes, and comes back after the server is replaced; the unit tests
also pass against FFmpeg 4.4.8. voelinctl studio run gets --rtmp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The home page lists the latest chats across servers and the profiles
page raises an identity's security level, so the engine gains:
- Store::recent_chats / History::recent_chats: the newest message of
every chat, the most recently active first (one pass over the time
index).
- identity::improve_level: the hash cash search on every core, in
chunks of counters, cancellable, reporting each better level reached;
the key and so the unique id stay the same.
- privacy.private_messages and privacy.pokes (everyone, friends,
nobody): private messages and pokes of everyone else are dropped,
next to what privacy.block_mode does for blocked contacts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chat with author grouping, reactions, file cards and the composer;
a resizable members panel grouped by server group with badges and a
member card; pinned-message and topic drawers; the voice-channel grid
with stream cards; the watch-stream screen with viewers, volume, chat
and a full-window pop-out. Screenshots run headless on Xvfb with
WAYLAND_DISPLAY removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured on a real RX 7900 GRE with FFmpeg 9: VA-API and AMF encode
1080p60 and 1440p60 at a quarter to half a core, simulcast included;
RGB DMA-BUFs are converted to NV12 on the GPU; Wayland screen capture
delivers frames again (it delivered none) and switches to shared memory
where reading GPU memory is slow; the H.264 level of the SPS matches
the offer; AV1 is cropped to what this GPU really encodes; FFmpeg 9's
structure offsets are checked against its headers.
Co-Authored-By: Claude Opus 5.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 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
Manual and smoke testing of the engine's voice features needs a driver:
`voelinctl engine <address> <action>` runs one engine voice session and
does files (ls, upload with an optional chat link, download, rm, mkdir,
mv), avatar (set, clear, wait for someone's and check its MD5), poke,
dm, offline (send, read with --expect and --delete), contacts (set, rm,
ls in --db) or listen (pokes, chat, file links, which it can download).
It prints one line per event and fails on errors or when time is up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Offers list the stream codec first, then the codecs of hardware encoders,
VP8 through libvpx and HEVC last; software encoders other than VP8 are
only ever the stream codec, so no answer starts an expensive one. The
streamer's peer reports the codec each answer chose, the session sends
video only to viewers of its codec and tells the encoders through
LayerFeedback which codecs are needed. Each layer's encoder thread keeps
one encoder per such codec, made when a viewer needs it and dropped when
none does; the stream codec is skipped while nobody takes it.
The H.264 profile-level-id is computed from macroblocks per second, frame
size and bitrate (Table A-1), at least 3.1 as before. Streamer takes an
encoder preference (hardware on/off, auto / software / a named backend)
that reconfigure can change live. HEVC is negotiable (str0m packetizes
it) and only offered when a hardware encoder has it.
Work in progress: committed early so it cannot be lost.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The new UI needs a channel file browser, avatars and icons, pokes,
direct messages to anyone, the offline message inbox and a friends list.
The voice connection can do all of it; the engine did not offer it.
Files (module files): ListFiles, DownloadFile (to disk as <path>.part,
renamed when complete, resumable, or into memory), DownloadChatFile for
a FileRef from a chat message, UploadFile, CancelTransfer, DeleteFiles,
RenameFile, CreateDirectory. Transfers stream in 64 KiB pieces and
report Requested/Started/Progress (files.progress_interval_ms)/Done/
Failed/Cancelled; requests and transfers carry an id the caller picks.
Avatars and icons are fetched by themselves (cache.fetch_images) into a
content-addressed disk cache (module cache: avatars by MD5, icons by id,
LRU bounded by cache.max_mb, 0 = no limit, use times kept as file times,
concurrent downloads of one file deduplicated across sessions) and
reported as AvatarReady / IconReady. SetAvatar uploads ours and
announces its hash, or removes it.
Pokes are a command and a distinct event (they were stored as private
messages before). A failing voice command (e.g. a private message to a
client who left) is now an error event instead of ending the connection.
Offline messages (module offline) list, read, send, delete and mark.
Contacts (module contacts) are engine-wide and stored in the client
database: SetContact / RemoveContact, ContactsChanged, FriendPresence
across all sessions, last seen time and server, per-person volume and
mute applied in every session, blocked authors flagged in chat and
their pokes and private messages hidden or flagged (privacy.block_mode),
and stream.permissions = friends lets friends watch without asking.
ServerDetails and Groups events report the server's details and groups
when they change. The book mapping moved to its own module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Stream audio is mixed from any number of sources (desktop, chosen apps,
the shared window's app, the processed microphone), each with gain,
mute and meters, changeable while live. Desktop audio now leaves out
Voelin's own playback on Linux, Windows and Android.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Screen-share audio took the default sink's monitor on Linux, so viewers
heard the TeamSpeak voices we play, and there was no way to share one
application's sound only.
capture::playback::start_playback(filter, source) now captures what
applications play into a mixer source, with PlaybackFilter::AllButSelf
(everything except our process and its descendants) or App(Pid | Name),
and audio_apps() lists the applications that play, updated live:
- Linux: a LinkManager (capture/pipewire_links.rs) watches the PipeWire
registry for Stream/Output/Audio nodes and their clients, and links the
output ports of every selected stream through the link-factory into a
capture stream of ours that the session manager leaves unlinked
(node.autoconnect = false). PipeWire sums the links, so one capture
stream carries any number of applications; links follow streams as
they come and go, and a restarted application is matched by name
again. Our own streams are recognised by process id (node, client, or
socket credentials; /proc parent chain); loopback and filter outputs
(node.link-group) are skipped because their sources are captured
directly. This depends on no session-manager policy, adds no sink,
and leaves the user's routing and volumes alone.
- Windows: WASAPI process loopback per capture, exclude mode on our
process tree for everything, include mode on the chosen process tree
(for a name, one capture per matching audio session's process,
matched again every two seconds); sessions of all playback devices
for the list; the owner of an HWND for window audio. Only
type-checked (x86_64-pc-windows-gnu).
- Platform providers (Android) get start_input / stop_input / apps.
- X11: window_pid() reads _NET_WM_PID, so a shared window's audio can be
selected automatically.
tests/pipewire_apps.rs runs a private PipeWire, WirePlumber and D-Bus
(skipped without them) with two tone players in other processes and one
in ours, and checks by frequency that desktop audio has both players and
not us, that name and pid captures have only their application, that a
new player is linked live, a quit one dropped, and a restarted one
matched again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Theme tokens from the mockups, Inter, Lucide icons and Twemoji (with
their notices and About credits), a component library, desktop and
phone shells, today's screens re-skinned, view models and bindings
split out of app.rs, an image cache and live ui.* settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The single 1700-line app.slint becomes a design system and screens that
later waves can compose:
- theme.slint: colour, radius, spacing and type tokens (dark and light,
a runtime font scale); icons.slint: Lucide icons as tintable images.
- components/: Button, IconButton, TextField, SearchBox, Select, Toggle,
Slider, SegmentedTabs, Avatar, badges, Card, Meter, NavItem, ListItem,
PopupMenu, Tooltip, Modal, Toast, ResizeHandle, Spinner, RichText and
the EmojiPicker.
- shells/: the desktop frame (server rail, top bar, sidebar with the user
card) and the phone frame with a bottom navigation, switched at a
breakpoint from the settings.
- screens/: today's screens re-skinned (channels, chat, streams panel and
viewer, settings page, home, dialogs, phone pages); all callbacks and
properties keep their behaviour. Navigation state is the Nav global.
On the Rust side app.rs keeps setup and event glue; servers.rs, chat.rs,
settings_page.rs and appearance.rs hold the logic, vm/ the pure view
models, bind/ the callbacks, dev.rs the development switches. Models are
created once and updated row by row (vm::list::sync); each chat tab owns
its lines model, so a message appends one row. Emoji come from the
bundled Twemoji archive through a size-bounded image cache, split into
runs that wrap with the text. New settings ui.theme, ui.font_scale,
ui.narrow_breakpoint and ui.image_cache_mb apply live.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Capture, conversion and encoding on their own threads with latest-wins
handoffs and frame pools, one encoder per simulcast layer, portal
DMA-BUF, a wlroots capture backend, tuned libvpx, per-stage statistics,
Streamer::reconfigure and voelinctl stream bench. Conflicts: the root
manifest (dimpl patch next to the release profile) and voelinctl's
command list (probe-stream next to the stream tools).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
tsgw keeps runtime-edited settings and permission rules in its database
(they win over --set, environment and tsgw.toml), migrates its database
in place, and serves the new features to clients that opt in; old
clients are unaffected. voelin-core gets a typed gateway client.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The hub, observer, relays and sessions now run in tests against a fake
raw ServerQuery server, driven over a real WebSocket by the typed
client: chat with pins, reactions and topics (including the prefix in
TeamSpeak and topic posts from official clients), old clients still
getting chat_event, unknown message types answered without a
disconnect, events with RSVP and reminders, the stream directory
following presence and linking stream events, the activity feed, and
admin settings, permission rules, quotas and rate limits applied live.
An ignored test runs the same flows against a real server and tsgw.
The relay pump subscribed to a rebuilt pool 100 ms after the old one
closed, so channel chat in that gap was lost after a nickname change.
Each pool now gets its own pump, subscribed before it opens a relay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The new Voelin UI needs Discord-like features that TeamSpeak does not
have. They run on tsgw, so the protocol grows, additively within v1:
- capabilities in hello (server-wide) and auth_ok (per user, with admin)
- query_history with before/after id and time cursors, optional limit,
topic filter; sync by revision for new and changed messages
- post (optionally into a topic), pins, reactions with per-user counts,
topics, scheduled events with RSVP and reminders, the stream directory,
the activity feed, runtime configuration and permission rules
- history entries carry topic, reactions, pinned flag and revision;
old clients ignore the extra fields
Old clients never see a new message type: extension pushes need enable
or a subscribe request. New error codes and enums have an unknown
fallback so older clients keep parsing newer gateways.
The optional client feature adds a typed client (request/answer by
envelope id, typed pushes), shared by the app engine and the gateway's
integration tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
`cargo bench -p voelin-media --bench convert` times, at 720p, 1080p and
1440p of the desktop test pattern: the old allocating one-thread
`to_i420`, the `Converter` on one thread and on all cores, the pyramid
(full, half and quarter size), and luma scaling to half (2x2 box) and to
2/3 (area average). criterion 0.8 is already in the lock file (the proto
crates use it), Apache-2.0 OR MIT.
docs/media.md describes the threaded simulcast pipeline, reconfigure and
the stats, the capture sinks, portal DMA-BUFs, the wlroots backend, the
libvpx settings, how to benchmark, the allocation behaviour, the modules
with unsafe code, and the test status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
`capture::wlroots::WlrootsCapture` captures outputs of wlroots
compositors (Sway, Hyprland, river, labwc, ...) directly over Wayland,
for sessions without a working portal or to skip its dialog. It uses
`ext-image-copy-capture-v1` with `ext-output-image-capture-source-v1`
where the compositor has them, else `wlr-screencopy-unstable-v1`
(`copy_with_damage` from version 2). Both only complete a frame once the
screen changed, so a still screen costs nothing. The compositor copies
into shared-memory buffers allocated once per size (memfd, mapped once);
the sink reads straight from the mapping (y-inverted frames are flipped
into a reused buffer first). XRGB/ARGB (BGRx in memory) and XBGR/ABGR
are read. Events are dispatched with a poll timeout so stopping is
prompt. Feature `wlroots` (default; Linux), using the wayland-client,
wayland-protocols and wayland-protocols-wlr versions already in the lock
file; `with_display` connects to another socket.
Tested against a headless sway 1.9 (wlr-screencopy v3, pixman renderer):
outputs, the captured background colour, a colour change through sway's
IPC arriving as a new frame, and the queue API
(`tests/wlroots_capture.rs`, skipped without VOELIN_WLROOTS_TEST_DISPLAY).
The ext-image-copy-capture path is untested: sway 1.9 predates it.
`CaptureBackend` gains `Portal` and `Wlroots` (names `auto`, `portal`,
`x11`, `wlroots` with `name()` / `FromStr`, as the stream settings spell
them); `Auto` stays the session default (the portal on Wayland).
`EncodedSource` passes `FrameSource::set_layer_bitrate` to the encoders
(`MediaSink::layer_bitrate`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Conflicts with the SRTP/BWE/simulcast work were in the engine's command
loop, session and stream tasks (both sides kept: SRTP order and layers
next to settings and discovery) and in the voelin-stream exports.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Settings were JSON blobs the UI read once at start and wrote back. The
engine had no way to read settings, nothing was notified of changes, and
there was no place for command line or config file values.
settings::Settings holds typed keys (a Key<T> carries its name, value type,
default, validation and a kind for a settings page; a registry lists the
registered keys). The effective value comes from the runtime value stored
in the client database, else the command line or environment
(VOELIN_SETTING_STREAM__FPS, --set key=value), else a config file (TOML or
JSON), else the default; reset() removes the runtime value. Reads come from
memory as Arc<T>; writes update memory, notify, and go to SQLite on a
writer thread in batches. Subscribers get every set and reset; a
SettingWatch per key gets value changes. Stored values are versioned: the
first migration copies the share dialog's frame rate and bitrate and the
crash report opt-in out of the UI's blob, which stays for older versions.
The keys the streaming work needs are defined: stream.fps (default 60),
stream.bitrate_kbps (8000), stream.layers (LayerSpec-compatible), codec,
capture and encoder backends, SRTP profiles, hardware acceleration and
stream.permissions, plus audio and crash_reports. No key has a maximum.
The engine takes Command::SetSetting/ResetSetting/AttachSettings and
reports Event::SettingChanged/SettingRejected for every change, also ones
made directly on the settings; a changed audio key is applied to the
sessions. stream.permissions answers join requests: everyone accepts,
channel accepts clients in our channel and denies others (the server
relays requests from any channel), nobody denies, friends asks (no
contacts yet). StartStream's auto_accept still accepts everyone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
Official TeamSpeak 6 clients use AES_CM_128_HMAC_SHA1_80, while our peers
negotiated AES-256-GCM. PeerConfig::srtp_profiles now sets the order (default
AES_CM_128_HMAC_SHA1_80, then the GCM profiles for peers without it); a
DTLS provider wrapping str0m's dimpl DTLS applies it and records the
negotiated profile. It can be changed at runtime (Streams::set_srtp_profiles,
Command::SetSrtpProfiles) for new connections.
Streamer peers now run str0m's bandwidth estimation and pacer. Each viewer
gets the simulcast layer its estimate allows (down at once, up after 2 s
above the next layer's minimum plus 20%), switching at a keyframe of the new
layer, which is requested. Keyframe requests and bitrate targets (lowest
estimate of a layer's viewers) are per layer and reach the encoders
lock-free through LayerFeedback (StreamSink::take_layer_keyframes,
layer_bitrate). Peers that negotiate RID simulcast (PeerConfig::simulcast,
for SFUs/WHIP) get every layer with its RID. Layers can change while live.
voelinctl stream start takes --layer, --simulcast, --srtp and --placeholder
(layered synthetic frames without an encoder) and prints each viewer's
layer, estimate and SRTP profile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
The server announces a stream only to the clients in the streamer's channel
when it starts; clients that arrive later see only client_is_streaming. To
find out what the server offers instead, probe-stream runs two clients:
A creates a channel and starts a stream, B arrives afterwards and tries
candidate commands from another channel and from A's channel
(requeststreaminfo spellings, clientgetvariables, clientinfo, list-like
command names, joinstreamrequest with the learned id), A tries updatestream
and client_meta_data. Every command both clients exchange is printed raw
through a listener on the tsproto connection (tsclientlib's unstable API),
so notifications the declarations do not know yet show up too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
str0m's DTLS stack (dimpl) hard-codes the SRTP profile a DTLS server picks
(AES-256-GCM first), with no way to configure it. Official TeamSpeak 6
clients use AES_CM_128_HMAC_SHA1_80, so we need to patch dimpl. This commit
only vendors the crate as published and routes crates.io's dimpl to it;
the change follows separately so it can be reviewed and dropped on its own.
third_party is excluded from the workspace so dimpl's dev-dependencies and
tests stay out of our builds, and own-crates.sh skips it like crates/proto.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G