Screen sharing was slow mostly because every frame was copied and allocated several times on its way to the encoder: the PipeWire callback copied the mapped buffer into a new Vec, X11 copied the shared-memory segment, Windows copied twice, `to_i420` allocated fresh planes on one thread, and libvpx output was copied into Vec after Vec. Capture backends now hand each frame to a `FrameSink` on their own thread, with the pixels still in the capture buffer (`FrameRef`: borrowed planes with strides). `ScreenCapture::start_sink` is implemented by the test pattern (renders into one reused buffer), X11 (the MIT-SHM segment, cursor blended in place, monitor/window geometry looked up once a second instead of every frame), the portal and Windows Graphics Capture (the mapped staging texture with its row pitch); other backends get a forwarding default. `start` keeps working through a queue adapter. `FramePacer` caps frame rates by timestamps; sinks can change the cap while capturing (X11 and the test pattern follow, the portal renegotiates the frame rate). Portal: LINEAR DMA-BUFs are negotiated in addition to shared memory (mandatory modifier, fixated by us, `dataType` per buffer kind), mapped once per buffer and read between DMA_BUF_IOCTL_SYNC start/end. When reading them is slow (uncached VRAM), the stream renegotiates to shared memory. Tiled modifiers are not offered (needs a GPU import). The streaming path: - `workers::Workers`: a fork-join pool that allocates nothing per job. - `convert::Converter`: any stride, BGRx/BGRA/RGBx/RGBA (yuv's SIMD paths), I420 and NV12 into a caller's I420 frame, in row bands on all cores; handles buffers without padding after the last row. - `scale`: separable area-average downscaling (bilinear up), weights per size pair computed once, a 2x2 box fast path, row bands on the pool; `Pyramid` converts a capture once and derives every requested size from the nearest larger one, sharing equal sizes. - `pool::FramePool`: recycled `Arc<VideoFrame>`s; `handoff::Handoff`: a one-slot latest-wins atomic handoff that counts replaced frames. Codecs: `VideoEncoder::encode_with` hands out encoded frames borrowed from the encoder (libvpx's own buffer; OpenH264 into a reused buffer). libvpx: `cpu-used` adapts to the measured encode time against the frame interval (VP8 levels -10..-4, VP9 starting at 8 within 5..9), threads from all CPUs the frame size can use, VP8 token partitions and VP9 tile columns from the thread count and width, keyframes only on request, frame durations from timestamps (variable frame rate), `set_fps`, and `speed` for stats. A probe on the desktop test pattern showed VP8 speeds beyond -10 are no faster on screen content, only worse (about 3 dB PSNR). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
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.
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 for the design and milestones.
Status
Done so far (milestones M0–M4 and the first part of M5 of the plan):
crates/proto/: vendored tsclientlib, modernised (TS6 fields and stream messages, faster off-thread Init1 puzzle,curve25519-dalek4, fuzzing fixes; see UPSTREAM.md)crates/voelin-model: server flavor detection (TS3 / TS6) and capabilitiescrates/voelin-audio: Opus voice encoding, framing, resampling, WAV, jitter buffer/mixer, cpal devicescrates/voelin-store: SQLite store for identities, bookmarks, settings and chat history; keyring secretscrates/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 ServerQuerycrates/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)crates/voelin-core: client engine; sessions merge voice, gateway and query sources, route chat, run audio; 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, 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 soundcrates/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 servertools/voelinctl: headless CLI: channel tree, chat, voice send/record, raw commands, stream events,query,observe(invisible presence),relay(channel chat without joining) andgatewaydev/: TeamSpeak 3.13 and TeamSpeak 6 (6.0.0-beta13.1) servers;scripts/it-smoke.shchecks tree, server chat, channel chat, a voice tone round-trip, invisible presence, relay chat and the gateway on bothfuzz/: cargo-fuzz targets for packets, commands and the license chainandroid/+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)
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.
| Connected with voice | Observing invisibly through the gateway |
|---|---|
![]() |
![]() |
| Watching a stream | Sharing the screen |
![]() |
![]() |
Try it
# 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
# 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
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_DEMO_STREAM=1 (a local test stream in the viewer, no server needed),
VOELIN_OPEN=share|settings[:<tab>]|about|client, VOELIN_AUTOWATCH=1, VOELIN_AUTOSHARE=test-pattern.
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 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).
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, 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.
Security issues: see SECURITY.md. Releases: docs/release.md.



