Finish banner rendering, image cache invalidation, avatar/icon wiring and image-format support. Bound raster decoding, retain readable text contrast, and recover failed downloads while stopping obsolete reload timers.
Validated with 168 library tests, a private TS6 banner lifecycle test including the real 60-second reload, desktop builds, strict scoped Clippy, formatting, license notices, independent source review and six headless desktop/mobile renders.
On the Windows CI runner jq ends its lines with \r\n; `tr '\n' ' '`
removed only the \n, so every crate name kept a \r and cargo refused
`voelin-android\r` as a package name, failing the Windows clippy job.
`jq -j` writes the list with no line breaks at all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The host banner (virtualserver_hostbanner_gfx_url) and TeamSpeak 6
channel banners are http(s) addresses on any host, not files on the
server, so the voice file transfer that fetches avatars and icons cannot
get them. A new engine path (web.rs) downloads them with the workspace's
reqwest client (rustls, system proxies and certificate store) into the
same cache, keyed by the MD5 of the address (pictures/<md5>), only for
http and https, at most 4 MiB, with a 10 s connect and 30 s overall
timeout, and keeps a download only if its content is a picture the UI
decodes (PNG, JPEG, GIF, WebP, SVG), whatever the address or the server
say; an error page is not cached as a banner.
The session fetches the banners of the presence it shows, from any
source, when cache.fetch_images allows (it contacts hosts the server
chose, as the official client does), and reports each as PictureReady.
When the server sets virtualserver_hostbanner_gfx_interval, a timer asks
the session to fetch the host banner again (never more often than once a
minute, as TeamSpeak 3 and 6 servers enforce) and the new file replaces
the old one; Cache::fetch takes `fresh` for that.
Tests: a local HTTP server on 127.0.0.1 for the download, the size cap
(announced and unannounced), refused pages and the cache; the cache keys;
a live test that sets both banners on the TeamSpeak 6 dev server through
ServerQuery, sees them arrive and puts the server back. voelinctl engine
prints the pictures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A TeamSpeak 6 channel can have a banner picture (channel_banner_gfx_url,
channel_banner_mode) that the official client draws behind the channel.
The server sends both in channellist, notifychannelcreated and
notifychanneledited (seen on 6.0.0-beta13.1), but the declarations only
had them in channellist and the book had no place for them, so they were
dropped with an "Unknown argument" warning. The book's Channel keeps them
now (local patch 13 in crates/proto/UPSTREAM.md) and ChannelInfo carries
the address and the mode.
The mode's numbers are those of the host banner (the server's channeledit
documentation: 0 as it is, 1 stretched, 2 scaled keeping the aspect
ratio), so HostBannerMode becomes BannerMode and serves both. The book
keeps the mode as text, as upstream declared it: a value the generated
parser does not know would otherwise drop the whole channel list.
The query observer asks channellist for -icon and -banners (TeamSpeak 3
and 6 ignore flags they do not know) and reads banners from the channel
events too, so invisible presence shows them as well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The relay drops every 25th RTP packet it forwards, retransmissions
included, so which packet that is shifts with timing. Under load it can
be the stream's last packet, and no later packet shows the viewer the
hole to ask for, so the last of the 90 frames never arrived. One more,
uncounted frame now follows them; a loss in the middle still shows up as
a missing frame or a gap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An automatic bitrate up to 60 Mbit/s that follows size and frame rate,
presets and settings up to 8K and 320 fps, the portal asked for the
stream's frame rate, H.264/HEVC/AV1 levels that count the frame rate,
memory frames on the GPU path for VA-API encoders, and a pacer that no
longer caps a peer at one packet a millisecond. Measured through the
TS6 dev server: 1440p240 and 1080p240 arrive at 60 Mbit/s; 4K60
decodes at 60 fps. 8K60 needs DMA-BUF capture, and 8K decoding reaches
about 20 fps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The image cache stores downloads without an extension (avatars/<md5>,
icons/<id>), but the UI loaded them with Image::load_from_path, which
picks the decoder from the extension. Every avatar and server icon
failed with "The image format could not be determined" and was drawn
empty. Read the bytes and let Image::load_from_data sniff the format,
which also covers the SVG icons TeamSpeak 6 servers keep.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What capped a Voelin stream and what does now; what the GPU's encoders
reach on their own (AV1 61-63 fps at 8K, 233 at 4K; HEVC 51-52 and 193;
H.264 at most 4096 wide, 194 at 4K); the streamer before and after
(8K30 from memory on 1.45 cores instead of 3.47, 8K60 from video memory at
60 fps on 0.01, 4K120 H.264 at 120 instead of 84, 4K240 AV1 at 232
instead of 107); end to end through the TeamSpeak 6 dev server (4K60 AV1
at 60 Mbit/s decoded at 60 fps, 1440p240 AV1 and 1080p240 H.264 arriving
at their full 60 Mbit/s, 8K30 limited by the viewer's decoding at about
20 fps); why a 60 Mbit/s 4K60 stream arrives as 40-46 (the encoders' CBR
filler and padding, which str0m drops); and the viewer's RGBA cost per
picture, which is not the limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wave 4B's settings pages arrived with their own stream controls, written
for the old limits: the Video page's bitrate slider stopped at 20 Mbit/s,
its frame rates at 120 and its quality presets at 1440p, and with the
automatic bitrate (0, now the default) any change on that page stored a
bitrate of 1 kbit/s (`form.bitrate.round().max(1.0)`), while the
Streaming page could not set the automatic bitrate back.
Kept 4B's layout and put the controls into it: frame rates up to 320,
quality presets 4K and 8K (`PRESETS`), the slider up to 60 Mbit/s with
the field empty (and a note) for the automatic bitrate, which a preset
turns into the automatic bitrate of its size and the frame rate
(`preset_layers`, tested); the Streaming page takes empty, 0 or "auto" as
automatic and says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For measuring streams end to end: `stream start --stats` prints once a
second what the encoder makes per layer (size, fps, kbit/s, target,
encode time), `stream watch --stats` what arrives and decodes (decoded
fps, received bitrate, size, decoder, frames decoded and skipped,
keyframe requests), `stream start --pattern desktop` streams the
code-editor test pattern (about as costly as real screen content), and
`stream --no-bwe` turns bandwidth estimation off, to see what the path
carries unpaced. `Action::Stream` is boxed (the arguments grew past
clippy's limit) and `watch` takes its options in one struct.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 3840x2160@60 AV1 stream at 60 Mbit/s, Voelin to Voelin through the
TeamSpeak 6 dev server on loopback, was received at 5 Mbit/s: the
bandwidth estimate started at 60 Mbit/s and fell within seconds to 9, and
str0m's probes measured 9.4-9.6 Mbit/s every time. That is one 1188-byte
packet a millisecond. str0m's pacer asks for a timeout at once after
every packet it lets out; the peer task slept until it with tokio, whose
timer rounds up to its next millisecond. Without bandwidth estimation the
same stream arrived at 44-46 Mbit/s and decoded at 60 fps.
The peer task now handles a due timeout at once instead of sleeping on
it, up to 256 turns in a row, so packets and commands are still read in
between. Same stream: the estimate climbed to 110 Mbit/s and the viewer
received 69-73 Mbit/s at 60 fps. `the_pacer_keeps_up_with_60_mbits`
(loopback, 60 Mbit/s of 60 fps frames with 1 MB keyframes) fails without
it (7.9 Mbit/s received, the estimate at 12.5) and passes with it (56
Mbit/s, the estimate above 98).
With the estimate free to rise, an encoder followed it above the stream's
bitrate (to 91 Mbit/s for a 60 Mbit/s stream). Its target is now capped
at the layer's bitrate, or `max_bitrate` where set, as `LayerSpec`
documents: estimates move it down and back up to it.
`no_layer_request_without_the_offer_listing_layers` asserted that the
viewer had no output at all after ten frames; with frames arriving faster,
frame events were still queued. It now checks that no request was sent,
which is what it means.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The home page, friends, direct messages with offline inbox, the bell,
search, events and the full set of settings pages from the design, on
desktop and phone. Profiles is the one identities page; the store's
default identity is the only default, and one function picks the
identity a connection uses. New privacy settings let the user limit who
may send private messages or poke (everyone by default).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The development branch's identity work and this wave's Profiles page
were two models of the same thing: the store's default identity (schema
4: where each identity came from and which one is the default, which the
import on start relies on to replace Voelin's own identity once) next to
this wave's identity.default setting, and a separate Identities section
next to Profiles. They are one now.
- The store's default is the only default: the identity.default setting
is gone (never released, so nothing to migrate). Choosing an identity
calls Store::set_default_identity as the user's choice, which no
import replaces, and says it applies from the next connection.
- One place picks the identity of a connection: the bookmark's own if it
names one that exists, else the store's default. Connecting, My
Account and each identity's "Used by" all go through it.
- Profiles has what Identities had: each identity's origin ("Made in
Voelin", "Imported", "Chosen by you") with its level, the Default
badge or "Use as default", and the switch for importing the official
clients' identities on start, next to this wave's rename, export,
delete, security level, import by hand and identity per server. The
Identities section, its sidebar entry and the phone's sixth tab are
gone; VOELIN_OPEN=settings:identities opens Profiles.
- docs/identity.md and docs/ui.md say so; the Identities screenshot gives
way to the Profiles one, taken from a store with the created identity
and a synthetic TeamSpeak one.
Checked headless with a fake home and synthetic identities only: the
first start creates Default; the second, with a synthetic TeamSpeak 6
database, makes its identity the default once and says so; the third
changes nothing, and My Account shows the store's default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app's streams always offered H.264 at level 3.1: its peer
configuration is made before a share starts, and only voelinctl set the
real level. A 4K or high-frame-rate stream then declared far less in its
offer than in its SPS, which a viewer that sizes its decoder from the
offer may refuse.
Each layer's encoder now tells its sink what it makes
(`MediaSink::layer_format`: size, frame rate, bitrate, whether the
bitrate is automatic), when the sink is attached (from the size captured
so far, so a viewer that joins before the first frame is encoded is
covered), with the layer's first frame and on every change. The engine's
stream task offers new viewers the level of the largest layer (its
bitrate at `max_bitrate` if that is higher) in both profiles, and puts an
automatic bitrate into the layer as before; this one hook replaces
`auto_bitrate`.
Offering 6.0 broke the stream: str0m 0.23 knows no H.264 level above 5.2,
nor does libwebrtc (`H264Level` on its main branch), and a
`profile-level-id` they cannot parse matches nothing, so a viewer answered
without video (`m=video 0`). The offer is now capped at 5.2
(`h264::MAX_OFFER_LEVEL`); a stream that needs 6.x (4K above 60 fps, 8K)
is offered as 5.2 and keeps its real level in the SPS.
Tests: through two stream tasks, an encoder's 3840x2160@60 reaches the
next offer as 640c34 and 42e034 (and without the update it stays 3.1);
the largest layer counts, at its max bitrate; an automatic bitrate still
moves the layer once, not per frame.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Voelin's auto-made identity gives way to the official client's default
on the first start that finds one, and that choice is remembered (store
schema 4 records each identity's origin and the default). Settings has
an Identities section with "Use as default", and the vendored key
decoder no longer rejects private keys that start with zero bytes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured at 7680x4320@60 with av1_vaapi at 60 Mbit/s, the CPU path made
27 fps: the pyramid converted each frame to I420 on every core (4.6 ms),
then the encoder thread interleaved it to NV12 and uploaded it into a
VA-API surface on one thread (`encode_with`), 20 ms of its 36.7 ms per
frame, so 81 frames in 5 s were dropped. 3840x2160@120 with h264_vaapi
made 84 fps the same way.
While every encoder takes GPU frames, a picture in memory (shared memory
from the portal, X11, wlroots, the studio's composite, the test pattern)
now takes the GPU path the DMA-BUFs take: `GpuConverter::convert_memory`
copies it as it is (BGRx or RGBx) into a VA-API surface of its own and
converts and scales that for every layer. That copy is all the CPU does:
5.7 ms of the 11.9 a 7680x4320 frame takes (the rest is the GPU's upload
and conversion), one thread, because eight copying threads saved 2 ms for
four times the CPU. Not waiting for the GPU was tried and was slower
(36 fps at 8K60 against 42: the encoder then waited instead).
The test pattern drew a 7680x4320 frame on one thread (230 MB of copies),
which alone kept the bench under 40 fps; it now draws in bands on four
threads, which the memory bandwidth limits anyway.
Tests: a BGRx and an RGBx picture through the GPU match the CPU's
conversion (40.4 dB at full size, 48.7 at half), and a streamer on the
test pattern in memory with two `h264_vaapi` layers sends every frame
through the GPU and decodes in the right colours (a red-blue swap fails
it). The bench's GPU count now covers both kinds of frame.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The screens of this wave had no line in docs/ui.md, against the recipe
for adding a screen: what each shows, how it opens headless and which
engine data it reads. They now have a section with a table of the parts
(home, Library, friends, direct messages, the bell, search, events,
pictures in chat, join by address) and one of the settings sections, the
UI's new keys (ui.image_preview_kb, notify.*, video.*, identity.default),
the new VOELIN_OPEN switches, the new files in the structure, and the
limits of mapping the design onto TeamSpeak.
The screenshots of the home, the server page, the light theme and the
settings showed the screens before this wave; they are taken again, and
the new screens (friends, messages, the bell, search, events, Library,
Integrations, Profiles, and on the phone friends, messages, events, the
bell and the streaming settings) are added, all headless with sample
data and reduced to 256 colours.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Brings the negotiation work (voelin-stream: mDNS candidates, relays,
Chromium offers) and it-smoke waiting for clients instead of fixed
pauses, before the final checks of the identity default work. No
conflicts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The identity tests failed now and then: one key in 256 has a private
scalar below 2^248, the TeamSpeak export stores it as a DER integer
without the leading zero bytes, and EccKeyPrivP256::from_tomcrypt passed
those fewer than 32 bytes to from_short, which refused them. Such an
identity from the official client could not be imported at all ("no
identity in this file"). The scalar is padded to 32 bytes now; a test
round-trips keys with one, two and 31 leading zero bytes through both
export forms. Local patch 12 in UPSTREAM.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the phone the settings are reached from the You tab's list, which
showed five of the eleven sections: My Account, Profiles, Devices,
Notifications, Integrations and Advanced could only be found through
the picker inside the settings. The list now has all of them, in the
order of the phone's settings design (account, profiles, appearance,
voice and video, streaming, notifications, privacy, devices, then
keybinds, integrations and advanced), each with its chevron.
A file in a chat message showed a grey round icon while the design's
file card, and the conversation panel's shared files, show a document
on a red square (a picture on a blue one); the chat's file card now
does the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs failed at random steps while the dev servers were slow to let clients
in (4 to 13 s per connect on a loaded machine): the presence probe left
before the observer's window, and the gateway and relay talkers spoke
before the gateway user or the relay listened. The observer now waits up
to 45 s (it ends as soon as it sees the probe) and the probe stays 8 s;
the gateway and relay steps talk once the gateway user sees the listener
and once the relay relays and the listener is in.
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>
With the official client's identity taking the place of the one Voelin
made, the user needs to see which identity is in use and switch either
way. Settings has an Identities section now (a sixth tab, ID, on the
phone): every stored identity with where it came from, its security
level and unique id, "Default" on the one servers see and "Use as
default" on the others. A choice applies from the next connection,
says so in the status, and is the user's: no import replaces it (the
store marks a created identity chosen this way as the user's). The
section also has the switch for importing the official clients'
identities on start (identity.import_from_teamspeak).
The rows are a pure function with a test; screenshots, headless, of a
store with the created identity and two synthetic TeamSpeak ones.
docs/identity.md describes the one-time replacement and the section;
VOELIN_OPEN=settings:identities opens it.
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 user wants to appear as their TeamSpeak identity. Until now the
official client's default became Voelin's only on a store without
identities, so anyone who had started Voelin once kept the identity the
app had created on its own, which nobody chose.
The store now records where each identity came from and which one is
the default (schema 4: identities.origin created/imported/user and
is_default; the migration marks the first identity named Default as
created, the rest as imported, the first as the default). When the
import on start finds the official client's default while Voelin's
default is still the created one, that identity becomes the default,
once: the created one is kept, and choosing it again later makes it the
user's own, which no import replaces. The status says so ("You now use
your TeamSpeak identity "X"; your previous one is kept").
The toast wrapped nothing and was cut at 560 pixels, wider than a phone;
it now wraps within the window. voelinctl identity list shows the origin
and the default. Tested with synthetic databases and in the app headless
with a fake home: created, then replaced once, then left alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test pattern's DMA-BUFs came from /dev/udmabuf: ordinary memory,
which the GPU reads over the bus. Measured on the Radeon RX 7900 GRE
(`gpu_conversion_cost`, new, ignored): converting a 3840x2160 RGB buffer
to NV12 took 9.7 ms from such a buffer against 0.16 ms from one in video
memory in the driver's tiled layout, and 4.0 against 0.09 ms at 1080p;
the import itself costs 0.01-0.02 ms either way. So the bench showed the
GPU path at 4K240 stuck at 70 fps waiting for the bus, which no real
capture does. udmabuf also refuses buffers over 64 MiB, so 7680x4320
(132 MiB) could not be benched on the GPU path at all.
`SyntheticScreen::with_video_memory` (`StreamerConfig::
synthetic_video_memory`, `voelinctl stream bench --vram`) draws eight
frames of the pattern in advance into VA-API surfaces of the driver's
layout, exported as DMA-BUFs and handed over in turn, as a compositor
hands over the screen; a sink that declines them gets memory frames as
before. The exported surface was a test helper and is now crate code
(`ffmpeg::Exported`). With it, from a dev build: 4K240 AV1 at 60 Mbit/s
236.8 fps with 0.31 ms on the GPU per frame and 0.03 cores; 8K60 60.0 fps,
1.01 ms, 0.01 cores, the encoder's 16.5 ms per frame the limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine now decodes with FFmpeg's decoders, hardware first, and has
two settings for it (stream.hardware_decoding, stream.decoder_backend).
Integrations lists the decoders under the encoders, each codec's in the
order they are tried, with what works and why the rest does not; the
Advanced page sets the decoder and hardware decoding next to the encoder
and hardware acceleration (whose description no longer claims the
decoders).
Streams of every channel are listed now, so a home live room names the
streamer's channel, not ours, and watching one, or a friend's stream,
goes through watch_client: at once from any channel, or when the lookup
brings a stream that is not known yet. Only without voice on that server
does a friend's Watch still join them first. The friends page's own
pending watch, which waited for us to be in the streamer's channel, is
gone; the development branch's pending watch does that job.
Home's hint for no servers no longer asks for a nickname: the add-server
dialog takes an address and an optional password now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VA-API's HEVC and AV1 encoders guessed their level themselves: FFmpeg's
AV1 guess reads the frame rate from `AVCodecContext.framerate`, which has
no AVOption and so was never set, and its HEVC guess ignores the rate. A
4K240 stream declared a level for 4K60, which a decoder that sizes itself
from the level may refuse.
The encoder now sets the level and tier from the stream's size, frame
rate and bitrate (H.265 Table A.8, AV1 A.3): the lowest level whose Main
tier holds the bitrate, else the lowest whose High tier does, else no
limits (HEVC 8.5, AV1 level 31) as FFmpeg does. 4K60 at 60 Mbit/s is 5.2
Main, 4K240 and 8K60 6.1. Only for VA-API, whose options take
`general_level_idc` and `seq_level_idx`; other wrappers count levels
differently. The rate-control buffer is clamped to what its int holds, so
a typed bitrate above 1 Gbit/s no longer fails the open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ScreenCast portal was offered a frame rate range up to the stream's
cap but no `maxFramerate`, so the compositor's own maximum (its screen's
refresh rate) applied whatever the cap was: a 30 fps stream of a 144 Hz
screen got 144 frames a second, of which the sink dropped most. It is now
offered `maxFramerate` up to the cap, preferably the cap: PipeWire keeps
the consumer's default where the producer's range allows it, so the
compositor sends at the lower of the cap and what it can, up to 320 fps
or more on a screen that fast. Renegotiated with the cap as before.
Windows Graphics Capture is reported to deliver about 60 frames a second
without a minimum update interval (or with one under 1 ms); it now gets
1 ms where Windows has the setting, so the sink's cap decides there too.
Type-checked only; it has not run on Windows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TSDNS without a port: the resolver now also asks a TSDNS server at the
address's parent domains on TCP 41144 when there is no SRV record, as
the official client does (the user's own server needs it); all steps
start at once and are taken in order, with short timeouts; a typed port
wins; SRV weight 0 records are kept (local tsclientlib patch 11).
- Add a server with its address and an optional password; everything
else defaults (the server's own name after the first connection, the
default identity's nickname) and stays editable under Advanced; edits
no longer drop the identity, channel and client version.
- The official clients' identities are imported on every start (read
only, new ones only; `identity.import_from_teamspeak`, default on).
- A server's gateway is found in DNS (SRV `_tsgws._tcp`/`_tsgw._tcp`,
walking up the domain, TXT for the path) or at
`http://<host>:7788/.well-known/tsgw`, which tsgw now answers; the
gateway client gained TLS so `wss://` gateways work.
Merged cleanly; fmt and clippy pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bitrate was a fixed 8 Mbit/s by default whatever was shared, and the
share dialog offered at most 10 Mbit/s and 60 fps. Asked for: Voelin
streams that can target 60 Mbit/s at up to 8K and 320 fps, with an
automatic bitrate that scales with the stream's resolution and frame rate
and follows it live, beyond 60 Mbit/s only when typed.
- `media::auto_bitrate(width, height, fps)`: 0.12 bits per pixel and
frame (7.5 Mbit/s at 1080p30, 15 at 1080p60, 27 at 1440p60) between
300 kbit/s and 60 Mbit/s, reached at 4K60 and 1080p240.
- `stream.bitrate_kbps` 0 is automatic and now the default. A streamer
layer with bitrate 0 works it out per picture from the size encoded and
the layer's frame rate, so a new resolution or frame rate moves it at
once, and tells its sink (`MediaSink::auto_bitrate`). The engine's
`StreamSink` puts it into the live stream's layer, so connections start
their bandwidth estimate at it and probe for it; without that the
stream would have kept the bitrate announced at the start.
`Streamer::bitrate_kbps()` is what to announce.
- The quick share offers 15-320 fps and Auto, 2.5 to 60 Mbit/s (typed
values still have no maximum; the `ui` blob keeps indices of the old
lists for older versions). The studio offers 4K and 8K and 30-240 fps,
takes an empty bitrate as automatic and derives its first simulcast
layer from the automatic bitrate.
- The studio now tells the engine its layers when it goes live and when
they change (`SetStreamLayers`), and a quick share resets them: the
session sends only layers it knows of, so a studio's simulcast layers
never reached a viewer, and its layer kept the bitrate announced.
- `voelinctl stream start` and `stream bench` default to the automatic
bitrate too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the address alone enough, a server added where there is neither an
imported identity's nickname nor a user name (Android has no USER) got an
empty nickname, which servers refuse; the form used to demand one. It
falls back to "Voelin user" now, editable under Advanced.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both sides kept. From the development branch: FFmpeg's decoders at
runtime (hardware first, then software, then built-in) with the settings
stream.hardware_decoding and stream.decoder_backend, applied to the
video when they change, and watching a streaming user's stream from the
channel list, their dialog and the member card.
video.rs keeps set_decoder_preference and leaves out encoder_report:
the Integrations page asks a copy of the codecs for the report on a
thread of its own (FFmpeg's probe can take a while), not on the UI
thread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The audit row of the viewer's codec and the transport section say how a
codec that never decodes is left out (Viewer, StreamUndecodable,
video_undecodable), media.md under Viewer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The viewer's runtime step keyed on video arriving at the transport. Now
that the pipeline keeps decoding after losses and tries a ladder of
decoders, "no media flows" has to be judged by decoded pictures: video
that keeps coming in a codec none of our decoders can show is the same
failure as no video, one layer up.
The app's Viewer watches the pipeline's decoded count (DecodeWatch): when
frames of one codec have come for 10 s, at least 60 of them, without a
single picture (time for every decoder of the codec's ladder to fail),
it sends Command::StreamUndecodable once. The stream task passes it to
Streams::video_undecodable, which asks the streamer for a new connection
without that codec if it offered another we take (the same Fallback as
the transport checks, logged, nothing left: logged and nothing loops).
A codec that decoded once is never reported: later losses are the
pipeline's to repair.
Tests: DecodeWatch alone (time and frames both needed, once per codec,
a codec that decoded is fine), through a real VideoPipeline (VP9 frames
that are not VP9 are reported after the wait, real VP8 keyframes never),
and two sessions where video_undecodable moves the viewer from VP9 to
VP8 and then, with nothing left, stays.
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 development branch gained FFmpeg's decoders and the decoder ladder.
Conflicts only in text: the changelog keeps both entries, media.md the
H.264 profile ladder next to the new VideoPipeline description, the
interop README both sets of Chromium findings, and browser_codecs.rs
both the per-format viewer sink and the new pipeline test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Probed against the TeamSpeak 6 dev server (6.0.0-beta13.1): `setupstream`
takes any bitrate and enforces none, but keeps it in 16 bits, so 100000
kbit/s is announced to the channel as 34464 and 4294967296 as 0. A stream
of more than 65.5 Mbit/s would have been announced as a small, wrong
number.
`proto::setup` now announces at most 65535 kbit/s
(`MAX_ANNOUNCED_BITRATE`); a 60 Mbit/s stream is announced as 60000, as
it is. The peers keep sending the real rate: nothing between them reads
the announcement. The probe and its results are in the protocol notes,
and the old "TeamSpeak caps streams at 10 Mbit/s" is corrected where the
code claimed it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the FFmpeg decoder ladder and watching a streaming user's stream
from the channel list. app.rs kept both sides: the identity import
before the identity is chosen (with the development switches read
there) and the video's decoder preference from the settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The add-server dialog asked for a name, the address with a port, a
nickname, a gateway URL and ServerQuery settings before anything could
be saved. Now it asks for the address (host, host:port, IP or server
nickname; the resolver finds the port) and an optional server password;
the rest is under an Advanced disclosure, open when editing. Empty
fields are filled in: the name is the address until the first
connection, then the server's own name; the nickname is the default
identity's (one imported from TeamSpeak keeps its nickname), else the
system user's; the default identity, no default channel; the gateway is
looked up in DNS (voelin_core::discover) when the server is saved
without one and when it connects, and one found is stored as if typed.
Editing keeps what the form does not show (identity, default channel,
client version, the query's server port), which saving dropped before.
The form-to-bookmark conversion is a pure function with tests. New
development switch bookmark:edit opens the current server's dialog;
docs/ui.md describes the dialog, with the desktop screenshot redone and
a phone one added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watching an official client's stream ran at about 1 fps: its H.264 (AMF)
uses B-frames, which Cisco's OpenH264 cannot decode (8 of 600 pictures at
1440p60), and after each error the pipeline waited for a keyframe that
rarely came. Now:
- FFmpeg's decoders are loaded at runtime like its encoders, each checked
by a self-test on clips our own encoders made; per codec the best that
works is used: VA-API (D3D11VA/DXVA2 on Windows), then FFmpeg's software
decoders, then libvpx/OpenH264/dav1d. Viewers accept AV1 > HEVC > VP9 >
H.264 > VP8, so official clients' preferred AV1 is taken directly.
- A failing decoder is replaced by the next one without ending the watch;
FFmpeg's H.264 and HEVC decoders conceal losses, so the pipeline keeps
decoding after a lost frame; a keyframe still wanted is asked for every
500 ms.
- `stream.hardware_decoding` and `stream.decoder_backend`, live.
Measured here (RX 7900 GRE): the 1440p60 B-frame stream plays at 59.9 fps
through h264_vaapi (58.9 with a frame lost every second), 0.8 fps through
OpenH264 before. Tested: every local encoder through every decoder of its
codec (PSNR), VA-API on the GPU, the fallback, no allocation per picture,
and headless Chromium sending AV1, VP9 and H.264 to the pipeline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The development branch gained watching a streaming user's stream from
the channel list (voelin-ui only); it merges without conflicts, and the
tree passes fmt and strict clippy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The audit's reason for leaving DTLS 1.3 off read as if 1.3 cost a round
trip; its handshake saves one. The point stands: that is all it would
bring, against an untried official client and no version step on a
failed handshake.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user asked to click a user who streams in the channel list and join
their stream. Three ways now:
- The LIVE mark on a streaming user's row in the channel tree joins the
stream at once (a button for screen readers too).
- Clicking the user opens their dialog as before; while they stream it
offers "Watch <name>'s stream".
- The member card offers "Watch stream" too.
All go through `watch_client`: it watches the user's stream when it is
known, and otherwise (a stream that started before we joined or in
another channel, still being looked up) remembers the request and starts
watching as soon as `StreamsChanged` brings the stream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One entry for the negotiation work users notice: the H.264 profile
ladder, the replacement of connections that carry nothing, mDNS host
candidates and the larger socket buffers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The official client re-offers on the running connection when it does
not encode the codec our answer chose; the new codec's first frames can
come late in the connection's first five seconds, and the viewer would
then step down for a connection that is about to work. A new offer on
the connection now restarts its check. stall_checks pins the rules:
once per connection, twice as long for a streamer, never with
Duration::MAX.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phone's home followed the desktop's order (live rooms, then the
servers) while the phone design (mobile mockup 01) has the servers
first, after the messages, then what is live, then recent activity. The
phone now does so; the desktop keeps live rooms above the servers as in
desktop mockup 01. A live card on the phone is smaller, so a second one
shows beside it as in the design.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stream no decoder here takes would otherwise warn every three
failures for as long as it is watched; the first time says it all.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The official client sends AV1 from GPUs that encode it, so the decoders'
measurement covers it too: streams from av1_vaapi (hardware, as the
official client's AMF) and SVT-AV1 at 2560x1440 and 60 fps, decoded by
every decoder of the AV1 ladder and compared with dav1d's pictures. All
600 pictures from each, the same: av1_vaapi 301-309 fps, libdav1d (8
threads) 412-426 fps, libaom 240-286 fps (release build, RX 7900 GRE,
FFmpeg 9.0.1). The H.264 measurement shares the helpers now, and its
table in media.md gives the range of two runs on a desktop in use.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
architecture.md gets "Negotiation: best first, then fall back": every
place Voelin agrees on parameters with a peer or a system component
(codecs both ways, H.264 profile and level, SRTP, DTLS, ICE, the stream
connection, simulcast, feedback, socket buffers, loss repair, Opus, WHIP,
the gateway, the client version, capture and encoder backends), its
ladder, what counts as not accepted (refused in the negotiation or found
failing at runtime), and whether it was already so, changed now, or not
done and why. The transport section describes the stall checks and the
mDNS candidates.
AES-GCM first and DTLS 1.3 stay off, with the evidence: both work with
headless Chromium 152 and the SRTP fallback is proven to trigger, but
the streamer's half needs the official viewer to answer a reconnectOffer
it did not ask for, which nothing shows yet. The protocol notes say how
to find out with the official client; they and the interop README record
the Chromium findings (mDNS responder, DTLS 1.3, receiver reports when
SRTP fails).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
media.md describes the decoders (hardware through FFmpeg's hwaccel API,
then FFmpeg's software ones, then the built-in ones), hw_device_ctx and
how it is found, the self-test clips, the ladder on this machine, the
settings, the pipeline's fallback and loss recovery, the measurements of
H.264 with B-frames at 1440p60, and what was tested where (VA-API on the
RX 7900 GRE, the browser interop; NVDEC, D3D11VA, DXVA2 and VideoToolbox
only type-checked or not at all). The protocol notes say what Voelin now
accepts from official streamers and why their H.264 decoded so badly
before (OpenH264 and B-frames).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The conflicts were in the app: the settings a running window follows (the
quick share's audio sources, now also the decoder settings) and the
imports of video.rs; both keep both sides.
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>
Browsers and other libwebrtc builds hide their host addresses behind
mDNS names (<uuid>.local) unless they have camera or microphone
permission; the official client may do the same. str0m takes only IP
addresses, so such candidates were dropped (in the SDP silently, trickled
with a debug line), and a LAN connection worked only if the hiding side
happened to start the checks.
Candidates with an mDNS name, in a remote offer or answer or trickled,
are now resolved in the background by a multicast DNS query
(voelin_stream::mdns) and added as plain candidates; ICE takes whichever
pair works. The query goes out from port 5353, shared with the system's
responder, because Chromium's responder ignores queries from other ports
(tried: none answered from an ephemeral port, every one from 5353); where
5353 cannot be shared it goes out from a port of our own.
browser_mdns_candidates_connect runs headless Chromium with the names on
and keeps our candidates from it, so it cannot start the checks: both as
streamer and as viewer the connection comes up and the media flows (with
resolution switched off for a control run it timed out).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the phone screens and dialogs, the quick share's sound and the
voelinctl stream commands of every channel in before the add-server
dialog changes, so they are made on top of the current dialogs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
decode_into reuses the caller's frame and the decoder's own download
frame, so a running decoder should make no Rust allocation per picture.
A counting global allocator (as the mixer's and the studio's tests have)
checks it for every decoder that passed its self-test, the VA-API ones
included: here av1_vaapi, hevc_vaapi, vp9_vaapi, h264_vaapi, libdav1d,
libaom-av1, hevc, vp9, h264 and vp8 make none over 30 pictures at
640x360. FFmpeg's own buffers are its mallocs and its pools.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Android check of voelin-media without default features failed after
Wave 6A: RTMP's queue, backoff, backlog and interleave constants and the
queued packet's fields are only used by the FFmpeg session, so without the
`ffmpeg` feature (where RTMP only refuses) they were dead code. The
constants are now compiled with the feature only, and the packet struct
says why its fields go unread without it.
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>
On the phone several settings pages were wider than the screen and
shifted out of it: a choice row kept its segmented control (up to 340px)
beside its label, so Notifications, Privacy & Safety and Streaming were
cut at the right, their labels squeezed into narrow columns that ran
into the next row. Advanced's settings list, the audio sources and the
identities did the same with fixed-width keys, sliders and buttons.
On the phone (the narrow layout) a choice or a number now goes under its
label across the card, a setting's key above its value, an audio
source's gain on a line of its own and an identity's buttons under its
name; layer fields and the source buttons wrap. The desktop keeps them
on one row as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The official client sends AV1 from modern GPUs, and H.264 after it
re-aligns; nothing checked that our viewer takes what a libwebrtc sender
produces. Headless Chromium now offers its canvas in AV1, VP9 and H.264
in turn to our viewer peer, configured with peer_config like a watch
(accepting what this machine decodes), and a VideoPipeline must decode
30 pictures of each at the canvas's size with the first decoder of the
codec's ladder, keyframe requests going back as PLIs.
Chromium 152 (Arch Linux, VOELIN_CHROMIUM=/usr/bin/chromium) sends all
three; here they decode on the GPU (av1_vaapi, vp9_vaapi, h264_vaapi).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switching clients should not mean a new unique id. On every start the app
now does what `voelinctl identity import --auto` does: identities in the
official TeamSpeak 3/6 clients' databases that Voelin does not have yet
are added, the files opened read-only and immutable as before. The
identity the official client uses by default (field 5 of its payload, now
read into `Found::selected`) goes in first, so when Voelin has no identity
of its own yet, that one becomes Voelin's default and servers see the same
unique id; an existing default stays.
What was imported is shown once in the status line (the toast on
desktop), by nickname. The runtime setting
identity.import_from_teamspeak (default on) turns it off; the sample data
of VOELIN_DEMO_UI never imports. The settings are now opened before the
identity is chosen. Tested with synthetic databases only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loopback tests show the ladder between two of our peers; whether
NoFeedback fires depends on what a libwebrtc viewer sends back when its
SRTP does not work, and on it not firing for a working one.
browser_srtp_failure_is_noticed puts the relay between our streamer
peer and headless Chromium 152. With AES-GCM first, our peer (the DTLS
server) selects AEAD_AES_128_GCM, the relay drops all SRTP after the
handshake, Chromium decodes nothing and its receiver reports never
mention our video: NoFeedback after 2 s. The next connection, offering
AES_CM_128_HMAC_SHA1_80 only (what the session's fallback offers),
decodes 90 of 90 frames and raises no NoFeedback.
The relay now drops the candidates it does not stand in for, since a
browser lists one per network interface.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report has the decoders now: print them like the encoders, with
their self-test results and rank, and the order a viewer tries each
codec's decoders in. --decoder and --no-hardware-decoding rank them as
the settings stream.decoder_backend and stream.hardware_decoding would.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watching the official client's stream (H.264 from AMF at 2560x1440 and 60
fps, with B-frames and rare keyframes) had a very bad frame rate in the
app, which decoded it with Cisco's OpenH264. Two ignored measurements
reproduce such a stream with the ffmpeg command (x264 with 3 B-frames,
h264_vaapi with 2, ten seconds of testsrc2 at 8 Mbit/s, keyframes every
ten seconds).
ffmpeg_decoders.rs decodes it with every H.264 decoder as fast as it
goes. Release build, RX 7900 GRE, FFmpeg 9.0.1, OpenH264 2.6.0:
h264_vaapi 398-424 fps, slowest frame 4.0-6.8 ms, every picture
h264 276-302 fps, slowest frame 6.6-8.0 ms, every picture
openh264 8 of 600 pictures, 592 errors: it does not decode B-frames
Both FFmpeg decoders give the same pictures (thumbnails compared), in
order.
decode_rate.rs plays it in real time into a VideoPipeline whose consumer
converts every picture to RGBA as the app does:
ladder (h264_vaapi), no loss: 59.9 fps
ladder (h264_vaapi), a frame lost a second: 58.9 fps (concealed)
OpenH264 alone, either way: 0.8 fps
So the frame rate was OpenH264 failing on every B-frame and the pipeline
then waiting for keyframes; with FFmpeg's decoders first in the ladder
the stream plays at its full rate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A connection could reach "connected" and still show nothing: an SRTP
library that negotiates a profile it then cannot use (official clients
reportedly failed that way with AES-GCM), or a streamer that has no
encoder for the codec our answer took. Nothing noticed; the viewer
waited forever.
Now each peer checks once per connection whether media gets through:
a viewer's peer reports NoVideo (with whether audio came) when no video
arrived within PeerConfig::stall_timeout (5 s), a streamer's peer
reports NoFeedback when, after twice that, none of the viewer's receiver
reports (or REMB) mentioned our video. Keyframe requests do not count:
a viewer that gets nothing keeps asking. The streamer waits longer so a
Voelin viewer steps down first.
The sessions then ask for a new connection with the next lower set,
logging each step: without the SRTP profile that was negotiated (both
AEAD profiles when it was one of them), or, when audio came but video
did not, without the video codec. A viewer sends `reconnect`; a
streamer sends a `reconnectOffer` itself, for viewers that do not step
down. What was left out stays out for that viewer; when nothing is left
the step is logged and nothing loops.
Proven with two sessions through a relay that passes the handshake and
drops SRTP once AES-GCM was selected (and with a source whose video is
only VP8 while the answer took VP9): each side falls back to
AES_CM_128_HMAC_SHA1_80 (or VP8), the media arrives, and the working
connection does not step again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A server published only through TSDNS, like ts.faumaray.ru (no SRV
record, its TSDNS at faumaray.ru:41144 answers another host and port),
could not be reached without typing the port: the resolver went from the
_tsdns._tcp SRV lookup straight to port 9987. The official client asks a
TSDNS server directly at the address's parent domains on 41144 in that
case, and so does Voelin now, in the official order: SRV _ts3._udp, TSDNS
(the servers _tsdns._tcp names, else the ones at each parent domain down
to the last two labels), then A/AAAA on 9987.
The steps start at once and their addresses come out in that order; each
step is given up after 10 s and a TSDNS server after 3 s, so a port a
firewall drops does not stall connecting. A port typed with the address
now overrides the port of every result. SRV records of weight 0, the usual
weight, were dropped by the weighted ordering and are kept now.
The lookups are injectable inside the module; the tests use a fake TSDNS
server on 127.0.0.1 and fake names, and the upstream tests that need the
internet are ignored. Recorded as local patch 11 in UPSTREAM.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A watched stream now decodes with the best decoder of its codec and,
when it fails, with the next of the codec's ladder, without ending the
watch: three failures in a row (errors, or ten frames without a picture)
replace it, the keyframe that failed starts the next one at once, and
otherwise a keyframe is asked for. Each switch is logged with its reason,
and DecodeStats tells the decoder in use.
The official client's H.264 has B-frames and rare keyframes, and the
pipeline dropped every frame after a loss or an error until the next
keyframe, which such an encoder seldom sends. Decoders that conceal what
a loss leaves missing (FFmpeg's H.264 and HEVC) now go on decoding while
a keyframe is asked for; the others still skip to it. Whenever one is
wanted it is asked for again every half second until it comes, also
while no frame arrives, instead of once per skipped frame.
Pictures come from a small pool and go to the callback as
Arc<VideoFrame>: decoders write into a free one (decode_into), and a
consumer that converts and drops each picture, as the app does, costs no
allocations.
Settings stream.hardware_decoding and stream.decoder_backend choose the
decoders like the encoder settings (decoder_preference); the app applies
them when they change, to streams watched from then on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watching an official client's stream failed partly because the app
decoded too little: no AV1 (the official client prefers it on modern
GPUs), and H.264 only with Cisco's OpenH264 downloaded. FFmpeg, already
loaded at runtime for the encoders, now decodes too, never linked or
shipped: the platform's hardware decoders through FFmpeg's hwaccel API
(VA-API and NVDEC on Linux, D3D11VA and DXVA2 on Windows, VideoToolbox on
macOS) for AV1, HEVC, VP9, H.264 and VP8, then FFmpeg's software ones
(dav1d, libaom, its own HEVC, VP9, H.264, VP8).
Hardware decoders get AVCodecContext.hw_device_ctx, located next to
hw_frames_ctx from the AVOption offsets of its neighbours and checked in
a new context like the encoders' fields; FFmpeg's default get_format
then picks the device's surfaces. Pictures are copied out of the GPU
into a frame of our own and into the caller's VideoFrame through the new
VideoDecoder::decode_into, both reused, so a running decoder allocates
nothing per picture on our side. Slice threads only and dav1d with a
frame delay of one keep the latency at zero.
A self-test per decoder, run once per process in parallel with the
encoders' probe, decodes a three-frame clip of each codec made by our
own encoders (src/ffmpeg/clips): each picture at once, at its size,
above 30 dB against the test picture, and on the GPU for a hardware
decoder, since FFmpeg silently decodes in software when the GPU lacks
the codec (VP8 on AMD).
Codecs now orders a ladder per codec (decoders_for): hardware, FFmpeg's
software decoders, then the built-in libvpx, OpenH264 and dav1d, under a
DecoderPreference like the encoders'; decoders() lists every codec one of
them decodes, best first (AV1, HEVC, VP9, H.264, VP8). The report lists
the decoders too. Tested here (RX 7900 GRE, FFmpeg 9.0.1): VA-API decodes
AV1, HEVC, VP9 and H.264 on the GPU, and every encoder of the machine
decodes with every decoder of its codec above 36 dB.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
media.md: H.264 offered as Constrained High then Constrained Baseline,
one encoder per format viewers chose, and the tests that prove it (the
SPS profiles, a Baseline-only viewer, headless Chromium answering the
Baseline entry). The protocol notes and the interop README record what
Chromium 152 does with the ladder; architecture.md the socket buffers
and how losses are repaired, with the measurements.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They were taken before the Share button's menu took over from the
separate Stream Studio buttons and before the phone's studio lost the
bottom bar, so they showed a top-bar button that is gone, the bar and
the old Chat tab. Taken again headless (desktop 1440x1000, its window
1600x1000, phone 390x844 and 390x1250).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release workflow and the Docker build install build-tools 36.0.0, as
docs/android.md asks, but AGP 8.13 wanted its default, 35.0.0: it
installed that one itself where the SDK licences were accepted, and
elsewhere the build stopped. app/build.gradle.kts now pins 36.0.0, and
the debug APK (arm64-v8a and x86_64) builds with an SDK that has only
platform 36, build-tools 36.0.0 and the NDK 27.3: the Gradle 8.14.3
wrapper on Temurin JDK 17, Kotlin without warnings.
docs/android.md had none of this wave: the voice notification as the
app's voice card (Mute, Deafen, Leave, tap to open the voice screen), the
live stream's notification, the screen drawn straight into the encoder's
input surface and the reader for simulcast, the app picker with icons,
Camera2 cameras with the CAMERA permission, Share to Voelin, what was
tested where (the Rust sides, headless screenshots, compile-only parts),
a known gap (no camera foreground service) and how to try it on Waydroid.
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>
At the design's size the home column ended below the window: its
section titles were taller than their text, the banner had more padding
and the recent chats did not show. The titles now hug their text, the
banner is a little lower, so banner, friends, live rooms, servers and
recent chats fit as in mockup 01; the four recent chats share their row
evenly instead of the last being cut.
The friends row showed a cut bubble at its edge and pushed Find Friends
out of sight; it now shows as many whole bubbles as fit with Find
Friends right after the last one (the rest scroll in). A live room's
picture fills the card with the title, streamer and tags over its
darker lower part, and a round arrow at the row's edge brings the next
one in, as in the design. Friend activity rows sit close together so
the right column shows what is happening below them.
On a server, the Members entry above the channel tree is no longer
marked while the members panel is open: the design shows it unmarked,
and the header's button already shows the panel. Offline messages in the
inbox show a mail sign without the sender's initials under it, and the
sample data has some, so the Inbox tab renders headless.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A streamer offered H.264 only in Constrained High, which peers whose
decoders list no High profile (headless Chromium's libwebrtc, many other
WebRTC stacks) cannot answer, so an H.264 stream had no way to reach them.
The offer now lists both profiles, best first (PT 112 Constrained High,
PT 108 Constrained Baseline, at the level the stream needs). The answer's
payload type tells the streamer which one the viewer took
(PeerEvent::VideoCodec now carries a VideoFormat: the codec, and H.264
with its profile). The streamer already ran one encoder per codec viewers
chose; it now runs one per format, so a Baseline viewer gets frames from
an encoder in Constrained Baseline, and frames go only to viewers of
their format (LayerFeedback has a bit for it).
voelinctl's FrameSource path offers Constrained High alone, as it cannot
encode per viewer. The browser test now offers the ladder and checks the
SPS profile of what it sent against what the browser chose.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The "Share screen" dialog had one switch for sound, "Share system audio",
which shared whatever stream.audio_sources held: changing what the
stream carries (an application, the microphone, desktop audio without
Voelin) or how loud meant the Stream Studio or the settings, and a
running share never followed.
The dialog now shows the studio's audio mixer while the switch is on
(off still means no audio at all): the studio's MixerRow for each source
(meter, gain, mute, the menu) and Add, which opens the studio's
PickDialog over the dialog to switch several sources on and off. They
read the main window's StudioBridge, filled without starting the studio
(App::mixer_show). Starting a share hands the sources with their gain
and mute to the capture (CaptureRequest::audio_sources); the stream
announces sound only when there is some. While it runs, the dialog
shows the same rows with the share mixer's meters, about 15 times a
second (the share keeps the timer), and every change of
stream.audio_sources, from the dialog or anywhere else (the settings
change event), goes to the running capture at once through
Capture::follow_audio, which reconfigures the streamer. A share started
without sound has no audio track, so the dialog says so instead.
The studio's rows and meters follow whichever streamer goes out: a quick
share's while one runs, else the studio's encoder. The picker's
application list is let go once neither the dialog nor the studio needs
it. With sample data, VOELIN_OPEN=share:live shares the test pattern
with the sample studio's sources, live at once with sample viewers, and
Stop ends it, as the studio's demo does. On a phone the frame-rate and
bitrate fields of the dialog no longer run past its edge.
Tests: capture_request carries the picked sources with gain and mute,
and nothing with the switch off or no sources; a running capture on the
test pattern follows changed sources, keeps a silent track when all are
removed, and one started without sound stays so. Headless screenshots
of the dialog before and during a share, 1440x900 and 390x844.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new smoke step (a viewer in the default channel watching a stream in
another channel) failed: `voelinctl stream watch` waited forever. Unlike
the app's engine and voelinctl's tree and repl, the stream commands never
subscribed to the other channels, and the server shows a client, and so
its streaming flag, only in subscribed channels; discovery never learned
there was a stream to look up. They now subscribe to every channel on
start, as the engine does.
Checked on the TS6 dev server: a viewer in the default channel received
and decoded 60 pictures (1280x720) of a stream in `smoke-elsewhere`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the streams of every channel (StreamItem::channel, the streams
panel listing other channels' streams after ours, the viewer's channel)
and the answer to a streamer's new offer.
streams.rs keeps both of the viewer's new values: whether the streamer
is an admin (this branch) and the stream's channel (the development
branch). The phone's pieces that list Bridge.streams now say where a
stream of another channel is: the voice screen's stream cards ("Lumen ·
in Gaming") and Home's Live now cards, whose comment and the server
rail's live flag no longer claim they are about our channel only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RTMP output for the Stream Studio through libavformat (any stream codec,
pushed as H.264 + AAC; tested against `ffmpeg -listen 1`, ffprobe checks),
MJPEG cameras (decoded off the capture thread), TeamSpeak 6's own viewer
counts (`viewer` of `notifystreaminfo`, refreshed round robin), a viewer
quality picker for Voelin streams (`a=x-voelin-layers` in the offer, an
`x-voelin-layer` signal only Voelin streamers get), viewer-side stats over
the player, Windows cameras through Media Foundation (compile-checked
only), and the docs for all of them.
Merged cleanly with server-wide stream discovery and renegotiation; the
viewer-count refresh now covers every channel's streams. fmt, clippy and
the tests of stream, media, core, ui and voelinctl pass.
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>
The voice screen's Go Live button said "Go Live" while the Stream Studio
was live, as it only followed a quick share: it now reads "Live" for
either.
The phone screenshots in docs/screenshots are taken again for this
wave's screens: the voice channel with the stream on top (mockup 02),
the Activity tab, and Home, Servers, Chats, You and Settings with the
header's voice button and the bottom bar as they are now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watching a stream from the official client failed. Its log shows why:
after our answer it decided our codec choice did not suit it ("remote peer
is using unsupported codec, realign") and sent a new offer on the same
connection, a renegotiation. Voelin answered every offer with a new peer:
new ICE credentials, new DTLS fingerprint (the official client logged both
answers, they differ), so the connection the official client kept using
was gone and no picture came.
- `Peer::renegotiate` answers a new offer on the running peer (str0m
`accept_offer` on the same Rtc): same ICE credentials and fingerprint.
- The viewer uses it for an `offer` signal while it has a connection; a
`reconnectOffer` still starts a new one.
- str0m answers a renegotiation in the codec order the connection was
built with, so a streamer re-offering another codec first kept sending
the old one; `order_like_offer` puts the answer's payload types in the
new offer's order.
Tests: a unit test (a str0m offerer adds audio in a new offer; same ICE
credentials and fingerprint, audio answered) and the order helper; the
browser interop test `browser_renegotiates_with_rust` (Chromium streams
VP8, re-offers VP9 on the same connection, VP9 frames arrive), passing
with Chromium 152.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The server announces a stream only to the clients in the streamer's
channel. Voelin looked up streams that started before it joined
(`requeststreaminfo`), but only in its own channel, so a stream anywhere
else on the server appeared only through a gateway's directory. The
official client lists and joins them without one: `requeststreaminfo`
answers from any channel, and a `joinstreamrequest` from another channel
reaches the streamer (confirmed on the TS6 dev server with the probe).
- Discovery follows every streaming client on the server: it looks up
the streams of clients in other channels as soon as they stream, keeps
them when we or they change channels, and drops them when the streamer
stops or leaves.
- The streams panel lists every channel's streams, ours first, the
others with their channel ("by X · in Gaming"); clients still being
looked up show in any channel. The viewer's note names the stream's
channel instead of claiming it can only be watched from there.
- As a streamer with `stream.permissions = channel` (the default), our
channel is let in and viewers from other channels are asked, as the
setting's description ("who may watch without being asked") says;
they were refused before.
Tested: discovery unit tests for the new rules; the engine's permission
test; the app headless (no gateway) on the TS6 dev server found and played
a stream in another channel and one that started before it joined;
scripts/it-smoke.sh gains a step where a viewer in the default channel
watches a stream in another channel.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The banner's slide arrows were bare chevrons in the corners, level with
the dots; the design draws them as dark round buttons with a light ring,
level with the banner's button, the dots a little lower in the middle.
The home sidebar's picture sat in a box inside the panel: its side
edges and a short, linear fade at the top showed where it began, and a
spacer under it (only on the home page) left an empty band above the
voice card. It now reaches the panel's edges, fills the sidebar down to
the cards as on the friends and messages pages, and its top fades into
the panel over half its height, easing out.
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>
The Camera2 provider landed without its description in the studio's
docs: how its frames reach a camera source (YUV_420_888 planes borrowed,
gathered into I420 only when turned or NV21), mirroring by default for
cameras facing the user, Switch camera, and what was tested where.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Screen sharing went MediaProjection -> ImageReader -> an owned Vec per
frame -> RGBA to NV12 on the CPU -> MediaCodec's input buffers: two
copies and a conversion of every frame on a phone's CPU.
Now, while it is the only MediaCodec encoder in the process (one
simulcast layer, one codec), an encoder takes GpuFrames: for the first
it starts a codec with an input surface (COLOR_FormatSurface,
max-fps-to-encoder at the stream's rate, repeat-previous-frame-after so
a still screen answers keyframe requests) and publishes it, and the
capture points its virtual display at that surface, resized to the
layer's size. The compositor renders the screen into the encoder; a
ticker at the stream's rate hands the sink GpuFrames that only collect
what the codec encoded, on the capture's timeline.
Simulcast keeps working by falling back: a second encoder (another
layer, or another codec a viewer chose) turns the path off for every
encoder and the display goes back to the reader, until it is the only
one again. One display can only render into one surface, and a GL
fan-out to several encoder surfaces is a lot of code for a case phones
rarely need. An encoder whose surface fails stays on frames in memory.
The fallback path no longer copies either: the provider's start_sink
hands the reader's buffer to the stream's sink borrowed. A frame-rate
change restarts the surface codec (its cap is fixed when it starts),
and the display is detached while it is resized, so neither consumer
sees a picture of the other's size.
Compiled for aarch64-linux-android only: there is no device here, so
frames per second and CPU use are not measured.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
media.md still described the studio as recording, replay and WHIP, and
its dependency table did not list what the studio's MJPEG cameras
(zune-jpeg) and its person segmentation (tract-onnx with the bundled
PP-HumanSeg model) build on.
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>