wiki: mirror docs/ of main at ad20979

faumaray committed 2026-10-24 13:26:34 +03:00
1 parent be1bc1eda0
commit ceaea17849
75 files changed
+7390 -1

No files matched your search

+74
@@ -0,0 +1,74 @@
Home.md
android.md
architecture.md
audio.md
building.md
ci.md
gateway-admin.md
gateway-protocol.md
i18n.md
identity.md
media.md
protocol-notes%2Fts6-streaming.md
release.md
research%2Fmyteamspeak.md
research%2Fstream-fps.md
research%2Fts6-late-join.md
research%2Fui-review.md
screenshots/banners-desktop-dark.png
screenshots/banners-desktop-light.png
screenshots/banners-desktop-voice.png
screenshots/banners-mobile-chat.png
screenshots/banners-mobile-servers.png
screenshots/banners-mobile-voice.png
screenshots/desktop-about.png
screenshots/desktop-add-server.png
screenshots/desktop-client-volume.png
screenshots/desktop-emoji-picker.png
screenshots/desktop-events.png
screenshots/desktop-friends.png
screenshots/desktop-home.png
screenshots/desktop-library.png
screenshots/desktop-light.png
screenshots/desktop-member-card.png
screenshots/desktop-messages.png
screenshots/desktop-notifications.png
screenshots/desktop-pins.png
screenshots/desktop-popout.png
screenshots/desktop-search.png
screenshots/desktop-server.png
screenshots/desktop-settings-appearance.png
screenshots/desktop-settings-integrations.png
screenshots/desktop-settings-profiles.png
screenshots/desktop-settings-voice.png
screenshots/desktop-share-dialog.png
screenshots/desktop-share-live.png
screenshots/desktop-stream-viewer.png
screenshots/desktop-studio-detached.png
screenshots/desktop-studio-live.png
screenshots/desktop-studio-source.png
screenshots/desktop-studio-window.png
screenshots/desktop-studio.png
screenshots/desktop-topic.png
screenshots/desktop-topics.png
screenshots/desktop-voice.png
screenshots/mobile-activity.png
screenshots/mobile-add-server.png
screenshots/mobile-chat.png
screenshots/mobile-events.png
screenshots/mobile-friends.png
screenshots/mobile-home.png
screenshots/mobile-messages.png
screenshots/mobile-notifications.png
screenshots/mobile-servers.png
screenshots/mobile-settings-streaming.png
screenshots/mobile-settings.png
screenshots/mobile-share-live.png
screenshots/mobile-share.png
screenshots/mobile-studio-details.png
screenshots/mobile-studio.png
screenshots/mobile-voice.png
screenshots/mobile-you.png
studio.md
testing%2Fmanual-matrix.md
ui.md
+170 -1
@@ -1 +1,170 @@
# VoelinClient
# Voelin
Voelin is a TeamSpeak 3 / TeamSpeak 6 compatible voice client written in Rust, for desktop
(Linux Wayland/X11, Windows, later macOS) and mobile (Android, later iOS).
It speaks the TeamSpeak client protocol itself (no official SDK). The protocol
layer is a vendored fork of [ReSpeak/tsclientlib](https://github.com/ReSpeak/tsclientlib).
> Not affiliated with or endorsed by TeamSpeak Systems GmbH. "TeamSpeak" is a
> trademark of its owner.
## Goals
| Feature | How |
|---|---|
| Global server chat | Native `sendtextmessage targetmode=3` |
| Chat in channels without joining their voice channel | Relay through invisible ServerQuery sessions (companion gateway `tsgw`, or own query credentials). The protocol only delivers channel chat for the channel you are in. |
| Voice | Opus over the TS3 UDP protocol, echo cancellation, jitter buffer |
| See who is in voice channels without joining | Channel subscriptions when connected; invisible presence through the gateway or own query credentials |
| Watch and share screen with sound | TeamSpeak 6 servers only: WebRTC peer-to-peer streams signalled through the server |
See [docs/architecture.md](architecture) for the design and milestones.
## Status
Done so far (milestones M0–M4 and the first part of M5 of [the plan](architecture#milestones)):
- `crates/proto/`: vendored tsclientlib, modernised (TS6 fields and stream
messages, faster off-thread Init1 puzzle, `curve25519-dalek` 4, fuzzing fixes;
see [UPSTREAM.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/crates/proto/UPSTREAM.md))
- `crates/voelin-model`: server flavor detection (TS3 / TS6) and capabilities
- `crates/voelin-audio`: Opus voice encoding, framing, resampling, WAV, jitter buffer/mixer, cpal devices
- `crates/voelin-store`: SQLite store for identities, bookmarks, settings and chat history; keyring secrets
- `crates/voelin-query`: ServerQuery client over raw TCP, SSH and HTTP WebQuery (events, rate limiting, keepalive)
- `crates/voelin-observer`: invisible presence (events or polling) and channel-chat relays over ServerQuery
- `crates/voelin-gateway` (`tsgw`) + `voelin-gateway-proto`: companion gateway for server admins. Users log in
with their TeamSpeak identity and get presence, channel chat and history without joining voice,
limited by their server permissions ([admin guide](gateway-admin))
- `crates/voelin-core`: client engine; sessions merge voice, gateway and query sources, route chat, run audio;
chat history (stored on the device, synced with the gateway when a chat opens); the gateway's pins,
reactions, topics, events, stream directory and administration; the media pipeline for streams
(capture → VP8 + Opus → stream, stream → decoder)
- `crates/voelin-ui` (`voelin`): Slint desktop app: servers, channel tree with talking indicators,
chat tabs (own channel via voice, other channels via relay), connect, observe invisibly (on selecting a server, through its gateway), mute, push-to-talk
(in the window and as a global hotkey), audio settings with a level meter, per-client volume, and on
TeamSpeak 6 streams: watch in a viewer, share the screen with sound. Desktop and phone layouts
from one design system, dark and light themes, text size, emoji ([docs/ui.md](ui))
- `crates/voelin-ui-vm`: the view models and the app's state behind the UI, with no UI toolkit: engine state
as plain rows and forms, chat formatting, the Twemoji archive, and what the settings pages and the
Stream Studio decide; `voelin-ui` puts them on Slint windows ([docs/ui.md](ui))
- `crates/voelin-stream`: TeamSpeak 6 streams: stream commands and notifications, JSON signalling,
WebRTC peers (str0m) with host and STUN candidates. A live test streams VP8 + Opus between two
clients through a TS6 server
- `tools/voelinctl`: headless CLI: channel tree, chat, voice send/record, raw commands, stream events,
`query`, `observe` (invisible presence), `relay` (channel chat without joining) and `gateway`
(also through the engine with `--engine`: chat history, gateway requests, stream directory)
- `dev/`: TeamSpeak 3.13 and TeamSpeak 6 (6.0.0-beta13.1) servers; `scripts/it-smoke.sh`
checks tree, server chat, channel chat, a voice tone round-trip, invisible presence,
relay chat, the gateway, chat history sync, pins/reactions/topics and the stream directory
- `fuzz/`: cargo-fuzz targets for packets, commands and the license chain
- `android/` + `crates/voelin-android`: the Android app (the same Slint UI in a NativeActivity,
voice in a foreground service, screen sharing through MediaProjection, MediaCodec, Keystore
passwords). It builds; it has not run on a device yet ([docs/android.md](android))
Screen sharing works between our clients through a TeamSpeak 6 server (VP8 video, Opus audio);
interop with the official TeamSpeak 6 client is not verified yet.
The UI (design system, desktop and phone layouts, emoji, how to add a screen) is described in
[docs/ui.md](ui). Screenshots with sample data (`VOELIN_DEMO_UI=1`):
| Server, chat and people in the channel | Watching a stream |
|---|---|
| ![server](raw/screenshots/desktop-server.png) | ![viewer](raw/screenshots/desktop-stream-viewer.png) |
| **Settings** | **Phone layout** |
| ![settings](raw/screenshots/desktop-settings-voice.png) | ![phone](raw/screenshots/mobile-chat.png) |
## Try it
```sh
# Desktop app
cargo run -p voelin-ui --bin voelin
# Local servers (use REGISTRY=mirror.gcr.io if Docker Hub rate-limits you)
docker compose -f dev/docker-compose.yml up -d
cargo run -p voelinctl -- connect 127.0.0.1:9987 tree # TeamSpeak 3
cargo run -p voelinctl -- connect 127.0.0.1:9988 tree # TeamSpeak 6
cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me repl # interactive chat
cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me voice send --tone 440
cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick ear voice record out.wav
# Streams (TeamSpeak 6): share the test pattern (or --source x11), watch and decode it
cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick eye stream watch --save-frame shot.png &
cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me stream start --synthetic --auto-accept
# Simulcast layers without an encoder; prints each viewer's layer, estimate and SRTP profile
cargo run -p voelinctl -- connect 127.0.0.1:9988 --nick me stream start --placeholder --auto-accept \
--layer 1.0:6000k --layer 0.5:1500k:min=800k
# ServerQuery (dev password voelin-dev-admin): invisible presence and relay chat
cargo run -p voelinctl -- observe ssh 127.0.0.1:10022 --secret voelin-dev-admin --allowlisted
cargo run -p voelinctl -- relay ssh 127.0.0.1:10022 --secret voelin-dev-admin --allowlisted --channel 1
# Gateway: users without voice, logging in with their identity
cargo run -p voelin-gateway -- --config dev/tsgw-ts6.toml &
cargo run -p voelinctl -- gateway ws://127.0.0.1:7788/v1 --identity <file> --presence --open channel:1
# ... through the engine: stored history synced with the gateway, then a request
cargo run -p voelinctl -- gateway ws://127.0.0.1:7788/v1 --identity <file> --engine \
--db /tmp/chat.db --chat channel:1 --older 1 --request '{"pins":{"target":{"kind":"channel","id":1}}}'
scripts/it-smoke.sh # all of the above, on both servers
```
Other commands: `voelinctl identity new`, `voelinctl versions`, `voelinctl connect <addr> listen|chat|raw`.
`voelinctl --help` lists all options.
Development switches of the desktop app (environment variables): `VOELIN_DATA_DIR` (database),
`VOELIN_AUTOCONNECT=voice|observe`, `VOELIN_SCREENSHOT=<png>` (with `VOELIN_SCREENSHOT_DELAY`),
`VOELIN_WINDOW_SIZE=<w>x<h>`, `VOELIN_DEMO_UI=1` (sample servers and chat, no server needed),
`VOELIN_DEMO_STREAM=1` (a local test stream in the viewer),
`VOELIN_OPEN=home|settings[:<section>]|about|share|bookmark|emoji|client|tab:<tab>` (comma-separated),
`VOELIN_AUTOWATCH=1`, `VOELIN_AUTOSHARE=test-pattern`; details in [docs/ui.md](ui).
Ready-made packages (Linux `.tar.gz`/`.deb`/Flatpak, Windows zip and installer, Android APK,
and the `tsgw` gateway for Linux servers) come from the release workflow (version tags, or run by
hand), and `scripts/docker-build.sh` builds the same ones locally in Docker: see
[docs/building.md](building).
Building on Linux needs the ALSA headers (`libasound2-dev`), fontconfig and xkbcommon
headers for the UI (`libfontconfig1-dev libxkbcommon-dev`), plus CMake and a C compiler for
the bundled libopus; for streams also libvpx and PipeWire (see [docs/media.md](media#build-requirements)).
## License
The vendored crates in `crates/proto/` are `MIT OR Apache-2.0` (upstream
`LICENSE-MIT` / `LICENSE-APACHE` are kept there). New crates are declared under
the same terms in `Cargo.toml`.
Third-party notices: [THIRD_PARTY_NOTICES.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/THIRD_PARTY_NOTICES.md), generated from
`Cargo.lock` by `scripts/notices.sh` and shown in the app's About page. The UI toolkit,
Slint, is used under its royalty-free license, which requires an attribution in the
About page. The UI bundles the Inter font (SIL OFL 1.1), Lucide icons (ISC) and Twemoji
graphics (CC-BY 4.0); `scripts/notices.sh` appends their notices from `about-assets.md`.
Security issues: see [SECURITY.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/SECURITY.md). Releases: [docs/release.md](release).
---
## Documentation pages
Mirror of `docs/` on `main` (`ad20979`). The repository files are the source; this wiki is regenerated by `.claude/wiki-sync.js`.
- [android.md](android): Android app
- [architecture.md](architecture): Architecture
- [audio.md](audio): Audio pipeline
- [building.md](building): Packages: from releases and built locally
- [ci.md](ci): CI
- [gateway-admin.md](gateway-admin): Running the tsgw gateway
- [gateway-protocol.md](gateway-protocol): Gateway protocol (`tsgw.v1+json`)
- [i18n.md](i18n): Translations
- [identity.md](identity): Identities
- [media.md](media): Media: frames, codecs and capture (`voelin-media`)
- [protocol-notes/ts6-streaming.md](protocol-notes%2Fts6-streaming): TeamSpeak 6: protocol notes
- [release.md](release): Releasing
- [research/myteamspeak.md](research%2Fmyteamspeak): myTeamSpeak
- [research/stream-fps.md](research%2Fstream-fps): Why watched streams played at a low frame rate
- [research/ts6-late-join.md](research%2Fts6-late-join): TeamSpeak 6: streams that started before we arrived
- [research/ui-review.md](research%2Fui-review): UI review, and what to take from TeamSpeak 6 and Discord
- [studio.md](studio): Stream Studio (`voelin_media::studio`, `voelin_core::studio`)
- [testing/manual-matrix.md](testing%2Fmanual-matrix): Manual test matrix
- [ui.md](ui): The user interface
+240
@@ -0,0 +1,240 @@
# Android app
The Android app is the desktop UI (`voelin-ui`, Slint) running in a
`NativeActivity`, plus a thin Kotlin layer for what only Java APIs can do:
foreground services and their notifications, the screen-capture consent,
the cameras, the share sheet, the Keystore.
```
android/ Gradle project (AGP 8.13, Kotlin 2.3, Gradle 8.14.3 wrapper)
app/src/main/java/.../voelin/ MainActivity (NativeActivity, Share to Voelin), Bridge,
Native, VoiceService, ScreenCaptureService, Notifications,
CameraCapture, SecretStore
crates/voelin-android/ libvoelin_android.so: android_main, engine host,
JNI glue, capture and camera providers, notifications
(foreground.rs), Keystore secrets
```
The phone layout of the UI (the voice channel with a stream, the bottom
navigation, the studio, the share dialog) is described in
[ui.md](ui); its screenshots are taken on the desktop at 390×844.
## Building
Requirements:
- Android SDK with `platforms;android-36` and `build-tools;36.0.0`
(`ANDROID_HOME`, or `sdk.dir` in `android/local.properties`), NDK
`27.3.13750724` (`ndk;27.3.13750724`; the versions are pinned in
`app/build.gradle.kts`)
- JDK 17 or newer
- Rust targets: `rustup target add aarch64-linux-android x86_64-linux-android`
- `cargo install cargo-ndk --locked` (4.x)
- CMake and make (or `CMAKE_GENERATOR=Ninja` with ninja): libopus is built
from source
```sh
cd android
./gradlew assembleDebug # arm64-v8a + x86_64 (emulator, Waydroid)
./gradlew assembleDebug -Pvoelin.abis=arm64-v8a # phones only, half the build
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb logcat -s RustStdoutStderr ScreenCaptureService VoiceService SecretStore
```
`assemble<BuildType>` runs `cargo ndk ... build -p voelin-android` (with
`--release` for release) into `app/build/rust/<build type>/<abi>/` before the
native libraries are merged; `-Pvoelin.skipCargo=true` packages what is there
(for CI steps that built the library already). The app's `versionName` is the
version of `crates/voelin-android`, and `versionCode` is derived from it
(docs/release.md). The Kotlin half of `rustls-platform-verifier` comes from
its Maven archive in the version `Cargo.lock` pins.
Release builds are minified (R8) and signed only when the signing settings
are given as Gradle properties (e.g. `~/.gradle/gradle.properties`) or
environment variables; nothing of it lives in the repository:
| Gradle property | Environment variable |
|---|---|
| `voelin.signing.storeFile` | `VOELIN_SIGNING_STORE_FILE` |
| `voelin.signing.storePassword` | `VOELIN_SIGNING_STORE_PASSWORD` |
| `voelin.signing.keyAlias` | `VOELIN_SIGNING_KEY_ALIAS` |
| `voelin.signing.keyPassword` | `VOELIN_SIGNING_KEY_PASSWORD` |
```sh
VOELIN_SIGNING_STORE_FILE=~/keys/voelin-release.jks VOELIN_SIGNING_STORE_PASSWORD=... \
VOELIN_SIGNING_KEY_ALIAS=voelin VOELIN_SIGNING_KEY_PASSWORD=... ./gradlew assembleRelease bundleRelease
```
minSdk is 29 (Android 10: MediaProjection foreground service type, playback
capture, NDK MediaCodec format queries); targetSdk and compileSdk 36.
## How it fits together
- **Entry**: the activity loads `libvoelin_android.so` (`android.app.lib_name`);
android-activity calls `android_main` on a new thread for every activity
instance. It installs crash reports (opt-in, `crash_reports` setting,
`<files>/crash-reports`), looks up the Kotlin `Bridge` class, initialises
`rustls-platform-verifier` (HTTPS certificate checks against the system
trust store), asks for the microphone and notification permissions, sets
Slint's Android backend and runs `voelin_ui::run` with the app's files
directory, Keystore secrets and the process's engine.
- **Engine for the process** (`host.rs`): one tokio runtime and `Engine`
per process. The activity may be destroyed while voice goes on; a new
window attaches and first receives events that rebuild the current state
(server info, state, presence, the last 300 chat messages per session,
streams), then live events (`voelin_ui::HostedEngine`). Back moves the task
to the background instead of finishing the activity; configuration changes
do not recreate it.
- **Voice in the background**: while any session has a voice connection,
`VoiceService` runs as a foreground service of type `microphone`. Its
notification has the channel as the title, the server and who is 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; with
several servers, "In voice on 2 servers" and their names. Tapping it
opens the voice channel screen (the activity hands the request to Rust,
which queues it until the window runs: `voelin_ui::request`). Rust
drives it from engine events (`foreground.rs`,
`Bridge.setVoiceNotification`). Audio itself is cpal on AAudio, as on
desktop.
- **Sharing the screen**: `voelin_media::capture::default_screen_capture()`
returns the MediaProjection provider (`capture.rs`) registered at start.
Starting shows the system consent dialog; on consent `ScreenCaptureService`
(type `mediaProjection`) mirrors the display, longest side at most
1920 px. While one MediaCodec encoder runs (one simulcast layer, one
codec: the common case) the virtual display renders straight into that
encoder's input surface, with no copy of a frame on the CPU; with more
encoders (layers, or a codec a viewer chose) it renders into an
`ImageReader` again, whose RGBA buffers go to the encoders borrowed
(`Native.onScreenFrame`), until one encoder is left ([media.md](media),
MediaCodec). System audio (`default_audio_capture()`) is
`AudioPlaybackCapture` of media, game and unknown usages, 48 kHz stereo
float, only while the projection runs; single apps are captured by their
uid (`addMatchingUid`), "every app but ours" excludes ours. While our
stream is live the notification says where and who watches ("Live in
Chill Zone", "Home · 2 watching") with Stop sharing. Ending the
projection from the status bar or the notification closes the capture
channels.
- **Choosing the stream's sound**: the share dialog and the Stream Studio
pick the sources of `stream.audio_sources` in the studio's picker:
the microphone, every app but ours, and the launchable apps
(PackageManager) with their own icons, several at once. Kotlin draws each
app's icon once per installed version into a 96 px PNG in the cache
(`Bridge.launchableApps`, `AudioApp::icon`). The shared window's audio is not
offered: a phone shares the whole screen.
- **Cameras** (the Stream Studio's camera sources): `CameraCapture.kt`
lists the Camera2 cameras (front first, their YUV sizes and highest frame
rate) and asks for the `CAMERA` permission when a camera is first opened
(the source shows why if it is refused). It opens the camera into an
`ImageReader` (`YUV_420_888`) at the wished size or the nearest (16:9
first, 1280×720 by default) and hands each frame's planes to Rust as
direct buffers valid during the call, with the turn that makes it
upright. Rust (`camera.rs`) passes upright planar or NV12 pictures on as
they are and gathers NV21 or turned ones into I420 in a buffer each
camera keeps: nothing is allocated per frame. Cameras that face the user
are mirrored by default; the source menu's Switch camera moves a source
to the next camera ([studio.md](studio)).
- **Share to Voelin**: the activity takes `ACTION_SEND` and
`ACTION_SEND_MULTIPLE` of any type. Text and links go into the composer
of the current chat, which the phone then shows (one tap sends them).
Files are copied out of the sending app while its content URIs are
readable, on a thread of their own, under the name the app gives (made
safe as a path component), then uploaded to the current chat's channel
(or the channel we are in) and linked there as the attach button does.
The copies live in the cache and are removed at the next start.
- **Watching and encoding**: `voelin_media::Codecs` uses the device's
MediaCodec encoders (hardware first) and decoders on Android
([media.md](media)).
- **Secrets**: `SecretStore` encrypts each password with AES-256-GCM under a
non-exportable Android Keystore key and keeps the ciphertext in private
preferences. The app disables Android backups (the database holds the
identity's private key).
- **JNI**: Rust calls static methods of `Bridge` (class looked up once on the
`android_main` thread, usable from any thread); Kotlin calls the
`external` methods of `Native`, exported by `native_method!` (panics and
errors become Java exceptions). Keep `bridge.rs`, `Bridge.kt` and
`Native.kt` in step.
Permissions: `INTERNET`, `ACCESS_NETWORK_STATE`, `RECORD_AUDIO`,
`MODIFY_AUDIO_SETTINGS`, `FOREGROUND_SERVICE` with `_MICROPHONE` and
`_MEDIA_PROJECTION`, `POST_NOTIFICATIONS`, `CAMERA` (asked for when a camera
is first opened; `android.hardware.camera.any` is optional).
## Status
| What | How | Status |
|---|---|---|
| `libvoelin_android.so` for `aarch64-linux-android` (Slint Android backend with Skia, AAudio, AWS-LC, SQLite, libopus) | `cargo ndk -t arm64-v8a build -p voelin-android` | builds; exports `android_main` and the `Native` methods |
| Debug APK | `./gradlew assembleDebug -Pvoelin.abis=arm64-v8a` | builds |
| Debug APK for phones and Waydroid (`arm64-v8a` + `x86_64`) | `./gradlew assembleDebug` on Linux: the Gradle 8.14.3 wrapper, Temurin JDK 17, an SDK with only `platforms;android-36`, `build-tools;36.0.0` and the NDK 27.3 | builds (Kotlin without warnings) |
| Engine host replay, voice service policy, the voice notification's text (deafen across sessions, several servers), the live stream's notice | unit tests (`cargo test -p voelin-android`) | tested |
| External capture providers, MediaCodec buffer layouts | `voelin-media` unit tests | tested |
| The phone screens: voice channel with a stream, Home, Servers, Chats, Activity, You, Settings, Stream Studio, the share dialog with its sound | headless screenshots at 390×844 ([ui.md](ui)) | tested on the desktop (the same Slint UI; not on a device) |
| A tapped voice notification opens the voice screen; text shared to the app lands in the composer | `VOELIN_OPEN=notification`, `VOELIN_OPEN=shared:<text>` on the desktop | the Rust side tested headless; the notifications, their actions, the share sheet and file uploads from it compile only |
| Cameras: YUV planes borrowed, gathered into I420, turned | `voelin-media` `camera::tests::camera_planes_are_borrowed_gathered_and_turned` | the Rust side tested; Camera2, the permission flow and switching compile only |
| The virtual display into the encoder's input surface, back to the reader for simulcast | `cargo ndk -t arm64-v8a clippy` | compiles only: frames per second and CPU use not measured (no device; Waydroid's encoders are software ones, if any) |
| The app picker with icons | the studio's and the share dialog's picker with sample data (headless) | the UI tested; the PackageManager list and its icons compile only |
| The app on a device: UI, voice in the background, screen sharing, watching, Keystore | manual matrix row IN3 and the Android rows | not run yet (no device or emulator in this environment) |
| Waydroid (Mesa GL) | the debug APK, `waydroid logcat` | works with the EGL workaround (below); before it, the app ended at start because Skia could not create its GL context |
Known gaps:
- The streams panel of the UI and the stream media pipeline of `voelin-core`
must build without the desktop media backends on Android (libvpx, X11,
PipeWire): `voelin-media` with `default-features = false` there, so that
`Codecs` uses MediaCodec.
- Rotating the device while sharing letterboxes the picture (the virtual
display keeps its size).
- Cameras deliver while the app is in front: there is no foreground service
of type `camera`, so Android stops a camera source when the app goes to
the background (the screen share goes on).
- The safe area (status and navigation bars) and the on-screen keyboard pad
the main window; dialogs drawn over it do not account for them yet.
- Only `arm64-v8a` and `x86_64` are built; 32-bit devices are not supported.
- No audio focus handling yet: a phone call does not pause our audio
(matrix row AN4). After a network change (Wi-Fi to mobile data) only
tsclientlib's own reconnect applies; untested on a phone.
### Mesa-based Android (Waydroid)
Slint draws with Skia over OpenGL ES. Before Skia looks up its functions,
Slint's surface loads glow's whole GL function table through
`eglGetProcAddress`. Android's libEGL gives every function it has no built-in
entry point for one of 256 "extension slots", and Mesa answers every name,
desktop GL included, so the slots run out; Skia then gets nothing for an
extension function it needs (`glTextureBarrierNV`) and the app ends right
after start:
```
E libEGL : no more slots for eglGetProcAddress("glTextureBarrierNV")
I RustStdoutStderr: … Could not create Skia Direct Context from GL interface
```
`crates/voelin-android/src/egl.rs` looks up Skia's extension functions once
at start, before Slint's surface, so they get slots first (logcat:
`EGL: N of 83 Skia extension functions resolved`). Vendor GPU drivers on
phones return nothing for desktop-only names and are not affected.
### Trying it on Waydroid
Waydroid on a PC runs the `x86_64` library, which the default
`assembleDebug` builds (`rustup target add x86_64-linux-android` first):
```sh
cd android && ./gradlew assembleDebug
waydroid app install app/build/outputs/apk/debug/app-debug.apk
waydroid app launch io.github.faumaray.Voelin
waydroid logcat | grep -E 'RustStdoutStderr|MainActivity|VoiceService|ScreenCaptureService|CameraCapture'
```
Things to try there: the bottom navigation (Home, Servers, Chats,
Activity, You), joining a voice channel and its screen from the top bar's
voice button, the voice notification (pull down the shade: Mute, Deafen,
Leave, tap it), Share from another app's share sheet (text, then a file),
the voice screen's Share menu: Share screen (the screen share dialog) with
sound from the audio picker (app icons) and its gain and mute while live,
and the Stream Studio with a camera source (Waydroid usually has no camera:
the source then says why).
---
*Mirrored from [`docs/android.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/android.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+636
@@ -0,0 +1,636 @@
# Architecture
This document condenses the project plan: what the client must do, which protocol
facts constrain it, how the code is organised, and the milestone order.
## Protocol facts that shape the design
- **Channel chat** (`sendtextmessage targetmode=2`) always goes to the sender's
*current* channel, on both TeamSpeak 3 and TeamSpeak 6. There is no protocol
way to read or post in another channel.
- **Presence**: a connected client always sits in some channel and is visible
there. Only ServerQuery clients are invisible. TeamSpeak 6 has no raw query:
SSH on 10022 and HTTP WebQuery (API key) on 10080/10443.
- **Screen sharing** exists only on TeamSpeak 6: peer-to-peer WebRTC (STUN only),
with the server relaying signalling commands (`setupstream`,
`respondjoinstreamrequest`, `streamsignaling`, `notifystream*`, ...). See
[protocol-notes/ts6-streaming.md](protocol-notes%2Fts6-streaming).
- `clientinit` must carry a `client_version_sign` signed by TeamSpeak, so the
client reuses known version/signature pairs (`voelinctl versions`).
- TeamSpeak 6 servers still accept the TeamSpeak 3 client protocol; verified with
`voelinctl` against 6.0.0-beta13.1.
### What "invisible" means for query clients (verified on 3.13.8 and 6.0.0-beta13.1)
The server does not hide ServerQuery clients: every client subscribed to a
channel receives `notifycliententerview` for query clients in it too
(`client_type=1`). Official clients hide a query client when its
`client_needed_serverquery_view_power` (100 for `serveradmin` by default) is
higher than the viewer's `i_client_serverquery_view_power` (only Server Admins
have it by default). So observers and relays are invisible to normal users of
official clients, visible to admins, and visible to third-party clients that
ignore the rule. This client applies the same rule.
TeamSpeak 6 ships with SSH and HTTP query disabled
(`TSSERVER_QUERY_SSH_ENABLED`, `TSSERVER_QUERY_HTTP_ENABLED`). HTTP guest
access (`query-http-allow-guest`, on by default) lacks list permissions unless
the admin grants them to the guest query group.
## How each feature is delivered
| Feature | Mechanism |
|---|---|
| Server chat | Voice connection: `targetmode=3`. Without one: gateway or own query session (`servernotifyregister event=textserver`) |
| Channel chat without joining | Relay pool (`voelin-observer`): invisible query sessions sit in channels and relay both ways; posts appear under the author's nickname |
| Chat history | Every message a session sees is stored on the device (`voelin-store`); a gateway's stored history fills in what the device missed (sync by revision, paging by time) |
| Pins, reactions, topics, events, stream directory, activity | Gateway features (`tsgw`), driven through `Command::Gateway` / `Event::Gateway` |
| Voice | tsproto UDP transport, Opus (`opus2`), echo cancellation / noise suppression (sonora), own jitter buffer, cpal / AAudio |
| Invisible presence | Gateway presence stream (snapshot + deltas from query events) or direct query; `channelsubscribeall` when voice-connected |
| Screen share with sound | TS6 stream signalling (`voelin-stream`), str0m WebRTC, per-platform capture and codecs (`voelin-media`) |
| Channel files, avatars, icons | Voice connection: `ftgetfilelist`, `ftinitdownload`/`ftinitupload` + TCP transfer, `ftdeletefile`/`ftrenamefile`/`ftcreatedir`; images cached on disk by content |
| Pokes, private messages, offline messages | Voice connection: `clientpoke`, `sendtextmessage targetmode=1`, `messagelist`/`messageget`/`messageadd`/`messagedel`/`messageupdateflag` |
| Friends, blocking | Contacts by unique id in the client database; presence of every session |
## Workspace layout
```
crates/proto/ vendored tsclientlib (tsproto, tsproto-packets, tsproto-types,
tsproto-structs + declarations, ts-bookkeeping, tsclientlib)
crates/<voelin-*> our crates (table below)
tools/voelinctl headless CLI
dev/ docker-compose TS3 + TS6 servers, gateway configs
scripts/ it-smoke.sh, own-crates.sh
fuzz/ cargo-fuzz targets
```
| Crate | Responsibility | State |
|---|---|---|
| `voelin-model` | UI-facing domain model (servers and their details, channels, clients, server and channel groups, chat and its file links, capabilities), no IO | done |
| `voelin-query` | ServerQuery codec and transports: raw TCP, SSH (russh), HTTP WebQuery | done |
| `voelin-observer` | Presence tracker + chat relay pool over `voelin-query` | done |
| `voelin-gateway-proto`, `voelin-gateway` (`tsgw`) | Companion service for server admins: identity-challenge auth, permission-mirroring authorization, presence stream, chat relay, SQLite history, WebSocket + JSON (`tsgw.v1+json`) | done |
| `voelin-store` | Identities (TeamSpeak, a Voelin key, the signed-in account, each with its account binding, as a `voelin-identity` `KeyStore`; see Identities), bookmarks, settings, chat history (dedupe, paging, sync cursors, where each chat was read), contacts, secrets (keyring / Android Keystore); versioned schema | done |
| `voelin-audio` | Capture/playback, Opus, echo cancellation, resampling, jitter buffer, mixer, VAD/push-to-talk; the voice packet types (`TalkerId`, `VoicePacket`, `EncodedVoice`), so it depends on no voice transport | v0 (no AEC yet) |
| `voelin-stream` | TS6 stream commands, JSON signalling, str0m peer connections, host/STUN candidates, streamer/viewer sessions, frame-source seam; its frame and simulcast layer types are `voelin-media`'s | sessions + transport |
| `voelin-core` | Engine: runtime, per-server sessions, merge of voice/gateway/query sources, the `ServerLink` seam the voice source sits behind (`link.rs`; `TsLink` is the TeamSpeak implementation, for now in this crate), event bus, command API, chat history, the gateway's features, audio settings and volumes, streams on TS6, files, avatar and icon cache, pokes, offline messages, contacts; `media` module (capture → encoder → stream, stream → decoder); the stream types of its API are its own (`stream_types`, see Streams) | done |
| `voelin-ui-vm` | The view models, toolkit-free: engine state turned into plain rows and forms (servers, channel tree, chat with its BBCode reader, social, streams, the Stream Studio, the settings pages), the app's state (`AppState`, sessions and chat tabs), `ImageRef`/`Rgb`/`list::diff`, the Twemoji archive. Depends on `voelin-core`, `voelin-model`, `voelin-store`, `voelin-gateway-proto` and `voelin-audio`, on no UI toolkit; a front end converts its rows | done |
| `voelin-ui` | Slint UI and the desktop binary: streams panel, viewer, share dialog, audio / hotkey / codec settings; the Slint side of what `voelin-ui-vm` decides (the Bridge and model writes, windows, the engine's tasks) and the conversion of its rows into Slint values (see [ui.md](ui), "Two crates") | done (desktop) |
| `voelin-media` | Screen and system-audio capture backends (PipeWire portal, X11, Windows Graphics Capture, Android MediaProjection), video codecs; the frame and simulcast layer types of a stream (`stream::EncodedFrame`, `LayerSpec`, `LayerId`, `LayerSet`) | done (desktop hardware encoders through FFmpeg loaded at runtime, not run on a GPU yet; MediaCodec not run on a device yet) |
| `voelin-platform` | Global hotkeys, notifications, paths, crash reports, notices | done |
| `voelin-android` + `android/` | Android library + Gradle/Kotlin app (foreground services for voice and screen capture); see [android.md](android) | builds, not yet run on a device |
## Merging sources
Each server session has up to three optional sources: **voice** (normal client
connection), **gateway**, and **query** (own credentials). Presence authority is
voice (after subscribing to all channels) > gateway > query. Channel chat uses
the native command only when voice-connected *and* in that channel, otherwise the
gateway, otherwise a local query relay. UI states: `Offline`,
`Observing (Gateway|Query)` (invisible), `Connecting`, `Connected`.
## The server link
A session's voice source, the connection that is visible on the server and
can talk, is a `voelin_core::link::ServerLink`, not a TeamSpeak connection
the session knows about. The trait has one method,
`spawn(options, ctx, cmds, events)`, which starts a connection on its own
task and returns:
- `options` is a `ConnectOptions` (the app calls it `VoiceOptions`): address,
nickname, password, channel to join, whether to open the audio devices;
- `ctx` is a `LinkCtx`: the session id, the event bus the link answers
requests on (file lists, transfers, offline messages, stream state), the
bus for the frames of watched streams, and the settings;
- `cmds` carries `LinkCmd`s in: chat, moves, mute, pokes, the encoded
voice frames from the audio thread, the file and offline-message requests,
`Stream(StreamCmd)` and `Disconnect`;
- `events` carries `LinkEvent`s out: `Connected` (name, `BackendInfo`,
`Capabilities`, our client id, the server's unique id), `Presence` (a full
snapshot each time), `OwnChannel`, `Chat`, `Poke`, `Audio` (a received
`VoicePacket`), `Talking`, `OwnStream`, `StreamAudio` (the audio of a watched
stream, for the audio thread's mixer), `StreamAudioEnded` (that stream's
audio is over), `Error` and `Disconnected`. `Disconnected` ends the
connection and is sent once, but it is not promised to be the last event:
the stream task of a connection winds down after the connection, so its
closing `OwnStream(Ended)` and `StreamAudioEnded` (and the bus events of
its streams) may follow it. `TsLink` ends the stream task as the
connection's loop ends, which usually puts them first, not always. The
session does not depend on it: on `Disconnected` it ends our own stream and
the audio of watched streams itself, and what the link says after that is
ignored like the events of a replaced link.
Everything backend-neutral stays in `session.rs`: merging the three sources,
the dedup of a message that arrives twice, the chat history, contacts, the
privacy rules, the images and the gateway directory. The session tags each
link with a generation, so events of a replaced one are ignored. A link
reports what the server can do as `Capabilities`; with `streams` set it also
runs the stream task (`stream.rs`), which the session reaches only through
`LinkCmd::Stream(StreamCmd)` (start, stop, answer a viewer, watch, layers,
frames, friends, the gateway directory, shutdown) and which reports our own
stream's life back as `LinkEvent::OwnStream`. The stream task's requests
and the server's stream notifications never leave the link.
`Engine::start_with_link(settings, history, link)` takes the link;
`Engine::start` and `start_with` use `TsLink` (`ts_link.rs`), the
TeamSpeak 3 and 6 connection of `tsclientlib`, which runs `voice.rs` with
`book.rs`, `stream.rs`, `versions.rs` and `identity.rs`. `tests/link_fake.rs`
drives the session with an in-memory link instead: it plays scripted
`LinkEvent`s (connect, presence, a message twice, a disconnect, a replaced
connection) and checks the presence, chat, dedup and history the session
makes of them, and the commands it gives back, with no TeamSpeak server or
crate involved.
Where this is going: `ServerLink` is this crate's interim seam. `TsLink` and
the modules it owns move to VoelinGateWay (`voelin-gateway-ts`, the
in-process TeamSpeak gateway), and the QUIC transport of VoelinProtocol
becomes the other implementation, both behind the backend-neutral
`voelin_proto::link::Session` that the protocol spec defines (the spec
replaces `voelin_core::link::ServerLink` by it, because the gateway
implements the trait and the client depends on the gateway). The seam is not
backend-neutral yet. What still has TeamSpeak types, or TeamSpeak's shape, and
changes when `TsLink` leaves:
- `ConnectOptions.identity` and `ConnectOptions.client_version`
(`tsclientlib` types), and the myTeamSpeak account proof in `LinkCtx`
(`myts_identity` of `tsproto`, `myts_data` of `tsclientlib`);
- client ids are TeamSpeak's `u16`: our own in `Connected`, `Poke` and
`Talking`, `LinkCmd::Poke`, a chat message's `author_id`, and the viewer
and streamer ids of the stream API;
- the `Presence` snapshots: `u16` client ids, `u64` channel and group ids,
server and channel groups, talk power, icons, badges, the myTeamSpeak
avatar;
- the stream vocabulary of `voelin-stream` (the TeamSpeak 6 stream
protocol): `PeerConfig` in `ConnectOptions.stream_peer`, `MediaFrame` in
the frames of watched streams, `VideoFormat` in `StreamCmd::VideoFrame`,
and `VideoCodec` and `FrameSource`, which `voelin_core::stream`
re-exports with them (see Streams, below).
## What the engine tells of the server's software
`Event::ServerInfo { session, name, backend, capabilities }` is the one place
the UI learns what it is talking to. `backend` is a `BackendInfo { product,
version }` of plain strings ("TeamSpeak 6", "6.0.0-beta13.1"; an empty
`product` and the server's own version string when the software was not
recognised), and `capabilities` is what that software can do (streams, query
kinds, files, offline messages). The UI shows `product` on a server's chip
and `BackendInfo::label()` in the status line, and branches on capabilities
only. The TeamSpeak 3 / 6 classification (`voelin_model::ServerFlavor`, from
the `virtualserver_version` string) happens in the voice source
(`voice.rs::backend_of`), which puts both in `LinkEvent::Connected`; no
`ServerFlavor` appears in the engine's public API, so another link (a Voelin
server) can fill the same two fields.
## Chat history
Every chat message a session sees is stored in the client database
(`voelin-store::chat`, table `messages`) under the server's unique id: live
over voice, pushed by the gateway, read by a query relay, or sent by us
(stored at once, as `local`). The unique id comes from the voice connection
(the server's key: base64 SHA-1 on TeamSpeak 3, SHA-256 on 6, the same value
as `virtualserver_unique_identifier`) or the gateway's `hello`; the database
remembers it for the bookmark's address and gateway URL (`server_aliases`),
so a chat shows its stored messages before any source has connected.
Query-only sessions, which learn no id, keep history under the query address.
Rows carry `ts_ms`, the author, the text, the source that delivered them
first, and, once the gateway's copy is known, its stable id (`remote_id`,
unique per server and chat), revision, topic, pin and reactions. A message
often arrives twice (over voice and from the gateway); the store merges the
copies into one row: by gateway id, else by the text without a relay's
`[nick] ` prefix, the author (unique id, the relay prefix naming the other
copy's author, or the nickname without unique ids) and a time difference of
at most `chat.dedupe_tolerance_ms` (default 5 s), between different sources
only (a person saying the same thing twice stays two messages).
`voelin-core::history` runs the database on a writer thread: live messages
are queued without waiting, writes that queue up go into one transaction,
statements are cached. When a chat opens (and whenever a source of the
session connects), the engine emits the newest `chat.history_page` stored
messages (`Event::ChatHistory`, source `Local`), then, with a gateway that
keeps history, syncs the chat: the first time the gateway's latest page,
afterwards `sync` from the chat's revision cursor (`chat_cursors`), which
returns new messages and messages whose pin, reactions or topic changed,
page after page until done (`Gateway` batches; the last one may be empty).
`Command::LoadOlderHistory` pages back: the gateway's page before that time
is fetched and merged first, then the stored page is emitted, so gaps (times
this device was offline) fill in as the user scrolls. Live messages and
changes come as `Live` batches. The UI keeps each chat as a list keyed by
the local id and ordered by `(ts_ms, id)`, and upserts every batch. Without
a gateway only `Local` batches come: the UI labels the chat "only messages
seen by this device".
Settings: `chat.store_history` (off: memory only, negative ids),
`chat.history_page` (0: everything), `chat.dedupe_tolerance_ms`,
`chat.retention_days` (0: keep everything; pinned messages stay). No limit
is built in.
## Gateway features in the engine
The session's gateway source runs on the typed client
(`voelin-gateway-proto`, feature `client`): presence and relayed chat as
before, plus the extensions. After login the engine enables the chat
extension pushes and subscribes to events, the stream directory and the
activity feed when the gateway offers them. `Command::Gateway` carries a
`GatewayRequest` (pins, reactions, topics and topic history, events with
RSVP, the stream directory, activity, permissions, runtime configuration and
permission rules); answers and pushes come as `Event::Gateway` with a
`GatewayUpdate` (`Done`/`Failed` for requests without data or refused ones,
`Connected`/`Capabilities`/`Disconnected` for what the gateway offers).
Messages in answers and pushes are stored first, so the UI gets them with
local ids. The contract is in the module docs of `voelin_core::gateway` and
`voelin_core::history`; `voelinctl gateway --engine` drives it from the
command line.
## Server details, groups and client details
The voice connection's book has everything the server tells its clients;
`voelin-model` carries it: per client the avatar hash (`client_flag_avatar`),
description, talk power, channel group, server groups, badges, icon, away
message, mute, talk, recording and stream flags; per server
(`Presence::server`, `ServerDetails`) the welcome and host message, host
banner (link, image, reload interval, scaling), host button, icon, unique id,
platform, version and priority speaker dimming; the server and channel groups
(name, icon, sort id, naming mode, type). `Event::Presence` carries all of it;
`Event::ServerDetails` and `Event::Groups` come when those parts change.
Gateway and query presence fill what their rows have. The new fields are
optional in JSON, so gateways and clients of different versions still
understand each other. Badges are GUIDs: `voelin_model::badges` names them
from a table and gives the address of their pictures on TeamSpeak's server,
which the engine fetches like web banners.
## Files, avatars and icons
Channel file browsers, avatars and icons go over the voice connection (TS3
and TS6 alike, verified against 3.13.8 and 6.0.0-beta13.1). `ftgetfilelist`
lists a directory; `ftinitdownload`/`ftinitupload` open a transfer, which
then runs over its own TCP connection to the port the server announces (the
dev TS6 server announces 30034, its published port). The engine
(`voelin_core::files`) streams transfers in 64 KiB pieces: downloads into
`<path>.part`, renamed when complete (resumable), or into memory; uploads
read the file as they send it. Progress is reported every
`files.progress_interval_ms`; transfers can be cancelled. Nothing limits
sizes besides the server's quotas. Requests and transfers carry ids the
caller picks (`RequestId`, `TransferId`).
Chat messages link files as `[URL=ts3file://name?serverUID=…&channel=…&path=…&filename=…&size=…]`;
`ChatMessage::file_refs` finds them (`FileRef`) for file cards and
`Command::DownloadChatFile` fetches one (refused if the link names another
server). `FileRef::to_bbcode` writes a link.
Avatars live in channel 0 as `/avatar_<unique id bytes as a–p>` (one letter
per nibble; the same on TS6 with its longer unique ids); `client_flag_avatar`
is the file's MD5. Icons are `/icon_<id>`, the id being the CRC32 of the
image (below 1000: built into clients). The engine fetches every avatar and
icon of the servers it is on (`cache.fetch_images`) into a content-addressed
disk cache (`voelin_core::cache`, `<cache>/voelin/images/{avatars,icons}`):
a lookup is a map access, a download of the same file for several sessions
runs once, and the least recently used files go when the cache exceeds
`cache.max_mb` (0: no limit). `Event::AvatarReady` / `Event::IconReady`
report the files. `Command::SetAvatar` uploads ours to `/avatar` and
announces its hash (`clientupdate client_flag_avatar`), or removes it.
## Pokes, private and offline messages
`Command::Poke` sends `clientpoke`, its message cut to 100 characters
(`POKE_MESSAGE_MAX`); incoming pokes are `Event::Poke` (they used to be
stored as private messages). Private messages to any client on
the server are a `ChatTarget::Private(unique id)` chat over the voice
connection, stored in the chat history under the peer's unique id, so the
conversation survives reconnects and new client ids. Gateways and query
relays cannot send private messages as the user; without voice the engine
says so. A voice command that fails (e.g. a private message to a client who
left) is an error event; the connection stays.
Offline messages (`voelin_core::offline`, capability `offline_messages`,
TS3 and TS6) are listed, read, sent to a unique id (on TS6 the one that
server generation derives, see `voelinctl identity show`), deleted and
marked read. Guests may not send them by default.
## Contacts
Contacts (`voelin_store::contacts`, table `contacts` since schema version 3)
are people by unique id: friend, blocked or neutral, with a note, a mute and
a volume, when they were added, and when and on which server they were last
seen. The engine (`voelin_core::contacts`) keeps them in memory for lookups,
takes `Command::SetContact` / `RemoveContact`, and reports
`Event::ContactsChanged`. From the presence of every session (voice,
gateway or query) it reports where each friend is (`Event::FriendPresence`)
for Home's friends list, and records sightings in one write per change. A
contact's mute and volume apply to their voice in every session. Messages of
blocked contacts are flagged (`ChatMessage::blocked`, live and in history);
their private messages and pokes are dropped or flagged per
`privacy.block_mode`. `privacy.private_messages` and `privacy.pokes`
(everyone, friends, nobody) drop those of everyone else.
`stream.permissions = friends` lets friends watch our
stream without asking and asks for everyone else.
## Identities
The `identities` table of `voelin-store` holds identities of more than one kind.
A row is a `voelin_identity::IdentityBlob` { `kind`, `uid`, `level`, `json` }
with an optional account binding: a `teamspeak` row is the JSON of a
`tsproto::Identity`, exactly as the client has always stored it; a `voelin` row
is an Ed25519 key; the `account` row (`account:<account uid>`) says which
account the installation is signed in to and which key is its device key; a
kind this version does not know passes through untouched. `uid` is unique
across kinds, and the uid forms of the kinds do not overlap. The table got its
new columns from two schema versions, 6 (`kind`, defaulting to `teamspeak`) and
7 (`account`, `integration`, `integration_rev`, `synced`), the SQL of which is
`voelin-identity`'s (`migrate::ADD_KIND_COLUMN` and `ADD_ACCOUNT_COLUMNS`);
every identity that existed stays what it was: kind `teamspeak`, unbound, its
JSON untouched, its origin and default flag kept.
`Store` keeps the TeamSpeak identity methods (`identities`, `identity`,
`add_identity`, ...), which act on `teamspeak` rows only, so nothing above the
store changed. `SqliteKeyStore` is the same table as a `KeyStore`, with the
binding: `put` replaces a row of the same `(kind, uid)` and keeps its name,
origin and default flag, a uid another kind holds is refused, a TeamSpeak blob
is stored only when its JSON is a tsproto identity whose key has the uid it
names (the error says only that, never the JSON: it is a private key), and
the TeamSpeak security level is still computed from the key, never stored. A
`put` that changes only the binding of a row (its data is what `get` read from
the row) neither checks nor rewrites the data, so a row whose data was damaged
outside the client (JSON that is no identity, a BLOB, bytes that are no UTF-8)
cannot keep a sign-out from unbinding it, and keeps its data byte for byte.
`get` hands such data out as text with the odd bytes replaced, and the `put` of
that text is taken for the data that is there; any other text is a new identity
for the uid, checked as ever, and replaces the bytes.
A row whose binding columns cannot be read is listed and read as unbound, with a
warning, instead of failing the list; so no damaged row, the account record's
included, keeps a sign-out from finishing, and `Forget` still deletes the key
it names.
Signing out of an account is the trait's `sign_out`, run on this table: it
removes the account record and the synced copies, unbinds the identities only
this device holds, keeps the device key (unbound, byte for byte) when the
record says it predates the account, and deletes it when it does not or when
the caller asks to forget it. The engine and the UI do not use the key store
yet; accounts, sign-in and the integrations page are later steps.
The device key is never a synced copy. The trait's `sign_out` deletes every
identity bound with `synced = true` in its first step, before it reads the
record, so a device key stored that way would be deleted even where the record
says to keep it. `SqliteKeyStore` therefore refuses, with an error that names
the key and the record, a `put` of a `voelin` blob with `synced = true` while an
account record names its uid as the device key, or while an account record
cannot be read (it may name the key); and a `put` of an account record whose
device key is stored as a synced copy. A key bound with `synced = false` is
accepted: a sign-out unbinds it and then follows the record. The check is made
under the store's lock; it is defence in depth against the code that signs in,
which does not exist yet.
The rows are private keys, so a deleted key must not stay in the file. Every
connection to the database sets `secure_delete`, which makes SQLite overwrite
what it deletes, and deleting a key (`Store::delete_identity`, and the
`KeyStore::remove` a sign-out deletes with) is followed by a
`PRAGMA wal_checkpoint(TRUNCATE)`, so that the frame of the write-ahead log that
held the key's page goes too: neither `client.db` nor `client.db-wal` has the
key's text afterwards. A sign-out runs the checkpoint once, after its last step,
not after each row it removes. The checkpoint waits for another connection for
150 ms at most (the connection's own busy timeout is restored after it), because
while it waits for a reader it holds the writer lock of the log and every other
writer waits with it. If another connection blocks it (one that keeps reading an
old snapshot) the delete stands, a warning is logged, and the bytes stay in the
log file until a later checkpoint truncates the log, later writes overwrite
those frames, or the last connection to the database closes and the log is
deleted. Keys deleted before `secure_delete` was on stay in the free pages until
the database is vacuumed.
`voelin-identity` comes from the private VoelinProtocol repository as a git
dependency pinned by commit ([building.md](building#depending-on-voelinprotocol)).
## Streams
`voelin-stream::Streams` holds the stream state of one TS6 connection without
doing connection IO: it is fed stream notifications (and failed commands) and
the app's decisions, owns the str0m peers, and queues requests to send plus
events. Inside it, `StreamerSession` runs our stream (one peer per viewer, our
offer in `respondjoinstreamrequest`), `ViewerSession` one watched stream
(answer through `streamsignaling`), and `StreamDirectory` the streams of our
channel. Its tests drive two instances through a fake relay server.
Transport details of our stream (`voelin-stream`):
- **SRTP profile**: DTLS negotiates the profile in the order of
`PeerConfig::srtp_profiles`, by default AES_CM_128_HMAC_SHA1_80 (what
official TS6 streams use), then AEAD_AES_128_GCM and AEAD_AES_256_GCM for
peers without it. Our peer is the DTLS server with official clients and
browsers, so our order decides. `dtls::VoelinDtlsProvider` wraps str0m's
dimpl DTLS with that order; dimpl is vendored in `third_party/dimpl` with a
patch for it (`VOELIN-PATCH.md`). The order is a setting
(`Streams::set_srtp_profiles`, `Command::SetSrtpProfiles`, which takes the
profiles' names; the stream task parses them) and applies to new
connections.
- **Media that does not get through**: a connection can come up and carry
nothing (an SRTP library that negotiates a profile it cannot use, a
streamer without an encoder for the codec the answer took). Each peer
checks once per connection: a viewer's reports `PeerEvent::NoVideo`
(with whether audio came) when no video arrived within
`PeerConfig::stall_timeout` (5 s); a streamer's reports
`PeerEvent::NoFeedback` when, after twice that, no receiver report (or
REMB) of the viewer mentioned our video. Keyframe requests do not count:
a viewer that gets nothing keeps asking. The sessions then ask for a new
connection with the next lower set and log the step: without the SRTP
profile that was negotiated (both AEAD profiles when it was one of
them), or without the video codec when audio came and video did not. A
viewer sends `reconnect`; a streamer sends a `reconnectOffer` of its own,
for viewers that do not step down (it waits twice as long, so a Voelin
viewer goes first). One layer up, the app's `media::Viewer` judges by
decoded pictures: video of one codec that keeps coming (10 s, at least
60 frames) without a single picture, every decoder of the codec's
ladder having failed, makes it send `Command::StreamUndecodable`, and
the viewer asks for a connection without that codec
(`Streams::video_undecodable`). What was left out stays out for that
viewer or watched stream; when nothing is left, that is logged and
nothing loops.
- **mDNS candidates**: host candidates behind `<uuid>.local` names (how
browsers and other libwebrtc builds hide host addresses) are resolved by
a multicast DNS query (`voelin_stream::mdns`, from port 5353 shared with
the system's responder: Chromium's answers nothing else) and added as
plain candidates, from offers, answers and trickled candidates alike.
- **Losses**: each peer socket asks for 4 MB of receive and send buffer
(`PeerConfig::udp_buffer`; Linux caps it at `net.core.rmem_max`, and
what was granted is logged, with a hint when it is less): the default
208 KB overflowed under a 1440p keyframe on loopback (118-209 datagrams
per 5 s of a 9 Mbit/s stream), the larger buffer dropped none
(`tests/loopback.rs` `high_bitrate_bursts`). What is still lost is
repaired by NACK and retransmission (RTX), which our answers keep for
every video codec; str0m waits up to 30 complete frames for a
retransmission before it hands a frame over as non-contiguous
(`losses_are_repaired_by_retransmission`: one packet in 25 lost, every
frame whole).
- **Bandwidth estimation and pacing**: each viewer connection of our stream
runs str0m's send-side estimation (transport-cc feedback; REMB if a viewer
sends only that) and paces packets to it. Estimates are per viewer
(`ViewerInfo::estimate`). The offer is unchanged by it: str0m always offers
the transport-cc and abs-send-time extensions.
- **Simulcast**: `StreamerOptions::layers` lists the encodings (`LayerSpec`).
A viewer gets the highest layer whose `min_bitrate` its estimate reaches:
down at once, up after the estimate exceeded the next layer's minimum by 20%
for 2 s. A switch asks for a keyframe of the new layer and waits for it
before the viewer's frames change layer; the RTP timestamps come from one
capture clock, so the viewer's single video track continues. Keyframe
requests (PLI/FIR) go to the viewer's layer only. Each layer's bitrate
target is the lowest estimate of its viewers, at least 30 kbit/s, at most
its `max_bitrate`; the encoders read targets and keyframe requests through
`LayerFeedback` (lock-free, via `StreamSink::layer_bitrate` and
`take_layer_keyframes`), and events report them. Peers that negotiate RID
simulcast (`PeerConfig::simulcast`, off for TeamSpeak; for SFUs or WHIP) get
every layer with its RID. The layer list can change while live
(`Streams::set_layers`, `Command::SetStreamLayers`). Without layers the
stream has one layer 0 at the setup's bitrate and every viewer gets it.
The stream types the UI sees are `voelin-core`'s own (`stream_types.rs`, also
under `voelin_core::stream`): `StreamInfo`, `ViewerInfo`, `StreamSetup`,
`StreamKind`, `ViewerState`, and why a stream ended (`EndReason`,
`LeaveReason`). They have plain fields: client ids are `u16`, a viewer's SRTP
profile is its name (`AEAD_AES_128_GCM`), its video codec is
`voelin_media::Codec`. The frame and layer types in the API
(`stream::EncodedFrame`, `LayerSpec`, `LayerId`, `LayerSet`) are
`voelin-media`'s, which `voelin-stream` uses as they are. The conversion to
and from `voelin-stream`'s own types happens in one place, `stream.rs`: the
stream task converts what `Streams` reports, and what the UI asks for
(`StreamSetup`, the profile names) on the way in, so the stream session's
own types (its `StreamInfo`, `ViewerInfo`, `StreamSetup`, `SrtpProfile`,
`EndReason`) no longer show in `Command` and `Event`. Still
`voelin-stream`'s in the engine's API are the peer and media vocabulary:
`PeerConfig` (in `ConnectOptions`), `MediaFrame` (the frames of watched
streams), `VideoFormat` and `VideoCodec` (on the `StreamSink`),
`FrameSource`, `SyntheticSource`; they move out of the core with the stream
task (the decoupling plan's next steps).
In `voelin-core` a stream task per voice connection runs `Streams`. The link
owns the task (see [The server link](#the-server-link)): the TeamSpeak
connection hands it the `MessageEvent`s as notifications and the clients'
channels, and sends its requests; the session talks to it with
`LinkCmd::Stream(StreamCmd)`. Encoders push frames through
the `StreamSink` of `StreamState::Live`; received frames of watched streams go
to `Engine::subscribe_frames`, not the event bus. The audio of watched streams
goes to the session as `LinkEvent::StreamAudio` and on to its audio thread,
which mixes it like a talker with its own volume (`Command::SetStreamVolume`).
`voelin-core::media` (feature `media`) connects this to `voelin-media`:
`Streamer` captures (screen, window, portal or the test pattern, plus system
audio), encodes with the codec of our offer (VP8 by default; the offer carries
only the codec we encode, since every viewer gets the same frames) and Opus,
and feeds the `StreamSink`, honouring keyframe requests. `Viewer` decodes a
watched stream on its own thread (skipping to the next keyframe after losses
and asking for one) and hands pictures to the UI, which keeps only the newest
(`Latest`). `EncodedSource` wraps a `Streamer` as a `voelin-stream::FrameSource`
for `voelinctl stream start`; `SyntheticSource` (fake VP8 bytes, one frame per
layer) remains for voelin-stream's own tests and `voelinctl stream start
--placeholder`.
The server announces a stream only to the clients in the streamer's channel
at its start. `voelin-stream::discovery` follows the clients' channels and
streaming flags (`Streams::update_clients`), and looks up streams nobody
announced to us with `requeststreaminfo clid=<streamer>`
([research/ts6-late-join.md](research%2Fts6-late-join)). The lookup is a
`StreamLookup` trait. The session's gateway directory is the second one:
its registered entries (stream id, streamer) go to the stream task, which
adds those of streamers in our channel that still stream
(`Streams::discovered`), so a stream is found even when the server's lookup
does not answer. Our own stream registers itself in the directory when it
goes live (title, kind, channel, client), updates its viewer count, and is
removed when it ends.
## Negotiation: best first, then fall back
Wherever Voelin agrees on parameters with a peer or a system component, it
tries the best choice first and steps down towards the most compatible one
when the better one is not accepted. "Not accepted" is either refused in
the negotiation itself (SDP, handshake, a backend's start) or found failing
at runtime. The second matters: the official client answers H.264 it
cannot decode and then shows nothing, so for codecs "accepted" is not
"works", and a streamer cannot see a viewer's decoder. Audit of
2026-10-03:
| Point | Ladder (best → most compatible) | Not accepted means | State |
|---|---|---|---|
| Video codec, streamer offer | stream codec (configured, else the first of the encoder preference every TeamSpeak client decodes) → AV1, VP9, VP8 of hardware encoders and VP8 of libvpx → H.264 of hardware → HEVC | SDP: the answer lists what the viewer takes; our first one it took is sent (`PeerEvent::VideoCodec`), one encoder per format. At runtime undetectable for the official client: without OpenH264 it answers H.264, decodes nothing and reports success (libwebrtc's `NullVideoDecoder`, no PLI) | already so; deliberately not best-first for H.264: codecs every client decodes come before it, because the streamer cannot see that failure |
| Video codec, viewer answer | the offer's order, limited to what we decode; each codec's decoders hardware → FFmpeg software → built-in ([media.md](media)) | SDP: no codec in common → refused with the reason (`PeerError::NoCommonCodec`); an official streamer that does not encode our pick re-offers on the same connection (`Peer::renegotiate`). Runtime: audio comes, video does not for `stall_timeout` (`PeerEvent::NoVideo { audio: true }`), or video comes and no picture decodes for 10 s and 60 frames, every decoder of the ladder having failed (`media::Viewer`, `Command::StreamUndecodable`) → `reconnect` without that codec | renegotiation already so; both runtime steps **changed now** (`viewer_falls_back_to_another_codec`, `undecodable_video_falls_back_to_another_codec`, `undecodable_video_is_noticed_through_the_pipeline`) |
| H.264 profile | Constrained High (PT 112) → Constrained Baseline (PT 108) | SDP: the answer takes only the Baseline entry (headless Chromium 152) → that viewer's frames come from an encoder in Constrained Baseline | **changed now** (`a_baseline_only_viewer_gets_the_fallback_profile`, `an_encoder_per_h264_profile_viewers_chose`, browser: 90 of 90 frames, SPS profile 66). Android's MediaCodec encoder makes High only |
| H.264 level, packetization | the level the stream needs (at least 3.1); packetization mode 1 | `level-asymmetry-allowed=1`; a peer without mode 1 does not take H.264 and gets the next codec | level: unchanged, not a ladder. The app offers 3.1 whatever the share's size (its peer configuration is made before the share starts; `voelinctl` sets the level): open issue |
| SRTP profile | AES_CM_128_HMAC_SHA1_80 → AEAD_AES_128_GCM → AEAD_AES_256_GCM | handshake: the DTLS server (we are, with official clients and browsers) takes the first of its order the client offers. Runtime: connected, nothing gets through (`NoVideo { audio: false }` at the viewer, `NoFeedback` at the streamer) → a new connection without the negotiated profile (without both AEAD ones if it was AEAD) | runtime ladder **changed now** (`viewer_falls_back_when_srtp_fails`, `streamer_falls_back_when_its_viewer_gets_nothing`, `browser_srtp_failure_is_noticed`). The order stays most-compatible-first, see below |
| DTLS version, cipher suite | 1.2 (str0m's default); ECDHE-ECDSA AES-128-GCM, AES-256-GCM (dimpl) | in the handshake: Chromium 152 offers 1.3 and 1.2 and gets 1.2; the server picks the suite from the client's list | already so; 1.3 not turned on, see below |
| ICE | host (configured, else the primary IPv4) → server-reflexive (TeamSpeak's STUN, trickled) → peer-reflexive; remote `<uuid>.local` names resolved by mDNS | pairs that fail their checks drop out, the best working pair is used; an mDNS name nobody answers within 3 s is dropped (debug log) | mDNS **changed now** (`browser_mdns_candidates_connect`); the rest already so. No TURN (TeamSpeak runs none), no IPv6 gathering |
| Stream connection | renegotiation on the running connection (a new `offer` signal) → a new connection (`reconnect` / `reconnectOffer`), each fallback step one more → the watch ends | a viewer whose connection closes asks again, three times, then the watch ends with `Failed`; fallback steps do not count against those three | renegotiation and reconnect already so, fallback steps **changed now**; no automatic `joinstreamrequest` again: a streamer may have to accept it by hand, so the user decides |
| Simulcast | one layer per viewer by its bandwidth estimate (TeamSpeak); RID simulcast only with `PeerConfig::simulcast` (SFU, WHIP) | an answer without `a=simulcast` leaves a RID peer without video | not changed: RID is opt-in and only `voelinctl --simulcast` turns it on; offer it only to peers that take it |
| Bandwidth feedback | transport-cc → REMB | a viewer without transport-cc feedback: its REMB estimates are used | already so |
| Socket buffers | 4 MB → what the system grants (`rmem_max`) | the kernel caps `SO_RCVBUF`; logged, once with a hint | **changed now** (`high_bitrate_bursts`: 118-209 drops per 5 s before, none after) |
| Loss repair | NACK + retransmission → after 30 complete frames, the frame is handed over non-contiguous → keyframe request | the depacketizer gives up waiting | already so, verified now (`losses_are_repaired_by_retransmission`) |
| Opus | 48 kHz stereo, 128 kbit/s music mode, 20 ms, in-band FEC on (5 %), DTX off; SDP `minptime=10;useinbandfec=1` | fmtp differences do not refuse a codec (str0m scores the match), and every Opus decoder takes every mode | already so, no ladder needed. Our answers lack `stereo=1`, so libwebrtc streamers send us mono; our playback is mono anyway |
| WHIP output | the studio's one codec + Opus; one host candidate | the service refuses → the output fails with its answer | not changed: a second codec would need a second encode; no STUN/TURN yet ([studio.md](studio)) |
| Gateway protocol | subprotocol `tsgw.v1+json`; features by `capabilities` | a gateway without a feature: the client hides it; unknown fields are ignored, unknown message types answered `unknown_type` | already so; a `v2` would be offered first as a second subprotocol once it exists |
| TeamSpeak client version | the configured signed version (a bookmark's `client_version`, `voelinctl --client-version`; `generic` claims the old `3.?.?` tuple), else the newest TeamSpeak 6 build signed for the native platform in `Versions.csv` (Linux 6.0.0-beta4.1, Windows 6.0.0-beta2), else the platform's generic `3.?.?` tuple; the legacy UDP protocol on TS3 and TS6 | a server that refuses the version ends the connection with its error | not done: no server here refuses the default; retrying with the newest signed version (`Versions.csv`, only `voelinctl` reads it) needs that refusal recognised first. TS6's protobuf transport is not implemented |
| Capture buffers | DMA-BUF in the sink's tiled modifiers → LINEAR DMA-BUF → shared memory | the compositor fixates the format; a LINEAR mapping slower than 1 ns per pixel over 30 frames renegotiates to shared memory; a failed GPU conversion or an encoder that needs frames in memory declines DMA-BUFs | already so |
| Capture backend | Android's provider → the ScreenCast portal (Wayland) → X11 (`DISPLAY`) → Windows Graphics Capture; or the backend set | the backend that cannot start fails the share with its reason; a cancelled portal dialog is not a failure | not changed: falling back from the portal to X11 on Wayland would capture XWayland only (black for Wayland windows); wlroots screencopy is the candidate for compositors without a portal |
| Encoder backend | the preference: hardware (VA-API, NVENC, Quick Sync, AMF, VideoToolbox, Media Foundation, MediaCodec) → libvpx VP8 → x264, OpenH264 → libvpx VP9 → SVT-AV1, libaom; a named backend first | at start-up each backend's self-test (one keyframe) leaves out what fails, with the reason; at runtime an encoder that fails logs and tries again with the next frame | start-up already so; switching backends after runtime failures not done |
Not turned on, with the evidence:
- **AEAD-first SRTP order.** AES-GCM is the better profile, and the
fallback works: when SRTP fails after an AES-GCM handshake, our streamer
notices (`NoFeedback`, also with headless Chromium as the viewer) and
offers AES_CM_128_HMAC_SHA1_80, and our viewer asks for it. But the
streamer's half needs the viewer to answer a `reconnectOffer` it did not
ask for, and nothing shows that the official client does; how official
clients failed with AES-256-GCM is only reported; and streams between
official clients reportedly use AES_CM_128_HMAC_SHA1_80, which suggests
they offer nothing else, where the order changes nothing. The gain (a
cheaper cipher) does not justify the risk until the official client is
tried (steps under the open questions of
[protocol-notes/ts6-streaming.md](protocol-notes%2Fts6-streaming#open-questions)).
- **DTLS 1.3.** With dimpl allowed to (str0m's `DtlsVersion::Auto`),
headless Chromium 152 negotiates DTLS 1.3 (`FEFC`, `TLS_AES_128_GCM_SHA256`)
and decodes 90 of 90 frames, and its ClientHello also offers 1.2, which
is what our 1.2-only peers get. But a DTLS handshake that fails closes
the connection without a version step (a reconnect uses the same
settings), the official client's DTLS 1.3 is untried, and all 1.3 would
save is one round trip while connecting, nothing for the stream. It
stays off.
## Settings
`voelin-core::settings::Settings` is the settings service. Keys are typed
statics (`Key<T>`: name, default, validation, a `Kind` for a settings page);
the effective value is the runtime value stored in the client database, else
a command line or environment override, else a config file, else the
default. Reads come from memory (`get`, `get_arc`, or a `SettingWatch` per
key); writes notify subscribers and go to SQLite on a writer thread. The
engine holds one (`Engine::settings`, `Command::AttachSettings`), takes
`Command::SetSetting` / `ResetSetting` and reports `Event::SettingChanged`.
The UI opens it on its database and registers its own keys (`ui`,
`client_playback`); the stream (`stream.*`), chat (`chat.*`), cache (`cache.*`),
file transfer (`files.*`) and privacy (`privacy.*`) keys
are defined in the core, which reads them on every use.
## Milestones
| | Scope | Exit criteria |
|---|---|---|
| **M0** | Vendoring, workspace, `voelinctl`, dev servers, CI | Builds on Linux + Windows; smoke test passes on TS3 and TS6 |
| M1 | Protocol modernisation: edition 2024, dependency updates, puzzle rewrite (off-thread, progress, cancel), TS6 declarations (`client_is_streaming`, stream commands), fuzzing | Tests green on both servers, clippy clean |
| M2 | Identities/bookmarks store, audio v0 (Opus, jitter buffer), `voelinctl voice` | Tone round-trips between two clients on both servers |
| M3 | `voelin-query` (raw/SSH/HTTP) + observer | Invisible presence and relay chat verified |
| M4 | Gateway v1 | Presence + channel chat without appearing in the client list, permission denials tested |
| M5 | `voelin-core` + Slint desktop UI (Linux) | Daily use on GNOME, KDE, X11 |
| M6 | Audio quality, global push-to-talk, Windows parity and packaging | One-hour call without drift or echo |
| M7 | TS6 stream viewer | Watch an official TS6 client's stream |
| M8 | Streamer: capture, system audio, encoders | Official TS6 client watches our 1080p30 stream with sound |
| M9 | Android app | Background voice, watch and share screen |
| M10 | Release hardening | Signing, crash reports, i18n, notices audit |
| M11+ | macOS / iOS | |
## Risks
- TeamSpeak 6 streaming is undocumented and still in beta: probe against our own
server, record findings in `docs/protocol-notes/`, pin server versions, gate
features on the server version. AGPL projects (astrum-ts6) are reference only.
- Signed client versions could be blocked: configurable, with fallbacks.
- ServerQuery flood limits: token buckets, capped relay pool, allowlist guidance.
- H.264 patents: no bundled encoder; runtime-downloaded Cisco OpenH264, VP8/VP9
preferred, OS hardware codecs.
---
*Mirrored from [`docs/architecture.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/architecture.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+138
@@ -0,0 +1,138 @@
# Audio pipeline
```
microphone ─ cpal ─ resample 48 kHz mono ─ Processor (AEC3, NS, AGC2) ─ 20 ms frames
─ Vad / push-to-talk / continuous ─ Opus ─ EncodedVoice ─ voice connection
voice connection ─ VoicePacket ─ Mixer (jitter buffer, Opus decode, per-talker
volume/mute, priority speaker dimming)
─ output volume ─┬─ resample to device ─ cpal ─ speakers
└─ Processor::render (echo canceller reference)
```
The audio thread lives in `voelin-core/src/audio.rs`; the building blocks are in
`voelin-audio`. All user settings are one serde struct, `voelin_audio::AudioSettings`.
## Voice packets
`voelin-audio` knows no voice transport (it depends on no TeamSpeak crate). What
crosses its boundary are the plain types of `voelin_audio::packet`:
| Type | Meaning |
|---|---|
| `TalkerId(u16)` | who is talking; the key of the mixer's queues, volumes and mutes (TeamSpeak's client id is used as is, watched streams get made-up ids) |
| `VoiceCodec` | `Voice` (mono Opus, speech) or `Music` (stereo Opus) |
| `VoicePacket { talker, seq, codec, whisper, payload }` | one received Opus packet; `seq` counts up per talker and wraps, an empty `payload` (or a single byte) ends the talk |
| `EncodedVoice { codec, payload }` | one frame from `VoiceEncoder`, an empty `payload` ends the transmission |
The transport adapter converts between these and its wire format; for the
TeamSpeak connection that is `out_audio` and `voice_packet` in
`voelin-core/src/voice.rs`, the only place that builds TeamSpeak audio packets
from `EncodedVoice` or reads them into `VoicePacket`s (codecs other than Opus
are dropped there, as the jitter buffer never played them). The audio thread,
the session and the mixer see only the types above, and so does the link's
seam: `LinkCmd::Audio` carries an `EncodedVoice` out and `LinkEvent::Audio` a
`VoicePacket` in (`voelin-core/src/link.rs`).
## Echo cancellation, noise suppression, gain control
[sonora](https://crates.io/crates/sonora) 0.2 (BSD-3-Clause), a pure Rust port of
the WebRTC audio processing module: AEC3, the WebRTC noise suppressor, AGC2
(adaptive digital gain + limiter) and a high-pass filter. Chosen over:
- `webrtc-audio-processing`: binds the C++ library, either a system package found
through pkg-config or a bundled C++ build (autotools, bindgen/libclang); its
licence is not an SPDX expression, and Windows/Android need extra toolchain work;
- `nnnoiseless` (RNNoise port): noise suppression only, no echo cancellation.
sonora needs no C/C++ toolchain, so it builds the same everywhere. It runs on 10 ms
frames; `Processor` frames arbitrary lengths internally. The dev profile compiles
the sonora crates with `opt-level = 3`: unoptimised, AEC alone takes a third of a
core; optimised, the full chain takes about 0.3 ms per 10 ms frame.
Measured with the unit tests (synthetic signals):
| | Result |
|---|---|
| Echo (far end delayed 20–120 ms, -6 dB) | about 25–33 dB attenuation within the first second, 50 dB after two; the delay estimate matches |
| Double talk (near-end tone during echo) | near-end tone loses about 3 dB |
| White noise, suppression `High` | 10 dB or more lower; a tone in 200 ms bursts keeps its level within 3 dB |
A steady tone is treated as stationary noise and suppressed, as expected from
this kind of noise suppressor, so the test uses bursts like syllables.
## Voice activity
`Vad`: a level gate in dBFS with hangover (default -40 dBFS, 300 ms). The optional
`Speech` mode also requires the RNN speech probability of WebRTC's AGC2 VAD
(`sonora-agc2`), which rejects noise loud enough to pass the gate. The RNN also
fires on pure tones, and on synthetic vowels only at low pitch, so the plain gate
stays the default until it is checked with real voices. With voice activation the
two 20 ms frames before the gate opened are sent too, so onsets are not cut.
## Jitter buffer and clock drift
`Mixer` wraps `voelin_audio::jitter::AudioHandler` (one queue per talker; it
started as `tsclientlib::audio::AudioHandler` and now reads `VoicePacket`s) and
adds per-talker volume and mute, and priority speaker dimming. The handler
absorbs sender clock drift: an underrun plays Opus loss concealment for
the missing frame (one inserted frame, and the talker is dropped after three in a
row), and when the smallest queue length over the last 255 packets exceeds its
spread, it drops every 100th sample (1 % faster) until the surplus is gone;
queues above 0.5 s are truncated.
`crates/voelin-audio/tests/drift.rs` simulates one hour of continuous speech with
20–60 ms network jitter, reordering and 0.5 % loss, with the sender clock at
+200 and -200 ppm (720 ms of disagreement per hour). Marker frames every 30 s
measure the end-to-end latency:
| Sender clock | Latency min / max | First 10 min avg | Last 10 min avg |
|---|---|---|---|
| +200 ppm | 73 / 131 ms | 112 ms | 125 ms |
| -200 ppm | 67 / 95 ms | 82 ms | 84 ms |
## Settings, levels and volumes
The engine keeps one `AudioSettings` for all sessions (`Command::SetAudioSettings`;
each new audio thread starts with it) and applies changes live. The desktop app
stores them under the setting `audio` and shows them on its settings page:
devices, transmit mode (push-to-talk, voice activation, continuous), the voice
activation threshold, echo cancellation, noise suppression and its level,
automatic gain, microphone gain, output volume and the playback buffer.
The audio thread reports the loudest 10 ms level since the last report about
ten times a second (`Event::InputLevel`, with whether voice is sent), which the
settings page shows as a meter with the threshold. Without a voice connection,
`Command::TestMicrophone` opens the microphone for the meter alone.
Per-client volume and mute are local (`SetClientVolume`, `SetClientMuted`); the
app keeps them by unique id and sends them again when the client shows up. Client
ids are reused, so the session forgets the settings of clients that left.
Watched streams play through the same mixer under made-up talker ids (counting
down from 65535) with their own volume (`SetStreamVolume`).
While a priority speaker has a queue (talking, or buffering before it plays)
and we have not muted it, every other queue, streams included, is dimmed by the
server's `virtualserver_priority_speaker_dimm_modificator`
(`ServerDetails::priority_speaker_dimm_db`, usually -18 dB, clamped to
-60..=0). The dimming fades in and out sample by sample over 100 ms (5 frames),
so the gain does not jump; priority speakers are never dimmed. The session sends
the priority speakers and the server's value to the audio thread when either
changes (`Mixer::set_priority`).
Push-to-talk works with the button in the window and a global hotkey
(`voelin_platform::HotkeyManager`: the portal on Wayland, XInput2 on X11, a hook on
Windows), configurable as e.g. `Ctrl+Shift+T`.
## Devices
Devices are selected by cpal's stable id (`host:device`, e.g. `alsa:hw:1,0`);
`device::input_devices()` / `output_devices()` list them with the system defaults
marked. cpal's error callback flags a stream as lost on fatal errors (not on xruns
or rerouting); `device::Managed` then reopens the selected device, or the default
one while the selected one is missing (retrying every 2 s, moving back within 5 s
of it reappearing). The audio thread reports these changes as session errors.
---
*Mirrored from [`docs/audio.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/audio.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+187
@@ -0,0 +1,187 @@
# Packages: from releases and built locally
Every platform has installable packages. The release workflow builds them,
and the Dockerfiles in `docker/` build the same kinds of packages on any
machine with Docker. Both use `scripts/package.sh`, so file names and
contents match. CI (`ci.yml`, run by hand only) runs the checks and builds
no packages; the release workflow builds packages without running them.
The packages hold the app, Voelin. The gateway `tsgw` runs on servers and is
packaged for Linux only, separately. `voelinctl` is a development tool and is
in no package (`cargo run -p voelinctl`).
| Platform | Files | Install |
|---|---|---|
| Linux x86_64 | `voelin-<version>-linux-x86_64.tar.gz` | unpack; `bin/voelin` plus desktop file and icon (prefix layout: `tar -xzf … --strip-components=1 -C ~/.local`), libvpx and libdav1d in `lib/`; `bin/voelin-install-deps` installs what comes from the system (FFmpeg, VA-API drivers, PipeWire, the desktop portal, a keyring) with apt, dnf, pacman or zypper |
| | `voelin_<version>_amd64.deb` | `sudo apt install ./voelin_<version>_amd64.deb` (Ubuntu 24.04+, Debian 13+); apt installs the libraries it links and, by default, the recommended FFmpeg, VA-API, PipeWire, portal and keyring packages |
| | `voelin.flatpak` (release workflow only) | `flatpak install --user voelin.flatpak` |
| Linux server | `tsgw_<version>_amd64.deb` | `sudo apt install ./tsgw_<version>_amd64.deb`, then configure and start it ([gateway-admin.md](gateway-admin#install)) |
| | `tsgw-<version>-linux-x86_64.tar.gz` | unpack; `bin/tsgw`, the systemd unit and the example config |
| | `tsgw-image.tar.gz` (release workflow only) | `docker load -i tsgw-image.tar.gz` |
| Windows x86_64 | `voelin-<version>-windows-x86_64.zip` | unpack; `voelin.exe` with FFmpeg's LGPL DLLs next to it (libvpx and dav1d are linked in) |
| | `voelin-<version>-setup.exe` | run it (per-machine install, uninstaller in Settings → Apps) |
| Android | `voelin-<version>-android-debug.apk` | `adb install …` or open it on the phone (arm64-v8a and x86_64) |
| | `voelin-<version>-android-release.apk` | only with signing configured ([release.md](release#android-apk-signing)) |
Each package run also writes `SHA256SUMS-<platform>`. Nothing is code-signed
yet: Windows SmartScreen warns about the installer, and the debug APK is
signed with a debug key (fine for testing, not for the Play Store).
The gateway's image can also be built directly:
`docker build -f crates/voelin-gateway/Dockerfile -t tsgw .`.
Gitea at [git.faumaray.ru](https://git.faumaray.ru) builds the same package
types through `.gitea/workflows/release.yml`: manual runs produce one
`voelin-packages` artifact; `v*` tag pushes also attach the packages to a
draft release. Windows packages there use MinGW rather than MSVC. See
[Gitea releases](release#gitea-releases) for signing and publishing,
and [runner setup](ci#gitea-release-runner) for host requirements.
## From releases
`.github/workflows/release.yml` builds every package:
- **A version tag** `v*` (`git tag -s v0.2.0 && git push origin v0.2.0`): the
packages and a `SHA256SUMS` are attached to a **draft** GitHub release once
every package is built (no checks run; run CI by hand first); review and
publish it by hand ([release.md](release#checklist)).
- **By hand**, for a build to test without a release: Actions → Release → Run
workflow (or `gh workflow run release.yml --ref <branch>`). The packages are
uploaded as artifacts, kept for 90 days: `voelin-linux-x86_64` (the app's and
the gateway's Linux packages), `voelin-windows-x86_64`,
`voelin-flatpak-x86_64`, `voelin-android` and `tsgw-image`.
```sh
gh workflow run release.yml --ref main
gh run list --workflow release.yml --limit 3
gh run download <run id> --dir dist
```
The Windows packages use the MSVC toolchain, libvpx and dav1d from vcpkg, and
FFmpeg's LGPL shared build from BtbN/FFmpeg-Builds
(`scripts/fetch-ffmpeg-windows.sh`, checked against the release's checksums). The
Android job builds a signed release APK only when the repository has the
signing secrets (`ANDROID_KEYSTORE_BASE64`, `VOELIN_SIGNING_STORE_PASSWORD`,
`VOELIN_SIGNING_KEY_ALIAS`, `VOELIN_SIGNING_KEY_PASSWORD`).
`.github/workflows/docker.yml` builds the Docker files below for every
release tag and by hand (Actions → Docker builds → Run workflow), and uploads
their output as `docker-linux`, `docker-windows` and `docker-android`.
## Locally with Docker
Needs Docker 23+ (BuildKit) or Docker Desktop, and about 15 GB of free disk
per platform (toolchains plus the build cache). From the repository root:
```sh
scripts/docker-build.sh linux # → dist/linux/
scripts/docker-build.sh windows # → dist/windows/
scripts/docker-build.sh android # → dist/android/
scripts/docker-build.sh # all three
```
The same with plain Docker, e.g. `docker build -f docker/linux.Dockerfile -o dist/linux .`
Rebuilds are incremental: the cargo registry, `target/` and Gradle live in
BuildKit cache mounts (`docker builder prune` frees them).
| Dockerfile | Builds | Notes |
|---|---|---|
| `docker/linux.Dockerfile` | the app's and the gateway's `.tar.gz` and `.deb` on Ubuntu 24.04 | the binaries need glibc 2.39+ and the libraries the `.deb` lists |
| `docker/windows.Dockerfile` | `.zip` and the NSIS installer | cross-compiled for `x86_64-pc-windows-gnu` with mingw-w64 and static libvpx and dav1d, FFmpeg's LGPL DLLs alongside; works on Windows 10 and 11 |
| `docker/android.Dockerfile` | debug APK | SDK, NDK and cargo-ndk as in CI; `--build-arg ABIS=arm64-v8a,x86_64,armeabi-v7a` picks the ABIs |
Options go after the platform, straight to `docker build`:
```sh
scripts/docker-build.sh android --build-arg ABIS=arm64-v8a
scripts/docker-build.sh android --build-arg APK=release \
--secret id=keystore,src=release.jks --secret id=signing,src=signing.env
```
For the signed release APK, `signing.env` holds `VOELIN_SIGNING_STORE_PASSWORD=…`,
`VOELIN_SIGNING_KEY_ALIAS=…` and `VOELIN_SIGNING_KEY_PASSWORD=…`. Secrets are not
stored in the image or the build cache.
**Behind a proxy:** `scripts/docker-build.sh` passes `HTTPS_PROXY`,
`HTTP_PROXY` and `NO_PROXY` on to the build and uses host networking when
the proxy is on localhost. If the proxy inspects TLS, set
`BUILD_CA_CERT=/path/to/proxy-ca.pem` so the builds trust it.
## Locally without Docker
- **Linux:** the packages from the table above need
`sudo apt install libasound2-dev libfontconfig1-dev libxkbcommon-dev libvpx-dev libdav1d-dev libpipewire-0.3-dev libspa-0.2-dev libclang-dev cmake dpkg-dev patchelf`,
then `cargo build --release --locked -p voelin-ui -p voelin-gateway`
and `scripts/package.sh linux`.
- **Windows:** [packaging/windows/README.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/packaging/windows/README.md)
(MSVC, vcpkg libvpx and dav1d, NSIS), then
`bash scripts/fetch-ffmpeg-windows.sh ffmpeg && FFMPEG_DLL_DIR=ffmpeg bash scripts/package.sh windows`
from Git Bash.
- **Android:** [android.md](android) (SDK, NDK, cargo-ndk), then
`cd android && ./gradlew assembleDebug` and `scripts/package.sh android`.
- **Flatpak:** [packaging/README.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/packaging/README.md#flatpak).
On a trusted machine with rootful Docker,
`scripts/flatpak-build.sh` writes `dist/flatpak/voelin.flatpak` using the
release builder image. It requires a privileged container for Flatpak's
nested sandbox; do not use it on an untrusted build host.
## Depending on VoelinProtocol
`voelin-store` uses `voelin-identity` (the identity blobs, the account-bound
`KeyStore` and the sign-out rules) from the **private** VoelinProtocol
repository, as a Cargo git dependency in the workspace `Cargo.toml`:
```toml
[workspace.dependencies]
voelin-identity = { git = "ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git", rev = "…" }
```
It is pinned by commit until the protocol tags a release that has it; moving
to a newer protocol means changing the `rev` (later a `tag`) and committing
the resulting `Cargo.lock` together with `THIRD_PARTY_NOTICES.md`, which
`scripts/notices.sh` regenerates (the CI notices job fails on a stale one).
Cargo fetches it over SSH, so the machine needs an SSH key that can read
VoelinProtocol (an `ssh-agent` or a `~/.ssh/config` entry for
`git.faumaray.com`); if Cargo's built-in git client cannot use your SSH setup,
set `net.git-fetch-with-cli = true` in `~/.cargo/config.toml`.
`voelin-identity` builds AWS-LC from source (`aws-lc-sys`), which needs a C
compiler (gcc or clang) and cmake.
`deny.toml` allows this one git source.
**CI and the Docker builds need read access to that repository too**: an SSH
deploy key (a repository secret written to `~/.ssh`, with the server's host key
in `known_hosts`) or an access token (rewrite the SSH URL to HTTPS with
`git config --global url."https://<token>@git.faumaray.com/".insteadOf ssh://gitea@git.faumaray.com/`
and set `CARGO_NET_GIT_FETCH_WITH_CLI=true`). Without it `cargo` cannot fetch
the dependency and a fresh checkout does not build; the details are in
VoelinProtocol's `docs/development.md` ("Depending on VoelinProtocol").
### Working with a sibling VoelinProtocol checkout
To change the protocol and this client together, check VoelinProtocol out next
to this repository (`Projects/Voelin/VoelinProtocol` beside
`Projects/Voelin/VoelinClient`) and redirect the git dependency to it with a
per-developer `.cargo/config.toml` in the root of this repository:
```toml
# VoelinClient/.cargo/config.toml (per developer, never committed)
[patch."ssh://gitea@git.faumaray.com/Voelin/VoelinProtocol.git"]
voelin-identity = { path = "../VoelinProtocol/crates/voelin-identity" }
# voelin-proto is a dependency of voelin-identity from the same repository:
voelin-proto = { path = "../VoelinProtocol/crates/voelin-proto" }
```
- Relative paths in a Cargo config file resolve from the directory that
contains `.cargo`, so `../VoelinProtocol` is the sibling checkout. (A git
worktree of this repository, such as `.wt/<name>`, uses the matching number
of `../` or an absolute path.)
- The URL must be spelled exactly as in the workspace `Cargo.toml`.
- `/.cargo/` is in `.gitignore`: the file is yours and is never committed.
- With the patch active Cargo rewrites `Cargo.lock` (the patched crates lose
their git `source`). Do not commit that: run `git checkout Cargo.lock` before
committing, or remove the file and run `cargo update -p voelin-identity`
after changing the `rev`. CI builds with `--locked` and has no patch.
---
*Mirrored from [`docs/building.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/building.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+172
@@ -0,0 +1,172 @@
# CI
GitHub Actions runs `.github/workflows/ci.yml`, including Linux checks,
Windows and Android Clippy, and TeamSpeak integration smoke tests. Automatic
runs are off: CI, the dependency audit and fuzzing run only by hand
(Actions → the workflow → Run workflow; the same on Gitea). Only the package
builds run by themselves, on `v*` tags, and they run none of these checks.
Both GitHub and Gitea provide release packaging; see [release.md](release)
and [building.md](building).
Cargo builds use one job in CI (`ci.yml`) so the generated UI library and
its test target do not compile concurrently. GitHub's release workflow uses
one job too, also inside its Flatpak build: on its 16 GB runners the UI
library does not fit next to other crates, and the runner is killed. The
Gitea release workflow, its Docker images and the Flatpak manifest itself
use Cargo's defaults (one job per CPU, no incremental builds in release
mode). The release profile uses ThinLTO and
16 codegen units instead of fat LTO and one unit, reducing peak compiler
memory while retaining optimised builds and panic unwinding. This trades some
whole-program optimisation for lower build-memory requirements; release
runtime performance has not been benchmarked for this change.
## Gitea Actions
`.gitea/workflows/ci.yml` runs a single Linux job when dispatched by hand
(automatic runs on pushes and pull requests are off).
The job runs:
- formatting and warnings-as-errors Clippy for our crates;
- workspace Clippy (vendored warnings are reported, compilation errors fail);
- a locked workspace all-targets build and workspace tests under Xvfb;
- cargo-deny 0.20.2 workspace policy checks and the cargo-about 0.9.2 notices check;
- offline regression tests of the Gitea draft-release uploader.
The workspace tests are not disabled. Xvfb supplies the display for X11
capture and hotkey tests. This is Linux CI, not parity with every GitHub job:
it does not run Windows/Android checks, Docker-based TeamSpeak smoke tests,
opt-in browser interop, or package builds. Gitea release packaging runs in
the separate `release.yml` workflow below.
### Runner setup
1. Enable Actions on the Gitea instance and in the repository settings.
2. Register an **x86_64 Linux** `act_runner` with a Docker-capable host and
this label (the left side must match the workflow's `runs-on`):
```text
ubuntu-24.04:docker://ghcr.io/catthehacker/ubuntu:act-24.04
```
Configure this in the runner's labels when registering/configuring it;
an `ubuntu-latest` label alone does not match. The job image must provide
Bash, Git, Node.js for checkout v4, and root or passwordless sudo for apt.
3. Allow network access from the runner and job container to the Gitea
instance, GitHub (checkout action, dependencies and RustSec advisories),
GHCR (runner image), Ubuntu apt mirrors, rustup distribution servers,
crates.io and dependency/license sources used by cargo-about. The
workspace also depends on the **private** VoelinProtocol repository
(`voelin-identity`, over SSH), so the job needs read access to it: an SSH
deploy key or an access token, set up as in
[building.md](building#depending-on-voelinprotocol). Until a runner has
it, a fresh checkout does not build there.
4. Provision enough RAM, swap and free disk for a full Slint workspace build
plus cargo-deny/cargo-about compilation. These are large builds; monitor
the first run and size the runner accordingly. The workflow limits Cargo
to one build job, disables incremental compilation, and reuses build
outputs between steps in one job. It does not create swap or modify the
Gitea host.
5. The workflow requests a three-hour job timeout. Legacy `act_runner`
versions ignore `timeout-minutes`; configure their runner-level limit
in the runner configuration instead:
```yaml
runner:
timeout: 3h
```
Newer `gitea-runner` (2.0+) supports the workflow-level timeout. Check
the installed runner's configuration rather than assuming the YAML
timeout is enforced. The Gitea server also stops any task running
longer than `ENDLESS_TASK_TIMEOUT` (default `3h`, `[actions]` in
`app.ini`), whatever the runner or the workflow say; raise it above the
longest job (see the release runner below).
The workflow shares the repository's local system-dependencies action with
GitHub CI and bootstraps rustup if absent, then installs the toolchain and
components pinned in `rust-toolchain.toml`. Checkout uses a fully qualified
GitHub action URL rather than depending on the instance's action-source
configuration.
No GitHub cache/artifact service or reusable-workflow support is required.
The job does not need a Docker socket mounted inside its container; the
runner itself still needs Docker access to start that container. Keep this
runner isolated from production services and credentials, particularly when
accepting untrusted pull requests. No release signing or publishing secrets
are needed.
After registering the runner, dispatch **CI** in Gitea Actions and inspect
all step results. Local YAML/shell checks do not prove that a particular
Gitea instance, runner registration, network policy or resource allocation
can complete this job.
### Gitea release runner
The instance at `https://git.faumaray.ru` reported Gitea **1.25.4** on
2026-10-04. Release publishing uses its REST API; artifact upload uses the
pinned Gitea artifact-action fork, not stock GitHub upload-artifact v4.
Register a separate **repository-scoped**, **x86_64 Ubuntu 24.04 native
host** runner with the label:
```text
voelin-release:host
```
Provision Bash, Git, Node.js 20+, Python 3.11+, curl, tar, gzip and rootful
Docker 23+ with BuildKit. Use **act_runner 0.2.7 or newer** (prefer the latest
maintained release), or gitea-runner 2+. Older act_runner does not provide
`ACTIONS_RESULTS_URL`, which the pinned artifact action needs. Register the
runner against `https://git.faumaray.ru`, reachable from both the host and
build containers. Gitea 1.25.4 provides the required artifact-v4 API.
The shared checks install native build dependencies
through root or passwordless sudo and bootstrap Rust. Docker builds install
Windows cross-toolchains, Android SDK/NDK and Java themselves; no Windows
runner or preinstalled Android SDK is needed. The Flatpak builder runs a
privileged container using the same Freedesktop 25.08 image as GitHub.
Allow network access to the existing CI sources, Flathub, Google's Android
downloads/Maven, Chromium's libvpx git server, Docker Hub, GHCR and the
gateway image's distroless base at GCR. Configure Gitea release attachment
types/size limits and reverse-proxy upload limits for the APKs, Flatpak and
gateway image; artifact and release storage must fit the full package set.
This host is not the container runner used for pull requests. Restrict it
to this repository's trusted release workflow, protect `v*` tags, and only
dispatch trusted branches. Do not advertise this label on an instance-wide
runner that untrusted repositories or PR workflows can select. Docker and
Flatpak privileges effectively grant host access. Use an isolated machine
with no production services or credentials.
Configure **one release runner**, with capacity 1, so runs do not race:
```yaml
runner:
capacity: 1
timeout: 8h
```
The workflow requests eight hours; older act_runner ignores job-level
timeouts, so the runner limit is required. The server's own limit must
allow it too, or Gitea stops the release after three hours:
```ini
[actions]
ENDLESS_TASK_TIMEOUT = 9h
```
Keep sufficient RAM/swap and free disk for all package builds and their
Docker caches. The package builds run one after another, each with as many
Cargo jobs as the host has CPUs. The workflow never prunes shared Docker
state or creates host swap. The token and optional Android signing secrets
are documented in
[Gitea releases](release#gitea-releases).
The Gitea release job builds packages only: it runs no formatting, Clippy,
tests, native Windows, Android Clippy or TS3/TS6 smoke tests; run CI by hand
for those. Full hosted builds and a draft upload must be verified on the registered
runner; local shell/API fixtures do not establish deployment acceptance.
---
*Mirrored from [`docs/ci.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/ci.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+459
@@ -0,0 +1,459 @@
# Running the tsgw gateway
`tsgw` lets users of Voelin see who is in which channel and read and
write channel chat **without joining voice**, on a server you administer. It
holds ServerQuery sessions (invisible to normal users of the official clients)
and serves users over a WebSocket (`tsgw.v1+json`, see
[gateway-protocol.md](gateway-protocol)). It also adds what TeamSpeak does
not have: pinned messages, reactions, topics, scheduled events, a directory
of running streams and an activity feed. Voelin shows these only on servers
with a gateway; official TeamSpeak clients do not see them (topic posts
appear in the channel as `[#topic] text`).
## What users get
| Feature | How |
|---|---|
| Presence | One query session watches the server; each user sees the channels their `i_channel_subscribe_power` allows, without query clients |
| Channel chat | A relay query session is moved into each channel someone opened; it forwards what is said and posts users' messages under their own nickname, as if they wrote them |
| Server chat | Read by the watcher, posted by the gateway's lookup session |
| History | Relayed messages are stored (SQLite) with stable ids; pages by id or time in both directions, without a size limit unless you set one; `sync` returns what changed since a revision |
| Pins | Pinned messages per chat, kept even when older messages are pruned |
| Reactions | Any emoji on any stored message, with counts and who reacted |
| Topics | Threads in a chat, started from a message or standalone; posts are relayed as `[#Title] text`, and TeamSpeak posts in that form join the topic |
| Events | Scheduled events per server or channel, with RSVP (going / maybe / not going) and reminders; stream events show when the host goes live |
| Stream directory | Voelin streamers register running TeamSpeak 6 streams, so viewers who join later can find them; entries go when the streamer leaves or stops, and clients that stream without registering are listed as detected (without a stream id) |
| Activity feed | Streams started and stopped, events scheduled, starting or cancelled, topics started, messages pinned |
The nickname in relayed posts is the one the server has on record for the
user's identity (from `clientdbinfo`), not something the user can choose. For
each post the relay (or, for server chat, the lookup session) takes that
nickname, sends the message and takes its own name back; while someone on the
server has the nickname it uses `Nick1` to `Nick3`, as TeamSpeak names a second
client of the same name. Only when it can take none of them (a nickname under
three characters, the server refusing the change) does the post go out under
the relay's own name, as `relay.format` (`[Nick] text`).
Each feature can be turned off (`features.*`); pins, reactions and topics
need `history.enabled`.
## Authentication and authorization
Users log in by signing a challenge with their TeamSpeak identity. The
gateway derives the unique id (SHA-1 of the public key on TeamSpeak 3, SHA-256
on TeamSpeak 6) and looks it up with `clientdbfind`, so **an identity must have
connected to the server with voice once** before it can use the gateway.
Checks, mirroring what the user could do with a real connection
(`permoverview`, cached 60 s):
- identity security level ≥ `virtualserver_needed_identity_security_level`
(and `auth.min_security_level`); not in `banlist`; not in `auth.deny_uids`;
member of one of `auth.require_server_groups` if set
- read a channel: `i_channel_join_power` ≥ the channel's
`i_channel_needed_join_power`, and no channel password unless the user has
`b_channel_join_ignore_password`
- post in a channel: the above plus `b_client_channel_textmessage_send`
- post in server chat: `b_client_server_textmessage_send`
- see a channel in presence (and its events, streams and activity):
`i_channel_subscribe_power` (server level) ≥ the channel's
`channel_needed_subscribe_power`
Pins, reactions and topics also need read (reactions, pins) or post (topics)
access to the chat. On top of that, each action has a permission rule, see
[Permission rules](#permission-rules).
Posts are limited to `limits.posts_per_window` per `limits.post_window_secs`
per connection (5 per 5 s by default), other changes to
`limits.actions_per_window` per `limits.action_window_secs` (30 per 10 s).
Every login, post and settings change is written to the audit table.
## Setup
1. Enable ServerQuery. TeamSpeak 6 has it off by default:
`TSSERVER_QUERY_SSH_ENABLED=1` (the gateway needs events, so SSH, not HTTP).
TeamSpeak 3: raw (10011) or SSH (10022).
2. Use a query login with enough rights for `clientdbfind`, `clientdbinfo`,
`permoverview`, `banlist`, `clientmove`, `sendtextmessage`,
`servergroupsbyclientid` and `channelgroupclientlist`, e.g. a dedicated
login in the Server Admin group.
3. Put the address the server sees for the gateway into the server's
`query_ip_allowlist.txt` and set `query.allowlisted = true`. The server's
flood protection counts the query commands of each address, all of
tsgw's connections together and the SSH login included: it refuses the
10th command within 3 seconds and asks to wait, and two more commands
during the wait get the address banned for 600 seconds. tsgw logs the
address when it starts ("the TeamSpeak server sees the gateway's queries
coming from this address"):
- tsgw on the server's machine: `127.0.0.1`, which the file lists by
default.
- tsgw in a Docker container with bridge networking: the container's
or the bridge's address (e.g. `172.17.0.2`), not `127.0.0.1`. Add
that address, or run the container with `--network host`.
The server reads the file again within seconds, without a restart; that
also lifts a 600 s ban. Do not set `allowlisted = true` without the
entry in the file: tsgw then sends at full speed until the server
refuses a command, and an older tsgw got the address banned that way.
Now it stops at the first refusal and logs "the server limits this
address although it was taken to be on its query allowlist". Without
the allowlist tsgw stays under the limit itself (9 commands per 3 s
over all its connections) and, after a refusal (other query tools on
the same address count too), sends nothing on any connection for at
least 3 s, so logins are slower when many happen at once.
4. Each relayed channel is one more query connection. Keep
`relay.max_channel_relays` below the server's per-IP connection limit.
Relays count toward a channel's max clients unless their group has
`b_channel_join_ignore_maxclients`.
5. Install tsgw ([below](#install)), copy the example config to
`/etc/tsgw/tsgw.toml` and set the query address and credentials
(`TSGW_QUERY_PASSWORD` or `password_file`).
6. Run it behind TLS (Caddy, nginx) and publish it in DNS, or let it
answer on its default port next to the server
([below](#letting-voelin-find-the-gateway)): users only add the
server's address and never see the gateway.
## Letting Voelin find the gateway
When a user adds a server by its address (`ts.example.org`), Voelin looks
for its gateway the way TeamSpeak looks for the voice server (SRV
`_ts3._udp`, then TSDNS), and observes the server through it as soon as the
user selects the server (users do not type gateway URLs or query logins).
It asks at the server's host name and then at each parent domain down to the
registered domain, the most specific name first; for `ts.example.org` that
is `ts.example.org`, then `example.org`. It looks once per run when the
server is selected or connects with voice, and again when its address
changes: what is published takes the place of what was found before (a
lookup that finds nothing keeps it). Every gateway found is kept and
tried in turn, best first, each for up to 20 seconds; the first that logs
in is used, and the log file names those it passed over (URL and error).
Only when all of them fail does it wait (1, 2, 5, 10, 20, then every 30
seconds, give or take 30 %; at once when voice connects) and start over;
users see nothing of it. Only a refused login ends it (bad signature,
security level too low, banned, not allowed); a gateway that cannot do the
login yet (for example an identity the server has not seen) is tried again.
Once connected, the client pings the gateway every 30 seconds and connects
again after 60 seconds without an answer.
**DNS records** (preferred). An SRV record names the gateway's host and
port, the service name says whether it speaks TLS:
| Record | Gives |
|---|---|
| `_tsgws._tcp.<name> SRV <prio> <weight> <port> <host>` | `wss://<host>:<port>/v1` (TLS, e.g. behind Caddy or nginx) |
| `_tsgw._tcp.<name> SRV <prio> <weight> <port> <host>` | `ws://<host>:<port>/v1` (plain, e.g. tsgw itself on 7788) |
| `_tsgws._tcp.<name> TXT "path=/<path>"` (optional, same for `_tsgw`) | another path than `/v1`, e.g. behind a reverse proxy |
Which gateways: those of the most specific name that publishes a record,
and only those (a parent domain's records are another server's gateway
when the host publishes its own). At that name `_tsgws` before `_tsgw`,
among several records of one kind the lowest priority first, then tsgw's
own answer at that name (below), but only when a plain record is published
there, so a server that publishes only TLS is never reached without it. A
TLS proxy that fails (no rule for the host, no certificate) thus falls
back to the plain gateway published next to it. With no record at any
name, tsgw's own answer at the most specific name that gives one. A target
of `.` means "no gateway here" and the search goes on at the parent
domain. Examples (zone of `example.org`):
```dns
; Behind a TLS proxy at gw.example.org that forwards /tsgw/v1 to tsgw:
_tsgws._tcp.example.org. 3600 IN SRV 0 0 443 gw.example.org.
_tsgws._tcp.example.org. 3600 IN TXT "path=/tsgw/v1"
; -> wss://gw.example.org:443/tsgw/v1 for ts.example.org, voice.example.org, …
; tsgw itself, without TLS, next to the server ts.example.org:
_tsgw._tcp.ts.example.org. 3600 IN SRV 0 0 7788 ts.example.org.
; -> ws://ts.example.org:7788/v1, only for ts.example.org
```
The record's service name must match what listens on the port: tsgw
itself speaks plain WebSocket, so its own port (7788) is published as
`_tsgw`; a `_tsgws` record there makes Voelin start TLS with it, which
fails. Publish `_tsgws` only for a port with TLS in front.
Behind [Zoraxy](https://zoraxy.aroz.org/): add an HTTP proxy rule for the
gateway's host (`gw.example.org`) with one upstream, tsgw's plain address
(`<tsgw host>:7788`), "Proxy Target require TLS Connection" off,
WebSockets on, and a certificate for the host (ACME). If the rule also
has an uptime monitor, point it at `/health` (tsgw's `/` answers 404).
Check from outside: `curl https://gw.example.org/health` prints `ok` (or
what is missing while tsgw is not logged in to the TeamSpeak server, see
[Logs](#logs)); Zoraxy's own `404 page not found` there means no rule
matched the host or the request went to another upstream. Then set `listen.public_url =
"wss://gw.example.org/v1"` in tsgw.toml, so its own answer points at the
proxy.
One domain with several servers and several gateways: publish one record
per server host (`_tsgws._tcp.ts1.example.org`, `_tsgws._tcp.ts2.example.org`);
a record at the domain itself applies to every host below it that has none
of its own.
**Without DNS records** (like TSDNS on port 41144): Voelin asks
`http://<name>:7788/.well-known/tsgw` at the same names (and at an IP
address the server was added by). tsgw answers there with its URL,
`{"url": "…"}`: `listen.public_url` if set, else the address the request
came in on (`ws://<host>:7788/v1`). So a tsgw that listens on the default
port on the server's host is found with no setup at all; behind a proxy,
set `listen.public_url` so the answer points at the proxy.
Discovery is as trustworthy as DNS and the network, like TSDNS: prefer a
`_tsgws` record, so TLS proves the gateway is yours. Voelin checks a
`wss://` gateway's certificate against the system's certificate store, so
use one from a public CA (Caddy's automatic Let's Encrypt certificates
work); the Android app cannot reach `wss://` gateways yet (it has no
system store to read). A user logs in with
their own identity, when they select the server in Voelin.
## Install
tsgw is packaged for Linux servers, separately from the app
([building.md](building)): the release workflow attaches the packages and
the image (`tsgw-image.tar.gz`) to each release and uploads them as artifacts
when run by hand, and
`scripts/docker-build.sh linux` builds them locally.
**Debian/Ubuntu** (`tsgw_<version>_amd64.deb`, Ubuntu 24.04+ / Debian 13+).
It installs `/usr/bin/tsgw` and a systemd unit that is not started until
there is a config:
```sh
sudo apt install ./tsgw_<version>_amd64.deb
sudo install -d -m 755 /etc/tsgw
sudo cp /usr/share/doc/tsgw/examples/tsgw.example.toml /etc/tsgw/tsgw.toml
sudoedit /etc/tsgw/tsgw.toml
# The query password, readable by root only (systemd reads it before
# starting tsgw as an unprivileged dynamic user).
echo 'TSGW_QUERY_PASSWORD=…' | sudo install -m 600 /dev/stdin /etc/tsgw/tsgw.env
sudo systemctl enable --now tsgw
journalctl -u tsgw -f
```
The database (`history.path = "tsgw.db"`) ends up in `/var/lib/tsgw`. The unit
(`packaging/linux/tsgw.service`) runs tsgw sandboxed: no write access outside
that directory, network only.
**Other distributions** (`tsgw-<version>-linux-x86_64.tar.gz`): `bin/tsgw`,
the same unit in `lib/systemd/system/` and the example config in
`share/doc/tsgw/`. Copy the binary to `/usr/bin` (or change `ExecStart`) and
the unit to `/etc/systemd/system/`.
**Container** (`tsgw-image.tar.gz`, or build it):
```sh
docker load -i tsgw-image.tar.gz # or: docker build -f crates/voelin-gateway/Dockerfile -t tsgw .
docker run -d --name tsgw --init --restart unless-stopped \
-v $PWD/tsgw.toml:/etc/tsgw/tsgw.toml:ro -v tsgw-data:/var/lib/tsgw \
-e TSGW_QUERY_PASSWORD=… -p 7788:7788 tsgw
docker logs -f tsgw
```
The volume keeps the database (`/var/lib/tsgw/tsgw.db`: login tokens,
history, settings changed at runtime) when the container is replaced.
`--init` passes `docker stop` on to tsgw and cleans up after it;
`--restart unless-stopped` brings it back after a crash or a reboot. With
bridge networking (the default) see step 3 of [Setup](#setup) about the
address the TeamSpeak server sees.
**From source:** `cargo run --release -p voelin-gateway -- --config tsgw.toml`.
## Logs
tsgw logs to standard output: `journalctl -u tsgw -f` under systemd,
`docker logs -f tsgw` in a container (colours only on a terminal; `NO_COLOR`
turns them off there too). At the default level it logs:
- at start: the version and settings in use (whether a query password is
set, never the password itself), the query login and how long it took,
the address the TeamSpeak server sees for the gateway (with a hint when
`query.allowlisted` is off), "listening" with the URL apps are given;
- each app connection: its address, `X-Forwarded-For` and `User-Agent`,
then logins (unique id, nickname, signature or token, how long it took),
refused logins with the reason, requests slower than 1 s and the close
(reason, how long it was open). Every line of a connection carries its
number and address (`ws{id=12 peer=…}`);
- ServerQuery: failed commands (by name), each wait the server's flood
protection asks for, relays opened and closed, the watcher connecting
and losing its connection (with the attempt and the next wait), the
lookup connection lost and restored.
More detail with `log.level` (`TSGW_LOG_LEVEL`; without it `RUST_LOG`):
| Setting | Shows |
|---|---|
| `TSGW_LOG_LEVEL=debug` | also every request and its time, ServerQuery connections opening and closing |
| `TSGW_LOG_LEVEL=info,voelin_query=trace` | every query command sent and answered, with its time and the connection it went over (`lookup`, `observer`, `relay <channel>`) |
| `TSGW_LOG_LEVEL=warn` | only problems |
Libraries that log every packet (`russh`, `hyper`, `h2`, `tower`,
`tungstenite`) stay at warnings unless the setting names them
(`debug,russh=debug`). Under systemd put the variable into
`/etc/tsgw/tsgw.env`, in a container pass `-e TSGW_LOG_LEVEL=…`.
`log.file` (`TSGW_LOG_FILE`) writes the log to a file as well. tsgw appends
to it, also across restarts; at 20 MB it moves to `tsgw.1.log` (older ones
one further along, 5 files in all) and a new one starts. A relative path is
relative to the working directory, `/var/lib/tsgw` under systemd and in the
container (`TSGW_LOG_FILE=logs/tsgw.log` with the volume above). The systemd
unit can also write `/var/log/tsgw`. If the file cannot be opened, tsgw
says so and logs to standard output only.
While the TeamSpeak server cannot be reached (not started yet, restarting),
tsgw listens anyway and logs in as soon as it can, waiting 1, 2, 3, 5, 10,
then 30 seconds between attempts (longer if the server's flood protection
asks for it). Apps that connect meanwhile wait up to 10 seconds, then are
told to try again. A query connection the server drops is opened again the
same way, and relays that someone still reads or that are pinned come back.
Opening a query connection (connecting, logging in, selecting the server)
gives up after 10 seconds, so a server that does not answer holds up
nothing for long. `/health` answers
`ok` while the gateway is logged in and watching the server, otherwise 503
and what is missing (`starting: …`, `query: down, observer: up`).
## Visibility
Query clients are not hidden by the server; official clients hide them from
users whose `i_client_serverquery_view_power` is below the query client's
needed view power (100 by default). Server Admins, and third-party clients
that ignore the rule, see the gateway's sessions. Relayed posts show the
user's nickname, like a message the user wrote in TeamSpeak; whoever can see
query clients sees that it came from a query session.
## Configuration
`tsgw.toml` holds two kinds of keys (the example marks them):
- **Bootstrap** keys are needed before the database opens: `gateway_id`,
`server.voice_port`, `query.*` (transport, address, login, password,
`allowlisted`), `listen.bind`, `listen.public_url`, `history.path` and
`log.level`, `log.file` ([Logs](#logs)).
They come from the file, the environment or the command line and apply
at start; changing them needs a restart.
- Everything else (history, relays, features, permission rules, quotas,
limits, reminders) is a **seed**: the value in use unless an admin changes
it at runtime. Runtime changes are stored in the gateway's database and
apply at once, without a restart.
Where a value comes from, highest first:
| Source | How |
|---|---|
| `db` | set at runtime (`config_set`, `perm_set`), stored in the database |
| `cli` | `tsgw --set history.retention_days=90` (repeatable) |
| `env` | `TSGW_<KEY>`: upper case, dots become `_`, e.g. `TSGW_HISTORY_RETENTION_DAYS=90`, `TSGW_QUERY_PASSWORD=…`; lists as `1,2,3` or JSON, rules as JSON |
| `file` | `tsgw.toml` |
| `default` | built in |
**Reload.** `SIGHUP` (`systemctl reload tsgw`), a changed file (checked every
5 s) or the `config_reload` admin command reads the file again. Values set at
runtime keep winning; the log names every key where the file now says
something else ("file differs from the value set at runtime"). Bootstrap keys
changed in the file are logged as needing a restart. A file that does not
parse changes nothing. `config_reset` drops a runtime value, so the key falls
back to the command line, environment, file or default.
Changes apply live: relays pick up a new `relay.nickname` (the relay
sessions are replaced; channel chat keeps flowing), newly pinned channels
open, retention prunes at once, reminder times and quotas apply to the next
request, and connected apps get the new list of features.
### Keys
Numbers are non-negative; quotas and limits of 0 mean none. There are no
built-in caps on history pages, pins, topics, events or reactions: only what
you set here.
| Key | Default | |
|---|---|---|
| `auth.require_server_groups` | `[]` | If not empty, users need one of these server groups |
| `auth.deny_uids` | `[]` | Unique ids that may never use the gateway |
| `auth.min_security_level` | `0` | On top of the server's own requirement |
| `auth.token_ttl_hours` | `720` | Lifetime of login tokens |
| `relay.nickname` | `"Chat Relay"` | Relay sessions are named `<nickname> <cid>`, the lookup session `<nickname> Gateway` |
| `relay.format` | `"[{nick}] {text}"` | How posts appear when the relay cannot take the user's nickname |
| `relay.idle_teardown_secs` | `120` | Close a relay this long after its last reader left |
| `relay.max_channel_relays` | `6` | Concurrent relays (0: no limit) |
| `relay.pinned_channels` | `[]` | Always relayed, so their history is complete |
| `history.enabled` | `true` | Store messages; pins, reactions and topics need it |
| `history.retention_days` | `0` | Delete older messages (0: keep forever; pinned messages are kept) |
| `features.pins`, `.reactions`, `.topics`, `.events`, `.streams`, `.activity` | `true` | Turn features off; apps hide them |
| `topics.relay_format` | `"[#{topic}] {text}"` | How topic posts appear in TeamSpeak; TeamSpeak posts in this form join the topic |
| `events.reminder_minutes` | `[15, 0]` | Remind event subscribers this many minutes before the start (0: when it starts) |
| `events.stream_link_minutes` | `60` | A stream by the host links to a stream event from this long before its start until this long after its end |
| `activity.retention_days` | `0` | Delete older activity (0: keep forever) |
| `limits.posts_per_window` / `limits.post_window_secs` | `5` / `5` | Chat posts per connection |
| `limits.actions_per_window` / `limits.action_window_secs` | `30` / `10` | Pins, reactions, topics, events, streams per connection |
| `quota.history_page` | `0` | Most messages per history page |
| `quota.pins_per_channel` | `0` | Pins per chat |
| `quota.topics_per_channel` | `0` | Open topics per chat |
| `quota.events_per_user` | `0` | Upcoming events per creator |
| `quota.reactions_per_message` | `0` | Different emoji per message |
| `quota.reaction_bytes` | `64` | Longest reaction |
| `quota.message_bytes` | `0` | Longest post (TeamSpeak splits long ones anyway) |
| `quota.streams_per_user` | `0` | Directory entries per user |
| `perm.<action>` | unset | Permission rules, below |
Before this version history was pruned after 30 days by default; now the
default keeps it. Set `history.retention_days = 30` to keep the old behaviour.
### Admin commands
Users with the `admin` permission see the `admin` capability and can send
(see [gateway-protocol.md](gateway-protocol#administration)):
| Command | Does |
|---|---|
| `config_list` | Every key with value, source (`db`, `cli`, `env`, `file`, `default`), default, type, description and whether it is bootstrap; the query password is shown as `***` |
| `config_get {key}` | One key |
| `config_set {key, value}` | Store a value at runtime (JSON of the key's type); applies at once |
| `config_reset {key}` | Drop the runtime value |
| `config_reload` | Read the file again, like `SIGHUP` |
| `perm_list` | The rule of every action, its source and what the default allows |
| `perm_set {action, rule}` | Set a rule (same as `config_set perm.<action>`) |
| `perm_reset {action}` | Back to the file's rule or the default |
## Permission rules
Each action has a rule: who may do it, by TeamSpeak server group ids and/or
channel group ids (in the channel concerned), or everyone:
```toml
[perm]
pin = { server_groups = [6], channel_groups = [5] } # Server Admin, Channel Admin
create_event = { server_groups = [6, 7] }
react = { everyone = true }
```
A rule replaces the action's default; `{}` allows nobody. Users with `admin`
may do everything, and whoever may `moderate` a channel may also pin there.
Access to the chat itself (read, or post for topics) is always required.
Groups come from presence for users who are online and from
`servergroupsbyclientid` / `channelgroupclientlist` (cached 60 s) otherwise.
| Action | Default without a rule |
|---|---|
| `react` | everyone who can read the chat |
| `pin` | moderators and admins |
| `create_topic` | everyone who can post in the chat |
| `create_event` | everyone who can post in the event's channel (server chat for server-wide events) |
| `rsvp` | everyone |
| `stream` | everyone (their own streams) |
| `moderate` | `b_channel_modify_name` in the channel (Channel Admin): edit or delete others' topics, events, streams and pins |
| `admin` | `b_virtualserver_modify_name` (Server Admin): settings and rules |
Creators may always edit and delete their own topics, events and stream
entries.
## Data
The database (`history.path`, SQLite in WAL mode) holds login tokens, chat
messages with pins, reactions and topics, events and RSVPs, the stream
directory (so it survives a restart; entries whose client is gone are dropped
once the gateway sees the server), the activity feed, settings changed at
runtime and the audit log. The schema is versioned (`PRAGMA user_version`)
and migrated in place at start, keeping existing messages and their ids.
Message ids are never reused, even after pruning, so apps can merge history
with what they store locally.
---
*Mirrored from [`docs/gateway-admin.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/gateway-admin.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+197
@@ -0,0 +1,197 @@
# Gateway protocol (`tsgw.v1+json`)
How Voelin talks to `tsgw` ([gateway-admin.md](gateway-admin)). The types
are in `crates/voelin-gateway-proto` (`messages.rs`, `types.rs`); its
`client` feature is a typed client (one async method per request, pushes as
`Push`), which the app uses through `voelin_core::gateway`: the engine's
`Command::Gateway` requests and `Event::Gateway` updates map onto the
messages below one to one, and the chat history sync uses `query_history`
and `sync` ([architecture.md](architecture#chat-history)).
`voelinctl gateway --engine --request '<json>'` sends any request through
the engine, e.g. `'{"config_get":{"key":"relay.pinned_channels"}}'`.
## Transport
WebSocket to `…/v1`, subprotocol `tsgw.v1+json`, one JSON envelope per text
frame:
```json
{"v":1,"id":7,"type":"send_chat","data":{"target":{"kind":"channel","id":5},"text":"hi"}}
```
Next to it, `GET /.well-known/tsgw` answers `{"url": "…"}`, the URL apps
should use (`listen.public_url`, else the one the request came in on); apps
that find no DNS record ask there ([gateway-admin.md](gateway-admin#letting-voelin-find-the-gateway),
`voelin_core::discover`).
The client picks `id` for requests; the answer carries the same `id`.
Pushes have no `id`. Version 1 only grows: new message types and optional
fields. Both sides ignore unknown fields. The gateway answers a type it does
not know with `error` / `unknown_type` (and a malformed message with
`bad_request`), with the request's `id`, and keeps the connection.
Older clients never receive a type they do not know: the newer pushes only go
to clients that asked for them (`enable`, `subscribe_*`), and newer error
codes only answer newer requests. Enums that may grow (`ErrorCode`,
`EventKind`, `RsvpStatus`, `Action`, `StreamSource`, `ConfigSource`) have an
`unknown` fallback in the Rust types; activity kinds are plain strings.
## Login and capabilities
1. Gateway: `hello {gateway_id, server_uid, server_name, nonce, capabilities}`.
2. Client: `auth {omega, key_offset, ts, signature, nickname}`, an ECDSA
signature with the TeamSpeak identity over
`tsgw-auth-v1\n{gateway_id}\n{server_uid}\n{nonce}\n{ts}`, or
`resume {token, nickname}`.
3. Gateway: `auth_ok {uid, token, token_expires, capabilities}` or `error`.
`capabilities` in `hello` lists the features enabled on the gateway;
`auth_ok` repeats them for this user and adds `admin` when the user may
administer the gateway. A `capabilities {capabilities}` push follows when an
admin turns a feature on or off (to clients that sent `enable` or subscribed
to something). Clients hide what is missing.
| Capability | Meaning |
|---|---|
| `presence` | `subscribe_presence` |
| `relay` | channel and server chat |
| `history` | stored messages: `history`, `query_history`, `sync` |
| `pins`, `reactions`, `topics` | on stored messages |
| `events` | scheduled events |
| `streams` | stream directory |
| `activity` | activity feed |
| `admin` | configuration and permission rules (only in `auth_ok`) |
## Original messages
| Client → gateway | Answer |
|---|---|
| `subscribe_presence` / `unsubscribe_presence` | `presence_snapshot {seq, snapshot}`, then `presence_delta {seq, delta}` pushes / `ok` |
| `open_chat {target}` / `close_chat {target}` | `ok`; chat arrives as `chat_event {id, message}` (or `message`, below) |
| `send_chat {target, text}` | `ok` |
| `history {target, before?, limit}` | `history {messages}`, oldest first |
| `ping` | `pong` |
`history` entries now also carry `topic_id`, `reactions`, `pinned` and
`rev` (all omitted when empty); `limit` is no longer capped at 200, only by
`quota.history_page` if an admin sets it.
## Chat extensions
**`enable {features}`** → `enabled {features}`. After it, messages in open
chats arrive as `message {entry}` instead of `chat_event`, with the pushes
of the listed features (`pins`, `reactions`, `topics`; empty: all). Clients
that do not send it see topic posts in `chat_event` with the topic prefix.
A stored message (`HistoryEntry`):
```json
{"id":42,"message":{"target":{"kind":"channel","id":5},"author_name":"Bob","author_uid":"…",
"text":"hi","ts_ms":1700000000123,"via_relay":true},
"topic_id":3,"reactions":[{"emoji":"🦀","count":2,"me":true}],"pinned":true,"rev":1700000000200001}
```
`id` is stable and never reused; `ts_ms` is when the gateway saw it; `rev`
increases with every change to the message (post, pin, reaction), across
restarts.
| Request | Answer | Notes |
|---|---|---|
| `query_history {target, before?, after?, before_ms?, after_ms?, limit?, topic?, exclude_topics?}` | `history_page {target, topic?, messages, has_more}` | Oldest first. No cursor: the latest `limit`. `before`: the `limit` right before it. `after`: the `limit` right after it. Both: the range from `after`. `*_ms` are times (Unix ms). No `limit`: everything in range. `has_more`: more beyond the page in the paging direction |
| `sync {target, since_rev, limit?}` | `sync_page {target, messages, rev, has_more}` | New and changed messages by revision; pass `rev` next time |
| `post {target, text, topic?}` | `posted {entry}` | Like `send_chat`, returns the stored message; into a topic, TeamSpeak sees `[#Title] text` |
| `pin {message_id}` / `unpin {message_id}` | `ok` | Pushes `pinned {target, pin}` / `unpinned {target, message_id, by}` |
| `list_pins {target}` | `pins {target, pins}` | Newest first; `pin` is `{entry, by, ts_ms}` |
| `react {message_id, emoji}` / `unreact {…}` | `ok` | Any string without spaces. Push `reaction {target, message_id, emoji, user, added, count}` |
| `reactors {message_id, emoji}` | `reactors {message_id, emoji, users}` | |
| `create_topic {target, title, message_id?}` | `topic {topic}` | Push `topic_updated {topic}` (also on renames, archiving and new posts) |
| `update_topic {topic_id, title?, archived?}` | `topic {topic}` | Creator or moderator; archived topics take no posts |
| `list_topics {target, include_archived}` | `topics {target, topics}` | Most recently active first; `topic` has `message_count`, `last_activity_ms`, `root_message_id` |
| `permissions {channel?}` | `permissions {channel, actions}` | Actions the user may take (to hide buttons) |
`user`, `by` and `creator` are `{uid, name}`.
## Events
| Request | Answer |
|---|---|
| `create_event {event: EventSpec}` | `event {event}` |
| `update_event {id, event: EventSpec}` | `event {event}` (creator or moderator) |
| `delete_event {id}` | `ok` |
| `get_event {id}` | `event {event}` with `attendees` |
| `list_events {from_ms?, to_ms?, channel?, limit?}` | `events {events}` by start; default from now, including running events |
| `rsvp {event_id, status}` | `event {event}`; `status` `going`, `maybe`, `not_going` or `null` to withdraw |
| `subscribe_events` / `unsubscribe_events` | `ok` |
`EventSpec`: `{title, description, start_ms, end_ms?, channel?, kind:
"general"|"stream", stream_title?, stream_game?, host_uid?}`. An event adds
`id, creator, created_ms, updated_ms, going, maybe, not_going, my_rsvp?,
attendees?, live_stream?`. When the host of a stream event registers a stream
around its time, `live_stream` is the directory id until the stream ends.
Pushes to subscribers (only for events in channels they can see):
`event_updated {event}` (created, changed, RSVP counts, live),
`event_deleted {id}`, `event_reminder {event, starts_in_ms}` at the times in
`events.reminder_minutes`.
## Stream directory
| Request | Answer |
|---|---|
| `register_stream {stream_id, client_id?, channel?, title, kind, viewers?}` | `stream {stream}` |
| `update_stream {stream_id, title?, viewers?}` | `stream {stream}` |
| `unregister_stream {stream_id}` | `ok` |
| `list_streams` | `streams {streams}` |
| `subscribe_streams` / `unsubscribe_streams` | `streams {streams}` / `ok` |
An entry: `{id, stream_id?, streamer, client_id?, channel?, title, kind,
started_ms, viewers?, source: "registered"|"detected", event_id?}`. `id` is
the stream id, or `client/<clid>` for detected streams (a client with
`client_is_streaming` but no registration; its stream id is unknown).
`client_id` must be the registering user's own voice client; with it the
gateway drops the entry when that client leaves or stops streaming and
follows it to other channels. Entries without a `client_id` end with the
registering connection. Pushes to subscribers: `stream_started {stream}`,
`stream_updated {stream}`, `stream_ended {id, reason}`.
## Activity feed
`list_activity {before?, limit?}` → `activity {entries, has_more}`, newest
first; `subscribe_activity` / `unsubscribe_activity` → `ok`, then
`activity_added {entry}` pushes. An entry: `{id, ts_ms, kind, actor?,
channel?, ref_id?, text, data}`; `text` is a readable summary for kinds the
client does not know. Kinds so far: `stream_started`, `stream_ended`,
`event_created`, `event_cancelled`, `event_starting`, `topic_created`,
`pinned`.
## Administration
Needs the `admin` capability; see [gateway-admin.md](gateway-admin#admin-commands).
| Request | Answer |
|---|---|
| `config_list` | `config {entries}` |
| `config_get {key}` | `config_value {entry}` |
| `config_set {key, value}` | `config_value {entry}` |
| `config_reset {key}` | `config_value {entry}` |
| `config_reload` | `config {entries}` |
| `perm_list` | `perm_rules {rules}` |
| `perm_set {action, rule: {everyone?, server_groups?, channel_groups?}}` | `perm_rules {rules}` |
| `perm_reset {action}` | `perm_rules {rules}` |
`entry`: `{key, value, source: "db"|"cli"|"env"|"file"|"default", default,
type, description, bootstrap?}`. `rules`: `{action, rule?, source, default}`
for `react`, `pin`, `create_topic`, `create_event`, `rsvp`, `stream`,
`moderate`, `admin`.
## Errors
`error {code, message}` with `code`: `bad_request`, `auth_failed`,
`unknown_identity`, `level_too_low`, `banned`, `forbidden`,
`not_authenticated`, `unavailable`, `internal`, and for the extensions
`unknown_type`, `not_found`, `quota_exceeded`, `rate_limited`,
`feature_disabled`.
---
*Mirrored from [`docs/gateway-protocol.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/gateway-protocol.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+144
@@ -0,0 +1,144 @@
# Translations
The UI uses Slint's gettext-based translation markers: strings in
`.slint` files are marked with `@tr(...)`, extracted into a `.pot` template,
translated in `.po` files, and can be **compiled into the binary** (Slint's bundled
translations). The repository currently has a `.pot` template but no `.po`
translations; bundled translations are not enabled yet. Nothing needs to be
loaded at runtime, so there is no dependency on
GNU gettext (LGPL) and it works the same on Linux, Windows and Android.
## Marking strings
In `.slint` files every user-visible string goes through `@tr`:
```slint
Button { text: @tr("Connect"); }
Text { text: @tr("Connected to {}", server-name); } // arguments: {} or {0} {1}
Text { text: @tr("{n} user online" | "{n} users online" % count); } // plurals
Text { text: @tr("menu" => "Quit"); } // explicit context
```
- Whole sentences with placeholders, never concatenated fragments: word
order differs between languages. Use `{0}`, `{1}` when there are several
arguments, so translators can reorder them.
- Plurals always with the `|` / `%` form, even if English only needs two
forms; other languages have more.
- Not translated: nicknames, channel and server names, chat text, protocol
identifiers, the product name, log messages.
- By default the context of a string is the name of the component it is in,
so the same English word can be translated differently in different
places. Renaming a component therefore invalidates its translations until
they are merged again (`msgmerge` keeps them as fuzzy).
Strings produced in Rust (error messages, notification texts, status lines)
cannot use `@tr`. Keep the wording in Slint: an exported global with pure
functions that the Rust code calls, e.g.
```slint
export global Strings {
pure public function connection-lost(reason: string) -> string {
return @tr("Connection lost: {}", reason);
}
}
```
```rust
let text = window.global::<Strings>().invoke_connection_lost(reason.into());
```
Errors from lower layers (protocol, IO) are shown as details after a
translated sentence; they stay in English.
## Files
```
crates/voelin-ui/lang/
voelin-ui.pot template, generated
de/LC_MESSAGES/voelin-ui.po one directory per language (gettext locale name)
pt_BR/LC_MESSAGES/voelin-ui.po
```
The file name is the translation domain, which is the crate name
(`voelin-ui`); Slint's build looks for `lang/<lang>/LC_MESSAGES/<crate>.po`.
## Workflow
Tools (developer machines only): `cargo install slint-tr-extractor`, and
GNU gettext for `msgmerge` / `msginit` (`gettext` package; on Windows from
MSYS2 or Git for Windows' bundled tools).
```sh
# 1. Extract the template after changing strings
mkdir -p crates/voelin-ui/lang
rg --files crates/voelin-ui/ui -g '*.slint' | sort | \
xargs slint-tr-extractor --package-name voelin-ui -o crates/voelin-ui/lang/voelin-ui.pot
# 2. Update every translation (new strings empty, changed ones fuzzy)
for po in crates/voelin-ui/lang/*/LC_MESSAGES/voelin-ui.po; do
msgmerge --update --backup=none "$po" crates/voelin-ui/lang/voelin-ui.pot
done
# 3. Start a new language
mkdir -p crates/voelin-ui/lang/de/LC_MESSAGES
msginit --no-translator --locale=de --input=crates/voelin-ui/lang/voelin-ui.pot \
--output-file=crates/voelin-ui/lang/de/LC_MESSAGES/voelin-ui.po
```
Translators edit the `.po` files (Poedit, Lokalize, or a hosted service
such as Weblate pointed at `crates/voelin-ui/lang`). Fuzzy and untranslated
entries fall back to English. Run the extraction when strings change and
before each release (string freeze, see [release.md](release)). The
template carries a creation date and source line numbers, so CI does not
compare it exactly; a stale template only means new strings are not
translatable yet.
## Bundling and language selection
Once the first `.po` translation exists, configure `crates/voelin-ui/build.rs`
to compile translations into the binary:
```rust
slint_build::compile_with_config(
"ui/app.slint",
slint_build::CompilerConfiguration::new()
.with_style("fluent-dark".into())
.with_bundled_translations("lang"),
)
```
slint-build tracks the `.po` files, so edits rebuild. It fails ("No
translations found") while `lang/` has no `.po` file yet, so enable it
together with the first language.
At startup Slint picks the translation matching the system locale (exact
match such as `pt_BR` first, then the language `pt`), English otherwise. A
language setting in the app (stored in the settings, "System" by default)
calls `slint::select_bundled_translation("de")` after the window has been
created; `""` or `"en"` selects English. Changing it takes effect
immediately for all `@tr` strings.
The desktop app (voelin-ui) and the Android app share the `.slint` files and
therefore the translations. Texts outside Slint need their own mechanism:
- Android system texts (foreground service notification, permission
rationale): Android string resources in `android/app/src/main/res/values-<lang>/`.
- Desktop file and AppStream metainfo: translated with `itstool` / `msgfmt
--desktop` / `msgfmt --xml` from `.po` files when there are translations
for the app itself.
## Checks
- A pseudo-translation catches unmarked strings and truncation: create a
test language (e.g. `lang/eo/`) with `msgen` from the template, replace
the texts with longer accented versions, and select it with the language
setting (or `LANG=eo.UTF-8` on Linux).
- Test at least one language with longer words (German) and one with a
different script (Russian) on every screen before a release (manual
matrix row GE7).
- Dates and numbers are formatted in Rust; use unambiguous formats
(ISO dates, 24-hour times) until there is locale-aware formatting.
---
*Mirrored from [`docs/i18n.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/i18n.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+256
@@ -0,0 +1,256 @@
# Identities
A TeamSpeak identity is an ECC P-256 key pair. The public key gives the client
its unique id, which is how every server recognises it; the private key proves
ownership. Losing it means losing every server group, every permission and
every friend entry tied to that id — and anyone who copies it can impersonate
its owner on every server. **An identity file is a secret. Treat it like an SSH
private key.**
Voelin can import identities from the official clients so that switching does
not mean starting over, and export them back so they are never trapped here.
The myTeamSpeak account has a separate signing identity, which could
authenticate a `myTS ID` on voice servers without replacing the P-256 identity
that owns server permissions. This build has no account sign-in, so it presents
none; the account returns through the gateway. See
[the account protocol notes](research%2Fmyteamspeak#authenticated-account-identity-on-voice-servers).
## The unique ids
Both generations derive the unique id from `omega`, the base64 of the DER
("tomcrypt") encoding of the *public* key:
| Server | Unique id |
| --- | --- |
| TeamSpeak 3 | `base64(SHA1(omega))`, 28 characters |
| TeamSpeak 6 | `base64(SHA256(omega))`, 44 characters |
The same key therefore has two ids. `voelinctl identity show` prints both
(`uid` and `uid6`); the store keys identities by the TeamSpeak 3 id, which is
the shorter and older of the two.
The *security level* is hash cash over `omega`: the number of trailing zero
bits of `SHA1(omega || decimal counter)`, counted from the first byte. The
counter is stored next to the key; raising it raises the level, which is why
the counter travels with every export. Servers commonly require level 8.
## The export string
Every format below ultimately holds the same string:
```
<counter>V<obfuscated base64>
```
- `<counter>` is the hash cash counter in decimal.
- `V` separates it (the obfuscated part is base64, which never contains `V`
before the first `V` here because the counter is digits only).
- The obfuscated part is `base64(obfuscate(base64(DER key pair)))`, where the
DER is tomcrypt's `SEQUENCE { BIT STRING, INTEGER 32, INTEGER x, INTEGER y,
INTEGER private }` (109–117 bytes in practice, so 152 base64 characters, so
204 characters after the second base64).
- `obfuscate` XORs the first 100 bytes with a fixed 128-byte table and the
first 20 bytes with `SHA1` of the bytes from offset 20 up to the first zero
byte. It is not encryption; it stops nothing. The algorithm lives in
`tsproto_types::crypto::EccKeyPrivP256::{from,to}_ts_obfuscated`.
`tsproto`'s `Identity::new_from_ts_str` parses this string, so every importer
below only has to find it.
## Where the clients keep it
### TeamSpeak 3 and TeamSpeak 6: the `ProtobufItems` table
Both clients store identities in a table of the same shape, in their
`settings.db` (SQLite):
```sql
CREATE TABLE ProtobufItems (
timestamp integer unsigned NOT NULL,
key varchar NOT NULL UNIQUE,
value varchar -- protobuf bytes, despite the column type
)
```
`key` is `"1"`, `"2"`, … for the items plus one row `"Checksum"`. Each item
`value` is a protobuf message with a common header and one payload field:
| Field | Wire type | Meaning |
| --- | --- | --- |
| 2 | bytes | the item's own UUID (36 characters, with dashes) |
| 3 | bytes | a second UUID; present in TeamSpeak 6 rows, absent in TeamSpeak 3 rows |
| 4 | varint | small enum, 1 or 3 observed |
| 5 | bytes | optional UUID |
| 6 | varint | **item type**, 0–5 |
| 7, 8 | bytes | optional UUIDs, usually empty |
| 9 | varint | Unix timestamp in seconds |
| 16 + type | bytes | the payload, one field per item type |
The payload field number is `16 + type`, so the type in field 6 says which
field carries the body. **Type 1, payload field 17, is an identity:**
| Field | Wire type | Meaning |
| --- | --- | --- |
| 1 | bytes | the export string `<counter>V<obfuscated base64>` (207–213 characters) |
| 2 | bytes | the nickname, UTF-8 |
| 3 | bytes | an 8-character alphanumeric token, identical for every identity in one install — an account or device identifier, not part of the key |
| 4 | bytes | empty in every row seen |
| 5 | varint | 1 on exactly one identity: the selected one |
Voelin reads fields 1, 2 and 5 and ignores the rest. The other item types
(0, 2, 3, 4, 5 — connection profiles, bookmarks, server lists and such) are
**not** decoded; they are skipped by their type, not by guessing at their
contents.
The `Checksum` row is `SHA1` over the concatenation of the other rows' `value`
blobs in ascending numeric `key` order — 20 bytes, no key, no length prefixes.
It is an integrity check the client writes. Voelin does not verify it: it never
writes these files, so it cannot invalidate one, and refusing to import from a
database whose checksum a third-party tool left stale would help nobody. A key
that does not parse is rejected on its own merits.
`AccountData/Account` in the TeamSpeak 6 database is the myTeamSpeak account
record, not an identity — see [research/myteamspeak.md](research%2Fmyteamspeak).
It contains no ASN.1 key pair.
### TeamSpeak 3: `.ini` export
"Export identity" in the TeamSpeak 3 client writes:
```ini
[Identity]
id=friendly name
identity="<counter>V<obfuscated base64>"
nickname=Nickname
```
The quotes around `identity` are optional in files seen in the wild, so both
forms are accepted. Keys are matched case-insensitively and the section header
is not required.
### TeamSpeak 3: older `Profiles` rows
Client versions before the protobuf tables kept identities in the `Profiles`
table of `settings.db` as `Identities/<n>/identity` and
`Identities/<n>/nickname` rows. Voelin reads those too when they are present.
A current 3.6 install has only `Capture/…` and `Playback/…` rows there.
### `ts3clientui_qt.secrets.conf`
Some TeamSpeak 3 builds keep the identity list in this Qt config file next to
`settings.db`. It is read by the same line scanner as the `.ini` export: every
`identity=` line becomes an identity and everything else is ignored. No such
file existed on the installation this was developed against, so that path is
best-effort — if a build wraps the lines in a container of its own, Voelin
finds nothing in it rather than guessing.
## Default locations
Voelin looks in these places with `--auto`; each is opened read-only and none
is ever written.
| Client | Linux | Windows | macOS |
| --- | --- | --- | --- |
| TeamSpeak 3 | `~/.ts3client/settings.db` | `%APPDATA%\TS3Client\settings.db` | `~/Library/Application Support/TeamSpeak 3/settings.db` |
| TeamSpeak 6 | `~/.config/TeamSpeak/Default/settings.db` | `%APPDATA%\TeamSpeak\Default\settings.db` | `~/Library/Application Support/TeamSpeak/Default/settings.db` |
| TeamSpeak 6, Flatpak | `~/.var/app/com.teamspeak.TeamSpeak/config/TeamSpeak/Default/settings.db` | — | — |
| TeamSpeak 3, Flatpak | `~/.var/app/com.teamspeak.TeamSpeak3/.ts3client/settings.db` | — | — |
`$XDG_CONFIG_HOME` is honoured on Linux where the client honours it. Portable
installs keep `settings.db` next to the executable; point `--from` at it.
## What Voelin does
`voelin_core::identity` reads and writes these forms; `voelinctl` drives it:
```
voelinctl identity import --auto [--dry-run] [--store <db>]
voelinctl identity import --from <path> [--dry-run] [--store <db>]
voelinctl identity list [--store <db>]
voelinctl identity export <id> <path> [--store <db>]
```
`--store` defaults to the desktop app's client database,
`<data dir>/voelin/client.db`, so the CLI and the app share identities.
**On every start** the app does the same as `import --auto`
(`voelin_core::identity::import_new`): identities found in the default
locations that the client database does not have yet are added, the files
are only read. The user should appear as on the official client, so the
identity the official client uses by default (field 5 of its payload, below;
TeamSpeak 6's before TeamSpeak 3's) becomes Voelin's default when Voelin has
none, or only the one it created on its own the first time it started,
which nobody chose. That happens once: the created identity is kept, and
choosing it again in Settings → Profiles makes it the user's own, which
no import replaces; identities that were imported or chosen are never
replaced. The store keeps where each identity came from and which one is the
default (`identities.origin`: `created`, `imported`, `user`;
`identities.is_default`; schema version 4, which marks the first identity
named `Default` of an older database as created). What happened is shown
once in the status line (the toast on desktop), by nickname, e.g. "You now
use your TeamSpeak identity "X"; your previous one is kept". The runtime
setting `identity.import_from_teamspeak` (default on, also in Settings →
Profiles) turns it off, e.g. `--set identity.import_from_teamspeak=false`.
The sample data of `VOELIN_DEMO_UI` never imports.
**Settings → Profiles** lists the stored identities with where they came
from ("Made in Voelin", "Imported", "Chosen by you"), their security level
and unique ids; "Use as default" picks the one servers see from the next
connection on (`Store::set_default_identity` as the user's choice). The
store's default is the only default: a server connects with the identity its
bookmark names, if any (Profiles → Identity per server), else with the
store's default, and My Account shows the one the current server uses. The
page also renames, exports, deletes and raises the security level of
identities, and finds and imports the official clients' identities by
hand. `voelinctl identity list` shows the same (origin and default).
`VOELIN_OPEN=settings:profiles` (or `settings:identities`) opens it.
- **Import** prints what it found as nickname, unique id and security level —
all three are public, everything else in an identity is the private key —
and stores each one through `voelin-store` under its nickname. An identity
whose TeamSpeak 3 unique id is already in the store is reported as a
duplicate instead of being added twice, including repeats within one run.
`--dry-run` reads and stores nothing. With `--auto`, a location that holds
no identity is reported and skipped rather than ending the run.
- Source files are opened read-only (`SQLITE_OPEN_READ_ONLY`) **and
`immutable`**, so SQLite takes no lock, creates no `-shm` file and does not
replay a write-ahead log the running client left behind. Nothing of the
user's is written, moved or copied. The cost is that an identity the client
has written but not yet checkpointed into the main database file is not
seen; closing the official client first makes sure everything is there.
- **Export** writes the TeamSpeak 3 `.ini` form, which the official client and
every other tool read. A new file is created with mode `0600` on Unix,
before anything is written into it.
An import is only trusted when the key pair is whole: the public key derived
from the private scalar has to verify what that scalar signs. The tests check
this on synthetic identities, and on a real installation when
`VOELIN_IDENTITY_IMPORT_CHECK` points `cargo test -p voelin-core` at a
database — which is how this was verified without any client's data entering
the repository. Every fixture in the tests is generated by
`tsclientlib::Identity::create`.
## Not supported
- **Encrypted identity exports.** The TeamSpeak 3 client can password-protect
an `.ini` export; that container is not decoded. Export without a password
and import that.
- **The other `ProtobufItems` item types.** Bookmarks, connection profiles and
server lists are not imported. Only identities are.
- **myTeamSpeak identity synchronisation.** There is no account sign-in in
this build, so no cloud identities are fetched and no account backups are
decrypted. Sign in with the official client once so it writes the identities
to `settings.db`, then import from there. See
[research/myteamspeak.md](research%2Fmyteamspeak) for the account protocol
notes; the account returns through the gateway.
- **Writing back to the official clients.** Voelin only reads them. Use the
`.ini` export and the client's own import.
- **Bringing the nickname's history along.** Only the key pair and the
nickname are imported. Which servers an identity was used on, its badges and
its myTeamSpeak links stay behind; servers re-associate by unique id on the
next connection, which is the part that matters.
---
*Mirrored from [`docs/identity.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/identity.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+1460
File diff suppressed because it is too large. Load diff
+429
@@ -0,0 +1,429 @@
# TeamSpeak 6: protocol notes
Everything here is reverse-engineered or collected from public sources. Mark each
item as **confirmed** (seen against our own server or in working code) or
**reported** (single secondary source). Update this file whenever a probe or
capture teaches something new.
## Legacy protocol on TS6 servers
- **Confirmed** (voelinctl, 6.0.0-beta13.1, 2026-09-25): the TS3 client protocol
connects (`initivexpand2` license chain with the TS5-server block type),
channel tree, server chat and channel chat work. Client version: the vendored
default `Windows_3_X_X__1`.
- **Confirmed**: new fields the vendored declarations do not know yet (logged as
"Unknown argument"):
- `initserver`: `virtualserver_address`, `virtualserver_version_sign`
- `initserver` / `notifycliententerview`: `client_is_streaming`
- **Confirmed**: unique ids differ. TeamSpeak 3 uses `base64(SHA1(omega))`
(28 characters), TeamSpeak 6 uses `base64(SHA256(omega))` (44 characters),
where omega is the base64 public key string. The same identity therefore has
a different `client_unique_identifier` on each server generation
(`voelin-gateway-proto::UniqueIds`).
- **Confirmed**: TS6 has no raw ServerQuery port; SSH query on 10022 and HTTP
WebQuery on 10080 (HTTPS 10443).
- **Reported**: beta13 made the Init1 puzzle difficulty adaptive to the server's
protection level.
## Screen sharing / streams
Transport (**reported**, TeamSpeak staff on community.teamspeak.com):
- WebRTC peer-to-peer between clients; the server only relays signalling. No SFU yet.
- ICE with STUN only (`turn.teamspeak.com`, `turn2.teamspeak.com`; no TURN relay).
- Media ports: UDP 49152–65535.
- Streams are channel-scoped: "public" means everyone in the streamer's channel.
- Bitrate capped at 10 Mbit/s. The server itself enforces no limit, see
[what `setupstream` takes](#what-setupstream-takes-confirmed-600-beta131-2026-10-04).
Codecs (**reported**, from the ts6-manager bot's working code):
- Video: H.264 Constrained High (the only H.264 profile the TS client decodes),
VP8, VP9, AV1. H.264 only when the client could download OpenH264 (see
"Codecs the official client decodes" below).
- Audio: Opus, 48 kHz stereo, payload type 111.
Commands over the normal client command channel (**reported**, ts6-manager,
which uses a TS3-signed client version over the legacy UDP transport):
| Direction | Command | Parameters |
|---|---|---|
| C→S | `setupstream` | `name type bitrate accessibility mode viewer_limit audio` (bot defaults: `type=3 bitrate=4608 accessibility=1 mode=1 viewer_limit=0 audio=1`) |
| C→S | `respondjoinstreamrequest` | `id clid msg offer=<SDP> decision=1\|0` |
| C→S | `streamsignaling` | `id clid json={"cmd":…,"args":{…}}` (answer, ICE candidates `candidate`/`sdpMid`/`sdpMlineIndex`, reconnect) |
| C→S | `joinstreamrequest` | `id clid msg is_remove` (viewer; confirmed, see below) |
| C→S | `stopstream` | `id reason` (confirmed) |
| C→S | `removeclientfromstream` | `id clid reason` (confirmed) |
| S→C | `notifystreamstarted`, `notifystreamstopped`, `notifystreaminfo` | |
| S→C | `notifyjoinstreamrequest`, `notifyrespondjoinstreamrequest` | |
| S→C | `notifystreamsignaling` | |
| S→C | `notifystreamclientjoined`, `notifystreamclientleft` | |
Flow: a viewer's join request arrives at the streamer as
`notifyjoinstreamrequest`; the streamer creates one peer connection per viewer and
sends its SDP offer in `respondjoinstreamrequest`; the viewer's answer and ICE
candidates come back through `streamsignaling` / `notifystreamsignaling`.
### Probe results (confirmed, 6.0.0-beta13.1, default permissions, 2026-09-25)
Sent with `voelinctl connect 127.0.0.1:9988 raw '<command>'` as a plain guest:
| Command | Result |
|---|---|
| `setupstream name=probe type=3 bitrate=4608 accessibility=1 mode=1 viewer_limit=0 audio=1` | ok; a guest may start a stream by default |
| `joinstreamrequest id=<uuid>` (also with `clid=`, `msg=`) | exists, `error id=1542` missing required parameter |
| `streamsignaling id=1 clid=1 json={}` | exists (`ClientInvalidId`) |
| `stopstream id=<x>` | exists, missing parameter |
| `requestjoinstream`, `joinstream` | `CommandNotFound` |
After `setupstream` the server sends, to the streamer:
```
notifyclientupdated clid=20 client_is_streaming=1
notifystreamstarted clid=20 id=e7da957e-7ce0-46cf-bf6d-754d3446b4d4 name=probe type=3 access=1 mode=1 bitrate=4608 viewer_limit=0 audio=1 return_code=0
```
Other clients in the channel receive the same `notifystreamstarted` (without
`return_code`) and `notifyclientupdated clid=<streamer> client_is_streaming=1`;
`client_is_streaming` is also part of `notifycliententerview` and `initserver`.
When the streamer disconnects, everyone gets `notifystreamstopped id=<uuid>`.
Stream ids are UUIDs. The notification carries the command's `return_code`, and
the field is named `access` there (not `accessibility`).
### What `setupstream` takes (confirmed, 6.0.0-beta13.1, 2026-10-04)
`bitrate` (kbit/s) is informational: the server stores it in 16 bits and
enforces nothing. Sent with `voelinctl connect 127.0.0.1:9988 --log-commands
raw 'setupstream name=probe type=3 bitrate=<b> accessibility=1 mode=1
viewer_limit=0 audio=1'` (`RUST_LOG=debug` prints the commands), every one
answered `error id=0`, and `notifystreamstarted` announced:
| `bitrate` sent | announced |
|---|---|
| 10000, 10001, 60000 | the same |
| 100000 | 34464 (100000 mod 65536) |
| 1000000 | 16960 |
| 4294967295 | 65535 |
| 4294967296, 0 | 0 |
So 65535 kbit/s is the most a stream can announce, and anything above it
wraps silently. Voelin announces its stream's real bitrate up to 65535
(`proto::MAX_ANNOUNCED_BITRATE`; e.g. 60000 for a 60 Mbit/s stream), and
its peers send whatever the stream needs whatever was announced: nothing
between the peers looks at the announcement. Viewers see the announced
value in `notifystreamstarted` / `notifystreaminfo`.
### Join handshake (confirmed, 6.0.0-beta13.1)
```
viewer -> server: joinstreamrequest id=<uuid> clid=<streamer clid> msg=<text> is_remove=0
streamer <- server: notifyjoinstreamrequest clid=<viewer clid> id=<uuid> msg=<text> is_remove=0
```
All four parameters are required. `is_remove=1` withdraws the request; the
server also sends `notifyjoinstreamrequest ... is_remove=1` to the streamer when
the viewer disconnects. Found by testing candidate parameter names from the
server binary against a live stream (`is_remove` matches the
`JoinStreamRequestEvent.is_remove` protobuf field).
### End-to-end stream (confirmed, 6.0.0-beta13.1, 2026-09-25)
`crates/voelin-stream/tests/live_ts6.rs` runs a whole stream between two of our
clients through the server, with str0m on both ends:
```
streamer -> setupstream name=live\stest type=3 bitrate=4608 accessibility=1 mode=1 viewer_limit=0 audio=1
streamer <- notifystreamstarted clid=<s> id=<uuid> ... return_code=... (viewer gets it without return_code)
viewer -> joinstreamrequest id=<uuid> clid=<s> msg=... is_remove=0
streamer <- notifyjoinstreamrequest clid=<v> id=<uuid> msg=... is_remove=0
streamer -> respondjoinstreamrequest id=<uuid> clid=<v> msg offer=<SDP offer> decision=1
viewer <- notifyrespondjoinstreamrequest id=<uuid> ... offer=<SDP, unchanged> decision=1
viewer -> streamsignaling id=<uuid> clid=<s> json={"cmd":"answer","args":{"answer":<SDP>}}
streamer <- notifystreamsignaling id=<uuid> clid=<v> json=<unchanged>
ICE + DTLS directly between the peers; VP8 video and Opus audio flow
streamer -> removeclientfromstream id=<uuid> clid=<v> reason=5
viewer <- notifystreamclientleft id=<uuid> clid=<v> reason=5 (streamer: + return_code)
streamer -> stopstream id=<uuid> reason=1
viewer <- notifystreamstopped id=<uuid>
```
- `stopstream id=<uuid>` alone and `stopstream id clid` fail with
`ParameterMissing`; `stopstream id reason` works. `removeclientfromstream id clid`
fails the same way; it needs `reason` too. Reasons are `StreamLeaveReason` values.
- The server passes SDP and JSON through unchanged (escaped as usual).
- Host candidates embedded in the SDP are enough on one machine; trickled
candidates use `{"cmd":"iceCandidate","args":{"candidate","sdpMid","sdpMLineIndex"}}`
(the parser also accepts `sdp`/`mid`/`mLine`).
### Schema embedded in the server (confirmed)
The server binary embeds the protobuf descriptors of the new binary protocol
(`client/streaming.proto`, `events/stream_events.proto`). The text commands
are separate handlers with their own parameter names, but the events and the
enums line up:
| Enum | Values |
|---|---|
| `StreamType` (`type`) | 1 none, 2 camera, **3 screen**, 4 window, 5 existing session, 6 voice |
| `StreamAccessibility` (`accessibility`/`access`) | 1 none, 2 public, 3 contacts only, 4 private |
| `StreamMode` (`mode`) | 1 none, 2 P2P, 3 SFU |
| `StreamLeaveReason` (`reason`) | 1 none, 2 left, 3 denied, 4 failed, 5 kicked, 6 banned |
Events (text notification names in brackets):
| Event | Fields |
|---|---|
| StreamStarted (`notifystreamstarted`) | client_id, session_id, name, type, access, mode, bitrate, viewer_limit, audio |
| StreamStopped (`notifystreamstopped`) | client_id, session_id, reason |
| StreamUpdated | client_id, session_id, name, type, access, mode, bitrate, viewer_limit, audio |
| StreamInfo (`notifystreaminfo`) | return_code, client_id, session_id, name, type, accessibility, mode, viewer, bitrate, viewer_limit, audio |
| JoinStreamRequest (`notifyjoinstreamrequest`) | client_id, session_id, message, is_remove |
| RespondJoinStreamRequest (`notifyrespondjoinstreamrequest`) | client_id, session_id, message, decision, offer |
| StreamSignaling (`notifystreamsignaling`) | client_id, session_id, json |
| StreamClientJoined / StreamClientLeft | client_id, session_id (, reason) |
In text form `client_id` is `clid`, `session_id` is `id` and `message` is `msg`.
The binary protocol's requests (`SetupStreamRequest` with `max_width`,
`max_height`, `max_framerate`, `codec`, `properties`, and uint64 stream ids)
differ from the text commands. There is also a `virtualserver_sfu_endpoint`
property for the planned SFU mode.
Errors: `setupstream` refused with error 2568 ("insufficient client
permissions") has been seen; no stream permission names are documented.
More text commands and notifications named in the server binary:
`requeststreaminfo`, `updatestream` and `notifystreamupdated` (probed, see
below), and `notifystreamattendees` (`return_code`, `client_id`; never seen).
The protobuf `RequestStreamInfoRequest` only has `stream_id`, but the text
command takes `clid` instead.
### Streams that started before we joined (confirmed, 6.0.0-beta13.1, 2026-09-26)
`initserver` and `notifycliententerview` carry `client_is_streaming`, but no
stream id. The server sends `notifystreamstarted` only to the clients in the
streamer's channel when the stream starts. A client that connects later, or
enters the channel later, gets nothing about running streams.
`requeststreaminfo clid=<streamer>` fills the gap. It answers with
`notifystreaminfo` (the command's `return_code`, then one part per stream of
the client: `clid id name type accessibility mode viewer bitrate viewer_limit
audio`), from any channel. For a client without streams, or an unknown
client, the answer has no stream parts.
`updatestream id=<id> [name type access mode bitrate viewer_limit audio]`
notifies the channel with `notifystreamupdated clid id <changed fields>`. It
sends nothing when nothing changed.
Full transcript, all the variants tried, and what Voelin does with them:
[docs/research/ts6-late-join.md](research%2Fts6-late-join). Voelin
looks up unannounced streams in its channel with `requeststreaminfo`
(`voelin_stream::discovery`).
### Viewer counts (confirmed, 6.0.0-beta13.1, 2026-10-03)
Streamer A, viewers B and B2, bystander C in one channel, every command
logged (`--log-commands`):
- `viewer` of `notifystreaminfo` is the number of viewers the streamer
accepted: `requeststreaminfo clid=<A>` answered `viewer=1` while B2
watched and `viewer=0` after it left.
- `notifystreamclientjoined clid=<viewer> id=<stream>` goes to everyone in
the channel (C got one for B and one for B2), but not to the viewer who
joined.
- `notifystreamclientleft clid=<viewer> id=<stream> reason=1` goes only to
the streamer and to the viewer who left (`joinstreamrequest ...
is_remove=1`); C got nothing, also not when B left the server.
- No `notifystreamupdated` when viewers come or go (`StreamUpdated` has no
viewer field).
So a client counts joins itself, and asks `requeststreaminfo` again now and
then for the leaves it is not told about: `StreamInfo::viewers`
(`voelin_stream`), kept by `StreamDirectory` and refreshed one stream at a
time every 5 s by the engine (`Streams::refresh_viewer_counts`).
### Voelin's own additions (not TeamSpeak's)
Between Voelin clients only, a viewer can pick the streamer's simulcast
layer: the offer of a Voelin streamer with several layers carries a
session-level `a=x-voelin-layers:<id>/<WxH or scale>/<bitrate>[/<fps>] ...`
line, and a Voelin viewer that saw it may send
`streamsignaling json={"cmd":"x-voelin-layer","args":{"layer":<id or null>}}`.
The server relays both unchanged (6.0.0-beta13.1). Official clients are not
affected: libwebrtc skips unknown session attributes (headless Chromium 152
answers and decodes such an offer), and official streamers never put the
attribute in their offers, so they are never sent the signal. Details in
[media.md](media).
### WebRTC interop with Chromium (confirmed, Chromium 141, 2026-09-26)
`crates/voelin-stream/tests/browser_interop.rs` (`VOELIN_INTEROP=1`, see
`tests/interop/README.md`) runs our str0m peers against headless Chromium's
libwebrtc, the stack the official client is built on:
- Our streamer offer (VP8 + Opus, BUNDLE, `setup:actpass`, host candidates in
the SDP) is accepted; Chromium answers `setup:active` and decodes the
synthetic 1x1 VP8 keyframes. Opus packets arrive.
- Chromium's offers (canvas video + oscillator audio) with VP8, VP9 or AV1
preferred are answered by our viewer, which receives frames of that codec
and Opus; a PLI from us yields a VP8 keyframe. Playwright's Chromium cannot
send H.264.
- Trickled candidates must carry the real `sdpMid`: str0m's mids are random
strings (e.g. `fhs`), not `0`. Our `iceCandidate` signals use the peer's
first mid and `sdpMLineIndex` 0; Chromium's `addIceCandidate` accepts them.
- Without camera/microphone permission Chromium hides host candidates behind
mDNS names (`<uuid>.local`), which str0m cannot use. Our peers resolve them
with a multicast DNS query (`voelin_stream::mdns`, 2026-10-03). Chromium
152's responder answers queries sent from port 5353 (with multicast
answers on every interface) and ignores "legacy" queries from other
ports, so the query goes out from 5353, shared with the system's
responder. `browser_mdns_candidates_connect` keeps our candidates from the
browser, so only a resolved name can connect: it does, both ways. The
official client may send such names too.
- str0m answers in its own codec order and the offerer sends the answer's
first codec, so `Peer::answer` orders the viewer's codecs like the offer.
- SRTP profile: libwebrtc answers our `setup:actpass` offer as DTLS client
(`setup:active`) and offers AEAD_AES_256_GCM, AEAD_AES_128_GCM and
AES_CM_128_HMAC_SHA1_80; the server picks. dimpl, str0m's DTLS, always
picked AES-256-GCM, while streams between official clients are reported to
use AES_CM_128_HMAC_SHA1_80 (and official clients failed with ours). Our
peers now pick in the order of `PeerConfig::srtp_profiles`, by default
AES_CM_128_HMAC_SHA1_80 first; Chromium's `getStats()` confirms
`srtpCipher: AES_CM_128_HMAC_SHA1_80` (DTLS 1.2,
`TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256`). Whether this was what broke the
official client is still to be confirmed with it.
- When SRTP fails after the handshake (a relay that lets STUN and DTLS
through and drops SRTP once AES-GCM was selected), Chromium 152 decodes
nothing and its receiver reports never mention our video; our streamer
peer reports that (`PeerEvent::NoFeedback`) and the session offers a new
connection without AES-GCM (`browser_srtp_failure_is_noticed`; the
AES_CM_128_HMAC_SHA1_80 connection then decodes 90 of 90 frames). A
working connection raises no such report.
- DTLS: Chromium 152's ClientHello offers 1.3 and 1.2. Our peers use 1.2
(str0m's default) and get it; allowed 1.3, dimpl negotiates it with
Chromium 152 (`FEFC`, `TLS_AES_128_GCM_SHA256`) and the stream decodes
(tried 2026-10-03, not turned on: see "Negotiation" in
[architecture.md](architecture)).
- With bandwidth estimation on our streamer peer, Chromium's transport-cc
feedback gives estimates; the offer is the same as without (str0m always
offers transport-cc and abs-send-time).
### Codecs the official client decodes (confirmed, client 6.0.0-beta4.1, 2026-10-03)
From the official Linux client's log (`~/.cache/TeamSpeak/Default/logs/`)
while it watched a Voelin stream, and the symbols of its binary:
- At start-up it downloads Cisco's OpenH264
(`http://ciscobinary.openh264.org/libopenh264-2.6.0-linux64.8.so.bz2`); here
the download failed (`Failed to download openh264 binary http code: 403`).
- Voelin offered H.264 first (the hardware encoder's codec), with every H.264
variant str0m knows. The client answered H.264 `profile-level-id=42e01f`
(packetization mode 1), then could not make a decoder for it: `Trying to
create decoder for unsupported format. Codec name: H264` — libwebrtc's
`NullVideoDecoder`, nothing shown. Its SDP capabilities list H.264 whether
or not OpenH264 loaded.
- Its decoders: `FFmpegDecoderVP8`, `FFmpegDecoderVP9`, `FFmpegDecoderAV1`
(FFmpeg bundled in `/opt/teamspeak`, dav1d and libaom linked in), AMF
hardware decoders for H.264 and AV1, and OpenH264 (`H264DecoderImpl`) once
downloaded. VP8, VP9 and AV1 therefore always decode; H.264 depends on the
download.
- It answers with the first codec of the offer it lists, like Chromium.
Voelin now offers codecs every client decodes first (`decoded_everywhere`)
and H.264 only in the profiles it encodes: Constrained High, then
Constrained Baseline (both packetization mode 1). A client that answers
the Baseline entry (headless Chromium 152; the official client's own
answer above was a Baseline profile too) gets frames from an encoder in
that profile. The real encoders' streams (VA-API
H.264 and AV1, from memory and from DMA-BUFs; libvpx VP8 and VP9; x264,
SVT-AV1, libaom) decode in Chromium 152's libwebrtc at full size
(`crates/voelin-core/tests/browser_codecs.rs`). Watching such a stream with
the official client itself is still to be confirmed: the beta needs a
myTeamSpeak sign-in on first start, so it cannot run from a throwaway
profile.
### The official client re-offers (confirmed, client 6.0.0-beta4.1, 2026-10-03)
Streaming from the official client to Voelin, its log shows: our answer
(H.264, VP9, VP8 — no AV1, which the app did not decode) → "remote peer is
using unsupported codec, realign" → a new `offer` signal on the same
connection → our answer → `ENCODER create: H264`. The new offer is a
renegotiation of the running connection: the answer must come from the same
peer (same ICE credentials and DTLS fingerprint). Voelin answered every offer
with a new peer, so the connection broke and nothing was shown. Now
`Peer::renegotiate` answers an `offer` signal on the running connection (a
`reconnectOffer` still starts a new one), in the codec order of the new offer
(str0m keeps the first offer's order; `order_like_offer` fixes the answer's
`m=` lines), so the streamer switches to the codec it re-offered. Tested
against Chromium: `browser_renegotiates_with_rust` (VP8, then a re-offer of
VP9 on the same connection; VP9 frames arrive).
### What Voelin accepts from official streamers (2026-10-03)
The re-offer above came from our answer lacking AV1, and the H.264 the
official client then sent decoded badly: its encoder (AMF on the user's
AMD GPU, 2560x1440 at 60 fps, 6-9 Mbit/s) uses B-frames and a lookahead
(its log prints QP for "IDR / P / B-frames") although the negotiated
profile is Constrained High, and asked for a keyframe only twice in the
session. Voelin decoded H.264 with Cisco's OpenH264 2.6.0, which does not
decode B-frames: in a 1440p60 test stream with B-frames it gave 8 pictures
of 600, every B-frame an error, and the viewer then waited for keyframes.
A Voelin viewer now decodes with FFmpeg first ([media.md](media#ffmpeg-decoders-loaded-at-runtime)):
hardware (VA-API on Linux, D3D11VA / DXVA2 on Windows, VideoToolbox on
macOS, NVDEC), then FFmpeg's software decoders, then the built-in libvpx,
OpenH264 and dav1d. It accepts AV1, HEVC, VP9, H.264 and VP8 wherever one
of them works (any FFmpeg build has software HEVC, VP9, H.264 and VP8;
AV1 needs dav1d or libaom in it, or a GPU), and answers in the offer's
order, so an official client that offers AV1 first gets AV1 back and no
longer re-aligns. H.264 no longer depends on OpenH264, and B-frames
decode: the same 1440p60 stream plays at 59.9 fps through VA-API, 58.9
fps with a frame lost every second (FFmpeg's H.264 decoder conceals the
loss while a keyframe is asked for, every half second until one comes),
against 0.8 fps with OpenH264. Headless Chromium 152's AV1, VP9 and H.264
streams decode in the pipeline at their size (`browser_codecs.rs`
`browser_streams_decode_in_the_pipeline`). Watching the official client
itself with these decoders is still to be confirmed.
## Open questions
- [x] Viewer side: `joinstreamrequest id clid msg is_remove` (see above).
- [x] Meaning of `setupstream` `type`, `accessibility` and `mode` values (enums above).
- [x] Parameters of `stopstream` and `removeclientfromstream` (`reason` is required).
- [ ] Which permission gates `setupstream` (error 2568).
- [x] Contents of `notifystreamstarted` (see probe results).
- [x] Contents of `notifystreaminfo` (`requeststreaminfo clid=<streamer>`, see above).
- [x] Whether a client that connects later is told about running streams: no (see above).
- [x] How a client finds running streams after connecting: `requeststreaminfo`
(presumably what the official client does too; not captured from it).
- [ ] Interop with the official TS6 client (its offer/answer details, whether
it trickles candidates, mDNS host candidates). The codecs it picks and
decodes are known (see above); Chromium's WebRTC stack interoperates.
- [ ] Whether the official client, as a viewer, answers a `reconnectOffer`
it did not ask for (our streamer sends one when the viewer's receiver
reports show none of our video), and whether it offers AES-GCM at all.
To find out: Voelin streams to it with
`voelinctl ... stream start --synthetic --auto-accept --srtp
AEAD_AES_128_GCM,AES_CM_128_HMAC_SHA1_80` and `RUST_LOG=voelin_stream=debug`;
the viewer list prints the SRTP profile per viewer. AES-GCM selected
and a picture: the official client handles it, and AEAD-first could
become the default. AES_CM_128_HMAC_SHA1_80 selected: it does not
offer AES-GCM, and the order does not matter. No picture: after 10 s
the log says "offering a new connection without SRTP"; a picture after
that proves it answers our `reconnectOffer`.
- [ ] Whether stream audio can be sent without video.
- [ ] The WebRTC/protobuf transport some TS6 clients use on UDP 9987
(`client_protocol_format=proto`, reported in community reverse engineering).
Not needed while the legacy transport works.
## Sources
- clusterzx/ts6-manager: `packages/backend/src/voice/streaming/stream-signaling.ts`,
`packages/backend/src/voice/tslib/client.ts`
- community.teamspeak.com threads 56850 (how screen share works), 58890 (TS3
servers have no screen share), 62456 (port range), 62512 (bitrate limit)
- github.com/teamspeak/teamspeak6-server `CONFIG.md`, releases
---
*Mirrored from [`docs/protocol-notes/ts6-streaming.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/protocol-notes/ts6-streaming.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+241
@@ -0,0 +1,241 @@
# Releasing
How a release is versioned, built, signed and checked. The app id
`io.github.faumaray.Voelin` ([packaging/README.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/packaging/README.md))
cannot change after the first release on Flathub or Google Play.
CI resource settings and the Linux Gitea runner setup are documented in
[ci.md](ci). Release packaging and draft publication run on GitHub and
Gitea ([git.faumaray.ru](https://git.faumaray.ru)); runner and credential
requirements differ.
## Gitea releases
`.gitea/workflows/release.yml` builds Linux tarballs and `.deb` files, Windows
zip and NSIS installer (MinGW cross-build), Android debug APK (arm64-v8a and
x86_64), a Flatpak bundle, and the gateway container image. It reuses the
Dockerfiles and `scripts/package.sh`, and builds packages only: it runs none
of the checks (formatting, Clippy, tests, TeamSpeak smoke tests); run CI by
hand for those before accepting a release.
- **Manual dispatch:** after all builds pass, download the
`voelin-packages` artifact from the run. Manual runs never publish a draft,
even when dispatched against a tag.
- **Push a `v*` tag:** the same artifact is uploaded, then packages and a
combined `SHA256SUMS` are attached to a **draft** Gitea release. Review,
sign checksums and publish manually, just as on GitHub.
Set the repository secret `RELEASE_TOKEN` to a Gitea personal access
token with `write:repository`, limited to this repository where supported
(Gitea refuses secret names that start with `GITEA_` or `GITHUB_`; the
workflow hands it to the script as `GITEA_RELEASE_TOKEN`).
The token's account must be able to write releases. The publishing script
uses the runner's `GITHUB_SERVER_URL` and `GITHUB_REPOSITORY`; it requires
HTTPS and never uses GitHub's release API. On this instance the server URL
is `https://git.faumaray.ru`. No registry credentials are needed: the gateway
image is attached as `tsgw-image.tar.gz`, not pushed to an OCI registry.
Retries update only a matching **draft**, replacing same-named assets.
Published releases are not changed; a failed upload leaves a partial draft
for retry. Do not publish or modify a draft while the workflow runs. Gitea
1.25 ignores workflow concurrency and environment approvals; use the
dedicated, serial trusted runner described in [ci.md](ci#gitea-release-runner).
For an optional signed Android release APK, set the same four signing secrets
listed below. They are written outside the Docker build context with private
permissions, passed as BuildKit secrets, and removed on success or failure.
Signed builds invalidate the signing stage's cache on every run; changing a
key or password cannot return a cached APK signed with the previous key.
Without the keystore secret, only the installable debug APK is produced; a
partially configured keystore fails the job rather than producing an
unsigned release. Windows and Flatpak packages are not code-signed by this
workflow.
## Versioning
- One version for the apps: `version` of `crates/voelin-ui` (desktop; the
installer and the About page read it), `crates/voelin-android` and the
Android app's `versionName`. Semantic versioning; before 1.0 a minor bump
may break settings or the gateway protocol, and the changelog says so.
- Android `versionCode` must grow with every upload:
`major * 1000000 + minor * 1000 + patch` (0.2.3 is 2003).
- The gateway `tsgw` (`crates/voelin-gateway`) is versioned on its own, since
server admins update it separately. Its wire protocol is versioned in the
WebSocket subprotocol (`tsgw.v1+json`); a breaking change needs `v2` and a
period in which the gateway serves both.
- Library crates are not published (`publish = false`) and keep their
versions.
- Tags: `v<version>` for the apps (`v0.2.0`), `tsgw-v<version>` for the
gateway. Tags are annotated and signed (`git tag -s`).
## Changelog
`CHANGELOG.md` follows [Keep a Changelog](https://keepachangelog.com/). Every
change a user or server admin notices adds a line under `Unreleased`
(Added / Changed / Fixed / Removed / Security). At release the section gets
the version and date, and its highlights also go into the `<releases>` entry
of `packaging/linux/io.github.faumaray.Voelin.metainfo.xml` (shown by
software centers and Flathub). Release notes also state the TeamSpeak server
versions the release was tested against (TS3 and TS6 from
`dev/docker-compose.yml`).
## Third-party notices
`THIRD_PARTY_NOTICES.md` lists the licenses of everything compiled into the
apps. It is shown in the About page (`voelin_platform::notices::text()`) and
shipped in every package. It is generated, never edited:
```sh
cargo install cargo-about --locked --version 0.9.2 --features cli
scripts/notices.sh # regenerate
scripts/notices.sh --check # what CI runs
```
- `about.toml`: accepted licenses (the same list as `deny.toml`), the
targets we ship (Linux, Windows, Android), no build or dev dependencies,
and clarifications for crates whose license files cargo-about does not
find (Slint, the bundled libopus, AWS-LC, OpenH264). Clarifications pin
file checksums; after a dependency update that changes such a file the
script fails and the new text has to be checked and its checksum updated.
- `about.hbs`: the Markdown template, with the notices that do not come from
crates: the Slint attribution, OpenH264 (downloaded at runtime, not
shipped), the vendored tsclientlib and libvpx.
- The output does not depend on the host, so CI (`notices` job in
`.github/workflows/ci.yml`) compares the committed file exactly and fails
when `Cargo.lock` changed without a regeneration. The cargo-about version
is pinned in the script and the job: a newer version may format
differently, so update both together.
A new license has to be allowed in `deny.toml` (cargo-deny fails first) and
in `about.toml`, and must be compatible with distributing the apps under
MIT OR Apache-2.0 (no GPL/AGPL/LGPL code linked in; LGPL only as a
dynamically loaded system library, after review).
## Signing
Signing keys and certificates never go into the repository. In CI they live
in the secrets of a GitHub environment `release` that requires approval,
are written to `$RUNNER_TEMP` in the job and deleted at its end.
### Windows (Authenticode)
Unsigned executables trigger SmartScreen warnings; signed ones build
reputation with the publisher's certificate. Sign `voelin.exe` first,
then build the installer with `/DSIGN=...`, which signs the installer and the
uninstaller it writes (see [packaging/windows/README.md](https://git.faumaray.com/Voelin/VoelinClient/src/branch/main/packaging/windows/README.md)).
Always timestamp (`/tr ... /td SHA256`), so signatures stay valid after the
certificate expires.
Options for the certificate:
- **Azure Trusted Signing**: Microsoft-managed certificates, no hardware
token, billed monthly; needs an Azure subscription and identity
validation of the publisher (check the current eligibility rules). Sign
with `signtool` and the Trusted Signing dlib (NuGet package
`Microsoft.Trusted.Signing.Client`):
```powershell
# metadata.json: {"Endpoint": "https://<region>.codesigning.azure.net",
# "CodeSigningAccountName": "<account>", "CertificateProfileName": "<profile>"}
signtool sign /v /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 `
/dlib Azure.CodeSigning.Dlib.dll /dmdf metadata.json target\release\voelin.exe
```
In GitHub Actions, `azure/trusted-signing-action` does the same with a
service principal (client id, tenant id, secret as environment secrets).
- An OV or EV code-signing certificate (on a hardware token or in a cloud
HSM, as CAs require since 2023) with `signtool /f` or the HSM's CSP.
- SignPath's free plan for open-source projects (signing happens in their
service from a CI artifact).
Check the result with `signtool verify /pa /v <file>` for the executable,
the installer and `uninstall.exe` after installing.
### Linux
- **Flathub** builds and signs the Flatpak itself (with Flathub's key) from
a manifest in the `flathub/<app id>` repository. For the first submission
open a pull request against `flathub/flathub` with the manifest, where the
source is this repository at the release tag and commit (not `type: dir`)
plus the generated `cargo-sources.json`. Before submitting: run
`flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest`
and `... repo`, `appstreamcli validate` on the metainfo, add screenshots
and the release entry to the metainfo. Flathub reviews names and branding:
the app must not look like an official TeamSpeak product.
- For our own releases (GitHub): a tarball of `voelin` with the desktop
file, metainfo, icon and notices, and optionally a Flatpak bundle
(`flatpak build-bundle --gpg-sign=<key> ...`). Publish `SHA256SUMS` and
sign it (`gpg --detach-sign` or minisign) with a key whose fingerprint is
in the README.
### Android
APKs and app bundles are signed with a keystore kept outside the
repository; losing it means existing installs can no longer be updated.
- Create it once:
`keytool -genkeypair -v -keystore voelin-release.jks -alias voelin -keyalg RSA -keysize 4096 -validity 10000`,
and back it up (two offline copies, password in a password manager).
- The Gradle build reads the keystore path, alias and passwords from Gradle
properties or environment variables (`~/.gradle/gradle.properties`, CI
secrets), never from files in the repository: `voelin.signing.storeFile`,
`voelin.signing.storePassword`, `voelin.signing.keyAlias`,
`voelin.signing.keyPassword`, or `VOELIN_SIGNING_STORE_FILE`,
`VOELIN_SIGNING_STORE_PASSWORD`, `VOELIN_SIGNING_KEY_ALIAS`,
`VOELIN_SIGNING_KEY_PASSWORD` ([android.md](android)). Without them it
builds unsigned or debug-signed artifacts only.
- CI: the `android` job signs a release APK when the repository has the
secrets `ANDROID_KEYSTORE_BASE64` (`base64 -w0 voelin-release.jks`),
`VOELIN_SIGNING_STORE_PASSWORD`, `VOELIN_SIGNING_KEY_ALIAS` and
`VOELIN_SIGNING_KEY_PASSWORD`; the keystore is decoded to `$RUNNER_TEMP` and
removed afterwards. Check with `apksigner verify --print-certs app-release.apk`.
- Google Play: use Play App Signing; our keystore is then the upload key
(it can be reset through Play support if lost). F-Droid builds and signs
itself unless reproducible builds are set up.
## Checklist
Before tagging:
1. `main` is green in CI, including the smoke job (TS3 + TS6) and the
browser interop job.
2. `cargo deny --workspace check` is clean; the ignores in `deny.toml` are
still needed and still justified.
3. `scripts/notices.sh` has been run after the last dependency change (CI
`notices` job green); new licenses in the diff were reviewed. The About
page shows the AboutSlint widget (required by Slint's royalty-free
license), the OpenH264 attribution and the notices.
4. The [manual test matrix](testing%2Fmanual-matrix) has been run for this
version, results committed; failures are fixed or listed as known issues.
5. Translations: `.pot` regenerated and `.po` files merged
([i18n.md](i18n)); string freeze announced a week before.
6. Versions bumped (`crates/voelin-ui`, `crates/voelin-android`, Android
`versionName` / `versionCode`, `voelin-gateway` if it changed),
`Cargo.lock` updated, changelog and metainfo `<release>` written.
Release:
7. Tag `v<version>` (signed) on the release commit and push it.
8. The tag's release workflow (`release.yml`, [building.md](building))
builds every package (it runs no checks: run CI by hand first): the app's
Linux tarball and `.deb`, Flatpak bundle, Windows zip and installer and
Android APKs (signed when the secrets are set), and the gateway's Linux
tarball, `.deb` and image; its `release` job attaches them with a
`SHA256SUMS` to a draft GitHub release. Sign the
Windows executable and installer, and an AAB for Google Play, by hand
until CI has the certificates.
9. Verify: signatures (`signtool verify`, `apksigner verify`), the installer
and the Flatpak on a clean machine (matrix rows IN1-IN3), the version in
the About page.
10. Sign `SHA256SUMS`; write the changelog section, known issues and the
tested server versions into the draft release; publish it.
11. Update the Flathub manifest (tag, commit, `cargo-sources.json`), Google
Play / F-Droid.
After:
12. Add an empty `Unreleased` section to the changelog.
---
*Mirrored from [`docs/release.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/release.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+426
@@ -0,0 +1,426 @@
# myTeamSpeak
> The implementation (`voelin-myts`) moved to VoelinGateWay; this client has no account sign-in and carries neither the crate nor the `schema-api` snapshot it used (`third_party/schema-api`, which had no licence). The notes below are kept as research, written when the client had the feature, so they describe the removed implementation (`voelin-myts`, the login page, `Bridge.myts`) in the present tense.
## Desktop account sessions
myTeamSpeak is TeamSpeak's account service: it holds the user's identities,
bookmarks and settings server-side so the official clients can synchronise
them. Voelin opens a login page at desktop startup and makes the signed-in
myTeamSpeak account the main app profile. The same form lives in Settings →
My Account. Native login, OTP, saved-session validation and sign-out use
`voelin-myts`; registration, password recovery and account management open the
official website in the default browser.
This reverses the previous decision to leave account sign-in out of scope, at
the repository owner's request. The API remains non-public. This integration
does not establish permission to use or redistribute TeamSpeak's private API
or schemas.
Registration, activation-email resend, password recovery, username/email/password
changes, two-factor authentication, deletion and data export are available through
named browser actions. The website may be signed in to a different account;
Voelin does not transfer credentials to it. After completing a change, sign out
and back in to Voelin to refresh the profile.
Native cloud synchronization and recovery-key restoration are not implemented.
The app does not synchronize identities, bookmarks or settings, or create
account encryption and backup keys. Password login can decrypt an existing
version-2 account key to authenticate the account on voice servers (below).
To import cloud identities, sign in with the official client
so they are written to its local `settings.db`, then use the existing identity
import. See [../identity.md](identity).
### Transport and verification boundary
The implementation consumes the message types, session status checks and wire
codec from the `schema-api` snapshot that was vendored in `third_party/schema-api` (removed from this repository). Its
generated tonic gRPC clients are not used: the official clients use custom
protobuf-over-HTTP with `Content-Type: application/ts3cloud` at
`https://clientapi.myteamspeak.com`.
Requests contain a one-byte method-name length, the method name, and then the
protobuf payload. For login this is `05 6c 6f 67 69 6e` followed by `LoginData`.
Responses contain the protobuf alone. The live service labels these binary
responses `application/json`; decoding still uses protobuf and requires the
operation's explicit success status. Login uses `/authentication`; session
validation and deletion use `/session`.
`Client::login` accepts the user's password and derives the wire credential:
standard Base64 of PBKDF2-HMAC-SHA512 with 10,000 iterations, 48 output bytes,
and salt `ASCII_lowercase(email) + "ts3Login" + password`. The derivation runs
on Tokio's blocking pool. It reuses `base64` and `pbkdf2` already present in
the workspace dependency graph; no new cryptographic implementation is added.
These details replace the initial guessed header and raw-password handling.
On 2026-10-04, an owner-authorized live login, session validation, and logout
passed. Ordinary tests remain offline and use synthetic credentials. Live OTP
and expired-session renewal have not been verified.
Static evidence from the installed clients (ELF virtual addresses):
- TS3 request framing: `0x14a19dd`–`0x14a1a49`; password salt and iterations:
`0x1152b60`–`0x1152c24`; 48-byte derivation: `0x1154920`; SHA-512 selection:
`0x11e35af` and descriptor table `0x1b4a930`. Executable SHA-256:
`87c9b6927949d28c64e9da21fdf62bdf7a9e5b204597e9f75497ff6ee45be8ac`.
- TS6 request framing: `0x1dfd4e1`–`0x1dfd54c`; response decoding:
`0x1dfddcb`–`0x1dfde0b`. Executable SHA-256:
`9a32215a578a14525ec43f5e6f60aae087c0229c1b60487da235e3b3782cd40a`.
The renewal request has separate `renewal_token` and `auth_token` fields.
The official TS3 client requires both cached values before renewing
(`0x1143d81`–`0x1143dba`). Password login supplies no auth token, so an expired
password-login session requires fresh sign-in. The client API rejects missing
renewal credentials before making a request. It does not silently create the
separate shareable authentication token used by the official client's
sharing/import flow.
A saved OTP renewal token is used only with the same account's device ID in a
password login; an explicit one-time code takes precedence. Both are replaced
with the next successful response and cleared on sign-out. The installed TS6
serializer at `0x1cbed20`–`0x1cbefc1` independently confirms the email/password/OTP/
device/OTP-renewal fields. Live OTP and token rotation remain unverified.
Passwords and one-time codes are not persisted. Session and renewal material
are stored together as a single `myts/session` item through the app's secret
store, never in plaintext settings. Replacing one item prevents a partial write
from mixing credentials from different accounts. The bundle also stores the
account UUID, username and email, with backward-compatible defaults for older
bundles. With a saved session the login page does not open at all: startup
validates the session in the background (Settings → My Account shows the saved
profile as "Checking session…" meanwhile) and only an expired session brings
the page back. Errors leave retry and manual sign-in available. Transport
failures retain saved credentials. A locked keyring can be retried without
restarting. Continue without an account dismisses the page and is remembered
(`ui.skip_account_prompt`), so it does not ask at the next start; signing in
clears that.
### Profile and avatar
After a sign-in or a validated saved session the app asks the user service,
`https://clientapi.myteamspeak.com/user` (the route string is in the TS6
client next to `/authentication` and `/session`), for `getAccountData` with the
basic info, avatars, description, badges and authenticated devices, and shows
them in Settings → My Account (and the avatar in the sidebar's profile when
the server has none for us). An avatar's file name (the "online" one first)
is its download link: it is fetched as it is with a plain GET, HTTPS only, at
most 4 MiB, and kept in `<data>/account/avatar` for the next start; it is
fetched again only when the name changes. The login response's own avatar
file names and description are used until then. What is kept goes into the
same secret-store bundle as the session (`profile`), never the token into a
URL.
### Presenting the account's avatar, and other clients' avatars (TeamSpeak 6)
Voice servers show the account's avatar (and the blurred banner behind it
in the client-info view) and badges from what the client sends once
connected, not from `clientinit` (the official 6.0.0-beta4.1 client never
sets `client_myteamspeak_avatar` or `client_signed_badges` itself):
updatemytsdata myts_certificate=<cert> [myts_signed_badge=<list>] [myts_avatar=<AvatarData>]
built at 0x1f38520: `myts_certificate` is the inner `MyTSUserCertificate.cert`
bytes, `myts_avatar` a serialized `AvatarData` (its `AvatarInfo`, a timestamp
and myTeamSpeak's signature), `myts_signed_badge` a `UserBadgesSignedList`
of the badges the user chose (at most three, in the chosen order; none
until chosen). The values are the raw bytes with TeamSpeak's escaping only
(`\a` and `\b` included), no base64. The official client sends it once
connected, after a sign-in (after `updatemytsid`), after an avatar upload
and after a badge change.
What the TeamSpeak 6 server (6.0.0-beta13.1) does with it: it parses the
certificate as a TeamSpeak license chain, requires the leaf to be valid now,
of block type 6 (`MYTSID_SIGN`; types 4 to 7 carry nothing after the 42-byte
header), the chain to lead to TeamSpeak's root and the key not to be on
myTeamSpeak's revocation list, and takes the leaf's derived Ed25519 key. It
verifies the avatar's signature over `SerializeAsString(AvatarInfo) ||
myTS ID (33 bytes) || timestamp (u64, big-endian)` and each badge's over
`uuid (16 bytes) || sign_timestamp (u64, big-endian) || myTS ID`, the myTS
ID being the one it holds for the client at that moment. What does not
verify is silently emptied (`client_myteamspeak_avatar` /
`client_signed_badges` become empty, answer `error id=0`); only an unusable
certificate with a non-empty value is refused, with 1538 (also when the
server could not load the revocation list). The server echoes both
properties for the client before its answer. A bare parameter clears it
without a certificate; an absent one is left alone. `updatemytsid` does
not check them again, so they are sent again after it.
Voelin does the same checks locally (`tsproto::myts::Certificate`,
`voelin_myts::choose_avatar`, `choose_badges_certificate`) to choose, for
the avatar and for the chosen badges, a certificate that verifies them,
from those at hand: the last password sign-in's (`LoginSession` fields 10
and 11, the avatar as it came), the one myTeamSpeak's avatar service hands
out with the avatar, and the myTS ID's `pubSignCert` when its leaf is of
type 6. Since a server verifies with the one certificate of each command,
the avatar and the badges go in separate commands when they need different
certificates (one command, certificate, badges, avatar, when one verifies
both). A badge id must be in the 36-character form with hyphens: the server
reads it with Boost's `uuid` parser, which throws on anything else, so such
a badge is never sent. After sending, Voelin logs whether the server shows
them, or why not, and names the badges it dropped (`client_signed_badges`
lists the ids that verified). Each connection sends only what changed, all
of it again after `updatemytsid` or a reconnect, and clears with bare
parameters what it showed and should no longer show: on a sign-out or an
account change, `updatemytsdata myts_certificate myts_signed_badge
myts_avatar` (or only the parts it showed; both answer 0).
Without a password: `requestContactsAvatar` at `/user` with the account's own
raw myTS ID (`RequestContactsAvatarInfoRequest{session, id:
[AvatarRequestID{key: Any(…AvatarRequestID.MYTSKey{id})}]}`) answers the
account's `AvatarData` as it came, whose `optional` field holds
`OptionalAvatarDataContactInfo{mytsid, user_cert}`; `user_cert` is checked
by the official client with the same function as the login certificate. An
unknown session gets an empty answer, like an account without an avatar, so
an empty answer means "nothing learned" and never clears what is kept.
`getSignedBadges(Session)` at `/user` answers `UserBadgesSignedResponse{list,
error_code}` (109 for an unknown session); each `SignedUserBadge` is kept as
it came. Voelin asks both after a password sign-in, after a checked saved
session and then daily, and keeps the answers in
`<data>/account/presentation.json` (public data); the chosen badges are kept
per account in `<data>/account/badges.json`, across sign-outs. A chosen
badge myTeamSpeak no longer lists takes none of the three places, and is
dropped from the choice the next time the user changes it.
Other clients' avatars arrive as `client_myteamspeak_avatar`, plain text
`<state>,<url>;<state>,<url>…` with myTeamSpeak's `AvatarState` numbers
(`request_avatar_with_ts_server_client_property`, 0x1ae2840): an entry
that is not `<number>,<url>` (an empty one from a trailing `;` too) spoils
the whole value; the online picture is shown, else away, do not disturb,
offline; the server's own avatar (`client_flag_avatar`) wins when it loads.
Voelin downloads it (HTTPS, 4 MiB) where the server's is not shown: none
set, no voice connection (observing), or its download gave up.
`requestAvatarSignedUrl` is not a download call: it signs *upload* links.
In the TS6 6.0.0-beta4.1 Linux client, `Account_Manager_Impl::
request_avatar_signed_urls`'s reply goes only to `upload_avatar`, whose
upload (`Cloud_Sync_Impl::upload_avatar_to_intermediate_bucket`) is an
`http_v2::Http_Client::put`, followed by `requestUploadAvatar`. The client's
own avatar comes from `MyTeamSpeak::Account::request_own_myts_avatar`
(0x1ae1a50): it parses the stored `AvatarData` and hands each map entry's
state and name, unchanged, to `Avatar_Cache::request_avatar_from_urls`
(0x12d6e20), which passes the name as the URL to `Http_Client::get` with an
empty header list (0x12d78c1). An early Voelin fetched the signed link with
a GET instead and was refused with HTTP 403 by the live service; a refused
download is now logged as "avatar download returned HTTP …", apart from
the account service's errors.
Sign-out returns to login, clears local account material and attempts remote
session deletion; storage or remote errors are reported. A late completion
cannot sign a canceled operation back in. Server identities and bookmark
nicknames remain independent of the primary app profile.
### The User Tag (TeamSpeak 6)
`client_user_tag` is the account's primary TeamSpeak chat identifier
(`name@myteamspeak.com`): the entry with `primary` set in
`getActiveIdentifierList` at `/tschat` (Voelin falls back to
`getAccountData`'s active identifiers). The token that proves it comes from
`requestSignedAllowedIdentifierList` at `/tschat`; both take
`AuthenticatedUser{session}` only (no chat account, `matrix_id` never set)
and answer an `ErrorHandling` whose `return_code` must be 1 (5: the session
expired). The token is a `MatrixIdentifierToken{signature, sign_certificate,
timestamp, tags}`, kept as it came. Viewers (the official client's
`verifyIdentifierToken`) parse `sign_certificate` as a license chain from
TeamSpeak's root, require its leaf to be valid now (any block type), verify
the Ed25519 signature over `SerializeAsString(tags) || timestamp (u64,
big-endian) || myTS ID` with the myTS ID the client shows the server
(`client_myteamspeak_id`), and require the tag to be one of the tags. They
verify once per change of the property, and only if they have a TeamSpeak
chat connection themselves. The value is compact JSON in this key order:
{"myts_token":"<standard padded base64 of the token>","tag":"<tag>","updated":<ms since 1970>}
sent as `clientupdate client_user_tag=<value>` (TeamSpeak escaping, so `/`
goes as `\/`), once connected and after every `updatemytsid`, on servers
that know the property (protocol 8, TeamSpeak 6; on protocol 7 the official
client mirrors the JSON into `client_meta_data`, which Voelin leaves to its
own identification). A bare `clientupdate client_user_tag` clears it, on
sign-out or account change. The server stores and relays the value without
checks (about 8 KB at most). Voelin checks the token itself before using it,
asks for a new one when it would not hold three days later, and shows the
tag in Settings → My Account.
### Authenticated account identity on voice servers
The account UUID is a profile identifier, not the authenticated `myTS ID`.
Password login unwraps the account's encrypted root key, then the account's
private signing scalar. The key pair is checked before it becomes usable.
The validated identity is stored with the session in the secret store; it is
not published to voice sessions until saved-session validation succeeds.
Older saved sessions need a fresh password sign-in to obtain this identity.
Missing, unsupported or invalid identity data leaves account login usable and
shows an explicit warning that voice servers will not receive a myTS ID.
The established version-2 format uses:
- PBKDF2-HMAC-SHA512, 10,000 iterations, 32 bytes, with salt
`ASCII_lowercase(email) + "ts3Encryption" + password`.
- Root wrapping: `02 || tag16 || nonce12 || ciphertext32`, AES-256-GCM
with empty associated data.
- Private-key wrapping: `iv16 || ciphertext32 || SHA512(plaintext32)`,
AES-256-CTR with a little-endian 128-bit counter. The digest and matching
public key must verify. Version-1 root wrapping is explicitly unsupported.
The existing transport's connection challenge is
`SHA256(30 08 00 00 00 00 || shared_iv64) || "MyTeamSpeakID"`.
Signing uses the raw account scalar, not Ed25519 seed expansion. The public
proof sends `myTeamspeakId`, `acTime`, `userPubKey`, `authSign`, `pubSign` and
`pubSignCert` on `clientinit`; the last two split `public_signature` at byte 64.
The HTTP response's numeric creation timestamp is byte-swapped once for the
voice protocol's decimal `acTime`. The provider public signature covers
`public_key32 || wire_acTime.to_le_bytes() || myTS_ID33`.
Neither the account UUID nor `mytsid_user_cert.cert` substitutes for these fields.
Private key material never belongs in a packet.
The main account is shared by all voice connections. Each new connection signs
its own challenge. Account changes cancel an unfinished handshake; connected
clients send `updatemytsid`, and logout sends an empty myTS ID. Rejected or
unanswered account updates disconnect rather than retaining a previous account
association.
Static TS3 evidence in the binary identified above: proof helper `0x1018580`,
`clientinit` invocation `0x1020c3b`, live update `0x1049659`, scalar signing
`0x1196800`, password KDF `0x1152cf0`, version-2 unwrap `0x11542d0`, GCM
layout `0x1155610`, and private-key integrity check `0x1153280`.
The login-to-storage timestamp swap is at `0x110b57c`; the server's public
signature payload is built at `0x1222da`–`0x12260d` in the pinned TS3 server.
Independent synthetic crypto vectors and malformed/tampered key tests cover
the local implementation. The ignored `voelin-core/tests/myts_live.rs` test
requires explicit account opt-in and caller-owned loopback servers; it checks
server-side identity association, clearing, reattachment, and fresh handshakes.
On 2026-10-04, owner-authorized live password login, authenticated key unwrap,
session validation and remote session deletion passed. Isolated official TS3
3.13.8 and TS6 6.0.0-beta13.1 servers each accepted two fresh signed handshakes,
reported the expected `client_myteamspeak_id`, and passed live clear/reattach
checks. Both reported the native Linux compatibility tuple and Voelin metadata.
The test servers needed a container-local DNS override to a working address
for `ts3services.teamspeak.com` before their official revocation-list downloads
succeeded; TLS and signature/revocation checks remained enabled. No server
override is part of the application.
Official-client visual inspection remains unverified: isolated TS3 3.6.2
crashed before showing its UI; isolated TS6 started but required account
confirmation before reaching the server view. No existing client profile was
changed. GUI checks of Voelin's account fields passed at desktop and narrow
sizes using synthetic account data.
### Client reporting
The voice engine chooses an unchanged signed compatibility tuple for the
actual operating system: the newest TeamSpeak 6 client build signed for it
(`6.0.0-beta4.1 [Build: 1779880475]` on Linux, captured from the official
Linux client's `clientinit`; `6.0.0-beta2` on Windows, from upstream
tsdeclarations), else the generic `3.?.? [Build: 5680278000]`. Every row of
`Versions.csv` verifies against TeamSpeak's version-signing key. A bookmark's explicit compatibility-version override
is honored and validated. `client_meta_data` identifies `Voelin`, its package
version and native OS. The CLI uses the same catalogue and native default.
TeamSpeak signs compatibility versions: replacing the signed version with an
arbitrary `Voelin` string is not supported. Metadata does not establish that
stock clients display Voelin in their standard version label.
An account change during an automatic transport reconnect cancels that voice
session to prevent stale credentials from being sent. Reconnect manually in
that case; ordinary connected account changes use the live update command.
The vendored crate had no declared license, which is why it was removed from this
repository (its provenance was recorded in `third_party/schema-api/VOELIN-PATCH.md`).
### Official account-management routes
Read-only inspection on 2026-10-04 verified these routes in the deployed
[main bundle](https://www.myteamspeak.com/main.a0429db5055b28c1.js) and
[account-management bundle](https://www.myteamspeak.com/933.0799f055321e36e9.js):
| Action | Official route |
| --- | --- |
| Registration | `https://www.myteamspeak.com/register` |
| Password recovery | `https://www.myteamspeak.com/forgot-password` |
| Activation email | `https://www.myteamspeak.com/resend-activation` |
| Account overview | `https://www.myteamspeak.com/my-account` |
| Username / email / password | `/my-account/change-username`, `/my-account/change-email`, `/my-account/change-password` |
| Two-factor authentication | `/my-account/change-2fa` |
| Deletion / data export | `/my-account/manage-account`, `/my-account/manage-data` |
The site's authentication guard preserves the requested destination. Its
[registration](https://www.myteamspeak.com/5.dcb40731983490af.js) and
[password recovery](https://www.myteamspeak.com/252.5c94d1e115160e7d.js) flows
use reCAPTCHA. Password changes rewrap encryption-key material, and deletion
requires a separate confirmation. Browser handoff retains those provider-owned
steps. Only fixed HTTPS URLs are passed as desktop-opener arguments; no shell,
email, password or token is included. Opening a page does not submit a change.
These are website-source findings, not a published native API guarantee.
### Local verification
```sh
cargo test -p voelin-myts
cargo test -p voelin-ui --lib myts::tests
cargo build -p voelin-myts -p voelin-ui
cargo clippy $(scripts/own-crates.sh) --all-targets --no-deps -- -D warnings
cargo fmt $(scripts/own-crates.sh) --check
scripts/notices.sh --check
```
The HTTP tests use loopback mock servers and synthetic credentials. UI tests
cover the secret-store bundle, failed reads/writes/deletes, form states,
concurrent operations, primary-account replacement, legacy-bundle migration,
remembered-device ownership and late completions after sign-out. Screenshot
fixtures use `VOELIN_DEMO_UI=1` and `VOELIN_OPEN=login`, `login:otp`,
`login:saved` or `login:account`; they never read the keyring. The formatting
command excludes vendored sources; `cargo fmt --all` also traverses local path
dependencies and reports upstream formatting differences. Clippy's `--no-deps`
also keeps diagnostics out of the existing vendored protocol crates.
The ignored `owner_live_login_validate_logout` test requires the owner to set
`VOELIN_MYTS_LIVE=1`, `VOELIN_MYTS_EMAIL`, `VOELIN_MYTS_PASSWORD`,
`VOELIN_MYTS_DEVICE_ID`, and optionally `VOELIN_MYTS_OTP`, then explicitly run
`cargo test -p voelin-myts owner_live_login_validate_logout -- --ignored`.
This test is not part of the offline verification commands above.
## The local record, structurally
The TeamSpeak 6 client keeps its account state in its `settings.db` in the
table `AccountData`, shape `(timestamp integer unsigned, key varchar unique,
value varchar)`, with two rows: `Account` and `Checksum`. `Checksum` is 20
bytes — `SHA1` of the other rows' values, the same rule as `ProtobufItems`
(see [../identity.md](identity)).
`Account` is a protobuf message, about 1.7 kB in the install examined. Its
shape, field numbers and lengths only:
| Field | Wire type | Length | Looks like |
| --- | --- | --- | --- |
| 1 | bytes | 18 | printable ASCII |
| 2 | bytes | 64 | printable ASCII, base64 alphabet |
| 3 | bytes | 36 | a UUID |
| 4 | bytes | 8 | printable ASCII, base64 alphabet |
| 5 | bytes | 32 | binary |
| 10 | bytes | 36 | a UUID |
| 50 | message | 38 | one nested field: a UUID |
| 51 | message | 2–5 | repeated, nine times; one or two small fields each |
| 52 | bytes | 61 | binary |
| 54 | message | 375 | 32-byte and 33-byte binary fields, a varint, a nested 112-byte blob, a 176-byte blob |
| 56 | message | 114 | one nested field: a 112-byte blob |
| 57 | message | 178 | a nested 98-character ASCII string, a varint, a 64-byte blob |
| 58 | bytes | 386 | printable ASCII |
| 59 | message | 6 | one small field |
| 61 | message | 241 | a 64-byte and a 112-byte blob |
The 386-character printable field and the 64-byte base64-alphabet field are the
shape of a bearer token and an identifier; **they were not decoded, parsed or
used, and no request was made to any TeamSpeak service.**
No field in `Account` parses as an ASN.1 `SEQUENCE`, so it carries **no
identity key pair** in the tomcrypt DER form the identities use. Importing
identities therefore never needs to touch this row, and Voelin's importer does
not read it. The 112-byte blobs are the right size for a raw key or signature
but are not DER; what they are was not investigated further, because nothing
Voelin does needs them.
`avatar_cache_mytsid` (one row, `contacts`) and `RevocationList` (one row,
`Cache`) are caches the account service fills. Neither is read either.
---
*Mirrored from [`docs/research/myteamspeak.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/research/myteamspeak.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+85
@@ -0,0 +1,85 @@
# Why watched streams played at a low frame rate
Watching a TeamSpeak 6 stream (someone's screen share in the viewer) showed
fewer frames than were sent, with freezes until the next keyframe. This
note records what was measured, what changed, and what is left.
## Measurements
On a 4-core 2.1 GHz VM (one core busy with another build for part of the
runs), with the app's own code: a 2560x1440 stream at 60 fps and about
25 Mbit/s, encoded by `VpxEncoder` from synthetic content (moving gradients,
a scrolling text-like area), fed to the viewer's decode loop in real time
with the same queue rules as `decode_loop`.
| Stream (VP8 token partitions) | Decode per picture | Shown | Freezes in 10 s |
|---|---|---|---|
| 4 or 8 (a sender with 6 cores or more) | 18-21 ms | 35-49 of 60 fps | 2-3 queue drops, 34-167 frames skipped waiting for a keyframe |
| 1 or 2 | 10.0-10.5 ms | 60 of 60 fps | none |
FFmpeg's command line on the same streams: `vp8` on 1 thread 95-101 fps, on
4 slice threads (what the viewer used) 54-60 fps; libvpx on 4 threads 23 and
11 fps on the 4- and 8-partition streams, on 2 threads 143 and 129. On clean
1080p test clips, 4 partitions decode at 290 fps on one thread and 47-74 fps
on 3-4 slice threads.
Handing a picture to the window (`video.rs`, a new zeroed `SharedPixelBuffer`
and the I420 to RGBA conversion, on the decode thread):
| Size | New buffer + convert | Reused buffer + convert |
|---|---|---|
| 1920x1080 | 3.0-3.6 ms | 0.6-0.8 ms |
| 2560x1440 | 5.1 ms | 1.0 ms |
| 3840x2160 | 12.4-12.8 ms | 2.4-2.5 ms |
## Causes and what changed
1. **FFmpeg's VP8 decoder on slice threads** (the main cause). Every software
decoder got all cores (up to 8) as slice threads. VP8's slice threads work
on the frame's token partitions, and Voelin's VP8 senders use 4 (6-8
cores) or 8 (9 or more) partitions, so the threads wait on each other and
one 1440p picture took 18-21 ms: the decoder could not keep 60 fps, fell
30 frames behind, dropped its queue and skipped everything until the next
keyframe. FFmpeg's `vp8` comes before libvpx in the ladder, and Windows
(and AMD under VA-API) have no VP8 hardware decoder, so most viewers took
this path. **Now** VP8 decodes on one thread (`ffmpeg::decoder::decoder_threads`).
2. **The picture's conversion on the decode thread.** Every decoded picture
was converted to RGBA on the decode thread, into a new zeroed buffer, even
when the window would only show the newest. **Now** the decoder hands its
newest frame to a converter thread (`video.rs`, `deliver`), which converts
only what can be shown, into buffers reused three pictures later (a buffer
the window still holds copies itself first).
3. **libvpx's decoder threads** spin waiting for each other and collapse when
another core is busy (the fallback without FFmpeg, e.g. Windows without its
FFmpeg libraries). **Now** at most 2 threads (`codec/vpx.rs`).
4. **dav1d** with a frame delay of one is slower on 3-4 threads (155-166 fps)
than on one (211 fps) on this 4-core machine, while 8 threads on a
32-core one gave 412 fps at 1440p. **Now** a quarter of the cores, 1 to 4
(`codec::dav1d_threads`, for our dav1d and FFmpeg's `libdav1d`).
## Left as they are
- **The sender.** The software VP8 encoder took 18-29 ms per 1440p frame on
this machine, so a similar sender tops out at 35-55 fps; frames beyond that
are dropped before encoding. The automatic bitrate is 0.12 bits per pixel
per frame (27 Mbit/s at 1440p60); about 0.07 would suit screen content and
decode faster. Showing the sender's encode rate next to the viewer's decode
rate would tell the two apart.
- **H.264 with one slice per frame** (the official client's AMF streams):
slice threads give nothing (about 180 fps either way); frame threads give
336-423 fps but add a frame of delay per thread, and the decoder self-test
expects a picture from every frame at once.
- **The window's texture upload.** The image has no cache key, so the
renderer uploads a new full-size texture per frame (not measured, no GPU
here).
- **Lossy links.** str0m waits up to 30 complete frames for a lost packet
before the frame is handed over as non-contiguous, and VP8/VP9/AV1 then
wait for a keyframe (asked for at most every 500 ms).
The measuring harnesses were throwaway programs around `voelin-media`'s
`VpxEncoder` and decoders and FFmpeg's command line; they are not part of the
repository.
---
*Mirrored from [`docs/research/stream-fps.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/research/stream-fps.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+242
@@ -0,0 +1,242 @@
# TeamSpeak 6: streams that started before we arrived
**Question.** The server sends `notifystreamstarted` only to the clients that
are in the streamer's channel when a stream starts. A client that connects
later, or enters the channel later, sees only the streamer's
`client_is_streaming=1`. How can it learn the stream id, so that it can send
`joinstreamrequest`?
**Answer.** `requeststreaminfo clid=<streamer>` works. The server answers with
`notifystreaminfo`: one part per stream of that client, each with the stream
id and the stream's properties. This works from any channel and needs no
permission beyond a guest's. Voelin uses it (see "What Voelin does" below).
Server: `teamspeaksystems/teamspeak6-server` 6.0.0-beta13.1 [Build: 1790080330],
default permissions, dev/docker-compose.yml. Probed on 2026-09-26 with
`voelinctl probe-stream` (`tools/voelinctl/src/probe.rs`).
## How the probe works
```
voelinctl probe-stream 127.0.0.1:9988 --streamer-identity dev/.state/ts6-admin.json
```
1. Client A creates a channel (`channelcreate`), which moves it there, and
starts a stream with `setupstream` (signalling only, no media).
2. Client B connects to the default channel and tries candidate commands.
3. B moves into A's channel and tries them again. Extra commands can be given
with `--try '<raw command>'`; `{id}`, `{a}`, `{b}` and `{cid}` are replaced
by the stream id, the two client ids and A's channel.
4. B sends `joinstreamrequest` with the id it learned.
5. A sends `updatestream` in several spellings, `requeststreaminfo` for
itself, and a second `setupstream`.
6. A puts the stream id into its `client_meta_data`. B reconnects straight
into A's channel and tries again.
7. A clears `client_meta_data` and stops the stream.
The probe hooks into the raw connection (tsclientlib's `unstable` API) and
prints every command both clients send and receive. It prints them unparsed,
so notifications the vendored declarations did not know yet
(`notifystreamupdated`) show up too.
## What the server answered
Stream id below: `6b5158dd-22ba-4118-b20d-9196fe975ac7`. A is clid 6, B is
clid 7 (8 after reconnecting). `return_code` values are left out.
### (a) Entering the streamer's channel
```
B -> clientmove cid=3 clid=7
B <- notifycliententerview cfid=0 ctid=3 reasonid=2 clid=6 ... client_meta_data client_is_recording=0 client_is_streaming=1 ...
B <- notifyclientmoved cfid=1 ctid=3 reasonid=0 clid=7
B <- error id=0 msg=ok
```
No `notifystreamstarted` and no `notifystreaminfo`. B only gets the
streaming flag. The same happens when B connects straight into A's channel
(step 6): its `notifycliententerview` for A carries `client_is_streaming=1`
and nothing else about the stream.
### (b) `requeststreaminfo`
| Command sent by B | Answer |
|---|---|
| `requeststreaminfo id=<id>` | `error id=1542 msg=missing required parameter` |
| `requeststreaminfo id=<id> clid=6` | `notifystreaminfo clid=6 id=<id> name=late\sjoin\sprobe type=3 accessibility=1 mode=1 viewer=0 bitrate=4608 viewer_limit=0 audio=1`, then ok |
| `requeststreaminfo clid=6` | the same `notifystreaminfo` |
| `requeststreaminfo stream_id=<id>` | 1542 |
| `requeststreaminfo stream_id=<id> clid=6`, `streamid=<id> clid=6`, `id=<id> clid=6 msg` | the same `notifystreaminfo` (only `clid` matters) |
| `requeststreaminfo clid=6 id=00000000-0000-0000-0000-000000000000` | the same `notifystreaminfo` with the real id: `id` is ignored |
| `requeststreaminfo cid=3`, `requeststreaminfo` | 1542 |
| `requeststreaminfo clid=<B itself, not streaming>` | `notifystreaminfo return_code=...` with no stream fields, then ok |
| `requeststreaminfo clid=9999` (no such client) | `notifystreaminfo return_code=...` with no stream fields, then ok (no error) |
| `requeststreaminfo clid=9\|clid=10` | answered for the first part only |
- `clid` is the only required parameter. The notification carries the
command's `return_code`.
- It works the same from the default channel (A's stream in another channel)
and from A's channel.
- A client with two streams (A sent a second `setupstream` in step 5) gets
both streams in one answer, as two parts:
```
notifystreaminfo return_code=0 clid=6 id=6b5158dd-... name=renamed\sagain type=3 accessibility=1 mode=1 viewer=0 bitrate=4000 viewer_limit=0 audio=1|clid=6 id=069ba23c-b71a-4002-9c97-a91d5ab4428b name=second type=3 accessibility=1 mode=1 viewer=0 bitrate=4608 viewer_limit=0 audio=1
```
- The field names differ from `notifystreamstarted`: `accessibility` (not
`access`), and `viewer`, the current number of viewers. Both match the
`StreamInfoEvent` protobuf message embedded in the server.
- A second `setupstream` while a stream runs is accepted. It creates a
second stream with a new id, and the channel gets `notifystreamstarted`
for it.
### (c) `clientgetvariables clid=6`
- From the default channel, without `channelsubscribeall`, the answer is
`error id=512 msg=invalid clientID`: A is not visible to B.
- In A's channel the answer is `notifyclientupdated clid=6 client_version=...
client_platform=... client_created=... client_totalconnections=... ...`.
It has nothing about streams.
### (d) `clientinfo clid=6`
The answer has `client_is_streaming=1` among the usual properties, and no
stream id.
### (e) Other command names
`requeststreamattendees id=<id>`, `streamattendees id=<id>`, `streamlist`,
`liststreams`, `requeststreams` and `requeststreamlist` all fail with
`error id=256 msg=command not found`. The server binary names no other
stream command in text form: `setupstream`, `stopstream`, `updatestream`,
`requeststreaminfo`, `joinstreamrequest`, `respondjoinstreamrequest`,
`streamsignaling` and `removeclientfromstream` are all of them.
`notifystreamattendees` (protobuf `StreamAttendeesEvent`: `return_code`,
`client_id`) never appeared.
### (f) `updatestream` by the streamer
| Command sent by A | Answer |
|---|---|
| `updatestream id=<id> name=renamed\sprobe` | ok; **B** (in the channel) and A get `notifystreamupdated clid=6 id=<id> name=renamed\sprobe` |
| `updatestream id=<id>` | ok, no notification |
| `updatestream stream_id=<id> name=...` | 1542 (`id` is required) |
| `updatestream id=<id> name=renamed\sprobe type=3 bitrate=4608 accessibility=1 mode=1 viewer_limit=0 audio=1` | ok, no notification (nothing changed) |
| `updatestream id=<id> name=renamed\sagain type=3 access=1 mode=1 bitrate=4000 viewer_limit=0 audio=1` | ok; `notifystreamupdated clid=6 id=<id> name=renamed\sagain bitrate=4000` |
`notifystreamupdated` carries only the fields that changed, and goes only to
the clients in the channel. It re-announces nothing to clients that do not
know the stream: with no change it sends nothing at all. So it is no way
to tell latecomers about a stream.
### Joining with a learned id
`joinstreamrequest id=<id> clid=6 msg=probe is_remove=0` from B, with the id
learned through `requeststreaminfo`, reaches A as
`notifyjoinstreamrequest clid=7 id=<id> msg=probe is_remove=0`. `is_remove=1`
is relayed too. B's reconnect in step 6 gave the same result. The full
join with media works (see "Verification" below).
The server does not limit join requests to the streamer's channel. In a
later run (2026-09-27, same server), B stayed in the default channel, sent
`channelsubscribeall`, looked the stream up and asked to join:
```
B -> requeststreaminfo clid=2
B <- notifystreaminfo clid=2 id=e977003a-... name=late\sjoin\sprobe type=3 accessibility=1 mode=1 viewer=0 bitrate=4608 viewer_limit=0 audio=1
B -> joinstreamrequest id=e977003a-... clid=2 msg=probe is_remove=0
A <- notifyjoinstreamrequest clid=3 id=e977003a-... msg=probe is_remove=0
```
So a stream is "channel scoped" only in whom the server announces it to. A
streamer that wants to admit only its channel has to check where the viewer
is. Voelin's `stream.permissions = channel` does that.
### `client_meta_data` as a side channel
`clientupdate client_meta_data=voelin-stream=<id>` is accepted from a guest.
The channel gets `notifyclientupdated clid=6 client_meta_data=voelin-stream=<id>`,
and a client that arrives later finds the value in its `notifycliententerview`
for A. So metadata would work as a fallback between Voelin clients, but
`requeststreaminfo` makes it unnecessary.
### Stopping
`stopstream id=<id> reason=1`: B, in the channel, gets
`notifystreamstopped clid=6 id=<id> reason=1`.
## What Voelin does
- `voelin_stream::proto::stream_info` sends `requeststreaminfo clid=<streamer>`.
The declarations (`crates/proto/tsproto-structs/declarations/Messages.toml`)
now know the answer's fields (`accessibility`, `viewer`, `return_code`, an
optional `id` for the empty answer) and `notifystreamupdated`.
- `voelin_stream::discovery::Discovery` follows the clients on the server:
their channel and `client_is_streaming`. It keeps the stream directory to
the streams of every client on the server that streams, in any channel
(a stream can be watched from another channel, see below). It looks up a
client that streams and whose stream we were not told:
- after connecting;
- when a client in another channel starts streaming (the server announces
a stream only in its channel);
- after we or the streamer change channels;
- when a streamer in our channel starts and its `notifystreamstarted`
has not arrived by the next update of the client list.
Each streamer is looked up once per change of its channel or flag. The
answer arrives as `notifystreaminfo` and fills the directory like an
announcement, so `Event::StreamsChanged` lists the stream and it can be
watched like any other.
- Where to look is a `StreamLookup` trait. `ServerLookup` (`requeststreaminfo`)
is the only lookup now. It stops asking on a connection whose server answers
"command not found". A later source, such as a gateway's stream directory,
plugs in with `Streams::add_lookup`, and hands what it finds to
`Streams::discovered`.
- `notifystreamupdated` updates the directory (name, bitrate, …).
- The engine (`voelin-core`) and `voelinctl stream list/watch` feed the
client list into `Streams::update_clients`.
Watching from another channel (confirmed, 6.0.0-beta13.1, 2026-10-03): with
B in the default channel and A's stream in another one, `requeststreaminfo
clid=<A>` answers as above and `joinstreamrequest` reaches A
(`notifyjoinstreamrequest`), the probe above shows it. The whole join with
media works too: `scripts/it-smoke.sh`, step "late stream", has a viewer in
the default channel watch a stream in `smoke-elsewhere`, and the app (no
gateway) listed and played a stream in another channel. Voelin lists the
streams of every channel, ours first; as a streamer with `stream.permissions
= channel` (the default) it lets its channel in and asks the user about
viewers from other channels.
Fallbacks (i) and (ii) from the plan were not built, because the native
command works. (i) would have been a re-announcement by the streamer; (ii)
would have put the stream id into `client_meta_data`. The probe shows what
they would do: (i) does not work through `updatestream`, and (ii) would work
between Voelin clients.
### Limits
- Streams of official clients are found the same way, since this is a
server command: nothing on the streamer's side is needed.
- Only clients we can see are looked up. That is always true of our own
channel, which is the only place streams are listed.
- Not probed: streams with `accessibility` other than 1 (public), and
whether a server permission can hide streams from `requeststreaminfo`.
## Verification
- `voelinctl connect 127.0.0.1:9988 --nick early stream --loopback start --synthetic --auto-accept`,
then, once it is live, `voelinctl connect 127.0.0.1:9988 stream --loopback watch --streamer-nick early --expect-frames 30`:
the late viewer printed `watching <id> of early`, connected and decoded 30
pictures.
- `scripts/it-smoke.sh`, step "stream (late viewer)", does the same.
- `crates/voelin-core/tests/stream_live.rs` `ts6_late_viewer_finds_running_stream`
(`VOELIN_LIVE=1`): an engine session connects after the stream is live,
gets it in `Event::StreamsChanged`, watches it and receives frames.
- `crates/voelin-stream/tests/sessions.rs` `late_viewer_finds_the_stream`
runs the same flow through a fake server, and `discovery.rs` has unit tests
for when lookups happen.
---
*Mirrored from [`docs/research/ts6-late-join.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/research/ts6-late-join.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+352
@@ -0,0 +1,352 @@
# UI review, and what to take from TeamSpeak 6 and Discord
**Question.** How good is the UI, what should change, and which features of
TeamSpeak 6 and Discord should Voelin port or add?
**Answer, short.** The UI is not bad. It has a real design system, two
themes, a phone layout from the same components, screen reader labels and a
Ctrl+K palette. Its problems are elsewhere:
1. The desktop shows the same things two or three times, and the app's own
advertising takes space from the content.
2. Behaviour every TeamSpeak user expects is missing: right-click menus, drag
and drop, moderation, channel creation, whisper, sounds.
3. Some things show wrong data: raw BBCode, raw spacer names, a password lock
that cannot be opened.
Against TeamSpeak 6, the gap is mostly the *classic* client (admin,
whisper, sounds, chat formatting). TS6's genuinely new features Voelin
mostly has already, or beats (Android, channel history, simulcast, the
studio). Against Discord, the most useful ideas need no server support at
all: unread state, search, notification levels per channel, ducking, hotkeys,
a call bar, an overlay.
What was checked:
- The UI at `1064cce`: the Slint code, plus the screenshots in
`docs/screenshots/` (taken 2026-10-03/04, sample data).
- TeamSpeak 6: client 6.0.0-beta4.1 and server 6.0.0-beta13.1, from their
release notes and the TeamSpeak forum.
- Discord: its changelogs up to September 2026.
Sources are at the end.
## 1. The UI
### Keep
- `Theme` tokens for every colour and size. The light palette is complete,
and the font scale works everywhere.
- The component catalogue (`ui/components/`) is used consistently. The
screens look like one app.
- The phone layout is built from the same components. Its bottom navigation
is sane: Home, Servers, Chats, Activity, You.
- About 470 `accessible-*` attributes. Tree rows have default actions and
descriptions ("talking", "streaming", "microphone off").
- The Ctrl+K palette shows keyboard hints. The member card, the event cards,
the pins and topics drawers and the Stream Studio are good screens.
### Wrong or broken (fix first)
| What | Where | Why it matters |
|---|---|---|
| BBCode is shown raw in chat. Only `[URL=ts3file://…]` file links are turned into cards (`src/vm/chat.rs:84`). Previews strip the tags (`src/vm/social.rs:53`) but the message view does not | `ui/screens/chat.slint` (`RichText` = text + emoji runs only) | Every official TS3/TS6 client sends `[b]`, `[url]`, `[color]` and `[img]`. The server welcome message is BBCode too (see the sample `[b]Nightfall Guild[/b]` in `src/dev.rs:428`) |
| Links in chat are not clickable | chat | People post links all day |
| Message text cannot be copied: no selection, no "Copy text" action | `MessageRow` hover actions: react, pin, topic only | Basic |
| Only `[cspacerN]` is understood. `[spacer]`, `[lspacer]`, `[rspacer]` and `[*spacer]` (repeated characters such as `[*spacer]---`) show their raw names | `src/vm/tree.rs:107` | Most community servers decorate their tree with these, so it looks broken on exactly those servers |
| A locked channel shows a lock, but joining always sends `password: None`, and nothing asks for the password | `src/bind/servers.rs:26` | The join fails with a server error and the user has no way in |
| A poke is always sent with an empty message | `src/members.rs:99` | A poke is usually *about* something |
| Invite links can be made but not opened. Voelin copies `ts3server://` links, but registers no URL handler: no `MimeType` in the `.desktop` file, no protocol in the installer, and `main.rs` does not read a link argument | packaging, `src/main.rs` | Half a feature; also blocks TS6's `tmspk.gg` invite links |
| Other clients' badges are parsed (`voelin-model/src/presence.rs:110`) but never shown | members, tree | TS6 users care about their badges |
| The priority speaker is shown with an icon, but others are not dimmed by `virtualserver_priority_speaker_dimm_modificator` (the server's dimming level for a priority speaker, −18 dB by default) | audio mixer | Every official client dims others while a priority speaker talks |
| The README and `docs/ui.md` screenshots still show the "via relay" chips, which `8deb778` removed | `docs/screenshots/` | The first impression is outdated. Regenerate them with `VOELIN_SCREENSHOT` |
### Desktop layout: too much repetition
At 1440×960 the server page has four columns: the rail (72), the sidebar
(264), the chat (~770) and the members panel (~280).
- **The same people are shown up to three times.** On the voice page you
see who is in Chill Zone in the tree under the channel, as the large
avatars on the stage, and again as "In Voice — 5" in the members panel.
On the chat page you see them in the tree and in the panel. On
TeamSpeak the tree *is* the member list.
- Close the members panel by default whenever the tree shows clients.
Keep it for observe-only servers, for searching, and for groups.
- Or offer one setting, "people in the tree / in a panel" (the Discord
model), and show them only once.
- **The top bar (56 px) adds little.** It holds a second Voelin logo, the
search field, the bell, the members toggle and help.
- Drop the wordmark, since the rail already has the logo.
- Move the members toggle into the chat header, where it also is.
- Then the bar can be lower, or merged with the chat header.
- **The same actions appear several times.**
- The settings gear is both at the bottom of the rail and in the user
card.
- On Home, "Add a Server" appears **four times**: the hero button, the
sidebar's Quick Actions, the "Your Servers" link and the right column's
Quick Actions.
- Quick Actions appear on both the left and the right.
- The "Friends Online" bubbles and the "Friend Activity" column list the
same people.
- **The app advertises itself.**
- The Home hero is a carousel ("Voice, chat and streams on TeamSpeak
servers. Talk. Watch. Share.").
- The sidebar's lower half shows decorative art ("Hang out / Play
together / Find your people") on Home, Friends and Direct Messages.
- That is a quarter of the screen for someone who already installed the
app. Show the hero on first run only. Use the space for "continue where
you left off" (last server and channel, with Join), unread mentions and
pinned DMs.
- **"Join a Server" and "Add a Server"** are two names for nearly the same
dialog. Make it one dialog with two buttons: *Connect* and *Save*.
- **The chat header squeezes the channel topic.** "Pinned Messages" and
"Topics" are wide labelled buttons, so the topic is cut short ("Hang out,
chat, and explore t…"). Make them icon buttons with a tooltip and a
count.
- **Direct messages live in two places.** The chat tabs mix the server, the
channels and DMs (`@Kairo`, `@Mira`…), and there is also a Direct
Messages page. Keep channels in the tabs and DMs on their page. If the
tabs are still wanted, add "Open in a tab" as an option.
- **Channel icons disagree.** The tree draws voice channels with a speaker,
but the chat header and the search results use `#`. On TeamSpeak every
channel is a voice channel with a chat, so pick one icon.
- **Unlabelled numbers.** The "75" and "100" at the right of member rows
are talk power. Label them ("TP 75"), or leave them to the member card.
- **Tree avatars are 22 px with two-letter initials** ("RI", "DE"), which
is unreadable. Use the picture, one letter, or a coloured dot.
- **The server rail is all blue squares with initials.** Use the server's
icon (`virtualserver_icon_id`), or a different hue per server (`Avatar`
already has `tint`).
- **The voice page has no call bar.** Mute and deafen exist only in the
sidebar's user card. The phone has a bottom bar (Mute, Deafen, Go Live,
Share, Leave). Give the desktop voice page the same bar under the stage,
with mute and deafen showing their state.
- **The voice page leaves little room for chat.** Under the stage and the
stream card, the chat gets about 300 px. Collapse the stage into a strip
of avatars when the chat scrolls, or add a divider that can be dragged.
- **The stream card shows a placeholder icon**, not a thumbnail of the
stream.
- **The stream viewer:**
- The header (streamer, title, "12 watching") is drawn straight on the
video, so it collides with the picture. Add top and bottom gradients,
and hide the controls after 2–3 s without mouse movement.
- Add a theatre mode between "in the page" and "full screen" that hides
the sidebar and the members panel.
- Make pop-out a real window (it is documented as missing).
- **Pop-ups have no edge.** The notifications panel has no shadow and no
scrim (the software renderer draws no shadows), so it blends into the
page behind it; LIVE badges from behind show next to it. Give pop-ups
`border-strong`, a darker surface, or a light scrim. Also, its fixed
height leaves an empty area.
- **Light theme:** the server card's title is dark text on the dark banner.
Text over pictures should be white with a scrim in both themes.
- **Older messages need a click.** Load them when the list reaches the top,
and keep the button as a fallback.
- **Unread is not marked.** There is no "new messages" divider and no
"jump to unread". Unread counts live in memory only.
- **Icon-only buttons.** The friend rows (message, poke, join, watch) and
the DM header (poke, join, profile, more) need visible tooltips.
### Settings: twelve sections that overlap
- **Streaming settings are scattered.** Streaming permissions are in
Voice & Video, Streaming and Privacy. Stream quality is in Voice & Video
and Streaming. Devices lists the microphones, speakers and cameras that
Voice & Video lists too. Suggested sections:
- **Voice**: microphone, output, processing, input mode and sensitivity.
- **Video & Streaming**: camera, quality, codec, simulcast, permissions,
recording.
- Make **Devices** a read-only diagnostics page, or drop it.
- **The voice activation threshold is in Keybinds**, away from the level
meter. Discord and TS6 put the input mode and the threshold on the meter.
`Meter` already has `threshold` and `show-threshold`.
- **"My Account" vs "Profiles" is unclear.** Call them "myTeamSpeak
account" and "Identities"; Profiles is `identities` underneath anyway.
- **Device names are cut off and confusing.** One microphone reads "System
default (Default ALSA Output (cu…"; it is called an Output, yet it is a
microphone. Show the PipeWire/Pulse description, with the full name in a
tooltip.
- **The phone shows Keybinds.** It has no keyboard in most cases.
### Phone
- **The voice screen:**
- It has two Leave buttons, in the header and in the bottom bar.
- Two headers repeat each other ("Voelin / Nightfall Guild", then
"Chill Zone").
- Below the player and the avatar strip, the chat shows about two
messages.
- There is a microphone button next to the composer as well as Mute in
the bar. Say which is hold-to-talk.
- **The Servers tab names the server three times**: the top bar, the server
pills and a banner card about 130 px tall.
- **Home:** the marketing hero takes about a quarter of the screen.
- **Untested on a device** (`docs/android.md`). Dialogs ignore the safe
areas, and audio focus is not handled. Expect more issues on the first
real device.
## 2. What to take from TeamSpeak 6
TS6 is still a beta: client 6.0.0-beta4.1 (2026-05-27), server
6.0.0-beta13.1 (2026-09-22). Most of what its users would miss in Voelin
is not new in TS6. It is the classic client that TS3 already had.
### 2a. Classic client features (TS3 and TS6 both have them)
| Feature | Voelin today | Notes |
|---|---|---|
| Right-click / long-press menus on channels and clients | none (click = chat or card, double-click = join) | The way TS users do everything. Channel menu: join, chat, edit, subscribe, copy link. Client menu: whisper, poke with a message, volume, mute, move, kick, ban, groups, info |
| Moving clients by drag and drop | none | Also: dragging channels to sort them |
| Kick from channel or server, ban, ban list | none (`Command` has no variant) | |
| Creating, editing and deleting channels: temporary, semi-permanent, permanent; password; max clients; codec quality; topic; description | none | Without it a user cannot even open a temporary channel, the most common TS action |
| Assigning server and channel groups, privilege keys (tokens) | none | |
| Permission editor | none | TS6 discusses a simpler "easy view"; start there |
| Server edit, "Recent server events" (log), complaints, client database, snapshots (TS6 beta4) | none | For admins; lower priority |
| Whisper lists and whisper hotkeys | incoming whispers only (`out_audio` in `voelin-core/src/voice.rs`: C2S only) | A TS signature feature: team leads whisper to the other leads |
| Asking for talk power | none (`client_talk_request` is not modelled) | Moderated channels |
| Channel description (BBCode, pictures) | none (`ChannelInfo` has the topic only) | Shown when a channel is selected |
| Server welcome message and host message in the chat | only stripped, in Home's news | Official clients print them in the Server tab, and host message mode 3 as a dialog |
| Notification sounds (sound pack): someone joined or left the channel, poke, message, connection lost, muted | none | Important for a voice app used while gaming: people do not look at the window |
| Hotkeys for mute, deafen, away, whisper, switching channel | PTT only | |
| Away with a message, auto-away when idle, mute while away | away is only shown | |
| Subscribing to channels one by one | always all channels (`voice.rs:424`) | Costs bandwidth and presence noise on large servers |
| Bookmark folders, importing the official clients' bookmarks | flat list; no import | TS6 syncs bookmarks through myTeamSpeak |
| Client info: version, platform, connected for, idle for, country flag, badges | partly (country as text) | |
| A file browser for the channel's files | none (the engine has `ListFiles`, `DeleteFiles`, `RenameFile`, `CreateDirectory`) | Only the UI is missing |
| Uploading an avatar | none (the engine has `SetAvatar`) | Only the UI is missing |
| Server and channel group icons next to names | crown, shield, chips | TS shows the group icons right of the name; servers rely on them |
### 2b. What is new in TS6
| Feature | Status in TS6 | Voelin | Recommendation |
|---|---|---|---|
| Chat editor: Markdown with live preview, toolbar, slash commands, undo; tables, code, KaTeX, Mermaid; full BBCode (beta4) | shipped | plain text | Render BBCode first: `b i u s url img color size quote code list table`. Then a composer with a formatting toolbar that writes BBCode. Check what beta4 puts on the wire for channel chat before matching its Markdown |
| YouTube inline, picture lightbox with zoom and pan, GIFs | shipped | picture overlay for `ts3file://` pictures only | Add http(s) pictures (opt-in, size-limited) and zoom/pan in the overlay |
| Several streams of a channel at once, pause, hide your own and inactive streams, auto-focus | shipped | one stream at a time (`viewer-streamer-id`) | Show a grid of the channel's streams on the voice page |
| Camera as a quick share | shipped | camera only as a Stream Studio source | Add "Camera" to the Share menu |
| Viewer limit, privacy (channel / contacts / private), join requests | shipped (fixed in beta4) | permissions plus accept/deny exist | Add the viewer limit |
| Global chat: DMs and group chats across servers, through myTeamSpeak (Matrix based, optional E2EE), with offline delivery, reply, edit, delete, reactions, pins, search | shipped | DMs need a voice connection to the peer's server | The largest interop item. Voelin signed in to myTeamSpeak when this was written; that left the client, and it returns through the gateway. Research the chat service (extend `research/myteamspeak.md`); it would give real DMs with official TS6 users, and streaming in DMs |
| myTeamSpeak cloud sync: bookmarks, contacts, group chats, badges | shipped | sign-in only, since removed (`docs/identity.md`) | Sync bookmarks and contacts first |
| Direct calls 1:1 with picture-in-picture | alpha (2026-08-20) | — | Wait; needs the global chat |
| Multi-track recording (a track per speaker) | alpha (2026-09-04) | the Studio records streams | Possible later with the Studio's recorder |
| Per-application audio for screen sharing | alpha | **already in Voelin** | — |
| Server directory and discovery, Communities (hosted servers) | shipped | — | A "Browse servers" page if the directory can be read |
| Several PTT bindings, voice activation modes (volume gate / hybrid / automatic) | shipped | one PTT key, one VAD | Several keys; an automatic threshold |
| Auto-connect to bookmarks (optionally muted), a hotkey to stream the focused application | shipped | — | Cheap |
| Custom themes (CSS extensions), custom fonts | shipped | dark/light | CSS does not apply to Slint, but every colour is a `Theme` token: an accent picker, a true-black theme, and importing token sets as JSON are cheap |
| Server snapshots from the client | shipped | — | Admin; later |
| Server-routed streaming (SFU) | announced, unreleased | — | Follow the server releases; it changes the stream negotiation |
**Where Voelin is already ahead of TS6.** Don't spend time catching up on
these; put them forward instead.
- An Android app. TS6 has no mobile client.
- Channel chat history, pins, reactions, topics and events through the
gateway. TS6 channel chat is not persistent and has no edit, delete or
reactions.
- Chatting in channels and seeing presence without joining.
- Simulcast layers, the Stream Studio (scenes, mixer, replay buffer),
AV1/VP8 decoding.
- Push-to-talk on Wayland through the portal.
## 3. What to take from Discord
The TeamSpeak protocol has no message ids, so some ideas need the `tsgw`
gateway. The table says which need what:
- **client**: works on any server.
- **gateway**: needs `tsgw`. Users without a gateway still see the plain
message.
- **TS**: maps onto a TeamSpeak feature that already exists.
| Feature | Needs | Notes |
|---|---|---|
| Read state per channel that survives restarts, a "new messages" divider, jump to unread, Esc marks read, Alt+↑/↓ and Alt+Shift+↑/↓ to move between channels and unreads | client | The store already keeps history; keep a "last read" per chat |
| Searching messages (`from:`, `in:`, `has:file`, before and after a date) | client | SQLite FTS5 over the stored history |
| Notification level per server and channel (all / mentions / nothing), mute for 1 h / 8 h / until switched back | client | Today the levels are per kind only |
| A Mentions tab in the bell, mentions highlighted in the chat, @ autocomplete in the composer | client | Mentions are already detected (`vm/social.rs:104`) |
| Typing indicator in DMs | client / TS | `clientchatcomposing` is declared and unused |
| Global mute and deafen hotkeys (Ctrl+Shift+M / D), a shortcut sheet on Ctrl+/, mouse back and forward | client | |
| Ducking: other apps get quieter while someone talks | client | Windows session volume; PipeWire stream volume |
| A call bar on the voice page | client | See §1 |
| Overlay: who is talking and our mute state, as a transparent always-on-top window that does not hook into games | client | Discord rebuilt its overlay this way in 2025 |
| Streamer mode: hide addresses, unique ids and server passwords, on its own when the Studio is live or OBS runs | client | Home shows `127.0.0.1:9987` today |
| Compact message layout, UI density, a true-black theme, an accent colour | client | Tokens make this cheap |
| Soundboard: short clips mixed into *our own* voice | client | Everyone hears it on any server, since it is just our voice. The gateway could share a server's sounds; respect talk power |
| Voice clips: "save the last 30 s" of the channel | client | The Studio has a replay buffer; ask for consent and show the recording flag |
| Zoom and pan while watching, picture-in-picture, a real pop-out window | client | Voelin already shows the stream statistics |
| "Ask to stream" (a request to someone to share their screen) | client | A poke with a fixed message, or a gateway request |
| Voice invite links with a preview of who is inside | gateway | `ts3server://` plus a page served by the gateway |
| How long a channel has been busy, its topic in the tree | client / TS | The channel topic exists |
| Stage-style view of moderated channels: speakers vs audience, "raise hand" | TS | TS has moderated channels and talk power requests; present them the Discord way |
| Priority speaker lowers the others | TS | See §1: the server already sends the dimming level |
| Replies | gateway | Others see a `> quote`-style prefix |
| Edit and delete | gateway | Only gateway users see the change; say so in the UI |
| Polls | gateway | Next to events and topics |
| Forwarding | client | Post again with "forwarded from" |
| Bookmarks and reminders for messages | client | Local |
| Link previews (OpenGraph), http pictures inline | client | Opt-in: fetching leaks the IP to the linked site |
| Onboarding and rules screening on a server | gateway | Later |
| Roles UI ("view as role") | TS | Maps onto server groups; after the permission editor |
**Not worth copying.**
- Nitro, boosts, quests: no equivalent.
- Activities: embedded web apps, and Slint has no web view.
- E2EE voice: the TS protocol cannot do it.
- Server discovery: TS6 has its own directory, see §2b.
## 4. Order of work
| # | Work | Size |
|---|---|---|
| 1 | BBCode rendering, clickable links, Copy text | S–M |
| 2 | Spacers, channel password prompt, poke with a message, badges, priority-speaker dimming | S |
| 3 | Regenerate the screenshots | S |
| 4 | Context menus and drag and drop. Then moderation: move, kick, ban; create, edit and delete channels; assign groups | L |
| 5 | Notification sounds; mute, deafen and away hotkeys; auto-away | M |
| 6 | Unread state, "new messages" divider, loading older messages on scroll, mention highlight and autocomplete | M |
| 7 | Desktop layout: members panel closed by default when the tree shows people, no duplicate actions or advertising, call bar, viewer scrim and theatre mode | M |
| 8 | `ts3server://` and `tmspk.gg` link handler | S–M |
| 9 | Sending whispers, asking for talk power, per-channel subscription | M |
| 10 | Message search (FTS5), notification level per server and channel | M |
| 11 | Merge the settings sections; tray, minimise to tray, autostart; streamer mode | M |
Later: the myTeamSpeak global chat and cloud sync, the overlay, the
soundboard, the stream grid and camera share, direct calls, the permission
editor, translations (the `.pot` exists, no `.po` yet).
## Sources
TeamSpeak 6:
- beta1: https://community.teamspeak.com/t/teamspeak-6-0-0-beta1-screen-camera-sharing-communities-design-overhaul/54925
- beta3 "Foundation I": https://community.teamspeak.com/t/teamspeak-6-0-0-beta3-foundation-i-update/62417
- beta3.3: https://community.teamspeak.com/t/teamspeak-6-0-0-beta3-3-minor-update/62656
- beta4 "Foundation II": https://community.teamspeak.com/t/teamspeak-6-0-0-beta4-foundation-ii-update/64497
- beta4.1: https://community.teamspeak.com/t/teamspeak-6-0-0-beta4-1-hotfix/64672
- Direct calls: https://community.teamspeak.com/t/first-look-at-1-1-direct-calls-for-teamspeak-6/65124
- Per-application audio: https://community.teamspeak.com/t/multi-app-audio-picker-for-screensharing/65236
- Multi-track recording: https://community.teamspeak.com/t/multi-track-audio-recording/65237
- Server beta13: https://community.teamspeak.com/t/ts6-server-beta-v6-0-0-beta13/65349
- Server repository: https://github.com/teamspeak/teamspeak6-server
- Channel chat is not persistent: https://community.teamspeak.com/t/cant-delete-messages-or-pictures-posted-in-ts6-server-channels/63343
- Staff on persistent text channels: https://community.teamspeak.com/t/subject-making-ts6-the-ultimate-discord-alternative-feedback-suggestions/63483/26
- What myTeamSpeak syncs: https://community.teamspeak.com/t/feedback-add-indicator-what-settings-are-synced-through-myts/56152
Discord:
- https://discord.com/blog/discord-update-march-25-2025-changelog (call bar, overlay rebuild, density)
- https://discord.com/blog/discord-update-september-25-2025-changelog
- https://discord.com/blog/discord-patch-notes-february-4-2026 (stream zoom/pan, stats)
- https://discord.com/blog/discord-patch-notes-june-4-2026 (clips, voice invites)
- https://discord.com/blog/discord-patch-notes-july-7-2026 (Request to Stream)
- https://discord.com/blog/discord-update-september-25-2026
- https://support.discord.com/hc/en-us/articles/22163184112407-Polls-FAQ
- https://support.discord.com/hc/en-us/articles/26442819646999-Message-Bookmarks-and-Reminders
- https://discord.com/blog/improving-mobile-with-squircles-styles-and-spacing
---
*Mirrored from [`docs/research/ui-review.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/research/ui-review.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

+379
@@ -0,0 +1,379 @@
# Stream Studio (`voelin_media::studio`, `voelin_core::studio`)
The Stream Studio composites scenes of sources (screens, windows, cameras,
images, text, colours) into one picture that becomes the video of our stream,
and keeps or forwards what the stream's encoders make: a recording, a replay
buffer to save clips from after the fact, and WHIP or RTMP to a broadcast
service. It
is the engine behind the Studio screen of the UI (scenes and sources, a live
preview, LIVE / timer, the audio mixer, Record Clip, Go Live / End Stream,
Share Window / Share Screen, a camera with background blur); this page is
about the engine and the API the UI drives. The screen itself is described
in [ui.md](ui#the-stream-studio).
```
sources (a thread each) ─ Feed (latest wins) ┐
screen / window / portal: capture backends │
camera: PipeWire (+ background filter) ├─ compose thread, at the output rate:
image / text / colour: drawn once │ Compositor → pooled RGBA canvas
┘ │ └─ preview tap (downscaled, own rate)
└─ StudioCapture: a ScreenCapture backend
│
Streamer::start_studio: convert → layers → encoders ─────┼─ MediaSink (the live stream, when attached)
audio sources → mixer → Opus ────┘
│ every packet of the stream codec, attached or not
└─ Studio::write_packet ─ replay buffer, recording, WHIP and RTMP outputs
```
Everything is changeable while it runs, and nothing is capped: any number of
scenes, sources and outputs, and a replay window limited only by its setting.
## Scenes (`studio::scene`)
`Scenes` is the whole studio as one serde value, the `studio.scenes`
setting: the scenes, which one is live (`active`), and the output `width`,
`height` (made even) and `fps`. Every field has a default, so settings
written by an older version load. A `Scene` is an id, a name, a background
colour and its `sources`, drawn first to last (0 is furthest back). A
`Source` has an id (unique in its scene), a name, a kind, a `transform`
(position, a box or a scale, `fit`: `contain` letterboxes, `cover` crops,
`stretch`), a `crop` in source pixels, `opacity`, `visible`, `locked` (for
the UI) and a `background` (replacement, below).
| Kind (`"kind"`) | Fields | Input |
|---|---|---|
| `screen` | `monitor`, `backend` (`portal`, `wlroots`, `x11`, `windows`; none: this session's), `cursor` | a capture backend, frames borrowed and copied into pooled frames |
| `window` | `handle` (X11 id, `HWND`), `backend`, `cursor` | the same |
| `portal` | `restore_token`, `cursor` | the ScreenCast portal's dialog (Wayland); with a `restore_token` the portal may restore its last choice without asking. The UI adds portal sources without one, so the dialog asks each time the source starts |
| `camera` | `device` (a `camera::Camera::id`; empty: the first), `size`, `fps`, `mirror` | see [Cameras](#cameras) |
| `image` | `path` | PNG or JPEG, alpha kept, read once |
| `text` | `text`, `font` (none: the bundled Inter), `size_px`, `colour`, `backdrop`, `align`, `padding` | rasterised once with `ab_glyph` |
| `colour` | `colour`, `size` | drawn once |
| `pattern` | `size` | the synthetic test pattern |
```json
{
"width": 1920, "height": 1080, "fps": 60, "active": 1,
"scenes": [{
"id": 1, "name": "Live", "background": {"r": 18, "g": 18, "b": 24},
"sources": [
{"id": 1, "kind": "screen", "monitor": 0, "transform": {"width": 1920, "height": 1080, "fit": "cover"}},
{"id": 2, "kind": "camera", "device": "/dev/video0", "mirror": true,
"transform": {"x": 1500, "y": 780, "width": 384, "height": 216},
"background": {"mode": "blur", "strength": 0.05}},
{"id": 3, "kind": "text", "text": "LIVE", "size_px": 40,
"backdrop": {"r": 200, "g": 30, "b": 30}, "padding": 8, "transform": {"x": 40, "y": 1000}}
]
}]
}
```
A source whose input fails (a camera that is gone, an unreadable image)
draws nothing and reports its error in the stats; it never stops the studio.
Changing a source restarts its input only when the input itself changed
(`SourceKind::same_input`): a drag, a crop, an opacity or a camera's
mirroring is a new plan for the compositor, not a new capture; a new text
or colour is drawn again; a portal token written back is not a reason to
ask the user again. Another background effect (or blur strength, image,
colour) starts the input again: its filter is set up with the effect.
## Compositing (`studio::compose`)
One compose thread ticks at the output rate. It takes every source's newest
picture from its `Feed` (a one-slot latest-wins handoff; a source that has
nothing new keeps its last picture, so a 30 fps camera does not blink in a
60 fps composite) and draws the live scene back to front into an RGBA canvas
from a `FramePool`, in bands of output rows on a `Workers` pool (all CPUs).
Scaling is the separable fixed-point filter of `scale.rs` (area averaging
down, bilinear up) with an inner loop for interleaved pixels, and a straight
copy at 1:1; images and text are alpha-blended, opacity applies to any
source, cameras can be mirrored, BGRA sources are swizzled on the way.
The plan (rectangles and filter weights) is rebuilt only when the scene, a
source's size or the output size changes, so a steady composite allocates
nothing (`tests/studio_alloc.rs` counts it). The canvas goes to the
streamer's ordinary conversion (one SIMD pass to I420 for the encoders, all
layers derived from it), so the encoders, simulcast and peers see an
ordinary screen source.
## Cameras
`camera::list()` reads V4L2 directly (`/dev/video*`: the card name, every
pixel format and every resolution the driver reports, no hard-coded list);
only three read-only enumeration ioctls are written by hand. Capture goes
through PipeWire, which owns the devices on a current desktop: from the
user's daemon, or in a sandbox from the XDG Camera portal (`ashpd`), both on
the same PipeWire thread as screen capture. Raw formats (YUYV, UYVY, NV12,
I420, packed RGB) are converted into pooled frames. MJPEG, which many USB
cameras offer for their large sizes only (the Fifine K420: 2560x1440 and
1920x1080 only as MJPEG, raw up to 1280x720), is decoded by `zune-jpeg`
straight into pooled RGBA frames on a thread of its own, latest-wins, so a
decode that falls behind drops pictures rather than holding up the camera;
the background filter then runs on that thread. A camera-like 1440p
picture takes about 30 ms to decode (one core), so 1440p at 30 fps is about
what that thread does.
What PipeWire is offered comes from the V4L2 list, best first: the wanted
size at the wanted rate in a raw format (nothing to decode), then the
wanted size at any rate with MJPEG first, then every format at the sizes it
lists, nearest the wanted size first. Every offer names sizes the driver
lists for that format: PipeWire's V4L2 source takes a size on trust and
then fails to set it (NV12 at 2560x1440 on a camera that has that size only
as MJPEG). `camera::SYNTHETIC` is always listed: the test pattern, for
tests and machines without a camera. `voelinctl studio cameras` prints the
list.
On Windows, Media Foundation (`camera::mf`): `MFEnumDeviceSources` lists the
cameras (the symbolic link is the id, then the friendly name, and every
native format with its sizes and rates), and an `IMFSourceReader` on a
thread of its own opens one at the native format nearest the wanted size,
the fastest up to the wanted rate, and hands out NV12 at that size: with
advanced video processing on, the reader decodes MJPEG and converts the
other formats itself. Frames go through the same pacer, pool and
background filter as on Linux. **Never run**: it is type-checked for
`x86_64-pc-windows-gnu` only, as nothing here runs Windows.
Android: the app registers a `camera::CameraProvider` (Camera2 through its
Kotlin side, [android.md](android#cameras)), whose cameras `list()` puts
first (front ones first). A camera opens into an `ImageReader`
(YUV_420_888) and its planes arrive as `camera::YuvPlanes` with the turn
that makes the picture upright for the screen's rotation: an upright planar
or NV12 picture goes to the source's sink as it is, NV21 and turned ones are
gathered into I420 in a buffer each camera keeps (nothing is allocated per
frame). `Camera::mirrored` is the default mirroring (a camera that faces the
user; not a phone's back camera); the source menu's Switch camera moves a
camera source to the next camera.
## Background replacement (`studio::segment`)
A source's `background` is `keep`, `blur` (`strength`: radius as a fraction
of the frame height), `image` (`path`, scaled to cover) or `colour`.
Anything but `keep` runs a `BackgroundFilter` on the source's own thread: the
segmenter gets a copy reduced to 256 pixels wide on a thread of its own and
makes a mask at 10 fps (a mask a few frames old is still right, and
segmentation costs far more than a frame); the frame path takes the newest
mask latest-wins, samples it up (nearest; the edge is only as soft as the
mask's own) and mixes the subject over the backdrop. The
blur is a three-pass box blur (close to a Gaussian), separable, with a
running sum so its cost does not grow with the radius, in bands on a worker
pool over pooled buffers.
The person is found by `segment::HumanSeg` (feature `segment`, on by
default): PP-HumanSeg, PaddleSeg's portrait segmentation model as OpenCV Zoo
ships it (`crates/voelin-media/models/`, 6 MB, Apache-2.0, bundled into the
binary), run on the CPU by `tract-onnx`. The frame is squeezed to 192x192 RGB;
the mask is the model's probability of a person per pixel, 192x192, which
the frame path stretches back over the frame (its soft edge is the
feathering). The model is parsed and optimised once per process, on the
segmentation thread when the first mask is due; one mask then takes about
50 ms on one core of a desktop CPU (dev builds optimise tract too), so the
10 masks a second cost about half a core. If the model does not load,
`segment::Ellipse`, a centred oval about where a person sits in front of a
camera, stands in (and builds without `segment` use it). Other models drop
in behind the `Segmenter` trait without changing the frame path.
## Outputs (`studio::output`)
Every packet of the stream codec goes to `Studio::write_packet` as it is
encoded: the video of one simulcast layer (`Studio::set_layer`, default 0;
a codec only a viewer chose is never teed) and the Opus audio. An output is
an `OutputSink` (`wants(track)`, `needs_keyframe()`, `write(packet)`,
`finish()`, `bytes()`); none of them may block an encoder. An output that
fails is removed and reported, and the rest go on.
- **Recording** (`record::Recorder`): WebM (VP8, VP9, AV1, Opus) or
Matroska (also H.264, H.265), from the file name; a codec WebM cannot hold
moves the file to Matroska (and it keeps its name). The container is our
own EBML writer (`ebml`): a header, the tracks, clusters of SimpleBlocks,
segment size unknown and no cues, so a recording cut short by a crash still
plays; the duration is written back at the end. H.264 is stored
length-prefixed with its parameter sets in `CodecPrivate`. A recording
starts at the next keyframe (it asks for one) and keeps the last two
seconds of audio while it waits, writing what belongs after the keyframe:
the encoders are behind the audio, so the audio of the keyframe's moment
has already gone by when it arrives.
- **Replay buffer** (`replay::ReplayBuffer`): the last `studio.replay_seconds`
of packets, from a keyframe; past `studio.replay_memory_mb` the oldest go to
a temporary file that is dropped again once they age out. While it is on it
asks for a keyframe every two seconds (the encoders make keyframes only on
request), so a clip is at most two seconds longer than the window.
`SaveClip` writes it through a recorder, without re-encoding, and keeps the
buffer.
- **WHIP** (`whip::Whip`, feature `whip`): `POST` the offer (with a bearer
token), apply the answer, `DELETE` the `Location` on stop. The session
(str0m, on a thread of its own, fed through a bounded queue) offers exactly
the codec the studio encodes and Opus. One host candidate on the interface
that reaches the service: no STUN or TURN yet. It asks for a keyframe when
it starts, when ICE comes up, when the service sends a PLI and after its
queue overflowed.
- **RTMP and RTMPS** (`rtmp::Rtmp`, feature `ffmpeg`): through libavformat
loaded at runtime, never linked ([media.md](media#rtmp-output)). Its
`rtmp://` and `rtmps://` protocols do the handshake, `connect`, `publish`
and TLS and take an FLV byte stream; the FLV is ours (`flv`: `onMetaData`,
AVC and AAC sequence headers, then one tag per frame), as the recordings'
Matroska is, so no libavformat struct is touched. Video is H.264 of the
output's layer (classic RTMP carries nothing else; Enhanced RTMP's HEVC,
AV1, VP9 and Opus are not written): the stream's packets as they are
when it encodes H.264; with another stream codec the streamer runs an
H.264 encoder for that layer beside it, as for a viewer that chose
another codec (`OutputSink::video_codec`, `Studio::output_codecs`), and
its packets go to the outputs that asked for H.264 only, while the
recordings and the replay buffer keep the stream's codec. Audio is the
studio's Opus decoded and encoded as AAC-LC (160 kbit/s, 48 kHz stereo)
by FFmpeg's own `opus` decoder and `aac` encoder, on the output's
thread. The stream key is the
last part of the URL's path (`rtmp://host/app/key`) or the output's token
(sent as the play path, the URL's path as the application); the output's
name never shows it. The first connection is made when the output is
added, so a wrong address or key fails there; a connection that fails
later (the service restarting, the network) is made again after 1, 2, 4,
... up to 30 seconds for as long as the output exists, each new one
starting at a keyframe it asks for, while the stats show why it is down.
A thread of its own runs the connection behind a bounded queue (about two
seconds): a slow upload drops packets rather than holding up an encoder,
and video resumes at the next keyframe. Audio goes out in time order with
the video (it waits for the video of its time, at most a second), and the
audio of the first keyframe's moment, which comes before the keyframe,
is kept as a recording keeps it. `EndStream` unpublishes and closes; a
network that does not answer is cut off after three seconds.
Recording and the replay buffer need no live stream: a studio's streamer
encodes from the start (see below).
## The controller (`studio::Studio`)
`Studio::start(scenes)` (on a Tokio runtime) starts composing at once, so
the preview has a picture before anything is live. The UI drives it with
`Studio::apply(Command)` and follows `Studio::events()` (a broadcast
channel; late subscribers miss what came before).
| Command | |
|---|---|
| `SetScenes(Box<Scenes>)` | replace the whole graph (a scene file, the setting) |
| `AddScene { name }` / `RemoveScene { scene }` / `RenameScene { scene, name }` | scenes; `SceneAdded` carries the new id |
| `SetActiveScene { scene }` | switch what is composited, live |
| `SetOutput { width, height, fps }` | the composite's size and rate |
| `AddSource { scene, name, kind }` / `RemoveSource { scene, source }` | sources; `SourceAdded` carries the new id |
| `UpdateSource { scene, source, change: Box<SourceChange> }` | name, kind, transform, crop, opacity, visible, locked, background (`None` leaves a field alone) |
| `ReorderSource { scene, source, to }` | z-order (0 is furthest back) |
| `SetPreview { width, height, fps }` | the preview tap's size and rate (default 480x270 at 15 fps) |
| `StartRecording { path }` / `StopRecording` | `.webm` or `.mkv` |
| `SetReplay { seconds, memory_mb }` / `SaveClip { path }` | the replay buffer (0 seconds: off) |
| `AddOutput(OutputSpec::Record { path } \| Url { url, token })` / `RemoveOutput { id }` | more recordings, WHIP (`http(s)://`, `token`: the bearer token), RTMP (`rtmp(s)://`, `token`: the stream key unless the URL ends with it) |
| `GoLive` / `EndStream` | the studio's state for the header (LIVE, timer); `EndStream` also closes the outputs that push (WHIP and RTMP push from when they are added). The TeamSpeak stream itself is started and attached as usual |
| Event | |
|---|---|
| `State(Status)` | anything in the header changed: `state` (Idle, Live), `live_for`, `recording`, `recorded_for`, `active_scene`, `output`, `fps`, `outputs` |
| `Stats(Box<Stats>)` | once a second: compose time, composed fps, per source (size, fps, frames the composite never used, error), per output (bytes, kbit/s, error), the replay buffer, preview frames, frames handed to the streamer |
| `Scenes(Arc<Scenes>)` | the graph changed; to show and to persist |
| `SceneAdded { scene }` / `SourceAdded { scene, source }` | new ids, to select them |
| `RecordingStarted { path }` / `RecordingStopped { path, duration, bytes }` | |
| `ClipSaved { path, duration }` | |
| `OutputAdded { id, name }` / `OutputRemoved { id, name }` | also when an output failed |
| `Error { context, message }` | something failed; the studio goes on |
Also: `scenes()`, `status()`, `cameras()`, `epoch()` (the clock of the
composite's timestamps), `set_layer(layer)`, `needs_keyframe(layer)`.
**Preview tap**: `Studio::preview()` is an `Arc<Handoff<VideoFrame>>`; the
UI takes the newest downscaled RGBA frame (`take()`, or `wait_timeout()` on
a thread of its own) at the size and rate of `SetPreview`. It is latest-wins:
a UI that is slow just skips frames and never holds up the composite.
`convert::to_rgba` (or the frame's RGBA plane directly) fills a Slint
`SharedPixelBuffer`.
## In the engine (`voelin_core::studio`, feature `media`)
- `voelin_core::studio` re-exports the studio. `studio::start(&settings)`
starts it from `studio.scenes` and the replay settings and keeps them in
step both ways: every scene edit is written back to `studio.scenes`, and a
change of `studio.scenes`, `studio.replay_seconds` or
`studio.replay_memory_mb` made anywhere else (a settings page, `--set`)
is applied to the running studio. Equal values are not written back, so
neither side echoes the other. `studio::recording_dir(&settings)` is where
recordings and clips go.
- `media::Streamer::start_studio(&codecs, config, studio)` makes the
composite the stream's video (`SourceId::Studio`): the same conversion,
simulcast layers, encoders, audio mixer (the Studio screen's mixer is the
streamer's: `audio_mixer()`, `audio_sources()`) and keyframe handling as
any share. Unlike other sources it is encoded from the start, attached or
not, and its audio clock starts at the studio's epoch, so recordings have
their audio in sync with the picture. Going live is unchanged:
`Command::StartStream`, then `attach(sink)` on `StreamState::Live`;
`detach()` (or the stream ending) leaves the studio recording.
| Setting | Default | |
|---|---|---|
| `studio.scenes` | no scenes, 1920x1080 at 30 fps | the scene graph (JSON as above); validated (unique ids, sane transforms) |
| `studio.replay_seconds` | 30 | replay window, 0: off, no maximum |
| `studio.replay_memory_mb` | 256 | MiB kept in memory before the oldest packets go to a temporary file |
| `studio.recording_dir` | empty: `Videos/Voelin` | where recordings and clips go |
## voelinctl
```sh
# A scene file for 10 s: preview picture, recording, replay clip, a scene
# switch halfway (live, while recording), a test tone as the audio.
voelinctl studio run scenes.json --seconds 10 --switch-to 2 \
--preview preview.png --record rec.webm --clip clip.mkv --replay 30 --tone 440 --codec vp8
# Push to a WHIP endpoint (token also from VOELIN_WHIP_TOKEN).
voelinctl studio run scenes.json --seconds 60 --whip https://ingest.example/whip --token ...
# Push over RTMP(S) (H.264, encoded besides the stream's unless --codec h264;
# the key in the URL or in --token).
voelinctl studio run scenes.json --seconds 60 --tone 440 \
--rtmp rtmps://live.example/app --token <stream key>
# The compositor alone: compose time and heap allocations per frame.
voelinctl studio bench --sources 4 --res 1920x1080 --fps 60
voelinctl studio cameras
```
## Performance
`voelinctl studio bench` (debug build; voelin-media is built at opt-level 3
in dev, so the compositor runs optimised), 32 threads, every source
delivering a new picture every frame, 1920x1080 at 60 fps:
| Sources | Compose (mean / p95) | Heap allocations per frame |
|---|---|---|
| 1 (a 3840x2160 screen scaled down) | 2.67 / 2.86 ms | 0 |
| 4 (that, a 1280x720 camera cropped and mirrored, a 256x256 image with alpha, text) | 3.10 / 3.42 ms | 0 |
| 16 (the four, four times) | 11.0 / 12.1 ms | 0 |
The 4K-to-1080p scale dominates; the scaler's inner loops are plain integer
code the compiler vectorises only in part, the place to look first if the
compositor ever needs to be faster. The preview tap (1920x1080 to 480x270,
two threads) takes about 3 ms at its own rate (15 fps by default).
## Status
| What | How | Status |
|---|---|---|
| Scene serde (defaults, round trip, invalid graphs refused) | `scene::tests`, `voelin-core` `studio::tests` | tested |
| Compositor: positions, alpha and opacity, scale, crop, clip, fit, BGRA, mirror, a source keeping its last picture, replanning | `compose::tests` | tested |
| No allocation per composed frame (and after a size change) | `tests/studio_alloc.rs`, `voelinctl studio bench` | tested: 0 |
| Text (bundled Inter), images with alpha, colour, test pattern sources | `source::tests` | tested |
| Controller: commands, events, preview tap, capture backend | `studio::tests` | tested |
| Recording and clips read back by ffprobe and decoded (VP8 + Opus; H.264 + Opus through a hardware encoder by hand) | `tests/studio_record.rs`, `voelin-core/tests/studio.rs`, `voelinctl studio run` | tested |
| Replay buffer: starts at a keyframe, keeps its window, spills to disk and back, codec change, keyframe requests, late keyframes keep their audio | `replay::tests` | tested |
| A studio stream recorded while its scene switches live, with a replay clip; audio and video start together | `voelin-core/tests/studio.rs` (decoded: red before the switch, blue after) | tested |
| Settings ⇄ studio in both directions | `voelin-core` `studio::tests` | tested |
| WHIP: offer, answer, ICE, DTLS, VP8 and Opus arriving, refusal with the service's reason, `DELETE` on stop | `tests/studio_whip.rs` against a WHIP server built on str0m in the test (`--features whip`) | tested; no public WHIP service tried |
| Real camera through the user's PipeWire (Fifine K420, 1280x720) | `camera::tests::a_real_camera_delivers` (`--ignored`) | tested on one webcam |
| MJPEG: decoded into pooled frames (one frame reused), broken pictures refused, the decoder thread takes the newest | `camera::mjpeg::tests` | tested |
| MJPEG from a real camera (Fifine K420) at 2560x1440, 1920x1080 and 1280x720 | `camera::tests::a_real_camera_delivers_its_largest_mjpeg_size` (`--ignored`, `VOELIN_CAMERA_SIZE` picks a size) | tested on one webcam: each size arrived at 10 fps, which is what the camera sent in that light (`v4l2-ctl` measured the same 10 fps) |
| Camera through the XDG Camera portal (sandboxes) | – | compiles only |
| Screen, window and portal sources | the existing capture backends ([media.md](media#capture)) | as tested there; not run inside the studio here |
| Background blur, image and colour backdrops on the oval mask | `segment::tests` | tested |
| Person segmentation (PP-HumanSeg through tract): loads, 192x192 mask, nobody in an empty room, time per mask | `segment::tests::the_model_finds_nobody_in_an_empty_room` | tested (about 50 ms per mask); on a photo of a person the mask follows the silhouette, arms and legs included (checked by eye, the photo is not in the repository); not yet tried with a camera |
| Windows cameras (Media Foundation: listing, the native format nearest the wanted size, NV12 through the source reader, MJPEG decoded by it) | `cargo clippy --target x86_64-pc-windows-gnu -p voelin-media` | type-checked only, never run |
| Android cameras (Camera2): planes borrowed, gathered or turned | `camera::tests::camera_planes_are_borrowed_gathered_and_turned` (the Rust side) | tested on the host; the Camera2 side compiles only (no device here) |
| RTMP: the FLV tags (sizes, times past 24 bits, AVC from Annex B, `onMetaData` in AMF0), URL and key handling (the name hides the key), dead servers refused | `flv::tests`, `rtmp::tests` | tested |
| RTMP beside another stream codec: an output asks for H.264 of its layer only, its packets reach it alone, the recording and the replay buffer keep the stream's | `studio::tests::packets_reach_the_outputs_and_the_studio_is_a_capture_backend` | tested |
| RTMP: write errors seen (`AVIOContext.error`, found at load), an abort ends a stuck connect, the sample format field of the AAC encoder, Opus → AAC (frames back to back from the packets' clock, priming, a gap restarts the clock) | `ffmpeg::avio::tests`, `ffmpeg::audio::tests`, `ffmpeg::tests` | tested with FFmpeg 9.0.1 (libavformat 63: `error` at 84, `sample_fmt` at 348) and FFmpeg 4.4.8 (58: 120 and 408) |
| RTMP end to end: a studio stream (H.264 through the hardware encoder, a 440 Hz tone) pushed to FFmpeg's own RTMP server (`ffmpeg -listen 1`) with the key apart from the URL; the server killed and another started on its port; `EndStream` | `voelin-core/tests/studio.rs` `a_studio_stream_goes_out_over_rtmp_and_comes_back_after_the_server_did` | tested: ffprobe reads `h264` 320x180 and `aac` 48000 Hz stereo in both servers' files, each starting at a keyframe, every picture decodes (red), the audio decodes to 440 Hz; the key arrived as the stream name; the second server finished its file and exited by itself. No public service (Twitch, YouTube) tried; RTMPS only through FFmpeg's TLS, untried here |
| RTMP from a VP8 stream: the same server, the key in the URL, a recording at the same time | `voelin-core/tests/studio.rs` `a_vp8_stream_goes_out_over_rtmp_as_h264` | tested: the streamer's layer encodes VP8 and H.264; ffprobe reads `h264` 320x180 and `aac` 48000 Hz stereo, starting at a keyframe, every picture decodes (red), 440 Hz; the recording is VP8 and Opus |
---
*Mirrored from [`docs/studio.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/studio.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+227
@@ -0,0 +1,227 @@
# Manual test matrix
What CI cannot check: other clients' WebRTC stacks, real desktops and
portals, real audio hardware, Android power management and the installers.
Run this matrix before every release (see [release.md](release)) and
after changes to the area in question.
## How to record results
- Fill in **Result**, **Date** (YYYY-MM-DD) and **Version** (from the About
page; the commit hash for unreleased builds) in the tables below and
commit the update with the release.
- Result: `pass`, `fail` with a link to the issue, `partial` with a note, or
`n/a` when the platform does not support the feature. Empty means not run.
- Keep only the latest run per row; earlier runs are in the git history.
- Note the desktop and OS versions in **Notes** the first time a row is run
on a new release of them (e.g. "GNOME 48.2, Fedora 42").
Platforms:
| Name | Session |
|---|---|
| GNOME | GNOME Shell 48 or newer, Wayland (older GNOME has no GlobalShortcuts portal) |
| KDE | KDE Plasma 6, Wayland |
| X11 | Any X11 session (e.g. Xfce, or GNOME/KDE on Xorg) |
| Win10 | Windows 10 22H2 |
| Win11 | Windows 11 24H2 or newer |
| Android | A phone with Android 12 or newer; note the model |
Servers: TeamSpeak 6 (streams need it; use the version pinned in
`dev/docker-compose.yml` or newer) and TeamSpeak 3.13 for voice checks. The
official client is the current TeamSpeak 6 client for the same OS unless
noted.
## Streams with the official TeamSpeak 6 client
- **ST1** The official client watches our stream: we share a monitor at
1080p30 with sound in our channel; the official client joins it. Pass:
picture within 5 s, smooth motion (move a window around), sound in sync
(play a video with speech), no freeze over 10 minutes, stop from either
side ends it cleanly.
- **ST2** We watch the official client's stream (screen with sound). Same
pass criteria. Note the codec it sent (debug log or stats).
- **ST3** Screen share with sound: system audio reaches viewers; voices of
the call are not sent back to them (known gap on Linux PipeWire, see
[media.md](media): note what viewers hear).
- **ST4** Portal restore token (Wayland): share, stop, share again. Pass: the
second share starts without the picker; after revoking the permission in
the desktop's settings the picker shows again.
- **ST5** H.264: enable OpenH264 (download on first use, attribution text
shown next to the switch), stream to the official client and watch its
H.264 stream. Disable it again: H.264 is no longer offered.
- **ST6** Our stream with two simulcast layers (Settings → Streaming, or
`voelinctl stream start --synthetic --layer 1.0:3000k --layer 0.5:800k
--auto-accept`): its offer then carries Voelin's `a=x-voelin-layers` line.
Pass: the official client watches as in ST1. While it watches the
official client's stream (ST2), our viewer shows no quality picker and
sends no `x-voelin-layer` signal (`RUST_LOG=voelin_stream=debug`, or
`--log-commands`: no `streamsignaling` with `x-voelin-layer`).
| ID | Platform | Result | Date | Version | Notes |
|---|---|---|---|---|---|
| ST1 | GNOME | | | | |
| ST1 | KDE | | | | |
| ST1 | X11 | | | | |
| ST1 | Win10 | | | | |
| ST1 | Win11 | | | | |
| ST2 | GNOME | | | | |
| ST2 | KDE | | | | |
| ST2 | X11 | | | | |
| ST2 | Win10 | | | | |
| ST2 | Win11 | | | | |
| ST3 | GNOME | | | | |
| ST3 | KDE | | | | |
| ST3 | X11 | | | | |
| ST3 | Win10 | | | | |
| ST3 | Win11 | | | | |
| ST4 | GNOME | | | | |
| ST4 | KDE | | | | |
| ST5 | GNOME or KDE | | | | |
| ST5 | Win11 | | | | |
| ST6 | any | | | | |
## Global push-to-talk
- **PT1** Bind push-to-talk (Wayland: the desktop's dialog appears; accept
or change the key), focus another application (a browser, a game in
fullscreen), hold the key: the talking indicator lights and others hear
us; release: it stops within 100 ms. Repeat 20 times quickly: no stuck
transmission. Hold the key and Alt+Tab away: release still ends it.
- **PT2** Change the binding and restart the app: the new binding works; on
Wayland the desktop keeps the binding without asking again.
- **PT3** Windows: with an elevated window (e.g. Task Manager) focused, note
whether push-to-talk works (a hook of a non-elevated app does not see
those keys; document, do not fail).
| ID | Platform | Result | Date | Version | Notes |
|---|---|---|---|---|---|
| PT1 | GNOME | | | | |
| PT1 | KDE | | | | |
| PT1 | X11 | | | | |
| PT1 | Win10 | | | | |
| PT1 | Win11 | | | | |
| PT1 | Flatpak on GNOME or KDE | | | | |
| PT2 | GNOME | | | | |
| PT2 | KDE | | | | |
| PT2 | X11 | | | | |
| PT2 | Win11 | | | | |
| PT3 | Win11 | | | | |
## Audio
- **AU1** Echo cancellation in a real one-hour call: laptop or desk
speakers (no headset) on our side, a second person on another client.
Pass: the other side hears no echo of their own voice (also while both
talk), our voice is not cut off, and the delay at the end of the hour is
the same as at the start (clap test at 0, 30 and 60 minutes). Note CPU
usage.
- **AU2** Device hotplug during a call: unplug the USB headset in use: audio
moves to the default device within a few seconds and an error or notice
is shown; plug it back in: it moves back within 5 s. Repeat with a
Bluetooth headset (connect, disconnect, switch between headset and
high-quality profiles).
- **AU3** Change the system default output and input while connected with
"default" selected: the app follows.
| ID | Platform | Result | Date | Version | Notes |
|---|---|---|---|---|---|
| AU1 | GNOME or KDE | | | | |
| AU1 | Win11 | | | | |
| AU1 | Android | | | | |
| AU2 | GNOME | | | | |
| AU2 | KDE | | | | |
| AU2 | X11 | | | | |
| AU2 | Win10 | | | | |
| AU2 | Win11 | | | | |
| AU2 | Android | | | | |
| AU3 | GNOME or KDE | | | | |
| AU3 | Win11 | | | | |
## Android
- **AN1** Background voice: connect, lock the phone, 30 minutes with the
screen off (unplugged, not on a charger). Pass: still connected, both
directions audible the whole time, the foreground notification is shown
and its mute / disconnect actions work. Note the battery used.
- **AN2** Watch a stream: the official desktop client's and ours.
- **AN3** Share the screen (MediaProjection) with sound to the official
client and to our desktop app; stop from the notification.
- **AN4** A phone call during a voice session: our audio pauses, the session
resumes afterwards. Switch between Wi-Fi and mobile data: it reconnects.
| ID | Platform | Result | Date | Version | Notes |
|---|---|---|---|---|---|
| AN1 | Android | | | | |
| AN2 | Android | | | | |
| AN3 | Android | | | | |
| AN4 | Android | | | | |
## Install and uninstall
- **IN1** Flatpak (bundle or Flathub): install, first run (microphone
permission, portals, notifications, keyring), update over the previous
version (data kept), `flatpak uninstall` (data kept) and
`flatpak uninstall --delete-data` (`~/.var/app/<app id>` removed).
- **IN2** Windows installer on a clean VM (no Visual C++ redistributable,
no Rust toolchain): SmartScreen and UAC show the publisher of the
signature, the app starts from the Start menu, an update over the
previous version keeps the settings, uninstall from Settings > Apps
removes the files, shortcut and registry key and keeps `%APPDATA%\voelin`;
`uninstall.exe /S` works too.
- **IN3** Android APK: install, update over the previous version (same
signature, data kept), uninstall.
| ID | Platform | Result | Date | Version | Notes |
|---|---|---|---|---|---|
| IN1 | GNOME | | | | |
| IN1 | KDE | | | | |
| IN2 | Win10 | | | | |
| IN2 | Win11 | | | | |
| IN3 | Android | | | | |
## General
- **GE1** About page: the AboutSlint widget, the OpenH264 attribution and
the full third-party notices (scrollable) are shown.
- **GE2** Crash reports: with reports enabled, start the app with
`VOELIN_TEST_CRASH=1`: it exits with a panic and, on the next start, offers
the report (open folder, delete). With reports disabled nothing is
written. Reports are in `~/.local/state/voelin/crash-reports` (Flatpak:
`~/.var/app/<app id>/.local/state/voelin/crash-reports`) or
`%LOCALAPPDATA%\voelin\crash-reports`.
- **GE3** Saved passwords survive a restart (GNOME Keyring, KWallet, Windows
Credential Manager, Android Keystore); without a keyring the app warns
and keeps them for the session only.
- **GE4** Notifications for pokes and private messages; clicking one brings
the window up.
- **GE5** Suspend and resume the machine while connected: the app
reconnects.
- **GE6** HiDPI and fractional scaling (150 %), two monitors with different
scales: text is sharp, windows open on the right monitor.
- **GE7** Another UI language (once translations exist): switch, restart,
no untranslated or truncated strings on the main screens.
| ID | Platform | Result | Date | Version | Notes |
|---|---|---|---|---|---|
| GE1 | any desktop | | | | |
| GE1 | Android | | | | |
| GE2 | Linux | | | | |
| GE2 | Win11 | | | | |
| GE3 | GNOME | | | | |
| GE3 | KDE | | | | |
| GE3 | Win11 | | | | |
| GE3 | Android | | | | |
| GE4 | GNOME | | | | |
| GE4 | KDE | | | | |
| GE4 | Win11 | | | | |
| GE5 | Linux | | | | |
| GE5 | Win11 | | | | |
| GE6 | GNOME | | | | |
| GE6 | KDE | | | | |
| GE6 | Win11 | | | | |
| GE7 | any desktop | | | | |
---
*Mirrored from [`docs/testing/manual-matrix.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/testing/manual-matrix.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*
+876
@@ -0,0 +1,876 @@
# The user interface
`crates/voelin-ui` is the Slint UI of the desktop app and of the Android app
(`crates/voelin-android` runs the same window). It uses Slint's software
renderer, the Inter font, Lucide icons and Twemoji; the look follows the
design mockups (deep navy panels, a blue accent, a server rail, a top bar, a
sidebar with the user card, an optional right panel). What its screens show
is made by `crates/voelin-ui-vm`, which knows no UI toolkit ([Two
crates](#two-crates)).
![Server page](raw/screenshots/desktop-server.png)
## Structure
```
crates/voelin-ui-vm/ view models and state, no UI toolkit
assets/twemoji.bin the Twemoji SVGs packed by scripts/pack-twemoji.py
src/
image.rs color.rs ImageRef (a picture by where it comes from), Rgb
list.rs list::diff(old, new) → Changes (update, remove, insert by index)
bridge.rs the bridge structs as plain values (Arc<str>, ImageRef, Rgb, Vec)
studio_bridge.rs the same for the Stream Studio
state.rs AppState, SessionView, Tab, Msg: what the client knows apart from
the window, generic over the list type of a chat tab's lines
servers.rs tree.rs chat.rs social.rs home.rs streams.rs avatar.rs studio/mod.rs
pure view models (engine state → bridge structs), unit-tested
settings.rs the UI's settings keys, the audio form
settings_pages/logic.rs, studio/logic.rs
the decisions of the settings pages and of the Stream Studio
bbcode.rs emoji.rs chat formatting; the Twemoji archive, text → runs of text and emoji
crates/voelin-ui/ the Slint front end
ui/
app.slint MainWindow: picks the shell, puts the page's screens in it, dialogs
theme.slint Theme global: design tokens (colours, radii, spacing, type)
icons.slint Icons global: Lucide icons (tint them with `Icon`)
bridge.slint structs, the Bridge global (data and callbacks for Rust),
Images (decoded images) and Emoji (the picker's data)
nav.slint Nav global: page, settings section, phone tab, dialogs, panel size
studio-bridge.slint the Stream Studio's structs and globals (StudioBridge, StudioNav)
studio-window.slint StudioWindow: the studio in a window of its own
viewer-window.slint ViewerWindow: the stream we watch in a window of its own
components/ the design system (catalogue below); index.slint exports all
shells/ desktop.slint (rail, top bar, Sidebar), mobile.slint (bottom
navigation), common.slint (Panel, VoiceCard, UserCard, ...)
screens/ channels, chat, members (panel, card), drawers (pins, topics),
voice (the voice channel), voice-parts (its people and
streams, also the phone's), streams (viewer; the phone's
panel), settings, settings-pages (its sections), home,
friends, messages (direct messages), events, overlays
(the bell, the search, a picture), dialogs, mobile and
mobile-voice (phone-only pages),
studio-parts (the studio's pieces), studio (its page, its
phone layout)
assets/ fonts/ (Inter, OFL), icons/ (Lucide, ISC), logo.svg
src/
app.rs setup, the Slint models (`Models`), event dispatch; `App` holds
a `voelin_ui_vm::state::AppState` and the window
servers.rs chat.rs members.rs streams.rs settings_page.rs appearance.rs
home.rs social.rs messages.rs events.rs previews.rs popout.rs
the Slint side of each area (social.rs: contacts, the bell and the
search; previews.rs: pictures in chat; popout.rs: the stream's own
window)
settings_pages/ mod.rs (Pages), bind.rs: the settings pages on the Bridge
studio/ mod.rs (StudioState), bind.rs: the Stream Studio's windows and engine
bind/ callbacks of each area, wired once; convert.rs, convert/items.rs
(plain values → Slint values), rows.rs (a Slint model kept in step
with a plain list)
images.rs the image cache (LRU, bounded by `ui.image_cache_mb`)
dev.rs development switches (screenshots, sample data)
```
Models are created once (`app::Models`) and updated row by row with
`bind::rows::Rows::sync`, which finds what changed with
`voelin_ui_vm::list::diff`, keeps the rows shared at both ends and changes,
inserts or removes the rest: a client that starts talking changes one row of
the tree. Every chat tab owns a `Rows` of its lines (`app::ChatRows`); the
chat view shows the selected tab's model, so a new message is one `push` and
switching tabs swaps the model. Lists that can grow (channels, messages,
notices, the emoji grid) use `ListView`, which builds only the visible rows.
## Two crates
`voelin-ui-vm` turns engine state into rows and decides what the controls
change; it has no `slint` and no `gpui` in its dependency tree, and the
Slint crate imports it as `vm` (`use voelin_ui_vm as vm`), so `vm::chat` in
this file is `voelin_ui_vm::chat`. The boundary:
- **Values.** A picture is an `ImageRef` (`Arc<ImageSource>`: a file of the
engine's cache with its stamp, decoded RGBA pixels, SVG or memory bytes,
or none; `size()` reads a file's header). A colour is an `Rgb(u32)`, a
shared string an `Arc<str>`, a list a `Vec`. The bridge structs (51 in
`bridge.rs`, 10 in `studio_bridge.rs`) are plain `Clone + PartialEq + Debug`
structs with the field names of the Slint structs in `bridge.slint` and
`studio-bridge.slint`; `MytsBadge` and `MytsForm`, which have no data source
in this build, stay Slint-only.
- **Lists.** `list::diff(old, new)` gives `Changes`: updates, removals and
insertions by index, in the order to apply them. `bind/rows.rs` applies
them to a `VecModel` and converts only the changed rows; a GPUI view
re-renders from the list and needs no `Changes`.
- **Conversion.** The Slint crate owns the temporary `From` impls from the
plain structs to the Slint ones (`bind/convert/items.rs`), the colour,
picture and model helpers (`bind/convert.rs`) and the decoded-picture cache
(`images.rs`).
- **State.** `AppState<L>` (the servers, their sessions, the settings the
screens show, the dialogs' targets), `SessionView<L>` and `Tab<L>` live in
`voelin_ui_vm::state`, generic over the list type `L` of a chat tab's
lines: the Slint app plugs in `Rows<ChatLine>` (`app::ChatRows`), a front
end that re-renders can use a `Vec`. `App.state` is the one `AppState`.
- **Logic and bind.** An area that interleaves decisions with Bridge writes
is split into `<area>/logic.rs` in `voelin-ui-vm` (functions over the
settings service, the `AppState` and plain rows; they return rows,
commands or messages for the status line, and write no Bridge) and
`<area>/bind.rs` in `voelin-ui` (the Bridge and model writes, windows,
timers, threads, engine commands). Done: `settings_pages` and `studio`.
The pure code is tested in `voelin-ui-vm` (`cargo test -p voelin-ui-vm`,
no display); the Slint crate's tests are what needs the window types.
### Controllers still to split
Counted as `.set_` calls per file (`grep -c '\.set_'`, the status line's
`set_status` included) before this round's splits; Bridge writes alone are
about four fifths of each. Each one is a slice of the same shape as
`settings_pages` and `studio`: move the decisions into
`voelin-ui-vm/src/<area>/logic.rs`, keep the writes in
`voelin-ui/src/<area>/bind.rs`.
| File | `.set_` calls | What it mixes |
|---|---|---|
| `streams.rs` | 45 | the streams panel, viewer and share dialog: what the voice card, the viewer header and the share form say, with the watch and share bookkeeping |
| `chat.rs` | 38 | the chat view: lines, the unread divider, pins, topics and downloads, with the engine's history batches |
| `app.rs` | 38 | event dispatch and the status line, the toolbar and tree refreshes |
| `servers.rs` | 37 | the rail, the server dialog and the channel tree's refresh |
| `settings_page.rs` | 26 | the audio settings page and the devices |
| `social.rs` | 23 | home's contacts, the bell and the search |
| `dev.rs` | 23 | development switches and the sample data (the switches stay with the window; the sample rows can move) |
| `images.rs` | 13 | the decoded-picture cache |
| `messages.rs` | 12 | direct messages |
| `appearance.rs` | 11 | theme, font scale and breakpoints |
| `popout.rs` | 8 | the viewer's own window |
| `members.rs`, `links.rs`, `inbox.rs`, `home.rs`, `events.rs` | 6, 5, 5, 5, 4 | small; split with their neighbours |
Before this round: `studio.rs` had 62 and `settings_pages.rs` 52 (the two
with the most). Their `bind.rs` files still show 58 and 51 `.set_` calls: the
Bridge and model writes stay where the toolkit is, and what each write says
now comes from `logic.rs`, which has tests of its own.
## Theme tokens
`Theme` (ui/theme.slint) holds every colour and size; components never use
literal colours.
| Group | Tokens |
|---|---|
| Mode | `mode` ("dark", "light", "system"; set from `ui.theme`), `dark` (resolved), `font-scale` (from `ui.font_scale`) |
| Backgrounds | `bg-app`, `backdrop` (gradient), `bg-rail`, `surface` (panels), `surface-2` (cards, inputs), `surface-3` (hover, menus), `surface-4` (pressed), `scrim` (behind modals), `scrim-light` (behind pop-ups), `overlay` |
| Lines | `border`, `border-strong`, `border-popup` (pop-ups, menus, tooltips), `glow`, `glow-width` (focus/selection ring; the software renderer draws no shadows) |
| Accent | `accent`, `accent-hover`, `accent-pressed`, `accent-soft` (selected rows), `accent-soft-hover`, `accent-text` (links), `name-text` (chat authors), `on-accent` |
| States | `live`, `live-soft`, `danger`, `danger-soft`, `success`, `success-soft`, `warning`, `warning-soft`, `idle`, `dnd`, `offline`, `gold` (crown), `info` |
| Text | `text`, `text-secondary`, `text-muted`, `text-disabled`, `icon` |
| Meter | `meter-low` (green), `meter-mid` (yellow), `meter-high` (red), `meter-off` |
| Radii | `radius-xs` 4, `radius-sm` 6, `radius-md` 8, `radius-lg` 12, `radius-xl` 16, `radius-pill` |
| Spacing | `space-1` 2 … `space-8` 32 (2, 4, 8, 12, 16, 20, 24, 32) |
| Type (scaled) | `font-xs` 11, `font-sm` 12, `font-body` 14, `font-md` 15, `font-lg` 17, `font-xl` 20, `font-2xl` 24, `font-3xl` 30; `weight-regular` … `weight-bold` |
| Sizes | `row-height`, `control-height` 36, `control-height-sm` 28, `icon-sm/md/lg` 16/20/24, `rail-width` 72, `sidebar-width` 264 (grows with the font scale), `topbar-height` 44 (more when large text makes the controls taller), `right-panel-min` |
| Motion | `fast` 120 ms, `normal` 200 ms |
A light palette is filled in for every colour; `mode` switches at runtime.
The standard widgets (scroll bars, context menus) follow through
`Palette.color-scheme`.
## Components
All in `ui/components/`, exported by `components/index.slint`.
A component used in many places keeps `opacity`, `visible`, shadows and
animations off its root element: Slint inlines such a component at every
use, which grows the generated code and the compiler's memory (IconButton
puts them on an inner `face`).
A 0 × 0 element (`PopupMenu`, `ShareMenu`) inside a layout caps that layout's
size across its direction at its minimum: put it outside the layout with
`x: 0; y: 0`, as the phone's `ShareControl` does.
| Component | File | Key properties |
|---|---|---|
| `Icon` | icon.slint | `source` (an `Icons.*`), `size`, `tint` |
| `Spinner` | icon.slint | `size`, `tint`, `running` |
| `Button` | button.slint | `text`, `icon`, `kind` (`ButtonKind.primary/secondary/danger/ghost`), `enabled`, `checked`, `small`; `clicked` |
| `IconButton` | button.slint | `icon`, `label` (screen readers), `tooltip` (default `label`, "" for none; on hover, also while disabled, desktop only), `checked`, `danger`, `alarm` (filled red with a white icon: Leave), `round`, `filled`, `edge` (the border of a filled one while not checked), `size`, `icon-size`, `tint`, `dot`, `count` (a neutral number at the top right, hidden at 0 or less); `clicked` |
| `ActionButton` | button.slint | round button with a caption (the phone's voice bar: Mic on or off, Deafen, Share, Leave; the You page: Mute, Deafen, Go Live, Leave), no tooltip: `icon`, `text`, `checked`, `danger`, `alarm`, `checkable` (screen readers hear `checked`), `size`, `icon-size`, `edge` |
| `FocusRing` | button.slint | the accent ring of focused controls |
| `TextField` | text-field.slint | `text`, `placeholder`, `input-type`, `icon`, `label`, `bare`, `read-only`; out `has-focus`, `text-height` (the height of its lines); `accepted`, `edited`, `key-pressed`; `clear()`, `select-all()`, `focus-end()` (the cursor after the text) |
| `SearchBox` | text-field.slint | a TextField with a magnifier and the Ctrl K hint (`show-shortcut`) |
| `Kbd` | text-field.slint | a key cap |
| `Field` | text-field.slint | `label` above a control (@children), `hint` below |
| `Select` | select.slint | drop-down: `model`, `current-index`, `current-value`, `icon`, `label`; `selected(string)` |
| `Toggle` | toggle.slint | the pill switch: `checked`, `label`; `toggled(bool)` |
| `ToggleRow` | toggle.slint | settings row: `icon`, `text`, `description`, `checked`; `toggled(bool)` |
| `RadioRow` | toggle.slint | `checked`, `text`, `description`, `icon`; `clicked` |
| `Slider` | slider.slint | `value`, `minimum`, `maximum`, `step`, `label`; `changed(float)` while dragging, `released(float)` |
| `SegmentedTabs` | tabs.slint | `model`, `current-index`, `label`; `selected(int)` |
| `TabItem` | tabs.slint | underlined tab: `text`, `selected`, `badge`, `closable`; `clicked`, `close` |
| `Avatar` | avatar.slint | `image` or `initials` + `tint` (one letter under 28 px, through `Images.first-letter`), `size`, `status` (`Status.online/idle/dnd/offline/info`), `speaking` (green ring), `crown`, `square` (server icons); a server icon at most half as wide (TeamSpeak's 16 px ones) is drawn at twice its size, sharp, on the tint (a person's picture always fills it) |
| `Art` | art.slint | a painted picture (`Icons.art-*`) covering `cover-width` × `cover-height` at its own aspect ratio, cut by the parent's clip; `align-x`, `align-y` (0 keeps the left or top edge, 1 the other); home's banner and cards, the stream cards |
| `CountBadge` | badge.slint | count bubble: `count`, `fill` (red), `ink` (the number) |
| `LiveBadge` | badge.slint | `text` (LIVE), `large` |
| `Chip` | badge.slint | tag: `text`, `icon`, `picture` (in its own colours, a badge's), `tint`, `fill`, `outlined` |
| `BadgeIcons` | badge.slint | up to three 14 px pictures after a name (`first`, `second`, `third`); empty ones take no room |
| `Dot` | badge.slint | a status dot |
| `Card` | card.slint | panel card with optional `title`, `icon`, `subtitle`, `selected`; `inset`, `gap` |
| `SectionHeader` | card.slint | `text`, `icon`, `count`, `action` ("See All >"), `small`; `action-clicked` |
| `Divider` | card.slint | horizontal line |
| `Banner` | card.slint | warning/error strip: `text`, `icon`, `tone`, actions as @children |
| `Meter` | meter.slint | segmented level meter: `level` (dBFS), `threshold`, `show-threshold`, `active`, `segments` |
| `SpeakingBars` | meter.slint | animated "speaking" bars |
| `NavItem` | list-item.slint | navigation entry: `icon`, `text`, `subtitle`, `selected`, `badge`, `chevron`; `clicked` |
| `ListItem` | list-item.slint | row with a leading slot (@children), `title`, `subtitle`, `trailing`, `selected` |
| `PopupMenu` | overlay.slint | themed menu: `entries` ([MenuEntry]), `show(x, y)`, relative to the menu element (where that is not in a layout give it `x: 0; y: 0`, or Slint centres it in its parent); `activated(int)` |
| `Tooltip` | overlay.slint | wraps @children; `text` shows at the pointer after a moment, until it leaves (desktop only: `Bridge.desktop`) |
| `HoverTooltip` | tooltip.slint | the same, put last in an element (as IconButton does): `text`; `pressed` and `hovered` of the element's TouchArea (a press closes it until the pointer leaves) |
| `TooltipBubble` | tooltip.slint | a tooltip's bubble: `text`, wrapping at `widest` (400px) |
| `Modal` | overlay.slint | dialog with backdrop: `title`, `subtitle`, `icon`, `card-width`, `card-height`; `dismissed` (backdrop, Escape, ×) |
| `Toast` | overlay.slint | `text`, `icon`, `timeout`, `shown` |
| `ResizeHandle` | overlay.slint | drag to resize a side panel: `size` (two-way), `minimum`, `maximum`, `left` |
| `RichText` | emoji.slint | text with formatting and inline emoji: `blocks` ([TextBlock]) of lines, quotes (a bar and the author), code (on a background), list items and rules; a block's `runs` ([TextRun]: bold, italic, underline, strike, code, the author's colour per theme, links underlined in the accent colour) flow and wrap in a FlexboxLayout; a click on a link opens it (`Nav.open-link`), a right-click shows Open link and Copy link |
| `MessageText` | emoji.slint | a message's text (`line`: ChatLine): one `Text` when it has neither formatting nor emoji, else a `RichText`; a note for a blocked contact's. The chat, the pins drawer and the studio's chat use it |
| `EmojiPicker` | emoji.slint | search, categories, virtualised grid; `picked(EmojiCell)`, `close` |
| `ListView`, `ScrollView` | std-widgets | re-exported (virtualised lists) |
Shell pieces (ui/shells/): `DesktopShell` (rail + top bar + panels as
@children), `Sidebar` (page navigation above the voice card and user card),
`Panel`, `ServerRail` (Home, the servers, Add a server, the settings; each
server shows its icon or its initials, on a colour no other server has while
there are at most ten, kept when a server is added),
`TopBar` (the search, starting over the main panel, opens the search like
Ctrl+K; the bell at the right), `MobileShell` (top bar: the tab's or the
page's name, such as Servers, Activity, You or Settings, the app's name on
Home, the server with the chat below on Chats; on the voice screen Back,
the channel with the server below, the people, Chats and More; the page;
bottom navigation), `VoiceCard` (Voice Connected, or Connecting…, and our
channel; Disconnect, and Hold to talk with push-to-talk; on the phone a tap
opens the voice screen), `VoiceButtons` (mute, deafen, share; `gear` adds
the voice settings; `round` and `filled` for the voice view's call bar),
`UserCard` (its avatar and name open Settings → My Account), `HoldToTalk`.
Pages bring their own title; About is in the settings (and on the phone's
You page).
Voice parts (ui/screens/voice-parts.slint), for the desktop's voice view and
the phone's voice screen: `Participant` (`member`, `size`: the avatar's) and
`StreamCard` (`stream`), both with `compact`, the phone's smaller look (a
person ringed only while talking or streaming, LIVE below the name; a stream
as a row with the streamer's avatar). The protocol has no thumbnails (a
picture means joining the stream, which the streamer sees as a request), so
a stream card shows the stream only while we watch it, and our own from the
Stream Studio its preview while live; otherwise the streamer's avatar,
ringed, with what they share, on a painted scene in their colour.
## The server page
The server page follows the design mockups 03 to 08 (desktop). Each part
comes from the engine's events; what a gateway adds is hidden without it.
| Part | `VOELIN_OPEN` | What it shows | Engine data |
|---|---|---|---|
| Chat | `server` (`server:chat`: the server chat), `actions`, `link-confirm[:<url>]`, `unread[:end]` | Header with the channel's topic, then icon buttons for Pinned messages and Topics (each with its count once the gateway sent them: asked for when the chat is shown), the voice channel and the members; chat tabs (the server chat and channel chats; private chats are on the Direct Messages page); messages grouped by author ("Today at 10:14"), avatars, BBCode formatting (see Formatting below), emoji, reactions with an add button, pin and topic marks, file cards with download; composer with attach, emoji and send. A link opens in the browser; one whose text is not its address (a masked link) first shows where it goes in `LinkDialog` (the host, the whole address; Open, Copy link, Cancel); a TeamSpeak link opens in Voelin (Adding a server: Links, below); a right-click on a link offers Open link and Copy link. Every message has actions on hover (`MessageActions`; `actions` shows the last one's): Quote (`> Author: …` lines at the start of the composer, which takes the focus to write below them and grows to show up to about eight lines) and Copy text, and with a gateway quick reactions, pin and Start a topic; a right-click on a message shows Copy text, Copy link (its first web address), Quote, and with a gateway React… and Pin. The server chat starts with the server's welcome message (and its host message when the server puts it in the chat log). Opens at the newest message and follows new ones while at the end. Scrolling up to within a screen of the top loads the page before, above the rows on screen, which stay in place (a spinner above the oldest message while it loads). The Older messages button there is for a chat too short to scroll, and for after a page that brought nothing (scrolling loads again once the list was a screen away). The voice view, the phone's voice screen and private chats load the same way. Messages count as read while their chat is on screen in the focused window; the chat tabs and the server rail count the others (not our own; private chats count on Direct Messages). A chat that comes on screen with new messages, or that is on screen when messages that came while away arrive (a stored or gateway page), shows a red line with New above the first (`NewDivider`) until the chat is left; while that line is above the view, a bar over the list says how many are new and since when (`UnreadBar`: "5 new messages since 10:14", Jump, and × to mark them read). Where each chat was read is kept on this device (the store's `chat_reads`), so the counts survive a restart: messages that came while away (a gateway's history) count as new | `ChatHistory` (and `Chat` for servers without history), `Presence` (welcome and host message), `AvatarReady`, `Transfer`, `Gateway` (pins; reactions arrive as stored messages); `Command::LoadOlderHistory`, `DownloadChatFile`, `UploadFile`, `GatewayRequest::React`, `Unreact`, `Pin`, `Unpin` |
| Members panel | `server` (`panel`, `no-panel`) | "Members — N" and a search; those streaming first (the people in our channel while the voice channel or a stream is shown), then each server group in the server's order with its icon, then those without a group. Rows: avatar with status, name, crown (admin groups), priority speaker, channel commander, recording, up to three myTeamSpeak badges, moderator role, a hand when their channel needs more talk power than they have ("Needs talk power to speak"; the member card has the number), what they do or the channel they are in. Resizable: the width is `ui.members_width` | `Presence`, `Groups`, `Talking`, `IconReady`, `PictureReady` |
| Member card | `member` | Description, groups, badges (up to three chips in the client's order, what each is for on hover; "Badge" for one the app does not know), talk power, country; private message (on Direct Messages), poke, friend, block; volume and mute for us | `ContactsChanged`, `PictureReady` (badges); `Command::SetContact`, `SetClientVolume`, `SetClientMuted`, `Poke` |
| Poke | `poke` (the first other member's, card open; after `friends` a contact's) | `PokeDialog`, from the member card, a friend's row and the direct message header: an optional message with a "12/100" count, Send off above 100 characters, Enter sends, Escape cancels | `Command::Poke` (trimmed, cut to 100 characters; the engine cuts too) |
| Channel password | `channel-password`, `channel-password:wrong` | Joining a channel (a double-click in the tree, joining a friend) moves there with voice, or connects into it (by its id) without; when the server puts us elsewhere on connecting, as it does for a wrong password, it is joined again, which says why. A locked channel first asks for its password in `ChannelPasswordDialog`, unless one was given since voice connected; a refused one asks again under "Wrong password". A full channel or another refusal is a toast | `Presence` (`has_password`), `JoinFailed`; `Command::MoveToChannel`, `ConnectVoice` (`channel_password`) |
| Pinned messages | `pins` | In the members panel's place: cards with author, time, text, files and reactions; the pin unpins, a click jumps to the message | `Gateway` `Pins`, `Pinned`, `Unpinned`; `GatewayRequest::Pins`, `Unpin` |
| Topics | `topics`, `topic:<id>` | In the members panel's place: search, cards with the message count, creator and last activity, Create Topic; an open topic replaces the chat's messages and takes replies | `Gateway` `Topics`, `Topic`, `TopicHistory`; `GatewayRequest::Topics`, `TopicHistory`, `CreateTopic`, `Post` |
| Voice channel | `voice`, `voice:compact` | Title, topic, "5 in voice / 50 total", Copy invite link (a `ts3server://` link to the channel; the phone's Invite button does the same), the members button, Smaller stage / Larger stage, Chat only; the people as large avatars (talking ring and bars, muted, crown, streaming); the streams as cards (the streamer's avatar on a painted scene in their colour, or the picture while watched, and our own from the Stream Studio its preview: `studio:live,server,voice`; LIVE, viewers, kind, bitrate, sound, Watch Stream); the call bar: mute and deafen (red while on), share (its menu opens above it), the voice settings and Leave; the channel's chat. The smaller stage (`ui.voice_compact`, and always in windows under 800 px tall, where its button is disabled) is one row of small avatars, scrolling sideways, and the streams as rows (Watch, Show), so the chat gets about 200 to 240 px more | `Presence`, `Talking`, `StreamsChanged`, viewer counts from `StreamsChanged`, else the `Gateway` stream directory |
| Watching a stream | `watch`, `watch,theatre`, `popout` | A header (on our channel's background) with the streamer's avatar, the title, the streamer and viewers, LIVE, the picture's height (the simulcast picker when a Voelin streamer offers layers), the members button and Leave; the player, with nothing over the picture but its controls: volume, elapsed time, what arrives (codec, size, frame rate, bitrate), back to the chat, theatre mode, pop out (desktop), full screen. The controls hide 2.5 s after the pointer last moved over the picture and come back when it moves (in full screen the cursor hides with them; on a touch screen a tap on the picture shows or hides them); while waiting for the picture and after the stream ended they stay, and so do they before the pointer was ever over the picture, as in screenshots. Then a note that the stream belongs to the channel; the channel's chat and a Stream Info tab. In theatre mode (`Nav.theatre`) it fills the window without the shell or the members button, the chat still under the picture; it ends with the viewer, and a narrow window keeps the phone layout. Escape leaves full screen, then theatre mode. In full screen (and on the phone outside the voice screen) the player is alone, with the streamer, title, viewers, LIVE and the quality over the picture's top, hiding with the controls. Popped out (`ViewerWindow`, `src/popout.rs`), the player alone is in a window of its own titled with the stream, while the main window goes on (`Bridge.viewer-popped`; the main window's `viewer-open` is false meanwhile): its controls keep it on top of the other windows (`always-on-top`, picture in picture; the next pop-out remembers it for the run) and bring it back; full screen and Escape are that window's, and it stays when another stream is watched. The stream's card on the voice page says "Playing in its own window", with Bring back (the streams panel's card has Bring back too). Closing the window brings the stream back too, on its server's page; Leave closes it, and so does closing the main window. The pictures go only to the window that shows the player | `WatchState`, `WatchLayers`, decoded frames and their stats (`src/video.rs`), `StreamsChanged` (viewer counts; the `Gateway` stream directory where the server gives none) |
The pins and topics share the place of the members panel: opening one
closes the other, and the members button brings the panel back. On the
phone the chat is the Chat tab and the members of our channel are on the
Activity tab, with the streams (the streamer's avatar on their colour, Watch,
Show and Leave). The Chat tab counts the server's unread chats; private chats
count on the Home tab, where the direct messages are.
The phone's Servers tab (`tab:servers`) is titled Servers: the servers as a
row of icons (a double tap edits one, + adds one), then the server card, the
one place for the server's name, counts and banner, with its menu (Edit
server, Add a server); Connect, or the voice card with our channel (a tap
opens the voice screen); and the channel tree.
The phone's voice screen (`voice` in a phone-sized window,
`screens/mobile-voice.slint`) has one header, the shell's top bar: Back (it
closes the pins, the topics or the members over the screen first, then the
screen), the channel's name on its banner with the server below, the people
in voice (the members page), Chats with the unread count, and More: Pinned
Messages and Topics (with a gateway), Stream Studio, Voice Settings and
Activity (`more` opens it). Below it come the stream we watch or the streams
as rows, the people (44 px avatars, scrolling sideways) and Invite, the
channel's chat and the composer. The stream and the people take at most
45 % of the screen, so the chat keeps about 320 px at 390 × 844 while
watching. The bottom bar has Mic on or Mic off and Deafen; with push-to-talk
Hold to talk in the middle (green, Talking…, while held) and Share,
otherwise Share in the middle; Share opens the share menu (Share screen,
Stream Studio) as the desktop's call bar does; and Leave, the screen's only
one. The transmit mode comes from the stored audio settings at start.
## Home, friends, messages and the settings pages
These follow the design mockups 01 (home, desktop and phone), 02 (direct
messages), 03 (the links above the channel tree) and 11 (Voice & Video,
desktop and phone), mapped onto what TeamSpeak has: there is no global
network, so nothing pretends one. "Friends" are the contacts (friend,
blocked or neither) and where they are is what the servers we are on (or
look into) say; "communities" are the user's servers. Nothing here needs
a gateway; what one adds (events, the stream directory, activity) shows
where a server has it.
| Part | `VOELIN_OPEN` | What it shows | Engine data |
|---|---|---|---|
| Home | `home`, `first-run` | Before the first server a banner with Voelin and Add a Server; after it "Continue where you left off": the voice channel we were in last (`ui.last_voice`, kept when our channel changes) with Join, which connects into it, or Open while voice is there (none once its server is deleted or has another address), and up to three unread mentions (they open their chat). Then friends online where the right column is hidden (as many whole bubbles as fit, Find Friends after them); live streams on our servers (any channel, the gateways' directories, clients flagged streaming) with viewers, server, channel and kind; our servers with who is there and Join or Open; the latest chats of every server. At the right what friends do and what is happening (gateway events and scheduled streams, soonest first, then server news). The sidebar lists the five newest private chats, unread first (not on the messages page). The phone has the messages, servers and live streams in one column after the friends | `State` (our channel), `FriendPresence`, `ContactsChanged`, `StreamsChanged`, `Gateway` (stream directory, events), `Presence` (the servers' welcome and host messages), `Chat` (mentions), `History::recent_chats` |
| Library | `library` | The Stream Studio's recordings and clips (the files in `studio.recording_dir`, newest first) with Play and Open Folder | the folder |
| Friends | `friends[:<uid>]` | Online, All and Blocked tabs, a search; each contact with where they are (server, channel, away, live), message, poke, join, watch. The selected one at the right: relation, where, a note, our volume and mute for them, friend, block, forget | `ContactsChanged`, `FriendPresence`; `Command::SetContact`, `RemoveContact`, `Poke`, `MoveToChannel` |
| Direct messages | `messages[:<uid>]`, `inbox`, `offline` | The private chats of every server and of the store (peers by unique id) with the last message and unread counts, All, Unread and Inbox (offline messages); the conversation with the chat's message list, pokes among the messages, pictures and files, a composer, and a clear state when the peer cannot be reached (an offline message instead, where the server keeps them); the peer at the right: relation, note, the servers they are on, shared pictures and files, our volume for them. A private chat is not a tab of the server page: while it is open here it is its server's current chat (a channel's chat opened meanwhile, as voice connecting opens its channel's, waits), and leaving the page goes back to the server's last chat tab (coming back reopens it). Its unread messages count on Direct Messages (on the phone, on the Home tab), not on the server rail | `ChatHistory` (`ChatTarget::Private` by unique id), `Command::LoadOlderHistory`, `Poke`, offline messages (`ListOfflineMessages`, `GetOfflineMessage`, `SendOfflineMessage`, `DeleteOfflineMessage`, `SetOfflineMessageRead`) |
| The bell | `notifications` | A panel under the bell, as tall as its notices (up to 560 px, then it scrolls): mentions, pokes, private messages, event reminders and friends coming online, newest first, unread marked; Mark all read, clear, the settings. Each kind is off, in the app or also a desktop notification (`notify.*`) | `Chat` and `ChatHistory` (mentions, private messages), `Poke`, `GatewayUpdate::EventReminder`, `FriendPresence`; `voelin_platform::notify` |
| Search | `search[:<text>]` | Ctrl+K: servers, channels of every server, people (on the servers and the contacts) and the settings pages; arrows choose, Enter opens | the sessions, contacts, bookmarks |
| Events | `events`, `event-form` | Above the channel tree (gateway `events`): a server's events with date, time, channel, scheduled stream, Going, Maybe and Not going with counts, who answered, reminders, Watch while live; create, edit and delete. Members (above the tree too) opens the members panel | `Gateway` events; `GatewayRequest::Events`, `CreateEvent`, `UpdateEvent`, `DeleteEvent`, `Rsvp` |
| Pictures in chat | `picture` | A linked png, jpg, gif or webp up to `ui.image_preview_kb` is downloaded into memory, decoded once into the image cache and shown as a card in the message; a click opens it larger. A picture on the web a message shows (`[img]`) comes into the engine's picture cache like banners, up to the same size and only with `cache.fetch_images`; until then, or without it, the message shows its address as a link | `Command::DownloadChatFile` with `DownloadTo::Memory`, `Transfer`; `Command::FetchPicture`, `PictureReady` |
| Join by address | `join` (the same as `bookmark`) | The add-server dialog (Adding a server, below): Connect saves the server, then connects | `Command::ConnectVoice` |
| TeamSpeak links | `link:<url>` | A `ts3server://`, `teamspeak://` or `tmspk.gg` link: in voice on its server, a move into its channel; else the add-server dialog filled in from it (Adding a server: Links, below) | `Command::MoveToChannel`, `Command::ConnectVoice` |
Settings sections (`settings:<section>`):
| Section | Holds |
|---|---|
| `account` | The identity in use (nickname, TeamSpeak 3 and 6 unique ids, security level), and a note that account sign-in is not available in this build |
| `profiles` (also `identities`) | Identities with where they came from: rename, use as default (the store's default, `Store::set_default_identity`), export as a TeamSpeak 3 .ini, delete, raise the security level on every core; the import of the official clients' identities on start (`identity.import_from_teamspeak`) and by hand from their settings and .ini files (key material is never shown); the identity per server |
| `appearance` | Theme, text size, the phone layout's width, the image cache |
| `voice` | Microphone (device, test, level, noise suppression, echo cancellation, automatic gain), output (device, test sound, volume), streaming permissions, camera (device, preview with the background effect), video settings (resolution, frame rate 15 to 320 fps, codec, hardware acceleration, mirror), stream quality presets (Auto, 720p to 8K) with free bitrate entry (slider up to 60 Mbit/s, empty: automatic) and the upload it takes |
| `streaming` | Frame rate, bitrate, codec, capture backend, simulcast layers, the stream's audio sources (desktop without Voelin, applications, the shared window's application, microphone; gain and mute each), recording and replay |
| `devices` | Microphones, speakers, cameras and what can be shared |
| `notifications` | Each kind of notification: off, in the app, on the desktop; a test notification |
| `privacy` | Who may send private messages and poke us, blocked people and what happens to their messages, streaming permissions |
| `keybinds` | Voice activation, push-to-talk and its global key, the window's shortcuts |
| `integrations` | The gateways of our servers with their features, and their administration for admins (configuration keys, permission rules); FFmpeg, the video encoders and decoders, what works and why not |
| `advanced` | Encoder and decoder, hardware acceleration and decoding, SRTP profiles, chat history, cache, transfers, logs and crash reports, and every setting by its key as JSON |
Settings controls read and write `voelin_core::settings` and apply at once;
numbers are typed freely next to the presets.
There is no account sign-in in this build: no login page at start, and
Settings → My Account shows the identity in use under a note, "Account sign-in
is not available in this build." The myTeamSpeak account (profile, avatar,
badges, User Tag) is meant to return through the gateway; the sign-in
screens (`screens/account.slint`) stay in the Slint code for it, fed no data
(`Bridge.myts` keeps its default: signed out, not available, no prompt).
[research/myteamspeak.md](research%2Fmyteamspeak) keeps the protocol notes.
## The Stream Studio
![Stream Studio](raw/screenshots/desktop-studio-live.png)
The studio (mockups 09, 10 and the phone's 04) is a page of the main window
(the Share button's menu: "Share screen" for a quick share of a screen or
window, "Stream Studio" for the studio; while a share runs the button opens
its dialog), a window of its own (the button in its
header; closing that window brings it back) and a phone page. Its controller
is `src/studio/` on the engine's studio ([studio.md](studio)), its decisions in `voelin-ui-vm`'s `studio/logic.rs`: the
studio runs while it is shown, live or recording, and a `Streamer` started
for it encodes the composite from the start, so Record Clip and recordings
work before going live.
| Part | `VOELIN_OPEN` | What it shows | Engine data |
|---|---|---|---|
| Scenes | `studio` | The scenes, the live one highlighted, with what each shows; click to switch live, double-click or the menu to rename, remove; Add Scene | `Event::Scenes`; `AddScene`, `SetActiveScene`, `RenameScene`, `RemoveScene` |
| Sources | `studio`, `studio:source`, `studio:camera` | The live scene's sources, front first: add a screen, window (on Wayland through the portal, on X11 the monitors and windows), camera, image, text or colour; show or hide; a menu with transform, crop, opacity, lock, background effect (cameras: off, blur, image, colour), forward, backward, rename, remove | `AddSource` (as `SetScenes`, with a placement), `UpdateSource`, `ReorderSource`, `RemoveSource`; per source size, rate and error from `Stats` |
| Header | `studio`, `studio:live` | "Streaming to channel • server", the connection (the viewers' bandwidth estimates against the bitrate, and the composed frame rate), resolution • fps • kbit/s, details on the info button | `Stats`, `Streamer::stats`, the stream's viewers |
| Preview | `studio`, `studio:live`, `studio:record` | The composite, LIVE and the time (or PREVIEW, REC), watching and joined viewers, title • destination | `Studio::preview` turned into pictures on a thread of its own, latest wins; `State` |
| Audio mixer | `studio`, `studio:audio` | One row per `stream.audio_sources` entry: meter, gain (dB), mute, a menu; + adds the microphone, desktop audio without Voelin, the shared window's application or an application that plays | the mixer's meters (lock-free, about 15 times a second); `Streamer::reconfigure` follows the setting |
| Stream chat | `studio` | The chat of the channel the stream goes to and a composer | the destination tab's stored messages, made into lines as the chat view does |
| Stream settings | `studio` | Destination (the voice channel of each TeamSpeak 6 server we are in), title, game, go-live message (sent to the channel when the stream is up), Show Viewer Count / Chat Overlay / Now Playing, Enable Stream Audio, Advanced Settings, output size and rate (presets 720p to 8K and 30 to 240 fps, or any numbers), bitrate (empty: automatic, up to 60 Mbit/s) or simulcast layers | `studio.ui`, `stream.bitrate_kbps`, `stream.layers`, `SetOutput` |
| Bottom bar | `studio`, `studio:settings` | Share Window, Share Screen, Record Clip (and start or stop a recording, the replay length, the folder), Go Live, End Stream, Studio Settings (replay seconds and memory, folder, preview size) | `SaveClip`, `StartRecording`, `StopRecording`, `studio.*`, `SetPreview`; `Command::StartStream`, `Streamer::attach`, `GoLive`, `EndStream` |
| Window of its own | `studio:window` | The same pieces, compact | — |
The studio's window has globals of its own: the controller sets the same
models (shared `VecModel`s) and the same values on both windows' globals
and wires both to the same callbacks (`bind/studio.rs`). The overlay
switches keep text sources named "Viewer count", "Chat overlay" and "Now
playing" in the live scene (they can be moved like any source). A TeamSpeak
stream has a name only, so the game goes into it after the title ("title —
game"), which is also what the gateway's directory shows. With sample data
(`VOELIN_DEMO_UI`) the studio runs from synthetic sources (the test pattern,
the synthetic camera with background blur, text, colours) and test tones,
on settings in memory, and recordings go to a temporary folder.
### Frame rate and quality in the quick share
The share dialog's lists (`FPS_CHOICES`, `BITRATE_CHOICES` in
`src/settings.rs`, the same lists in `dialogs.slint`) offer 15, 30, 60,
120, 144, 240 and 320 fps, and Auto (the default: from the size and frame
rate shared, up to 60 Mbit/s, the bitrate field left empty), 2.5, 4.6, 8,
10, 20, 40 and 60 Mbit/s; any other number can be typed, with no maximum.
Both are the settings `stream.fps` and `stream.bitrate_kbps` (0:
automatic). The `ui` blob keeps the index of the closest entry of the old
three- and four-entry lists for older versions.
### Sound in the quick share
The share dialog (`share`, and `share:live` for a running share) mixes its
sound with the studio's pieces: while "Share system audio" is on (off: no
audio at all) it shows the studio's mixer rows (`MixerRow`: meter, gain,
mute, a menu) for `stream.audio_sources`, and Add opens the studio's picker
(`PickDialog`) over it: the microphone, desktop audio without Voelin, the
shared window's application, any application that plays (on Android the
launchable apps with their icons), several at once. The rows read the
main window's `StudioBridge`, filled without starting the studio
(`App::mixer_show`). Starting a share hands the sources to the capture
(`CaptureRequest::audio_sources`); while it runs the dialog shows the
same rows with the share mixer's meters (about 15 times a second), and
every change of `stream.audio_sources`, from the dialog or anywhere else,
goes to the running capture at once (`Capture::follow_audio`, which calls
`Streamer::reconfigure`). A share started without sound has no audio track
to add sources to. With sample data `share:live` shares the test pattern
with the sample studio's sources, live at once with sample viewers.
## Adding a server
The add-server dialog (`BookmarkDialog` in `screens/dialogs.slint`, logic in
`servers.rs`) asks for the address (host, host:port, IP or server
nickname; the resolver finds the port through SRV records and TSDNS) and
an optional server password. *Advanced* (open when editing) has the name
and the nickname, and empty fields there are filled in: the name is the
address until the first connection, then the server's own name
(`adopt_server_name`); the nickname is the default identity's (one imported
from TeamSpeak keeps its nickname there), else the system user's, else
"Voelin user"; the identity is the default one, there is no default channel.
There are no gateway or ServerQuery fields: the gateway is looked up from
the address (DNS SRV records, else the gateway's `/.well-known/tsgw`) when
the server is saved, selected or connected
([gateway-admin.md](gateway-admin#letting-voelin-find-the-gateway)), one
found is stored, and a new address looks again. `bookmark` (or `join`) and
`bookmark:edit` open it (below).
Its footer has Delete at the left (when editing; only the icon on a phone),
then Cancel, Save and Connect. Save keeps the server. Connect, also Enter in
the address or password field, keeps it, connects it with voice and shows it
(`Bridge.save-and-connect`, `App::save_and_connect`): nothing connects when
saving failed. While the server has voice, Connect is hidden and Save is the
main button. Home's Add a Server opens this dialog too. The form also
carries a channel, its password and a privilege key for TeamSpeak links,
which are not stored with the server: with a channel the dialog shows
"Joins <channel>" and Connect connects into it; with a key it shows "This
link grants a server group".
### Links
A TeamSpeak link clicked in chat (or `link:<url>`, below) opens in Voelin
(`App::open_link` in `links.rs`). `voelin_model::Link::parse` reads
`ts3server://` and `teamspeak://` links (the scheme and the keys in any
case): the host (with a port as `host:port` or `[v6]:port`), and `port`,
`nickname`, `password`, `channel` (names from the top, `A/B`; a `/` in a
name is `%2F`, and `\/` in the path the dialog and the server get), `cid`
(a channel id, kept as the path `/<id>`), `channelpassword` and `token` (a
privilege key); other keys are ignored.
`tmspk.gg/s/<host>?…` (and `/s=<host>`) is the same server link, as its
page sends the browser on to `teamspeak://<host>?…`. Invite codes
(`tmspk.gg/<code>`, `teamspeak://invite=<code>`) only a TeamSpeak service
can resolve: the toast says they can't be opened yet.
The link's server is a saved one when the addresses match
(`vm::servers::same_address`: the host in any case, an IPv6 address with or
without brackets, no port as 9987; of several saved at that address, the
one in voice, else the one shown, `vm::servers::link_server`). In voice on
it, Voelin shows it and moves into the link's channel
(`vm::servers::channel_by_path`; of channels with the same name the first
in the tree that has the rest of the path) through `App::join_channel`,
with the link's channel password: a locked channel without one, or with a
wrong one, asks for it. A channel the server does not have is a toast.
Otherwise the dialog above opens filled in by
`vm::servers::link_form`: a saved server keeps its address, name, nickname
(a link never changes it) and stored password unless the link has one; a
new server takes the link's address, nickname (else the default one) and
password; both get the link's channel, its password and the key. Nothing
connects before Connect. `vm::servers::invite_link` (Copy invite link)
writes links with `ServerLink::to_url`, so they read back the same.
Selecting a server observes it invisibly through its gateway (or a query
login an older version stored), so its channels, members and chats show
without joining; there is no Observe button. Without a gateway, observing
starts once one is found.
Settings → Profiles (`ProfilesSection` in `screens/settings-pages.slint`;
`settings_pages/`, and `identities.rs` for the default and the import
switch) lists the stored identities with where they came from, marks the
store's default and has "Use as default" for the others, plus the switch
for importing the official clients' identities on start
([identity.md](identity)). `settings:profiles` opens it, and
`settings:identities` as well.
## Adding a screen
1. Write the screen in `ui/screens/<name>.slint` from the components
(`import { ... } from "../components/index.slint";`), reading data from
`Bridge` and navigating through `Nav` (e.g. `Nav.open-settings(...)`,
`Nav.show(Page.home)`). Text goes to the clipboard with `Nav.copy(text)`
(through a hidden text field in `MainWindow`; a toast confirms it).
2. New data: add a struct and a property (models: `[Struct]`) and callbacks to
`ui/bridge.slint`.
3. Place it: add a `Page` value in `ui/nav.slint` if it is a page, and in
`ui/app.slint` put its sidebar and main parts into `DesktopShell` under
`if Nav.page == Page.<name>:` (and a case in `MobileShell`). Dialogs go at
the end of `MainWindow` with an `*-open` flag in `Nav`.
4. Rust: a pure view model in `voelin-ui-vm/src/<name>.rs` (with tests) that
turns engine state into the plain bridge structs (`bridge.rs`, with a
`From` impl for the Slint struct in `bind/convert/items.rs`); a model in
`app::Models` set on the Bridge once and updated with `Rows::sync`;
callbacks in `voelin-ui/src/bind/<name>.rs` (call it from `bind::wire`);
the Slint side as `impl App` in `voelin-ui/src/<name>.rs`, with the
decisions in the view-model crate (`<name>/logic.rs`, [Two
crates](#two-crates)).
5. A development switch to open it (`dev.rs`, `VOELIN_OPEN=<name>`), a
screenshot (below) and a line in this file.
## Settings
The UI's keys (besides the engine's): `ui` (push-to-talk, H.264, share
dialog; one JSON value), `client_playback`, and the appearance keys, applied
live when they change (settings page, `--set`, another window):
| Key | Type | Default | Effect |
|---|---|---|---|
| `ui.theme` | dark / light / system | dark | colours |
| `ui.font_scale` | number above 0 | 1.0 | every type size |
| `ui.narrow_breakpoint` | pixels | 800 | below this width the phone layout |
| `ui.image_cache_mb` | megabytes | 256 | decoded images kept in memory (0: none) |
| `ui.members_width` | pixels | 280 | width of the members panel (dragging its edge sets it) |
| `ui.voice_compact` | bool | false | the voice channel view's smaller stage (its Smaller stage / Larger stage button sets it; windows under 800 px tall always have it) |
| `ui.image_preview_kb` | kilobytes | 8192 | pictures linked in chat (files and `[img]`) up to this size show as pictures (0: never) |
| `notify.mentions`, `notify.private_messages`, `notify.pokes`, `notify.event_reminders`, `notify.friends_online` | off / app / desktop | desktop (friends: app) | what the bell and the desktop say about each kind |
| `video.camera`, `video.background`, `video.resolution`, `video.mirror` | device id; none / blur; auto or WxH; bool | first camera, none, auto, true | the camera of the preview and the default of camera sources |
| `studio.ui` | JSON | see below | the Stream Studio's stream settings: `title`, `game`, `message` (go-live), `show_viewers`, `show_chat`, `show_now_playing`, `audio` (stream audio), `preview_width` (960), `preview_fps` (15) |
In a config file write them as dotted keys at the top level
(`"ui.theme" = "light"`): a `[ui]` table is read as the `ui` value.
## Emoji
The software renderer has no colour glyphs, so emoji are images. The 3720
Twemoji SVGs are packed by `scripts/pack-twemoji.py` into
`crates/voelin-ui-vm/assets/twemoji.bin` (64 KiB blocks of raw deflate, an index sorted by key,
picker names and categories; 1.9 MB) and embedded in the binary. `voelin-ui-vm`'s `emoji.rs`
splits chat text into grapheme clusters, maps emoji to Twemoji keys (code
points in hex; U+FE0F dropped outside ZWJ sequences, as Twemoji names its
files; text-default symbols such as © or digits only with U+FE0F) and makes
runs of each span of a message (see Formatting): one per word and one per
emoji. A message without formatting or emoji stays one `Text` (fast path);
any other is a `RichText`, whose runs wrap in a `FlexboxLayout` (lines break
between words, not inside them; a run does not wrap, so a word longer than
24 characters, such as an address, is cut into runs). One to three emoji
alone are shown large. `Images.emoji(key)` decodes an emoji once
(`images.rs`, LRU by bytes) when a visible row asks for it.
The picker lists the emoji without skin-tone variants by category (coarse
code-point ranges) and searches Unicode names. There are no shortcodes yet.
## Formatting
TeamSpeak clients format chat with BBCode. `voelin-ui-vm/src/bbcode.rs` reads a message
into a `Doc`: blocks (lines, quote lines, code, list items, rules) of spans
with a style (bold, italic, underline, strike, code, colour, link) or a
picture. The Doc does not depend on BBCode, so Markdown (TeamSpeak 6) can be
a second parser making the same Doc.
- Tags: `[b]`, `[i]`, `[u]`, `[s]`, `[color=#rgb|#rrggbb|name]`, `[url]`,
`[url=…]`, `[img]`, `[quote]`, `[quote=Name]`, `[code]` (nothing inside is
a tag; one line is inline code, more are a block), `[list]` with `[*]`,
`[hr]`. `[left]`, `[center]`, `[right]`, `[size]`, `[table]`, `[th]` and
`[td]` are dropped and their text kept; `[tr]` starts a line.
- Tags are read in any case, and only known ones: `[Nova] hi` and `[1]`
stay text. A tag left open ends with the message; a closing tag that
closes nothing stays text.
- A line break starts a block. Bare `http(s)://` and `www.` addresses are
links, without the punctuation after them. Links go only to the web,
TeamSpeak servers and channel files: `[url=javascript:…]` is no link.
`classify_link` says which (`LinkKind`: `Web`, `Server` for
`ts3server://`, `teamspeak://` and `tmspk.gg` invites, `File`, `Refused`
for other schemes, backslashes, spaces, control characters and a leading
`-`); only those reach `TextRun.link`. A link whose text is not its own
address (`[url=…]raid board[/url]`, another address) is masked
(`is_masked`, `TextRun.masked`): it asks before it opens.
- Colours are honoured, made readable on each theme (a contrast of 4.5:1 to
the chat's background, keeping the hue).
- Past 16 tags open at once or 1500 spans (or runs), a message is plain
text.
`vm::chat` turns a Doc into `TextBlock`s of `TextRun`s, leaves out the file
links shown as cards, and shows `[img]` pictures that are in the engine's
cache as picture cards (else their address as a link). `ChatLine.text` is
the plain text (quotes as `> `, list items as `• `), for screen readers and
copying; `ChatLine.link` is the first web address. Lists of chats,
notifications and the home's news show the text on one line
(`Doc::one_line`). Built lines are kept per message id and revision
(`LineCache`), so a refresh leaves unchanged rows alone.
## Development switches and screenshots
Environment variables (see `src/dev.rs`):
- `VOELIN_DEMO_UI=1`: sample servers, channels, members, chat with
formatting and emoji (and two pages of older messages, which load when
scrolled up), and a stream, without a server (nothing is stored).
- `VOELIN_OPEN=<what>[,<what>...]`: `home`, `server` (`server:chat`: the server chat), `settings[:voice|keybinds|streaming|privacy|appearance|profiles]` (`identities` is the same as `profiles`),
`about`, `share[:live]`, `bookmark[:edit]`, `emoji`, `client`, `panel`, `no-panel`,
`voice` (`voice:compact`: the smaller stage, not stored), `more` (after `voice` on the phone: the
voice screen's More menu), `pins`, `topics`, `topic:<id>`, `member`, `poke`,
`channel-password[:wrong]`, `actions` (the last message's actions, as if
hovered: a screenshot cannot hover), `first-run` (Home's banner as before
the first server, over the sample data), `link-confirm[:<url>]` (the question
before a masked link opens, by default the sample's), `link:<url>` (a
TeamSpeak link opened, as from chat: the server dialog filled in from
it, or in voice on its server a move; Adding a server: Links), `unread` (the
current chat read up to five messages before its end: the New line,
scrolled up to; `unread:end` ten messages before, at the end of the list,
under the bar that counts them), `watch`, `theatre` (after `watch`:
theatre mode), `popout` (`watch` in a window of its own)
(the server page, above), `tab:<home|servers|chat|activity|you>` (phone
layout); `friends[:<uid>]`, `messages[:<uid>]`, `inbox`, `offline`,
`library`, `events`, `event-form`, `search[:<text>]`, `notifications`,
`join` (the same as `bookmark`), `picture`, `camera` (the settings'
camera preview, the test pattern) and the settings sections `account`,
`profiles`, `devices`,
`notifications`, `integrations`, `advanced` (above). With sample data, `watch` plays the local test pattern in the
sample stream's place. `studio[:window|live|record|source|audio|camera|scene|settings]`
opens the Stream Studio (above) in that state (`studio:live` also with a
screen opened after it: `studio:live,server,voice` shows our stream's card
with the studio's picture); with its window open, or the stream's
(`popout`), a screenshot also saves the window alone (`<name>-window.png`)
and draws it over the main window.
- `VOELIN_WINDOW_SIZE=390x844`: window size (phone layout below the breakpoint).
- `VOELIN_SCREENSHOT=<png>`, `VOELIN_SCREENSHOT_DELAY=<s>`: save the window and exit.
- `VOELIN_DEMO_STREAM=1`, `VOELIN_AUTOCONNECT`, `VOELIN_AUTOWATCH`,
`VOELIN_AUTOSHARE`, `VOELIN_DATA_DIR` as before.
```sh
scripts/shots.sh shot.png settings:appearance 1440x960
# which runs, headless:
env -u WAYLAND_DISPLAY -u XDG_SESSION_TYPE SLINT_BACKEND=winit-software VOELIN_DATA_DIR=$(mktemp -d) \
VOELIN_DEMO_UI=1 VOELIN_OPEN=settings:appearance VOELIN_WINDOW_SIZE=1440x960 \
VOELIN_SCREENSHOT=shot.png VOELIN_SCREENSHOT_DELAY=4 \
xvfb-run -a -s "-screen 0 1440x960x24" target/debug/voelin
```
Remove `WAYLAND_DISPLAY` as above in a Wayland session: winit prefers
Wayland, so the window would open on the desktop instead of on the Xvfb
server (and take whatever size the compositor gives it). Remove
`XDG_SESSION_TYPE` too: with `wayland` there the push-to-talk hotkey (and
screen capture) use the desktop portal of the real session even on Xvfb,
and the desktop may ask to bind the shortcut. The script also
turns FFmpeg off (`VOELIN_FFMPEG=0`: probing hardware encoders is not
needed for pictures and has crashed in a driver), makes the screen twice
the window's size so the pointer is not over the window, and passes
`$ARGS` to the app (`ARGS="--set ui.theme=light"`). The pictures in
`docs/screenshots/` were made this way (reduced to 256 colours with
`convert -colors 256 PNG8:`).
| Server page | |
|---|---|
| ![chat and members](raw/screenshots/desktop-server.png) | ![voice channel](raw/screenshots/desktop-voice.png) |
| ![pinned messages](raw/screenshots/desktop-pins.png) | ![topics](raw/screenshots/desktop-topics.png) |
| ![a topic](raw/screenshots/desktop-topic.png) | ![member card](raw/screenshots/desktop-member-card.png) |
| ![watching a stream](raw/screenshots/desktop-stream-viewer.png) | ![popped out](raw/screenshots/desktop-popout.png) |
| Stream Studio | |
|---|---|
| ![studio](raw/screenshots/desktop-studio.png) | ![live](raw/screenshots/desktop-studio-live.png) |
| ![its own window](raw/screenshots/desktop-studio-window.png) | ![the window alone](raw/screenshots/desktop-studio-detached.png) |
| ![a source](raw/screenshots/desktop-studio-source.png) | ![phone](raw/screenshots/mobile-studio-details.png) |
| Desktop | |
|---|---|
| ![home](raw/screenshots/desktop-home.png) | ![light](raw/screenshots/desktop-light.png) |
| ![settings](raw/screenshots/desktop-settings-voice.png) | ![appearance](raw/screenshots/desktop-settings-appearance.png) |
| ![emoji](raw/screenshots/desktop-emoji-picker.png) | ![volume](raw/screenshots/desktop-client-volume.png) |
| ![share](raw/screenshots/desktop-share-dialog.png) | ![sharing](raw/screenshots/desktop-share-live.png) |
| ![add server](raw/screenshots/desktop-add-server.png) | ![about](raw/screenshots/desktop-about.png) |
| Home, friends, messages | |
|---|---|
| ![friends](raw/screenshots/desktop-friends.png) | ![direct messages](raw/screenshots/desktop-messages.png) |
| ![the bell](raw/screenshots/desktop-notifications.png) | ![search](raw/screenshots/desktop-search.png) |
| ![events](raw/screenshots/desktop-events.png) | ![library](raw/screenshots/desktop-library.png) |
| ![integrations](raw/screenshots/desktop-settings-integrations.png) | ![profiles](raw/screenshots/desktop-settings-profiles.png) |
| Phone layout | | | | |
|---|---|---|---|---|
| ![chat](raw/screenshots/mobile-chat.png) | ![servers](raw/screenshots/mobile-servers.png) | ![home](raw/screenshots/mobile-home.png) | ![you](raw/screenshots/mobile-you.png) | ![settings](raw/screenshots/mobile-settings.png) |
| ![voice channel](raw/screenshots/mobile-voice.png) | ![activity](raw/screenshots/mobile-activity.png) | ![studio](raw/screenshots/mobile-studio.png) | ![share](raw/screenshots/mobile-share.png) | ![sharing](raw/screenshots/mobile-share-live.png) |
| ![friends](raw/screenshots/mobile-friends.png) | ![messages](raw/screenshots/mobile-messages.png) | ![events](raw/screenshots/mobile-events.png) | ![the bell](raw/screenshots/mobile-notifications.png) | ![streaming settings](raw/screenshots/mobile-settings-streaming.png) |
| ![add server](raw/screenshots/mobile-add-server.png) | | | | |
## Server and channel pictures
The compact server card shows its icon over the host banner. TeamSpeak 6
channel banners sit behind their titles in fixed-height tree rows (34 pixels),
and behind desktop and phone chat/voice headers. Artwork uses centred cover
cropping without distortion; it never adds height to navigation. Custom channel
icons lead the title. Top-level spacer channels show their text without the
prefix and without an icon or a member count: `[spacerN]` and `[lspacerN]` on
the left, `[cspacerN]` centred, `[rspacerN]` on the right, and `[*spacerN]---`
repeats its text across the row as a line (any text may follow `spacer`, as
it only keeps names unique). Every screen that names a channel, and the
Android voice notification, shows a spacer's text; the tree search, Ctrl+K and
the event form leave out lines and empty spacers. A theme-aware surface
gradient (74% to 66% opacity) keeps primary text above 4.5:1 contrast even on
all-white or all-black artwork, while leaving the image visible. Missing
pictures retain the normal background.
A channel has one icon everywhere, a speaker (`Icons.channel`, a lock for a
locked one in the tree), and chat tabs, notifications and search results name
it without a `#`. A server icon at most half as wide as its avatar (TeamSpeak's
are often 16 pixels) is drawn at twice its size, sharp, on the server's colour
instead of stretched. Avatars under 28 pixels, as the tree's clients, show one
letter.
Bookmarks remember the server icon ID and the address that supplied it. The
server list, search results and server header load its cached bytes before
connecting, including after restarting the app. Editing a server address
invalidates the association; queued details from the old address cannot replace
it. A missing or evicted image falls back to initials. This requires no
ServerQuery configuration and starts no background voice connection.
First-visit icon downloads before login remain unverified. On a private TS6
6.0.0-beta13.1 fixture, the native encrypted handshake completed without
`clientinit`, but pre-login `serverinfo`, `getserverinfo`, `servergetvariables`,
`ftinitdownload` and `ftgetchannelfilehttptoken scid=icons` probes each received
no response within three seconds. The installed official client's UI code
populates its bookmark icon cache from connected server properties. Its clean
profile requires account setup before the server list, so no fresh-profile
network capture was obtained. These observations do not establish that every
server or client version lacks a pre-login mechanism.
Badges arrive as GUIDs (`client_badges`; on TeamSpeak 6 also
`client_signed_badges`, the myTeamSpeak badges the server verified, which
come first: `voelin_model::shown_badges`). Their names and descriptions come
from a table in `voelin-model` (`badges::info`, tsclientlib's list and the
newer entries of TeamSpeak's own, `https://badges-content.teamspeak.com/list`,
as of October 2026); newer badges show as "Badge". Their pictures are SVGs
on TeamSpeak's server (`https://badges-content.teamspeak.com/<guid>/<filename>.svg`,
`badges::icon_url`), fetched like web banners for the first three badges of
each client in the presence shown, and reported with `PictureReady`. A
client's tree row shows the pictures that arrived right after the name (its
group and client icons stay at the end); so does its row in the members
panel.
The engine downloads banners and badges, and the pictures chat messages
show (`[img]`, `Command::FetchPicture`), only while `cache.fetch_images` is
enabled.
Banners on the web (`http`, `https`) come from their host; banners in the
server's own files, linked as `ts3image://` (TeamSpeak 5 and 6:
`ts3image://<host>?port=…&channel=…&path=…&filename=…`, the file browser's
`ts3file://` link with its scheme changed; TeamSpeak 3:
`ts3image://<name>?channel=…&path=…`), come through the voice connection's
file transfer, so they need voice and the server's file permissions. Their
cache entry is named by the server too, as the same address names another
file elsewhere. Up to 16 web downloads run at once, at most 6 per host (a
redirect's target counts); duplicate URLs share a request. Pictures on the
web go through the desktop's proxy (the portal's, on Linux) or the
system's, SOCKS too. A picture may be up to 128 MiB (avatars and icons
too; myTeamSpeak avatars 4 MiB, a chat's `[img]` up to
`ui.image_preview_kb`), and goes to disk as it arrives. Web downloads
connect within 20 seconds, and fail after 60 seconds without data or when,
after their first 120 seconds, they average less than 8 KiB/s; there is
no fixed overall deadline, so large banners on slow hosts still arrive.
Failed banners and badges are tried again after 1, 4, 16, 60, 300 and 900
seconds, then every 15 minutes while they are shown; one whose address is
wrong or gone (HTTP 400, 404, 410) after 15 minutes, then hourly; one whose
host asks to wait (429, 503) when it says (1 minute to 1 hour). Asked for
again, a cached picture is downloaded only if its host says it changed
(ETag, Last-Modified). Avatars, icons and chat pictures receive up to three
automatic retries after 1, 4 and 16 seconds. Retries do not wait for a
presence update. Avatar/icon/banner file-transfer negotiation expires
after 30 seconds, and the download after 60 seconds plus its size at
8 KiB/s. User file transfers retain their existing timing. Replaced images
and closed sessions discard obsolete results. A host banner's reload
interval is at least 60 seconds; failed refreshes preserve the previous
cached picture. Closing the session stops its reload timer.
`PictureReady` (and `AvatarReady`, `IconReady`) has a file that changed
decoded again before the visible models refresh, also when the URL and
cache path stay the same.
PNG, JPEG, GIF, WebP, BMP, ICO and SVG (also after a comment or DOCTYPE)
are decoded by content, since cached files have no extension. Raster
pictures whose decoded RGBA would exceed 128 MiB are refused before pixel
allocation on the UI thread; those larger than 4096 pixels on a side are
scaled down (an animation to its first frame). SVG uses Slint's vector
loader and the existing vector-cache cost.
Avatars and server, channel, client and group icons use the same image cache.
The focused checks are the `voelin-core`, `voelin-model`, `voelin-observer`,
`voelin-store` and `voelin-ui` library tests. They cover offline icon restoration,
bookmark compatibility, cache misses and old-address event rejection. The live
`ts6_banners` test checks disabled
fetching, recovery from HTTP 503 without another presence update, all three
modes, channel URL replacement and removal, and a fresh host download after
the 60-second interval. `ts6_avatars` uploads an avatar with one client and
verifies its bytes and MD5 after another client downloads it into an independent
cache. Both use
the development TS6 server by default; a private fixture can override its
endpoints without changing the other live tests:
```sh
VOELIN_LIVE=1 \
VOELIN_BANNER_VOICE_ADDR=127.0.0.1:19988 \
VOELIN_BANNER_QUERY_ADDR=127.0.0.1:20022 \
cargo test --locked -p voelin-core --test live ts6_banners -- --exact
```
The 2026-10-04 follow-up passed all 200 focused library tests. The download
checks passed both live scenarios against a private
TS6 6.0.0-beta13.1 instance, including its real reload interval. The compact
layout passed seven headless screenshot scenarios. These screenshots use
sample data on Xvfb with Slint's software
renderer; the phone layouts are desktop renders, not Android device tests.
| Desktop | Phone layout |
|---|---|
| ![Dark chat and channel banners](raw/screenshots/banners-desktop-dark.png) | ![Channel banner in the mobile chat header](raw/screenshots/banners-mobile-chat.png) |
| ![Light chat and channel banners](raw/screenshots/banners-desktop-light.png) | ![Light server list](raw/screenshots/banners-mobile-servers.png) |
| ![Banner in the desktop voice header](raw/screenshots/banners-desktop-voice.png) | ![Banner in the mobile voice header](raw/screenshots/banners-mobile-voice.png) |
## Limits
- No drop shadows or blur (the software renderer draws none): glows are
translucent rings, the backdrop is a gradient rectangle.
- Avatars are the clients' pictures from the engine's cache
(`AvatarReady`), or initials on a colour from the name; group icons come
from `IconReady`.
- The members panel lists the people online: TeamSpeak tells a client
nothing about offline members, so the mockup's "Offline" section and a
server-wide member count are left out.
- The quality picker shows only when the streamer lists its simulcast
layers, which only a Voelin streamer does (`a=x-voelin-layers`, see
[media.md](media)); for the official client's streams the player
shows the decoded picture's height.
- The stream's own window is desktop only (Android has one window). It shows
no toasts and has no chat; status messages go to the main window. Keeping
it on top is a hint to the desktop: Wayland lets no app do it (winit
ignores it there; the compositor's window menu may offer it).
- A jump to a pinned message scrolls to where an average row would be
(rows differ in height), and only to messages already loaded. So does
the unread bar's Jump, and the bar shows while that estimate of the New
line is above the view.
- What is read stays on this device: TeamSpeak has no read receipts. The
window's focus is known on the desktop (winit); on Android a chat on
screen counts as read.
- The window keeps its native decorations (no custom title bar).
- The Stream Studio streams to the voice channel we are in (a TeamSpeak 6
stream belongs to its channel): its destination picks among the servers,
not among their channels. Image paths (image sources, backgrounds) are
typed, there is no file chooser. The background effect replaces what is
around the person the engine's segmentation model finds (an oval where
the model does not load). The
studio cannot be detached on Android (one window). Its own window shows
no toasts; status messages go to the main window.
- Home, friends and messages show what the user's servers tell: there is
no global network behind TeamSpeak, so the design's Discover, other
communities with member counts, the games friends play and the upgrade
panels are left out, and a friend shows as online only on servers we
are on or look into.
- Direct messages need a voice connection to the peer's server; the
design's calls, groups, requests, voice messages and reactions in
private chats have no TeamSpeak counterpart.
- On the phone the settings are a list on the You tab and a section
picker inside them, not the design's list beside the page (too narrow
for most sections at a phone's width).
---
*Mirrored from [`docs/ui.md`](https://git.faumaray.com/Voelin/VoelinClient/src/commit/ad2097963e023835c8f559c0c223bc9744cf1dc1/docs/ui.md) at `ad20979` by `.claude/wiki-sync.js`. Edit the file in the repository, not this page: the next sync overwrites it.*