Rename the project to Voelin; packages hold only the app, tsgw is a Linux server package

The product is Voelin (app id io.github.faumaray.Voelin), everywhere:
- crates tsc-* -> voelin-* (and voelin-fuzz), the desktop binary
  tsc-desktop -> voelin, the development CLI tsctl -> voelinctl;
- the Android app: applicationId, Kotlin package io.github.faumaray.voelin,
  VoelinApp, libvoelin_android.so (JNI class names follow);
- TSC_* environment variables -> VOELIN_*, Gradle properties tsc.* ->
  voelin.*, signing secrets VOELIN_SIGNING_*;
- the data/config/cache/state folder tsc -> voelin, the keyring service,
  thread names, the dev compose project;
- desktop file, metainfo, icon, Flatpak manifest, NSIS installer, docs.
The gateway keeps its name: bin tsgw (crate voelin-gateway), TSGW_* env
vars, the tsgw.v1+json protocol, the tsgw image. The window title and the
About page show "Voelin <version>" from voelin_platform::APP_NAME.

Packages (scripts/package.sh): the app only (voelin, voelin.exe, APKs,
Flatpak). voelinctl is a development tool and in no package. tsgw is for
servers and now its own Linux package, tsgw_<v>_amd64.deb and
tsgw-<v>-linux-x86_64.tar.gz, with a sandboxed systemd unit
(packaging/linux/tsgw.service; /etc/tsgw config, /var/lib/tsgw state) and
dependencies of its own (no GUI libraries). docs/gateway-admin.md has an
Install section.

Fixes:
- package-windows: makensis on Windows found no file through "D:/a/..."
  paths; pass Windows paths (cygpath -w).
- StartupWMClass is the app id, which the app sets as its X11 WM_CLASS
  (it was the binary name, so desktops could not match the window).
- Gradle wrapper download timeout 10 s -> 60 s (slow proxies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
Claude committed 2026-09-26 21:11:17 +00:00
1 parent fa9e626c5b
commit e050148a32
197 files changed
+1357 -1210

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
# Build context for docker/*.Dockerfile and crates/tsc-gateway/Dockerfile:
# Build context for docker/*.Dockerfile and crates/voelin-gateway/Dockerfile:
# the sources only. Builds keep target/ in cache mounts, never in the context.
.git
.claude
+27 -27
View File
@@ -55,7 +55,7 @@ jobs:
# XTEST input) run instead of skipping.
- name: Test (Linux, Xvfb)
if: runner.os == 'Linux'
run: xvfb-run -a bash -c 'TSC_X11_TEST_DISPLAY="$DISPLAY" cargo test --workspace --locked'
run: xvfb-run -a bash -c 'VOELIN_X11_TEST_DISPLAY="$DISPLAY" cargo test --workspace --locked'
- name: Test
if: runner.os != 'Linux'
run: cargo test --workspace --locked
@@ -74,7 +74,7 @@ jobs:
with:
key: release
- name: Build
run: cargo build --release --locked -p tsc-ui -p tsctl -p tsc-gateway
run: cargo build --release --locked -p voelin-ui -p voelin-gateway
# dpkg-shlibdeps works out the .deb's dependencies.
- name: Package (.tar.gz, .deb)
run: |
@@ -82,7 +82,7 @@ jobs:
scripts/package.sh linux dist
- uses: actions/upload-artifact@v4
with:
name: tsc-linux-x86_64
name: voelin-linux-x86_64
path: dist/
if-no-files-found: error
@@ -98,7 +98,7 @@ jobs:
with:
key: release
- name: Build
run: cargo build --release --locked -p tsc-ui -p tsctl -p tsc-gateway
run: cargo build --release --locked -p voelin-ui
# The installer is required here: install NSIS when the image lacks it.
- name: NSIS
shell: pwsh
@@ -115,12 +115,12 @@ jobs:
run: scripts/package.sh windows dist
- uses: actions/upload-artifact@v4
with:
name: tsc-windows-x86_64
name: voelin-windows-x86_64
path: dist/
if-no-files-found: error
# Flatpak bundle from packaging/flatpak (install with
# `flatpak install --user tsc-desktop.flatpak`). flatpak-builder builds
# `flatpak install --user voelin.flatpak`). flatpak-builder builds
# offline, from the crates that flatpak-cargo-generator lists.
package-flatpak:
name: package (Flatpak)
@@ -143,17 +143,17 @@ jobs:
/tmp/venv/bin/python /tmp/flatpak-cargo-generator.py Cargo.lock -o packaging/flatpak/cargo-sources.json
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: tsc-desktop.flatpak
manifest-path: packaging/flatpak/io.github.faumaray.TsClient.yml
bundle: voelin.flatpak
manifest-path: packaging/flatpak/io.github.faumaray.Voelin.yml
cache-key: flatpak-builder-${{ hashFiles('Cargo.lock') }}
upload-artifact: false
- uses: actions/upload-artifact@v4
with:
name: tsc-flatpak-x86_64
path: tsc-desktop.flatpak
name: voelin-flatpak-x86_64
path: voelin.flatpak
if-no-files-found: error
# The gateway's container image (crates/tsc-gateway/Dockerfile), saved as a
# The gateway's container image (crates/voelin-gateway/Dockerfile), saved as a
# file: `docker load -i tsgw-image.tar.gz`.
package-gateway-image:
name: package (gateway image)
@@ -162,8 +162,8 @@ jobs:
- uses: actions/checkout@v4
- name: Build and save
run: |
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' crates/tsc-gateway/Cargo.toml | head -n 1)
docker build -f crates/tsc-gateway/Dockerfile -t "tsgw:$version" -t tsgw:latest .
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' crates/voelin-gateway/Cargo.toml | head -n 1)
docker build -f crates/voelin-gateway/Dockerfile -t "tsgw:$version" -t tsgw:latest .
mkdir -p dist
docker save "tsgw:$version" tsgw:latest | gzip > dist/tsgw-image.tar.gz
(cd dist && sha256sum tsgw-image.tar.gz > SHA256SUMS-gateway)
@@ -209,33 +209,33 @@ jobs:
run: cargo install cargo-ndk --locked --version 4.1.2
- name: clippy (Android target, deny warnings)
run: |
cargo ndk -t arm64-v8a --platform 29 clippy --locked -p tsc-android -p tsc-ui --no-deps -- -D warnings
cargo ndk -t arm64-v8a --platform 29 clippy --locked -p tsc-media --no-default-features --no-deps -- -D warnings
cargo ndk -t arm64-v8a --platform 29 clippy --locked -p voelin-android -p voelin-ui --no-deps -- -D warnings
cargo ndk -t arm64-v8a --platform 29 clippy --locked -p voelin-media --no-default-features --no-deps -- -D warnings
- name: Debug APK
working-directory: android
run: ./gradlew --no-daemon assembleDebug -Ptsc.abis=arm64-v8a,x86_64
run: ./gradlew --no-daemon assembleDebug -Pvoelin.abis=arm64-v8a,x86_64
# Only with the signing secrets; an unsigned release APK is not installable.
- name: Release APK (signed)
working-directory: android
env:
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
TSC_SIGNING_STORE_PASSWORD: ${{ secrets.TSC_SIGNING_STORE_PASSWORD }}
TSC_SIGNING_KEY_ALIAS: ${{ secrets.TSC_SIGNING_KEY_ALIAS }}
TSC_SIGNING_KEY_PASSWORD: ${{ secrets.TSC_SIGNING_KEY_PASSWORD }}
VOELIN_SIGNING_STORE_PASSWORD: ${{ secrets.VOELIN_SIGNING_STORE_PASSWORD }}
VOELIN_SIGNING_KEY_ALIAS: ${{ secrets.VOELIN_SIGNING_KEY_ALIAS }}
VOELIN_SIGNING_KEY_PASSWORD: ${{ secrets.VOELIN_SIGNING_KEY_PASSWORD }}
run: |
if [ -z "$KEYSTORE_BASE64" ]; then
echo "::notice::No ANDROID_KEYSTORE_BASE64 secret: skipping the release APK"
exit 0
fi
export TSC_SIGNING_STORE_FILE="$RUNNER_TEMP/release.jks"
echo "$KEYSTORE_BASE64" | base64 -d > "$TSC_SIGNING_STORE_FILE"
./gradlew --no-daemon assembleRelease -Ptsc.abis=arm64-v8a,x86_64
rm -f "$TSC_SIGNING_STORE_FILE"
export VOELIN_SIGNING_STORE_FILE="$RUNNER_TEMP/release.jks"
echo "$KEYSTORE_BASE64" | base64 -d > "$VOELIN_SIGNING_STORE_FILE"
./gradlew --no-daemon assembleRelease -Pvoelin.abis=arm64-v8a,x86_64
rm -f "$VOELIN_SIGNING_STORE_FILE"
- name: Package
run: scripts/package.sh android dist
- uses: actions/upload-artifact@v4
with:
name: tsc-android
name: voelin-android
path: dist/
if-no-files-found: error
@@ -296,7 +296,7 @@ jobs:
- name: Check THIRD_PARTY_NOTICES.md
run: scripts/notices.sh --check
# tsctl, the gateway, the engine and tsc-stream against real TS3 and TS6
# voelinctl, the gateway, the engine and voelin-stream against real TS3 and TS6
# servers, including a synthetic VP8 + Opus stream through the TS6 server
# (scripts/it-smoke.sh).
smoke:
@@ -331,7 +331,7 @@ jobs:
# reported on the job but does not fail the workflow, since it depends on
# a browser download and the runner's network interfaces.
browser-interop:
name: browser interop (tsc-stream, Chromium)
name: browser interop (voelin-stream, Chromium)
runs-on: ubuntu-24.04
needs: test
continue-on-error: true
@@ -358,4 +358,4 @@ jobs:
npm install -g "playwright@$PLAYWRIGHT_VERSION"
playwright install --with-deps chromium
- name: Browser interop test
run: TSC_INTEROP=1 cargo test --locked -p tsc-stream --test browser_interop -- --nocapture
run: VOELIN_INTEROP=1 cargo test --locked -p voelin-stream --test browser_interop -- --nocapture
Generated
+256 -256
View File
@@ -8668,235 +8668,6 @@ dependencies = [
"tsproto-types",
]
[[package]]
name = "tsc-android"
version = "0.1.0"
dependencies = [
"anyhow",
"jni 0.22.4",
"rustls-platform-verifier",
"slint",
"tokio",
"tracing",
"tracing-subscriber",
"tsc-core",
"tsc-media",
"tsc-model",
"tsc-platform",
"tsc-store",
"tsc-ui",
]
[[package]]
name = "tsc-audio"
version = "0.1.0"
dependencies = [
"cpal",
"hound",
"opus2",
"rtrb",
"rubato",
"serde",
"serde_json",
"sonora",
"sonora-agc2",
"sonora-simd",
"thiserror 2.0.21",
"tracing",
"tsclientlib",
"tsproto-packets",
]
[[package]]
name = "tsc-core"
version = "0.1.0"
dependencies = [
"anyhow",
"futures",
"serde_json",
"thiserror 2.0.21",
"tokio",
"tokio-tungstenite 0.30.0",
"tracing",
"tsc-audio",
"tsc-gateway-proto",
"tsc-media",
"tsc-model",
"tsc-observer",
"tsc-query",
"tsc-stream",
"tsclientlib",
"tsproto-packets",
]
[[package]]
name = "tsc-gateway"
version = "0.1.0"
dependencies = [
"anyhow",
"axum",
"base64 0.22.1",
"clap",
"futures",
"rand 0.10.3",
"rusqlite",
"serde",
"serde_json",
"sha2 0.10.9",
"thiserror 2.0.21",
"tokio",
"tokio-tungstenite 0.30.0",
"toml",
"tracing",
"tracing-subscriber",
"tsc-gateway-proto",
"tsc-model",
"tsc-observer",
"tsc-query",
]
[[package]]
name = "tsc-gateway-proto"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
"serde",
"serde_json",
"sha-1",
"sha2 0.10.9",
"thiserror 2.0.21",
"tsc-model",
"tsproto",
"tsproto-types",
]
[[package]]
name = "tsc-media"
version = "0.1.0"
dependencies = [
"ashpd",
"bzip2",
"dav1d",
"libvpx-native-sys",
"memmap2",
"ndk 0.9.0",
"openh264",
"pipewire",
"reqwest",
"rustix 1.1.5",
"sha2 0.10.9",
"str0m",
"thiserror 2.0.21",
"tokio",
"tracing",
"wasapi",
"windows-capture",
"x11rb",
"yuv",
]
[[package]]
name = "tsc-model"
version = "0.1.0"
dependencies = [
"serde",
"serde_json",
]
[[package]]
name = "tsc-observer"
version = "0.1.0"
dependencies = [
"thiserror 2.0.21",
"tokio",
"tracing",
"tsc-model",
"tsc-query",
]
[[package]]
name = "tsc-platform"
version = "0.1.0"
dependencies = [
"ashpd",
"dirs",
"futures-util",
"notify-rust",
"serde",
"serde_json",
"thiserror 2.0.21",
"tokio",
"tracing",
"windows 0.62.2",
"x11rb",
]
[[package]]
name = "tsc-query"
version = "0.1.0"
dependencies = [
"reqwest",
"russh",
"serde",
"serde_json",
"thiserror 2.0.21",
"tokio",
"tracing",
]
[[package]]
name = "tsc-store"
version = "0.1.0"
dependencies = [
"keyring",
"rusqlite",
"serde",
"serde_json",
"thiserror 2.0.21",
"tsclientlib",
]
[[package]]
name = "tsc-stream"
version = "0.1.0"
dependencies = [
"anyhow",
"futures",
"serde",
"serde_json",
"str0m",
"thiserror 2.0.21",
"tokio",
"tracing",
"tracing-subscriber",
"tsclientlib",
"tsproto-packets",
]
[[package]]
name = "tsc-ui"
version = "0.1.0"
dependencies = [
"anyhow",
"chrono",
"dirs",
"png",
"serde",
"serde_json",
"slint",
"slint-build",
"tokio",
"tracing",
"tracing-subscriber",
"tsc-audio",
"tsc-core",
"tsc-model",
"tsc-platform",
"tsc-query",
"tsc-store",
"tsclientlib",
]
[[package]]
name = "tsclientlib"
version = "0.2.0"
@@ -8931,33 +8702,6 @@ dependencies = [
"url",
]
[[package]]
name = "tsctl"
version = "0.1.0"
dependencies = [
"anyhow",
"base64 0.22.1",
"clap",
"dirs",
"futures",
"futures-util",
"png",
"serde_json",
"tokio",
"tokio-tungstenite 0.30.0",
"tracing",
"tracing-subscriber",
"tsc-audio",
"tsc-core",
"tsc-gateway-proto",
"tsc-model",
"tsc-observer",
"tsc-query",
"tsc-stream",
"tsclientlib",
"tsproto-packets",
]
[[package]]
name = "tsproto"
version = "0.2.0"
@@ -9309,6 +9053,262 @@ dependencies = [
"syn 2.0.119",
]
[[package]]
name = "voelin-android"
version = "0.1.0"
dependencies = [
"anyhow",
"jni 0.22.4",
"rustls-platform-verifier",
"slint",
"tokio",
"tracing",
"tracing-subscriber",
"voelin-core",
"voelin-media",
"voelin-model",
"voelin-platform",
"voelin-store",
"voelin-ui",
]
[[package]]
name = "voelin-audio"
version = "0.1.0"
dependencies = [
"cpal",
"hound",
"opus2",
"rtrb",
"rubato",
"serde",
"serde_json",
"sonora",
"sonora-agc2",
"sonora-simd",
"thiserror 2.0.21",
"tracing",
"tsclientlib",
"tsproto-packets",
]
[[package]]
name = "voelin-core"
version = "0.1.0"
dependencies = [
"anyhow",
"futures",
"serde_json",
"thiserror 2.0.21",
"tokio",
"tokio-tungstenite 0.30.0",
"tracing",
"tsclientlib",
"tsproto-packets",
"voelin-audio",
"voelin-gateway-proto",
"voelin-media",
"voelin-model",
"voelin-observer",
"voelin-query",
"voelin-stream",
]
[[package]]
name = "voelin-gateway"
version = "0.1.0"
dependencies = [
"anyhow",
"axum",
"base64 0.22.1",
"clap",
"futures",
"rand 0.10.3",
"rusqlite",
"serde",
"serde_json",
"sha2 0.10.9",
"thiserror 2.0.21",
"tokio",
"tokio-tungstenite 0.30.0",
"toml",
"tracing",
"tracing-subscriber",
"voelin-gateway-proto",
"voelin-model",
"voelin-observer",
"voelin-query",
]
[[package]]
name = "voelin-gateway-proto"
version = "0.1.0"
dependencies = [
"base64 0.22.1",
"serde",
"serde_json",
"sha-1",
"sha2 0.10.9",
"thiserror 2.0.21",
"tsproto",
"tsproto-types",
"voelin-model",
]
[[package]]
name = "voelin-media"
version = "0.1.0"
dependencies = [
"ashpd",
"bzip2",
"dav1d",
"libvpx-native-sys",
"memmap2",
"ndk 0.9.0",
"openh264",
"pipewire",
"reqwest",
"rustix 1.1.5",
"sha2 0.10.9",
"str0m",
"thiserror 2.0.21",
"tokio",
"tracing",
"wasapi",
"windows-capture",
"x11rb",
"yuv",
]
[[package]]
name = "voelin-model"
version = "0.1.0"
dependencies = [
"serde",
"serde_json",
]
[[package]]
name = "voelin-observer"
version = "0.1.0"
dependencies = [
"thiserror 2.0.21",
"tokio",
"tracing",
"voelin-model",
"voelin-query",
]
[[package]]
name = "voelin-platform"
version = "0.1.0"
dependencies = [
"ashpd",
"dirs",
"futures-util",
"notify-rust",
"serde",
"serde_json",
"thiserror 2.0.21",
"tokio",
"tracing",
"windows 0.62.2",
"x11rb",
]
[[package]]
name = "voelin-query"
version = "0.1.0"
dependencies = [
"reqwest",
"russh",
"serde",
"serde_json",
"thiserror 2.0.21",
"tokio",
"tracing",
]
[[package]]
name = "voelin-store"
version = "0.1.0"
dependencies = [
"keyring",
"rusqlite",
"serde",
"serde_json",
"thiserror 2.0.21",
"tsclientlib",
]
[[package]]
name = "voelin-stream"
version = "0.1.0"
dependencies = [
"anyhow",
"futures",
"serde",
"serde_json",
"str0m",
"thiserror 2.0.21",
"tokio",
"tracing",
"tracing-subscriber",
"tsclientlib",
"tsproto-packets",
]
[[package]]
name = "voelin-ui"
version = "0.1.0"
dependencies = [
"anyhow",
"chrono",
"dirs",
"png",
"serde",
"serde_json",
"slint",
"slint-build",
"tokio",
"tracing",
"tracing-subscriber",
"tsclientlib",
"voelin-audio",
"voelin-core",
"voelin-model",
"voelin-platform",
"voelin-query",
"voelin-store",
]
[[package]]
name = "voelinctl"
version = "0.1.0"
dependencies = [
"anyhow",
"base64 0.22.1",
"clap",
"dirs",
"futures",
"futures-util",
"png",
"serde_json",
"tokio",
"tokio-tungstenite 0.30.0",
"tracing",
"tracing-subscriber",
"tsclientlib",
"tsproto-packets",
"voelin-audio",
"voelin-core",
"voelin-gateway-proto",
"voelin-model",
"voelin-observer",
"voelin-query",
"voelin-stream",
]
[[package]]
name = "vtable"
version = "0.5.0"
+26 -26
View File
@@ -8,20 +8,20 @@ members = [
"crates/proto/tsproto",
"crates/proto/ts-bookkeeping",
"crates/proto/tsclientlib",
"crates/tsc-android",
"crates/tsc-audio",
"crates/tsc-core",
"crates/tsc-gateway",
"crates/tsc-gateway-proto",
"crates/tsc-media",
"crates/tsc-model",
"crates/tsc-observer",
"crates/tsc-platform",
"crates/tsc-query",
"crates/tsc-store",
"crates/tsc-stream",
"crates/tsc-ui",
"tools/tsctl",
"crates/voelin-android",
"crates/voelin-audio",
"crates/voelin-core",
"crates/voelin-gateway",
"crates/voelin-gateway-proto",
"crates/voelin-media",
"crates/voelin-model",
"crates/voelin-observer",
"crates/voelin-platform",
"crates/voelin-query",
"crates/voelin-store",
"crates/voelin-stream",
"crates/voelin-ui",
"tools/voelinctl",
]
default-members = [
"crates/proto/tsproto-types",
@@ -30,18 +30,18 @@ default-members = [
"crates/proto/tsproto",
"crates/proto/ts-bookkeeping",
"crates/proto/tsclientlib",
"crates/tsc-audio",
"crates/tsc-core",
"crates/tsc-gateway",
"crates/tsc-gateway-proto",
"crates/tsc-model",
"crates/tsc-observer",
"crates/tsc-platform",
"crates/tsc-query",
"crates/tsc-store",
"crates/tsc-stream",
"crates/tsc-ui",
"tools/tsctl",
"crates/voelin-audio",
"crates/voelin-core",
"crates/voelin-gateway",
"crates/voelin-gateway-proto",
"crates/voelin-model",
"crates/voelin-observer",
"crates/voelin-platform",
"crates/voelin-query",
"crates/voelin-store",
"crates/voelin-stream",
"crates/voelin-ui",
"tools/voelinctl",
]
[workspace.package]
+33 -33
View File
@@ -1,13 +1,13 @@
# teamspeak_client_rs
# Voelin
A TeamSpeak 3 / TeamSpeak 6 compatible voice client written in Rust, for desktop
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; the product name of this client is still to be decided.
> trademark of its owner.
## Goals
@@ -28,30 +28,30 @@ Done so far (milestones M0–M4 and the first part of M5 of [the plan](docs/arch
- `crates/proto/`: vendored tsclientlib, modernised (TS6 fields and stream
messages, faster off-thread Init1 puzzle, `curve25519-dalek` 4, fuzzing fixes;
see [UPSTREAM.md](crates/proto/UPSTREAM.md))
- `crates/tsc-model`: server flavor detection (TS3 / TS6) and capabilities
- `crates/tsc-audio`: Opus voice encoding, framing, resampling, WAV, jitter buffer/mixer, cpal devices
- `crates/tsc-store`: SQLite store for identities, bookmarks, settings and chat history; keyring secrets
- `crates/tsc-query`: ServerQuery client over raw TCP, SSH and HTTP WebQuery (events, rate limiting, keepalive)
- `crates/tsc-observer`: invisible presence (events or polling) and channel-chat relays over ServerQuery
- `crates/tsc-gateway` (`tsgw`) + `tsc-gateway-proto`: companion gateway for server admins. Users log in
- `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](docs/gateway-admin.md))
- `crates/tsc-core`: client engine; sessions merge voice, gateway and query sources, route chat, run audio;
- `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/tsc-ui` (`tsc-desktop`): Slint desktop app: servers, channel tree with talking indicators,
- `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 sound
- `crates/tsc-stream`: TeamSpeak 6 streams: stream commands and notifications, JSON signalling,
- `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/tsctl`: headless CLI: channel tree, chat, voice send/record, raw commands, stream events,
- `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`
- `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 and the gateway on both
- `fuzz/`: cargo-fuzz targets for packets, commands and the license chain
- `android/` + `crates/tsc-android`: the Android app (the same Slint UI in a NativeActivity,
- `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](docs/android.md))
@@ -68,39 +68,39 @@ interop with the official TeamSpeak 6 client is not verified yet.
```sh
# Desktop app
cargo run -p tsc-ui --bin tsc-desktop
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 tsctl -- connect 127.0.0.1:9987 tree # TeamSpeak 3
cargo run -p tsctl -- connect 127.0.0.1:9988 tree # TeamSpeak 6
cargo run -p tsctl -- connect 127.0.0.1:9988 --nick me repl # interactive chat
cargo run -p tsctl -- connect 127.0.0.1:9988 --nick me voice send --tone 440
cargo run -p tsctl -- connect 127.0.0.1:9988 --nick ear voice record out.wav
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 tsctl -- connect 127.0.0.1:9988 --nick eye stream watch --save-frame shot.png &
cargo run -p tsctl -- connect 127.0.0.1:9988 --nick me stream start --synthetic --auto-accept
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 tsc-dev-admin): invisible presence and relay chat
cargo run -p tsctl -- observe ssh 127.0.0.1:10022 --secret tsc-dev-admin --allowlisted
cargo run -p tsctl -- relay ssh 127.0.0.1:10022 --secret tsc-dev-admin --allowlisted --channel 1
# 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 tsc-gateway -- --config dev/tsgw-ts6.toml &
cargo run -p tsctl -- gateway ws://127.0.0.1:7788/v1 --identity <file> --presence --open channel:1
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: `tsctl identity new`, `tsctl versions`, `tsctl connect <addr> listen|chat|raw`.
`tsctl --help` lists all options.
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): `TSC_DATA_DIR` (database),
`TSC_AUTOCONNECT=voice|observe`, `TSC_SCREENSHOT=<png>` (with `TSC_SCREENSHOT_DELAY`),
`TSC_DEMO_STREAM=1` (a local test stream in the viewer, no server needed),
`TSC_OPEN=share|settings[:<tab>]|about|client`, `TSC_AUTOWATCH=1`, `TSC_AUTOSHARE=test-pattern`.
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)
come from every CI run, and `scripts/docker-build.sh` builds the same ones locally in Docker:
+4 -4
View File
@@ -8,7 +8,7 @@ https://github.com/Faumaray/teamspeak_client_rs (private vulnerability
reporting). Do not open a public issue for them. If private reporting is not
available, open an issue asking for a contact, without details.
Include what is affected (desktop app, Android app, `tsgw` gateway, `tsctl`),
Include what is affected (desktop app, Android app, `tsgw` gateway, `voelinctl`),
the version or commit, and how to reproduce. You should get an answer within
a week. Fixes are released as soon as they are ready and credited in the
changelog unless you prefer otherwise.
@@ -26,10 +26,10 @@ us.
| What | Where | Protection |
|---|---|---|
| Identities (TeamSpeak private keys) | SQLite database `client.db` in the data directory (`~/.local/share/tsc`, Flatpak `~/.var/app/<app id>/data/tsc`, `%APPDATA%\tsc`, Android app storage) | File permissions of the user account only; not encrypted. An identity is the account on every server that knows it: back it up, do not share the file |
| Server and ServerQuery passwords | OS keyring (Secret Service, Windows Credential Manager, Android Keystore), service `tsc-client` | Keyring; kept in memory for the session only when there is no keyring |
| Identities (TeamSpeak private keys) | SQLite database `client.db` in the data directory (`~/.local/share/voelin`, Flatpak `~/.var/app/<app id>/data/voelin`, `%APPDATA%\voelin`, Android app storage) | File permissions of the user account only; not encrypted. An identity is the account on every server that knows it: back it up, do not share the file |
| Server and ServerQuery passwords | OS keyring (Secret Service, Windows Credential Manager, Android Keystore), service `voelin` | Keyring; kept in memory for the session only when there is no keyring |
| Bookmarks, settings, chat history | `client.db` | File permissions; history stays until deleted |
| Crash reports (opt-in) | `crash-reports` in the state directory (`~/.local/state/tsc`, `%LOCALAPPDATA%\tsc`) | Local only, never uploaded. They contain the panic message and a backtrace, which may include server addresses or names; review before attaching one to an issue |
| Crash reports (opt-in) | `crash-reports` in the state directory (`~/.local/state/voelin`, `%LOCALAPPDATA%\voelin`) | Local only, never uploaded. They contain the panic message and a backtrace, which may include server addresses or names; review before attaching one to an issue |
| OpenH264 (opt-in) | Downloaded from Cisco into the app's directories | Loaded only if its SHA-256 matches a known Cisco build |
## What others can see
+3 -3
View File
@@ -21,7 +21,7 @@ accepted = [
# Slint: GPL-3.0-only OR royalty-free OR commercial. We use the royalty-free
# license, which requires the AboutSlint widget in the About page.
"LicenseRef-Slint-Royalty-free-2.0",
# libbz2-rs-sys (unpacks Cisco's OpenH264 download in tsc-media).
# libbz2-rs-sys (unpacks Cisco's OpenH264 download in voelin-media).
"bzip2-1.0.6",
]
@@ -73,7 +73,7 @@ path = "opus/COPYING"
license = "BSD-3-Clause"
checksum = "01e1167d54a096d123cf6dfbbeb19587278845c6481d2d66d545669846079551"
# Only the bindings are compiled (tsc-media loads Cisco's binary at runtime),
# Only the bindings are compiled (voelin-media loads Cisco's binary at runtime),
# but without this every header of the vendored OpenH264 sources would be
# listed. upstream/LICENSE is also the license of Cisco's binary.
[openh264-sys2.clarify]
@@ -155,7 +155,7 @@ path = "LICENSES/LicenseRef-Slint-Royalty-free-2.0.md"
license = "LicenseRef-Slint-Royalty-free-2.0-text"
checksum = "5167f5056e850419106ab6265efbdca7cba4d99c849d1445ca0bbf6a1e2315fe"
# Android (tsc-android).
# Android (voelin-android).
[i-slint-backend-android-activity.clarify]
license = "GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0"
[[i-slint-backend-android-activity.clarify.files]]
+15 -15
View File
@@ -8,8 +8,8 @@ plugins {
/** The Cargo workspace the native library comes from. */
val workspace: File = rootDir.parentFile
/** `version` of crates/tsc-android, which is the app's version (docs/release.md). */
val crateVersion: String = workspace.resolve("crates/tsc-android/Cargo.toml").readLines()
/** `version` of crates/voelin-android, which is the app's version (docs/release.md). */
val crateVersion: String = workspace.resolve("crates/voelin-android/Cargo.toml").readLines()
.first { it.startsWith("version = ") }
.substringAfter('"').substringBefore('"')
@@ -29,17 +29,17 @@ fun lockedVersion(crate: String): String {
fun signing(property: String, env: String): String? =
providers.gradleProperty(property).orElse(providers.environmentVariable(env)).orNull
val releaseStoreFile = signing("tsc.signing.storeFile", "TSC_SIGNING_STORE_FILE")
val releaseStoreFile = signing("voelin.signing.storeFile", "VOELIN_SIGNING_STORE_FILE")
android {
namespace = "io.github.faumaray.tsc"
namespace = "io.github.faumaray.voelin"
compileSdk = 36
ndkVersion = "27.3.13750724"
defaultConfig {
// Placeholder like the desktop app id (packaging/README.md); it cannot
// change after the first upload to Google Play.
applicationId = "io.github.faumaray.TsClient"
// The desktop app id (packaging/README.md); it cannot change after
// the first upload to Google Play.
applicationId = "io.github.faumaray.Voelin"
minSdk = 29
targetSdk = 36
versionName = crateVersion
@@ -52,9 +52,9 @@ android {
if (releaseStoreFile != null) {
create("release") {
storeFile = file(releaseStoreFile)
storePassword = signing("tsc.signing.storePassword", "TSC_SIGNING_STORE_PASSWORD")
keyAlias = signing("tsc.signing.keyAlias", "TSC_SIGNING_KEY_ALIAS")
keyPassword = signing("tsc.signing.keyPassword", "TSC_SIGNING_KEY_PASSWORD")
storePassword = signing("voelin.signing.storePassword", "VOELIN_SIGNING_STORE_PASSWORD")
keyAlias = signing("voelin.signing.keyAlias", "VOELIN_SIGNING_KEY_ALIAS")
keyPassword = signing("voelin.signing.keyPassword", "VOELIN_SIGNING_KEY_PASSWORD")
}
}
}
@@ -90,12 +90,12 @@ dependencies {
implementation("org.rustls:rustls-platform-verifier:${lockedVersion("rustls-platform-verifier-android")}")
}
// libtsc_android.so, built with cargo-ndk into build/rust/<build type>/<abi>/
// before the JNI libraries are merged. -Ptsc.skipCargo=true uses what is
// libvoelin_android.so, built with cargo-ndk into build/rust/<build type>/<abi>/
// before the JNI libraries are merged. -Pvoelin.skipCargo=true uses what is
// there (e.g. built by CI in an earlier step).
val abis = providers.gradleProperty("tsc.abis").getOrElse("arm64-v8a,x86_64")
val abis = providers.gradleProperty("voelin.abis").getOrElse("arm64-v8a,x86_64")
.split(',').map(String::trim).filter(String::isNotEmpty)
val skipCargo = providers.gradleProperty("tsc.skipCargo").map(String::toBoolean).getOrElse(false)
val skipCargo = providers.gradleProperty("voelin.skipCargo").map(String::toBoolean).getOrElse(false)
for ((buildType, release) in listOf("debug" to false, "release" to true)) {
val out = layout.buildDirectory.dir("rust/$buildType")
@@ -106,7 +106,7 @@ for ((buildType, release) in listOf("debug" to false, "release" to true)) {
workingDir = workspace
val command = mutableListOf("cargo", "ndk", "--platform", "29", "-o", out.get().asFile.path)
abis.forEach { command += listOf("-t", it) }
command += listOf("build", "-p", "tsc-android")
command += listOf("build", "-p", "voelin-android")
if (release) command += "--release"
commandLine(command)
val ndk = android.ndkDirectory.path
+3 -3
View File
@@ -1,7 +1,7 @@
# Called from Rust through JNI by name.
-keep class io.github.faumaray.tsc.Bridge { *; }
-keep class io.github.faumaray.tsc.Native { *; }
-keep class io.github.faumaray.tsc.TscApp { *; }
-keep class io.github.faumaray.voelin.Bridge { *; }
-keep class io.github.faumaray.voelin.Native { *; }
-keep class io.github.faumaray.voelin.VoelinApp { *; }
# rustls-platform-verifier's Kotlin component, also called from Rust.
-keep class org.rustls.platformverifier.** { *; }
+3 -3
View File
@@ -20,12 +20,12 @@
restored on another device anyway.
-->
<application
android:name=".TscApp"
android:name=".VoelinApp"
android:allowBackup="false"
android:hasCode="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Tsc">
android:theme="@style/Theme.Voelin">
<!--
The Rust UI runs in this NativeActivity (android.app.lib_name).
@@ -40,7 +40,7 @@
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="android.app.lib_name"
android:value="tsc_android" />
android:value="voelin_android" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@@ -1,4 +1,4 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.Manifest
import android.content.Context
@@ -6,11 +6,11 @@ import android.content.pm.PackageManager
import android.os.Build
/**
* What the Rust library (crates/tsc-android/src/bridge.rs) calls, from any
* What the Rust library (crates/voelin-android/src/bridge.rs) calls, from any
* thread. Keep the names and signatures in step with it.
*/
object Bridge {
private val app: TscApp get() = TscApp.instance
private val app: VoelinApp get() = VoelinApp.instance
@JvmStatic
fun context(): Context = app
@@ -1,4 +1,4 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.app.NativeActivity
import android.content.Intent
@@ -7,7 +7,7 @@ import android.os.Bundle
import java.lang.ref.WeakReference
/**
* The window: a NativeActivity running `android_main` of libtsc_android.so
* The window: a NativeActivity running `android_main` of libvoelin_android.so
* (the Slint UI). Kotlin only handles what needs an Activity: permission
* prompts and the screen-capture consent dialog.
*/
@@ -1,13 +1,13 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import java.nio.ByteBuffer
/** Callbacks into the Rust library (crates/tsc-android/src/bridge.rs). */
/** Callbacks into the Rust library (crates/voelin-android/src/bridge.rs). */
object Native {
init {
// Already loaded by the NativeActivity; this registers it for JNI
// lookups from this class loader.
System.loadLibrary("tsc_android")
System.loadLibrary("voelin_android")
}
/** The user answered the screen-capture dialog (`error`: why it failed). */
@@ -1,4 +1,4 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.app.Notification
import android.app.NotificationChannel
@@ -1,4 +1,4 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.Manifest
import android.app.PendingIntent
@@ -92,7 +92,7 @@ class ScreenCaptureService : Service() {
}
private fun startVideo(projection: MediaProjection, fps: Int, maxSize: Int) {
val worker = HandlerThread("tsc-screen").also { it.start() }
val worker = HandlerThread("voelin-screen").also { it.start() }
this.worker = worker
val handler = Handler(worker.looper)
// The user or the system can end the projection (status bar chip,
@@ -137,7 +137,7 @@ class ScreenCaptureService : Service() {
}
}, handler)
display = projection.createVirtualDisplay(
"tsc-screen",
"voelin-screen",
width,
height,
metrics.densityDpi,
@@ -179,7 +179,7 @@ class ScreenCaptureService : Service() {
}
audioRunning = true
record.startRecording()
audioThread = thread(name = "tsc-system-audio") {
audioThread = thread(name = "voelin-system-audio") {
// 10 ms of stereo.
val buffer = FloatArray(SAMPLE_RATE / 100 * 2)
try {
@@ -222,7 +222,7 @@ class ScreenCaptureService : Service() {
private const val TAG = "ScreenCaptureService"
private const val ID = 2
private const val SAMPLE_RATE = 48_000
private const val ACTION_STOP = "io.github.faumaray.tsc.STOP_SHARING"
private const val ACTION_STOP = "io.github.faumaray.voelin.STOP_SHARING"
private const val EXTRA_RESULT = "result"
private const val EXTRA_DATA = "data"
private const val EXTRA_FPS = "fps"
@@ -1,4 +1,4 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.content.Context
import android.security.keystore.KeyGenParameterSpec
@@ -22,7 +22,7 @@ import javax.crypto.spec.GCMParameterSpec
object SecretStore {
private const val TAG = "SecretStore"
private const val KEYSTORE = "AndroidKeyStore"
private const val KEY_ALIAS = "tsc-secrets"
private const val KEY_ALIAS = "voelin-secrets"
private const val PREFS = "secrets"
private const val TRANSFORMATION = "AES/GCM/NoPadding"
private const val IV_BYTES = 12
@@ -1,9 +1,9 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.app.Application
/** The process's application object; the Rust side reaches Android through it. */
class TscApp : Application() {
class VoelinApp : Application() {
override fun onCreate() {
super.onCreate()
instance = this
@@ -11,7 +11,7 @@ class TscApp : Application() {
}
companion object {
lateinit var instance: TscApp
lateinit var instance: VoelinApp
private set
}
}
@@ -1,4 +1,4 @@
package io.github.faumaray.tsc
package io.github.faumaray.voelin
import android.app.Notification
import android.app.NotificationManager
@@ -58,8 +58,8 @@ class VoiceService : Service() {
private const val ID = 1
private const val EXTRA_TEXT = "text"
private const val EXTRA_MUTED = "muted"
private const val ACTION_DISCONNECT = "io.github.faumaray.tsc.DISCONNECT"
private const val ACTION_TOGGLE_MUTE = "io.github.faumaray.tsc.TOGGLE_MUTE"
private const val ACTION_DISCONNECT = "io.github.faumaray.voelin.DISCONNECT"
private const val ACTION_TOGGLE_MUTE = "io.github.faumaray.voelin.TOGGLE_MUTE"
@Volatile
private var running: VoiceService? = null
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Placeholder icon (packaging/linux/io.github.faumaray.TsClient.svg): a
Placeholder icon (packaging/linux/io.github.faumaray.Voelin.svg): a
speech bubble with sound waves, sized for the adaptive icon's safe zone.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
+1 -2
View File
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Placeholder product name (packaging/README.md). -->
<string name="app_name">TS Client</string>
<string name="app_name">Voelin</string>
<string name="channel_voice">Voice connection</string>
<string name="channel_screen">Screen sharing</string>
<string name="voice_connected">Connected to voice</string>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- The Slint UI draws the whole window. -->
<style name="Theme.Tsc" parent="@android:style/Theme.DeviceDefault.NoActionBar">
<style name="Theme.Voelin" parent="@android:style/Theme.DeviceDefault.NoActionBar">
<item name="android:windowBackground">@color/window_background</item>
</style>
</resources>
+2 -2
View File
@@ -3,5 +3,5 @@ android.useAndroidX=false
android.nonTransitiveRClass=true
kotlin.code.style=official
# ABIs the Rust library is built for (cargo-ndk names), e.g. only
# -Ptsc.abis=arm64-v8a for a phone.
tsc.abis=arm64-v8a,x86_64
# -Pvoelin.abis=arm64-v8a for a phone.
voelin.abis=arm64-v8a,x86_64
+1 -1
View File
@@ -2,7 +2,7 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=bd71102213493060956ec229d946beee57158dbd89d0e62b91bca0fa2c5f3531
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
networkTimeout=60000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+1 -1
View File
@@ -20,5 +20,5 @@ dependencyResolutionManagement {
}
}
rootProject.name = "tsc"
rootProject.name = "voelin"
include(":app")
@@ -1,5 +1,5 @@
[package]
name = "tsc-android"
name = "voelin-android"
version = "0.1.0"
description = "Android app library: native activity entry point, engine kept for the whole process, JNI bridge to the Kotlin services (voice, screen share), Android Keystore secrets."
edition.workspace = true
@@ -9,15 +9,15 @@ repository.workspace = true
publish.workspace = true
[lib]
name = "tsc_android"
# cdylib: libtsc_android.so, loaded by the app's NativeActivity. rlib: tests
name = "voelin_android"
# cdylib: libvoelin_android.so, loaded by the app's NativeActivity. rlib: tests
# and type checks on the host.
crate-type = ["cdylib", "rlib"]
[dependencies]
tokio = { version = "1.53.1", features = ["rt-multi-thread", "macros", "sync", "time"] }
tracing = "0.1.44"
tsc-core = { path = "../tsc-core" }
voelin-core = { path = "../voelin-core" }
[target.'cfg(target_os = "android")'.dependencies]
anyhow = "1.0.104"
@@ -25,13 +25,13 @@ jni = "0.22.4"
rustls-platform-verifier = "0.7.1"
slint = { version = "1.18", default-features = false, features = ["std", "compat-1-2", "backend-android-activity-06"] }
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
tsc-media = { path = "../tsc-media", default-features = false }
tsc-platform = { path = "../tsc-platform", default-features = false }
tsc-store = { path = "../tsc-store" }
tsc-ui = { path = "../tsc-ui" }
voelin-media = { path = "../voelin-media", default-features = false }
voelin-platform = { path = "../voelin-platform", default-features = false }
voelin-store = { path = "../voelin-store" }
voelin-ui = { path = "../voelin-ui" }
[dev-dependencies]
tsc-model = { path = "../tsc-model" }
voelin-model = { path = "../voelin-model" }
[lints]
workspace = true
@@ -10,7 +10,7 @@ use std::sync::{Mutex, Once, OnceLock, PoisonError};
use anyhow::Context as _;
use slint::android::AndroidApp;
use tracing::{error, info, warn};
use tsc_core::Command;
use voelin_core::Command;
use crate::foreground::Foreground;
use crate::host::EngineHost;
@@ -82,10 +82,10 @@ fn run(app: AndroidApp) -> anyhow::Result<()> {
slint::android::init(app).context("Slint Android backend")?;
let attached = host.attach();
tsc_ui::run(tsc_ui::RunOptions {
voelin_ui::run(voelin_ui::RunOptions {
data_dir: Some(data_dir),
secrets: Some(Box::new(secrets::KeystoreSecrets)),
engine: Some(tsc_ui::HostedEngine {
engine: Some(voelin_ui::HostedEngine {
engine: attached.engine,
runtime: attached.runtime,
events: attached.events,
@@ -96,12 +96,12 @@ fn run(app: AndroidApp) -> anyhow::Result<()> {
/// Local crash reports in `<files dir>/crash-reports`, recorded only if the
/// user opted in (off by default).
fn install_crash_reports(data_dir: &Path) {
tsc_platform::crash::set_app_version(env!("CARGO_PKG_VERSION"));
let enabled = tsc_store::Store::open(&data_dir.join("client.db"))
voelin_platform::crash::set_app_version(env!("CARGO_PKG_VERSION"));
let enabled = voelin_store::Store::open(&data_dir.join("client.db"))
.ok()
.and_then(|store| store.setting::<bool>(CRASH_REPORTS_SETTING).ok().flatten())
.unwrap_or(false);
tsc_platform::crash::install(data_dir.join(tsc_platform::crash::DIR_NAME), enabled);
voelin_platform::crash::install(data_dir.join(voelin_platform::crash::DIR_NAME), enabled);
}
/// Keep the voice foreground service in step with the voice connections.
@@ -1,9 +1,9 @@
//! JNI glue with the app's Kotlin side (`android/app/src/main/java/...`).
//!
//! - Rust → Kotlin: static methods of `io.github.faumaray.tsc.Bridge`, called
//! - Rust → Kotlin: static methods of `io.github.faumaray.voelin.Bridge`, called
//! from any thread (the class is looked up once on the `android_main`
//! thread, whose class loader sees the app's classes).
//! - Kotlin → Rust: the `external` methods of `io.github.faumaray.tsc.Native`,
//! - Kotlin → Rust: the `external` methods of `io.github.faumaray.voelin.Native`,
//! exported below with `native_method!` (panics and errors become Java
//! exceptions instead of crossing the FFI boundary).
@@ -22,7 +22,7 @@ static BRIDGE: OnceLock<Global<JClass<'static>>> = OnceLock::new();
/// Look up `Bridge` (on the `android_main` thread).
pub fn init(env: &mut Env) -> Result<()> {
if BRIDGE.get().is_none() {
let class = env.load_class(jni_str!("io.github.faumaray.tsc.Bridge"))?;
let class = env.load_class(jni_str!("io.github.faumaray.voelin.Bridge"))?;
let _ = BRIDGE.set(env.new_global_ref(class)?);
}
Ok(())
@@ -32,7 +32,7 @@ pub fn init(env: &mut Env) -> Result<()> {
fn with_bridge<T>(f: impl FnOnce(&mut Env, &Global<JClass<'static>>) -> Result<T>) -> Result<T> {
let class = BRIDGE
.get()
.ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.tsc.Bridge".into() })?;
.ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.voelin.Bridge".into() })?;
JavaVM::singleton()?.attach_current_thread(|env| f(env, class))
}
@@ -40,7 +40,7 @@ fn with_bridge<T>(f: impl FnOnce(&mut Env, &Global<JClass<'static>>) -> Result<T
pub fn context<'local>(env: &mut Env<'local>) -> Result<JObject<'local>> {
let class = BRIDGE
.get()
.ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.tsc.Bridge".into() })?;
.ok_or_else(|| Error::ClassNotFound { name: "io.github.faumaray.voelin.Bridge".into() })?;
env.call_static_method(
class,
jni_str!("context"),
@@ -160,7 +160,7 @@ pub fn secret_delete(key: &str) -> Result<()> {
// Native methods of `Native` (Kotlin `object` with `@JvmStatic external`).
const _: jni::NativeMethod = native_method! {
java_type = "io.github.faumaray.tsc.Native",
java_type = "io.github.faumaray.voelin.Native",
static extern fn on_screen_capture_result(granted: jboolean, error: JString),
};
@@ -176,7 +176,7 @@ fn on_screen_capture_result<'local>(
}
const _: jni::NativeMethod = native_method! {
java_type = "io.github.faumaray.tsc.Native",
java_type = "io.github.faumaray.voelin.Native",
static extern fn on_screen_frame(
pixels: JByteBuffer,
width: jint,
@@ -219,7 +219,7 @@ fn on_screen_frame<'local>(
}
const _: jni::NativeMethod = native_method! {
java_type = "io.github.faumaray.tsc.Native",
java_type = "io.github.faumaray.voelin.Native",
static extern fn on_screen_capture_stopped(),
};
@@ -229,7 +229,7 @@ fn on_screen_capture_stopped<'local>(_env: &mut Env<'local>, _class: JClass<'loc
}
const _: jni::NativeMethod = native_method! {
java_type = "io.github.faumaray.tsc.Native",
java_type = "io.github.faumaray.voelin.Native",
static extern fn on_system_audio(samples: jfloat[], count: jint, channels: jint, timestamp_ns: jlong) -> jboolean,
};
@@ -251,7 +251,7 @@ fn on_system_audio<'local>(
}
const _: jni::NativeMethod = native_method! {
java_type = "io.github.faumaray.tsc.Native",
java_type = "io.github.faumaray.voelin.Native",
static extern fn on_disconnect_voice(),
};
@@ -262,7 +262,7 @@ fn on_disconnect_voice<'local>(_env: &mut Env<'local>, _class: JClass<'local>) -
}
const _: jni::NativeMethod = native_method! {
java_type = "io.github.faumaray.tsc.Native",
java_type = "io.github.faumaray.voelin.Native",
static extern fn on_toggle_mute(),
};
@@ -1,7 +1,7 @@
//! Screen and system-audio capture through MediaProjection.
//!
//! Registered as `tsc_media` capture providers, so stream code captures with
//! `tsc_media::capture::default_screen_capture()` as on desktop. Starting
//! Registered as `voelin_media` capture providers, so stream code captures with
//! `voelin_media::capture::default_screen_capture()` as on desktop. Starting
//! asks the Kotlin side for the user's consent; on consent it runs
//! `ScreenCaptureService` (a `mediaProjection` foreground service) whose
//! `ImageReader` hands RGBA frames to [`on_frame`]. System audio
@@ -12,9 +12,9 @@ use std::time::Duration;
use tokio::sync::oneshot;
use tracing::warn;
use tsc_media::capture::external::{self, AudioProvider, ScreenProvider};
use tsc_media::capture::{BoxFuture, CaptureOptions, CaptureSource, SourceId};
use tsc_media::{AudioBuffer, Error, FrameSender, Result, VideoFrame};
use voelin_media::capture::external::{self, AudioProvider, ScreenProvider};
use voelin_media::capture::{BoxFuture, CaptureOptions, CaptureSource, SourceId};
use voelin_media::{AudioBuffer, Error, FrameSender, Result, VideoFrame};
use crate::bridge;
@@ -7,7 +7,7 @@
use std::collections::BTreeMap;
use tsc_core::{Event, SessionId, VoiceState};
use voelin_core::{Event, SessionId, VoiceState};
/// What the voice notification shows.
#[derive(Clone, Debug, PartialEq, Eq)]
@@ -78,8 +78,8 @@ impl Foreground {
#[cfg(test)]
mod tests {
use tsc_core::SessionState;
use tsc_model::{Capabilities, ServerFlavor};
use voelin_core::SessionState;
use voelin_model::{Capabilities, ServerFlavor};
use super::*;
@@ -11,7 +11,7 @@ use std::sync::{Arc, Mutex, MutexGuard, PoisonError};
use tokio::runtime::{Handle, Runtime};
use tokio::sync::{broadcast, mpsc};
use tsc_core::{Engine, Event, SessionId, StreamState, WatchState};
use voelin_core::{Engine, Event, SessionId, StreamState, WatchState};
/// Chat messages per session a new window gets back.
pub const CHAT_BACKLOG: usize = 300;
@@ -162,7 +162,7 @@ pub struct EngineHost {
fanout: Fanout,
}
/// What a window needs: see `tsc_ui::HostedEngine`.
/// What a window needs: see `voelin_ui::HostedEngine`.
pub struct Attached {
pub engine: Engine,
pub runtime: Handle,
@@ -173,7 +173,7 @@ impl EngineHost {
pub fn start() -> std::io::Result<Self> {
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.thread_name("tsc-engine")
.thread_name("voelin-engine")
.build()?;
let engine = runtime.block_on(async { Engine::start() });
let fanout = Fanout::default();
@@ -203,8 +203,8 @@ impl EngineHost {
mod tests {
use std::sync::Arc as StdArc;
use tsc_core::{SessionState, VoiceState};
use tsc_model::{ChatMessage, ChatTarget, Presence};
use voelin_core::{SessionState, VoiceState};
use voelin_model::{ChatMessage, ChatTarget, Presence};
use super::*;
@@ -266,7 +266,7 @@ mod tests {
replay.record(&Event::WatchState {
session: 2,
stream_id: "s2".into(),
state: WatchState::Ended(tsc_core::stream::EndReason::Local),
state: WatchState::Ended(voelin_core::stream::EndReason::Local),
});
let events = describe(&replay.events());
@@ -1,7 +1,7 @@
//! The Android app's native library (`libtsc_android.so`).
//! The Android app's native library (`libvoelin_android.so`).
//!
//! The APK (`android/`) starts a `NativeActivity` subclass that loads this
//! library; `android_main` then runs the shared Slint UI (`tsc_ui`) on
//! library; `android_main` then runs the shared Slint UI (`voelin_ui`) on
//! Slint's Android backend. The pieces around it:
//!
//! - [`host`]: one engine per process, so voice survives the activity being
@@ -12,7 +12,7 @@
//! - `bridge` (Android): JNI calls into the Kotlin side (`Bridge`) and the
//! native methods it calls back (`Native`)
//! - `capture` (Android): screen and system-audio capture through
//! MediaProjection, registered as `tsc_media` capture providers
//! MediaProjection, registered as `voelin_media` capture providers
//! - `secrets` (Android): passwords encrypted with an Android Keystore key
//!
//! Only [`host`] and [`foreground`] build on other platforms, for tests.
@@ -4,7 +4,7 @@
//! lives in the Android Keystore (hardware-backed where the device has it)
//! and keeps the ciphertext in the app's private preferences.
use tsc_store::{Error, Result, Secrets};
use voelin_store::{Error, Result, Secrets};
use crate::bridge;
@@ -1,5 +1,5 @@
[package]
name = "tsc-audio"
name = "voelin-audio"
version = "0.1.0"
description = "Voice pipeline: Opus encoding, framing, resampling, jitter buffer/mixer and audio devices."
edition.workspace = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
//! All user audio settings in one serde struct, e.g. for
//! `tsc_store::Store::set_setting("audio", &settings)`. Missing fields take
//! `voelin_store::Store::set_setting("audio", &settings)`. Missing fields take
//! their defaults, so stored settings survive new options.
use serde::{Deserialize, Serialize};
File renamed without changes.
@@ -52,7 +52,7 @@ mod tests {
#[test]
fn roundtrip() {
let path = std::env::temp_dir().join(format!("tsc-audio-{}.wav", std::process::id()));
let path = std::env::temp_dir().join(format!("voelin-audio-{}.wav", std::process::id()));
let clip = Clip { samples: vec![0.0, 0.5, -0.5, 0.25], channels: 2, rate: 48_000 };
write(&path, &clip).unwrap();
let back = read(&path).unwrap();
@@ -7,10 +7,10 @@
//! loss. Every 30 s it sends a loud marker frame instead of the quiet one;
//! the latency is the time from generating a marker to it leaving the mixer.
use tsc_audio::pcm::{FRAME_SAMPLES, SAMPLE_RATE, energy, sine, white_noise};
use tsc_audio::{Mixer, VoiceCodec, VoiceEncoder};
use tsclientlib::ClientId;
use tsproto_packets::packets::{AudioData, CodecType, Direction, InAudioBuf, OutAudio};
use voelin_audio::pcm::{FRAME_SAMPLES, SAMPLE_RATE, energy, sine, white_noise};
use voelin_audio::{Mixer, VoiceCodec, VoiceEncoder};
/// The receiver pulls 10 ms at a time, like a playback loop.
const PULL: usize = SAMPLE_RATE as usize / 100;
@@ -1,5 +1,5 @@
[package]
name = "tsc-core"
name = "voelin-core"
version = "0.1.0"
description = "Client engine: server sessions merging voice, gateway and query sources; the API the UI drives."
edition.workspace = true
@@ -11,15 +11,15 @@ publish.workspace = true
[features]
default = ["audio-device"]
# Capture and play audio through the system's devices.
audio-device = ["tsc-audio/device"]
audio-device = ["voelin-audio/device"]
# The `media` module: capture and video codecs for streams, with whatever
# tsc-media backends are enabled (e.g. MediaCodec and a registered capture
# voelin-media backends are enabled (e.g. MediaCodec and a registered capture
# source on Android).
media = ["dep:tsc-media"]
# `media` with tsc-media's desktop backends: libvpx, OpenH264 loaded at
media = ["dep:voelin-media"]
# `media` with voelin-media's desktop backends: libvpx, OpenH264 loaded at
# runtime, X11 and PipeWire on Linux. Not for Android (libvpx does not
# cross-compile there).
media-desktop = ["media", "tsc-media/default"]
media-desktop = ["media", "voelin-media/default"]
[dependencies]
anyhow = "1"
@@ -29,13 +29,13 @@ thiserror = "2"
tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time"] }
tokio-tungstenite = "0.30"
tracing = "0.1"
tsc-audio = { path = "../tsc-audio", default-features = false }
tsc-gateway-proto = { path = "../tsc-gateway-proto" }
tsc-media = { path = "../tsc-media", default-features = false, features = ["str0m"], optional = true }
tsc-model = { path = "../tsc-model" }
tsc-observer = { path = "../tsc-observer" }
tsc-query = { path = "../tsc-query" }
tsc-stream = { path = "../tsc-stream" }
voelin-audio = { path = "../voelin-audio", default-features = false }
voelin-gateway-proto = { path = "../voelin-gateway-proto" }
voelin-media = { path = "../voelin-media", default-features = false, features = ["str0m"], optional = true }
voelin-model = { path = "../voelin-model" }
voelin-observer = { path = "../voelin-observer" }
voelin-query = { path = "../voelin-query" }
voelin-stream = { path = "../voelin-stream" }
tsclientlib = { path = "../proto/tsclientlib" }
tsproto-packets = { path = "../proto/tsproto-packets" }
@@ -16,12 +16,12 @@ use std::time::{Duration, Instant};
use tokio::sync::mpsc;
use tracing::{debug, warn};
use tsc_audio::pcm::{self, FRAME_SAMPLES};
use tsc_audio::settings::TransmitMode;
use tsc_audio::vad::SILENCE_DB;
use tsc_audio::{AudioSettings, Framer, Mixer, Processor, Vad, VoiceCodec, VoiceEncoder};
use tsclientlib::ClientId;
use tsproto_packets::packets::{AudioData, CodecType, Direction, InAudioBuf, OutAudio, OutPacket};
use voelin_audio::pcm::{self, FRAME_SAMPLES};
use voelin_audio::settings::TransmitMode;
use voelin_audio::vad::SILENCE_DB;
use voelin_audio::{AudioSettings, Framer, Mixer, Processor, Vad, VoiceCodec, VoiceEncoder};
pub(crate) enum AudioIn {
Packet(InAudioBuf),
@@ -113,7 +113,7 @@ pub(crate) fn spawn(
) -> AudioHandle {
let (tx, rx) = std_mpsc::channel();
thread::Builder::new()
.name("tsc-audio".into())
.name("voelin-audio".into())
.spawn(move || run(rx, outgoing, events, settings))
.expect("spawn audio thread");
AudioHandle { tx }
@@ -151,7 +151,7 @@ struct Pipeline {
}
impl Pipeline {
fn new(settings: AudioSettings) -> tsc_audio::Result<Self> {
fn new(settings: AudioSettings) -> voelin_audio::Result<Self> {
let settings = sanitize(settings);
Ok(Self {
encoder: VoiceEncoder::new(VoiceCodec::Voice)?,
@@ -420,11 +420,11 @@ fn run(
#[cfg(feature = "audio-device")]
mod devices {
use tracing::debug;
use tsc_audio::AudioSettings;
use tsc_audio::device::{Capture, DeviceEvent, Managed, Playback};
use tsc_audio::pcm::{self, FRAME_SAMPLES, SAMPLE_RATE};
use tsc_audio::resample::Linear;
use tsproto_packets::packets::OutPacket;
use voelin_audio::AudioSettings;
use voelin_audio::device::{Capture, DeviceEvent, Managed, Playback};
use voelin_audio::pcm::{self, FRAME_SAMPLES, SAMPLE_RATE};
use voelin_audio::resample::Linear;
use super::{DEVICE_LATENCY_MS, PLAYBACK_CAPACITY_MS, Pipeline};
@@ -531,8 +531,8 @@ mod devices {
#[cfg(test)]
mod tests {
use tsc_audio::pcm::{SAMPLE_RATE, energy, sine, white_noise};
use tsc_audio::{ProcessingSettings, VadSettings};
use voelin_audio::pcm::{SAMPLE_RATE, energy, sine, white_noise};
use voelin_audio::{ProcessingSettings, VadSettings};
use super::*;
@@ -5,8 +5,8 @@ use tokio::sync::mpsc;
use tokio_tungstenite::tungstenite::Message;
use tokio_tungstenite::tungstenite::client::IntoClientRequest;
use tracing::info;
use tsc_gateway_proto::{ClientMsg, Envelope, ServerMsg, sign_challenge};
use tsc_model::{ChatMessage, ChatTarget, Presence};
use voelin_gateway_proto::{ClientMsg, Envelope, ServerMsg, sign_challenge};
use voelin_model::{ChatMessage, ChatTarget, Presence};
pub(crate) enum GatewayCmd {
OpenChat(ChatTarget),
@@ -41,7 +41,9 @@ async fn run_inner(
events: &mpsc::UnboundedSender<GatewayEvent>,
) -> anyhow::Result<()> {
let mut request = url.into_client_request()?;
request.headers_mut().insert("Sec-WebSocket-Protocol", tsc_gateway_proto::SUBPROTOCOL.parse()?);
request
.headers_mut()
.insert("Sec-WebSocket-Protocol", voelin_gateway_proto::SUBPROTOCOL.parse()?);
let (mut ws, _) = tokio_tungstenite::connect_async(request).await?;
let mut next_id = 1u64;
let mut presence = Presence::default();
@@ -98,10 +100,10 @@ async fn run_inner(
let _ = events.send(GatewayEvent::Error(format!("{code:?}: {message}")));
if matches!(
code,
tsc_gateway_proto::ErrorCode::AuthFailed
| tsc_gateway_proto::ErrorCode::UnknownIdentity
| tsc_gateway_proto::ErrorCode::LevelTooLow
| tsc_gateway_proto::ErrorCode::Banned
voelin_gateway_proto::ErrorCode::AuthFailed
| voelin_gateway_proto::ErrorCode::UnknownIdentity
| voelin_gateway_proto::ErrorCode::LevelTooLow
| voelin_gateway_proto::ErrorCode::Banned
) {
anyhow::bail!("gateway refused login: {message}");
}
@@ -32,14 +32,14 @@ use std::collections::HashMap;
use std::sync::Arc;
use tokio::sync::{broadcast, mpsc};
pub use tsc_audio::settings::TransmitMode;
pub use tsc_audio::{AudioSettings, ProcessingSettings, VadSettings};
use tsc_model::{Capabilities, ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor};
pub use voelin_audio::settings::TransmitMode;
pub use voelin_audio::{AudioSettings, ProcessingSettings, VadSettings};
use voelin_model::{Capabilities, ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor};
use crate::audio::{AudioEvent, AudioHandle, AudioIn};
pub use route::{ChatRoute, Dedup, route_chat};
pub use stream::{StreamFrame, StreamSink, StreamState, WatchState};
use tsc_stream::{EncodedFrame, StreamInfo, StreamSetup, ViewerInfo};
use voelin_stream::{EncodedFrame, StreamInfo, StreamSetup, ViewerInfo};
pub use voice::VoiceOptions;
pub type SessionId = u64;
@@ -63,7 +63,7 @@ pub enum Command {
/// Invisible presence and relay chat with own ServerQuery credentials.
ObserveQuery {
session: SessionId,
connect: Box<tsc_query::Connect>,
connect: Box<voelin_query::Connect>,
},
StopObserving {
session: SessionId,
@@ -6,7 +6,7 @@
//! VP8 by default) at the bitrate of the stream setup, and the audio with
//! Opus (48 kHz stereo, 20 ms). It hands the frames to a [`MediaSink`]:
//! the [`StreamSink`] of a live stream, or an [`EncodedSource`] for code
//! that drives `tsc_stream::Streams` itself. Keyframe requests of viewers
//! that drives `voelin_stream::Streams` itself. Keyframe requests of viewers
//! are honoured.
//! - [`VideoPipeline`] decodes the video of a watched stream on its own
//! thread and hands every picture to a callback. After lost frames or
@@ -17,8 +17,8 @@
//! - [`Latest`] hands the newest picture to a slower consumer such as a UI.
//! - [`LocalPreview`] runs capture → encoder → decoder without a server.
//!
//! [`tsc_media`] is re-exported for sources, codecs and pixel conversion.
//! Codecs are chosen through `tsc_media::Codecs`, so whatever backends the
//! [`voelin_media`] is re-exported for sources, codecs and pixel conversion.
//! Codecs are chosen through `voelin_media::Codecs`, so whatever backends the
//! build has are used (libvpx and OpenH264 with feature `media-desktop`,
//! MediaCodec on Android).
@@ -30,16 +30,16 @@ use std::thread::JoinHandle;
use std::time::{Duration, Instant};
use tracing::{debug, warn};
use tsc_audio::{VoiceCodec, VoiceEncoder};
pub use tsc_media;
use tsc_media::capture::synthetic::{SineSource, SyntheticScreen};
use tsc_media::capture::{
use voelin_audio::{VoiceCodec, VoiceEncoder};
pub use voelin_media;
use voelin_media::capture::synthetic::{SineSource, SyntheticScreen};
use voelin_media::capture::{
self, AudioCapture, CaptureOptions, CaptureSource, ScreenCapture, SourceId,
};
use tsc_media::{
use voelin_media::{
AudioBuffer, Codec, Codecs, ContentHint, EncoderConfig, FrameReceiver, VideoEncoder, VideoFrame,
};
use tsc_stream::{
use voelin_stream::{
EncodedFrame, FrameSource, Frequency, MediaFrame, MediaKind, MediaTime, PeerConfig, VideoCodec,
};
@@ -60,9 +60,9 @@ const KEYFRAME_RETRY: Duration = Duration::from_millis(500);
#[derive(Debug, thiserror::Error)]
pub enum MediaError {
#[error(transparent)]
Media(#[from] tsc_media::Error),
Media(#[from] voelin_media::Error),
#[error("Opus: {0}")]
Opus(#[from] tsc_audio::Error),
Opus(#[from] voelin_audio::Error),
}
fn lock<T>(m: &Mutex<T>) -> MutexGuard<'_, T> {
@@ -76,7 +76,7 @@ fn spawn(name: &str, f: impl FnOnce() + Send + 'static) -> Result<JoinHandle<()>
.map_err(|e| MediaError::Media(e.into()))
}
/// The `tsc_media` codec of a negotiated video codec.
/// The `voelin_media` codec of a negotiated video codec.
pub fn media_codec(codec: VideoCodec) -> Codec {
match codec {
VideoCodec::Vp8 => Codec::Vp8,
@@ -86,7 +86,7 @@ pub fn media_codec(codec: VideoCodec) -> Codec {
}
}
/// The negotiable video codec of a `tsc_media` codec.
/// The negotiable video codec of a `voelin_media` codec.
pub fn video_codec(codec: Codec) -> VideoCodec {
match codec {
Codec::Vp8 => VideoCodec::Vp8,
@@ -275,7 +275,7 @@ impl Streamer {
}
#[cfg(all(target_os = "linux", feature = "media-desktop"))]
SourceId::Portal => {
use tsc_media::capture::portal::PortalCapture;
use voelin_media::capture::portal::PortalCapture;
let mut portal = PortalCapture::with_restore_token(config.restore_token.clone());
let frames = portal.start(&SourceId::Portal, &options).await?;
let token = portal.restore_token().map(str::to_owned);
@@ -285,10 +285,10 @@ impl Streamer {
let mut screen = match config.backend {
CaptureBackend::Auto => capture::default_screen_capture()?,
#[cfg(all(target_os = "linux", feature = "media-desktop"))]
CaptureBackend::X11 => Box::new(tsc_media::capture::x11::X11Capture::new()),
CaptureBackend::X11 => Box::new(voelin_media::capture::x11::X11Capture::new()),
#[cfg(not(all(target_os = "linux", feature = "media-desktop")))]
CaptureBackend::X11 => {
return Err(tsc_media::Error::CaptureUnavailable {
return Err(voelin_media::Error::CaptureUnavailable {
backend: "x11",
reason: "X11 capture is only in Linux desktop builds".into(),
}
@@ -311,7 +311,7 @@ impl Streamer {
restore_token,
audio_error: None,
};
streamer.threads.push(spawn("tsc-stream-video", {
streamer.threads.push(spawn("voelin-stream-video", {
let shared = shared.clone();
move || video_loop(&shared, frames, encoder)
})?);
@@ -319,7 +319,7 @@ impl Streamer {
match start_audio(&config.source) {
Ok((capture, buffers, encoder)) => {
streamer.audio = Some(capture);
streamer.threads.push(spawn("tsc-stream-audio", move || {
streamer.threads.push(spawn("voelin-stream-audio", move || {
audio_loop(&shared, buffers, encoder)
})?);
}
@@ -528,7 +528,7 @@ impl MediaSink for ChannelSink {
}
/// A [`Streamer`] as a [`FrameSource`], for code that runs
/// `tsc_stream::Streams` itself (e.g. tsctl).
/// `voelin_stream::Streams` itself (e.g. voelinctl).
pub struct EncodedSource {
streamer: Streamer,
frames: std_mpsc::Receiver<EncodedFrame>,
@@ -701,7 +701,7 @@ impl VideoPipeline {
) -> Self {
let queue = Arc::new(DecodeQueue::default());
let thread = std::thread::Builder::new()
.name("tsc-stream-decode".into())
.name("voelin-stream-decode".into())
.spawn({
let queue = queue.clone();
move || decode_loop(&queue, &codecs, on_frame, request_keyframe)
@@ -741,7 +741,7 @@ fn decode_loop(
mut on_frame: impl FnMut(VideoFrame),
request_keyframe: impl Fn(),
) {
let mut decoder: Option<(Codec, Box<dyn tsc_media::VideoDecoder>)> = None;
let mut decoder: Option<(Codec, Box<dyn voelin_media::VideoDecoder>)> = None;
// Start at a keyframe; the streamer sends one when a viewer connects.
let mut waiting = true;
let mut last_request: Option<Instant> = None;
@@ -909,7 +909,7 @@ impl<T> Latest<T> {
/// Feeds a [`Streamer`]'s video straight into a [`VideoPipeline`].
struct PipelineSink {
input: FrameInput,
codec: tsc_stream::Codec,
codec: voelin_stream::Codec,
keyframe: Arc<AtomicBool>,
}
@@ -932,7 +932,7 @@ impl MediaSink for PipelineSink {
}
/// Capture → encoder → decoder without a server, e.g. to preview a share or
/// to develop the viewer (`TSC_DEMO_STREAM` in the desktop app).
/// to develop the viewer (`VOELIN_DEMO_STREAM` in the desktop app).
pub struct LocalPreview {
// Dropped first: no more frames into the pipeline.
streamer: Streamer,
@@ -974,9 +974,9 @@ impl LocalPreview {
/// the background.
#[cfg(all(test, feature = "media-desktop"))]
pub(crate) fn rectangle_span(picture: &VideoFrame) -> (u32, u32) {
use tsc_media::capture::synthetic::{BACKGROUND, RECT_COLOR};
use voelin_media::capture::synthetic::{BACKGROUND, RECT_COLOR};
let rgba = tsc_media::convert::to_rgba_vec(picture).unwrap();
let rgba = voelin_media::convert::to_rgba_vec(picture).unwrap();
let y = picture.height / 2;
let pixel = |x: u32| {
let i = ((y * picture.width + x) * 4) as usize;
@@ -1001,8 +1001,8 @@ mod tests {
#[test]
fn keyframe_detection() {
// VP8: the 1x1 keyframe of tsc-stream's synthetic source.
assert!(is_keyframe(Codec::Vp8, &tsc_stream::source::VP8_KEYFRAME_1X1));
// VP8: the 1x1 keyframe of voelin-stream's synthetic source.
assert!(is_keyframe(Codec::Vp8, &voelin_stream::source::VP8_KEYFRAME_1X1));
assert!(!is_keyframe(Codec::Vp8, &[0x31, 0x00]));
// VP9 profile 0: marker 10, profile 00, show_existing 0, frame_type 0/1.
assert!(is_keyframe(Codec::Vp9, &[0b1000_0000]));
@@ -1,8 +1,10 @@
//! The query source: own ServerQuery credentials, in-process observer and relays.
use tokio::sync::{broadcast, mpsc};
use tsc_model::{ChatMessage, ChatTarget, Presence};
use tsc_observer::{Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool};
use voelin_model::{ChatMessage, ChatTarget, Presence};
use voelin_observer::{
Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool,
};
pub(crate) enum QueryCmd {
OpenChat(ChatTarget),
@@ -19,7 +21,7 @@ pub(crate) enum QueryEvent {
}
pub(crate) async fn run(
connect: tsc_query::Connect,
connect: voelin_query::Connect,
mut commands: mpsc::UnboundedReceiver<QueryCmd>,
events: mpsc::UnboundedSender<QueryEvent>,
) {
@@ -74,7 +76,7 @@ pub(crate) async fn run(
Some(QueryCmd::SendChat { target, nick, text }) => {
let result = match &target {
ChatTarget::Channel(cid) => relays.send(*cid, &nick, &text).await,
_ => Err(tsc_query::Error::Unsupported("only channel chat is relayed with own credentials")),
_ => Err(voelin_query::Error::Unsupported("only channel chat is relayed with own credentials")),
};
if let Err(e) = result {
let _ = events.send(QueryEvent::Error(e.to_string()));
@@ -2,7 +2,7 @@
use std::collections::VecDeque;
use tsc_model::{ChannelId, ChatMessage, ChatTarget};
use voelin_model::{ChannelId, ChatMessage, ChatTarget};
/// Which source carries a chat.
#[derive(Clone, Debug, PartialEq, Eq)]
@@ -5,9 +5,9 @@ use std::sync::Arc;
use tokio::sync::{broadcast, mpsc};
use tracing::debug;
use tsc_audio::AudioSettings;
use tsc_model::{ChatMessage, ChatTarget, Presence};
use tsclientlib::ClientId;
use voelin_audio::AudioSettings;
use voelin_model::{ChatMessage, ChatTarget, Presence};
use crate::audio::{self, AudioEvent, AudioHandle, AudioIn};
use crate::gateway::{self, GatewayCmd, GatewayEvent};
@@ -1,5 +1,5 @@
//! TeamSpeak 6 streams of a session: a task that runs the stream sessions
//! ([`tsc_stream::Streams`]) of the voice connection.
//! ([`voelin_stream::Streams`]) of the voice connection.
//!
//! The voice task forwards stream notifications here and sends the resulting
//! commands. Only started for TeamSpeak 6 servers.
@@ -11,16 +11,16 @@ use std::sync::atomic::{AtomicBool, Ordering};
use tokio::sync::{broadcast, mpsc};
use tracing::debug;
pub use tsc_stream::{
use tsclientlib::ClientId;
pub use voelin_stream::{
Codec, EncodedFrame, EndReason, FrameSource, Frequency, LeaveReason, MediaFrame, MediaKind,
MediaTime, PeerConfig, StreamInfo, StreamKind, StreamSetup, SyntheticSource, VideoCodec,
ViewerInfo, ViewerState,
};
use tsc_stream::{
use voelin_stream::{
Output, Request, StreamEvent, StreamNotification, StreamerEvent, StreamerOptions, Streams,
WatchEvent,
};
use tsclientlib::ClientId;
use crate::audio::{AudioHandle, AudioIn};
use crate::voice::VoiceCmd;
@@ -355,7 +355,7 @@ mod tests {
use std::time::{Duration, Instant};
use tokio::time::timeout;
use tsc_stream::{FrameSource, SyntheticSource};
use voelin_stream::{FrameSource, SyntheticSource};
use super::*;
@@ -592,8 +592,8 @@ mod tests {
async fn test_pattern_through_stream_tasks() {
use std::sync::mpsc as std_mpsc;
use tsc_media::capture::SourceId;
use tsc_media::{Codec, Codecs};
use voelin_media::capture::SourceId;
use voelin_media::{Codec, Codecs};
use crate::media::{Streamer, StreamerConfig, VideoPipeline, rectangle_span};
@@ -7,10 +7,6 @@ use futures::prelude::*;
use tokio::sync::mpsc;
use tokio::time::{Instant, timeout};
use tracing::{info, warn};
use tsc_model::{
ChannelId, ChannelInfo, ChatMessage, ChatTarget, ClientInfo, Presence, ServerFlavor,
};
use tsc_stream::{PeerConfig, Request, StreamNotification};
use tsclientlib::data;
use tsclientlib::events::Event as BookEvent;
use tsclientlib::prelude::*;
@@ -19,6 +15,10 @@ use tsclientlib::{
StreamItem, Version,
};
use tsproto_packets::packets::{AudioData, InAudioBuf, OutPacket};
use voelin_model::{
ChannelId, ChannelInfo, ChatMessage, ChatTarget, ClientInfo, Presence, ServerFlavor,
};
use voelin_stream::{PeerConfig, Request, StreamNotification};
#[derive(Clone, Debug)]
pub struct VoiceOptions {
@@ -1,15 +1,15 @@
//! Engine against the development servers (dev/docker-compose.yml).
//! Runs only with `TSC_LIVE=1`; `scripts/it-smoke.sh` sets it.
//! Runs only with `VOELIN_LIVE=1`; `scripts/it-smoke.sh` sets it.
use std::time::Duration;
use tokio::sync::broadcast::Receiver;
use tokio::time::{Instant, timeout_at};
use tsc_core::{Command, Engine, Event, ObserveState, Source, VoiceOptions, VoiceState};
use tsc_model::ChatTarget;
use voelin_core::{Command, Engine, Event, ObserveState, Source, VoiceOptions, VoiceState};
use voelin_model::ChatTarget;
fn live() -> bool {
std::env::var("TSC_LIVE").is_ok_and(|v| v == "1")
std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1")
}
/// Wait for an event matching `f`, failing after 20 s.
@@ -29,7 +29,7 @@ async fn wait_for(
}
}
async fn engine_roundtrip(voice_addr: &str, query: tsc_query::Connect) {
async fn engine_roundtrip(voice_addr: &str, query: voelin_query::Connect) {
let engine = Engine::start();
let mut events = engine.subscribe();
let nick = format!("engine-{}", std::process::id() % 10_000);
@@ -93,15 +93,15 @@ async fn engine_roundtrip(voice_addr: &str, query: tsc_query::Connect) {
tokio::time::sleep(Duration::from_millis(500)).await;
}
fn query(transport: tsc_query::Transport, addr: &str) -> tsc_query::Connect {
tsc_query::Connect {
fn query(transport: voelin_query::Transport, addr: &str) -> voelin_query::Connect {
voelin_query::Connect {
transport,
addr: addr.into(),
user: "serveradmin".into(),
secret: Some("tsc-dev-admin".into()),
secret: Some("voelin-dev-admin".into()),
server_port: Some(9987),
server_id: None,
line: tsc_query::LineOptions { rate_limit: None, ..Default::default() },
line: voelin_query::LineOptions { rate_limit: None, ..Default::default() },
}
}
@@ -110,7 +110,8 @@ async fn ts6_engine() {
if !live() {
return;
}
engine_roundtrip("127.0.0.1:9988", query(tsc_query::Transport::Ssh, "127.0.0.1:10022")).await;
engine_roundtrip("127.0.0.1:9988", query(voelin_query::Transport::Ssh, "127.0.0.1:10022"))
.await;
}
#[tokio::test(flavor = "multi_thread")]
@@ -118,5 +119,6 @@ async fn ts3_engine() {
if !live() {
return;
}
engine_roundtrip("127.0.0.1:9987", query(tsc_query::Transport::Raw, "127.0.0.1:10011")).await;
engine_roundtrip("127.0.0.1:9987", query(voelin_query::Transport::Raw, "127.0.0.1:10011"))
.await;
}
@@ -1,6 +1,6 @@
//! The media pipeline through the engine and the TeamSpeak 6 development
//! server (dev/docker-compose.yml): one session streams the test pattern
//! (VP8 + Opus), another decodes it. Runs only with `TSC_LIVE=1`.
//! (VP8 + Opus), another decodes it. Runs only with `VOELIN_LIVE=1`.
#![cfg(feature = "media-desktop")]
@@ -10,15 +10,15 @@ use std::time::Duration;
use tokio::sync::broadcast::Receiver;
use tokio::time::timeout;
use tsc_core::media::tsc_media::capture::SourceId;
use tsc_core::media::tsc_media::capture::synthetic::RECT_COLOR;
use tsc_core::media::tsc_media::{Codec, Codecs, convert};
use tsc_core::media::{Streamer, StreamerConfig, Viewer, peer_config, stream_codec};
use tsc_core::stream::{PeerConfig, StreamSetup};
use tsc_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState};
use voelin_core::media::voelin_media::capture::SourceId;
use voelin_core::media::voelin_media::capture::synthetic::RECT_COLOR;
use voelin_core::media::voelin_media::{Codec, Codecs, convert};
use voelin_core::media::{Streamer, StreamerConfig, Viewer, peer_config, stream_codec};
use voelin_core::stream::{PeerConfig, StreamSetup};
use voelin_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState};
fn live() -> bool {
std::env::var("TSC_LIVE").is_ok_and(|v| v == "1")
std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1")
}
/// Wait for an event matching `f`, failing after 20 s.
@@ -73,7 +73,7 @@ async fn connect(
#[tokio::test(flavor = "multi_thread")]
async fn ts6_test_pattern_decoded() {
if !live() {
eprintln!("skipped: set TSC_LIVE=1 with the dev servers running");
eprintln!("skipped: set VOELIN_LIVE=1 with the dev servers running");
return;
}
let engine = Engine::start();
@@ -1,19 +1,19 @@
//! Streams through the engine against the development servers
//! (dev/docker-compose.yml): one session streams synthetic frames, another
//! watches. Runs only with `TSC_LIVE=1`.
//! watches. Runs only with `VOELIN_LIVE=1`.
use std::time::{Duration, Instant};
use tokio::sync::broadcast::Receiver;
use tokio::time::timeout;
use tsc_core::stream::{
use voelin_core::stream::{
EndReason, FrameSource, LeaveReason, MediaKind, PeerConfig, StreamSetup, SyntheticSource,
ViewerState,
};
use tsc_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState};
use voelin_core::{Command, Engine, Event, StreamState, VoiceOptions, VoiceState, WatchState};
fn live() -> bool {
std::env::var("TSC_LIVE").is_ok_and(|v| v == "1")
std::env::var("VOELIN_LIVE").is_ok_and(|v| v == "1")
}
/// Wait for an event matching `f`, failing after 20 s.
@@ -90,7 +90,7 @@ async fn connect(
#[tokio::test(flavor = "multi_thread")]
async fn ts6_stream_between_sessions() {
if !live() {
eprintln!("skipped: set TSC_LIVE=1 with the dev servers running");
eprintln!("skipped: set VOELIN_LIVE=1 with the dev servers running");
return;
}
let engine = Engine::start();
@@ -220,9 +220,9 @@ async fn ts6_stream_between_sessions() {
},
)
.await;
assert!(!sink.send(tsc_core::stream::EncodedFrame {
assert!(!sink.send(voelin_core::stream::EncodedFrame {
kind: MediaKind::Audio,
time: tsc_core::stream::MediaTime::from_90khz(0),
time: voelin_core::stream::MediaTime::from_90khz(0),
data: vec![0].into(),
}));
feeder.await.unwrap();
@@ -1,5 +1,5 @@
[package]
name = "tsc-gateway-proto"
name = "voelin-gateway-proto"
version = "0.1.0"
description = "Wire protocol and identity-challenge authentication of the tsgw gateway."
edition.workspace = true
@@ -15,7 +15,7 @@ serde_json = "1"
sha1 = { package = "sha-1", version = "0.10" }
sha2 = "0.10"
thiserror = "2"
tsc-model = { path = "../tsc-model" }
voelin-model = { path = "../voelin-model" }
tsproto-types = { path = "../proto/tsproto-types" }
[lints]
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
//! Messages in both directions.
use serde::{Deserialize, Serialize};
use tsc_model::{ChatMessage, ChatTarget, PresenceDelta, PresenceSnapshot};
use voelin_model::{ChatMessage, ChatTarget, PresenceDelta, PresenceSnapshot};
/// Every frame: `{"v":1,"id":7,"type":"send_chat","data":{...}}`.
///
@@ -1,5 +1,5 @@
[package]
name = "tsc-gateway"
name = "voelin-gateway"
version = "0.1.0"
description = "tsgw: companion gateway giving app users invisible presence and channel chat over ServerQuery."
edition.workspace = true
@@ -28,10 +28,10 @@ tokio = { version = "1.53.1", features = ["full"] }
toml = "1.1.6"
tracing = "0.1.44"
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
tsc-gateway-proto = { path = "../tsc-gateway-proto" }
tsc-model = { path = "../tsc-model" }
tsc-observer = { path = "../tsc-observer" }
tsc-query = { path = "../tsc-query" }
voelin-gateway-proto = { path = "../voelin-gateway-proto" }
voelin-model = { path = "../voelin-model" }
voelin-observer = { path = "../voelin-observer" }
voelin-query = { path = "../voelin-query" }
[lints]
workspace = true
@@ -1,10 +1,10 @@
# Build: docker build -f crates/tsc-gateway/Dockerfile -t tsgw .
# Build: docker build -f crates/voelin-gateway/Dockerfile -t tsgw .
# Run: docker run -v ./tsgw.toml:/etc/tsgw/tsgw.toml -p 7788:7788 tsgw
FROM rust:1.94-bookworm AS build
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends cmake libasound2-dev && rm -rf /var/lib/apt/lists/*
COPY . .
RUN cargo build --release --locked -p tsc-gateway && cp target/release/tsgw /tsgw
RUN cargo build --release --locked -p voelin-gateway && cp target/release/tsgw /tsgw
FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=build /tsgw /usr/local/bin/tsgw
@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
use anyhow::{Context, Result, bail};
use serde::Deserialize;
use tsc_query::Transport;
use voelin_query::Transport;
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
@@ -199,19 +199,19 @@ impl Config {
.unwrap_or_else(|| format!("tsgw@{}", self.query.addr))
}
pub fn query_connect(&self) -> tsc_query::Connect {
tsc_query::Connect {
pub fn query_connect(&self) -> voelin_query::Connect {
voelin_query::Connect {
transport: self.query.transport,
addr: self.query.addr.clone(),
user: self.query.user.clone(),
secret: self.query.password.clone(),
server_port: Some(self.server.voice_port),
server_id: None,
line: tsc_query::LineOptions {
line: voelin_query::LineOptions {
rate_limit: if self.query.allowlisted {
None
} else {
tsc_query::LineOptions::default().rate_limit
voelin_query::LineOptions::default().rate_limit
},
..Default::default()
},
@@ -4,7 +4,7 @@ use std::path::Path;
use std::sync::Mutex;
use rusqlite::{Connection, OptionalExtension, params};
use tsc_model::{ChatMessage, ChatTarget};
use voelin_model::{ChatMessage, ChatTarget};
pub struct Db(Mutex<Connection>);
@@ -11,10 +11,12 @@ use rand::RngExt;
use sha2::{Digest, Sha256};
use tokio::sync::broadcast;
use tracing::{info, warn};
use tsc_gateway_proto::{ErrorCode, UniqueIds, identity_level, verify_auth};
use tsc_model::{ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor, relay_text};
use tsc_observer::{Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool};
use tsc_query::{Command, QueryClient};
use voelin_gateway_proto::{ErrorCode, UniqueIds, identity_level, verify_auth};
use voelin_model::{ChannelId, ChatMessage, ChatTarget, Presence, ServerFlavor, relay_text};
use voelin_observer::{
Observer, ObserverConfig, ObserverEvent, RelayConfig, RelayEvent, RelayPool,
};
use voelin_query::{Command, QueryClient};
use crate::config::Config;
use crate::db::{Db, TokenInfo};
@@ -53,8 +55,8 @@ impl Denied {
}
}
impl From<tsc_query::Error> for Denied {
fn from(e: tsc_query::Error) -> Self {
impl From<voelin_query::Error> for Denied {
fn from(e: voelin_query::Error) -> Self {
Denied::new(ErrorCode::Unavailable, e.to_string())
}
}
@@ -414,7 +416,7 @@ impl Hub {
return Err(Denied::new(ErrorCode::Forbidden, "no permission for server chat"));
}
let msg = relay_text(&self.config.relay.format, &user.nickname, text);
for part in tsc_model::split_message(&msg, 1024) {
for part in voelin_model::split_message(&msg, 1024) {
self.lookup
.send(
&Command::new("sendtextmessage").arg("targetmode", 3).arg("msg", part),
@@ -2,7 +2,7 @@
//!
//! Gives app users invisible presence (who is in which channel) and channel
//! chat without joining voice, through ServerQuery. See
//! docs/gateway-admin.md and the protocol in `tsc-gateway-proto`.
//! docs/gateway-admin.md and the protocol in `voelin-gateway-proto`.
mod config;
mod db;
@@ -55,7 +55,7 @@ async fn main() -> Result<()> {
async fn ws(State(hub): State<Arc<Hub>>, upgrade: WebSocketUpgrade) -> impl IntoResponse {
upgrade
.protocols([tsc_gateway_proto::SUBPROTOCOL])
.protocols([voelin_gateway_proto::SUBPROTOCOL])
.on_upgrade(move |socket| session::run(hub, socket))
}
@@ -9,7 +9,7 @@ use std::collections::HashMap;
use std::sync::Mutex;
use std::time::{Duration, Instant};
use tsc_query::{Command, QueryClient, Row};
use voelin_query::{Command, QueryClient, Row};
const CACHE_TTL: Duration = Duration::from_secs(60);
@@ -81,7 +81,7 @@ pub struct PermIds {
}
impl PermIds {
pub async fn load(client: &QueryClient) -> tsc_query::Result<Self> {
pub async fn load(client: &QueryClient) -> voelin_query::Result<Self> {
let names = [
"i_channel_join_power",
"i_channel_needed_join_power",
@@ -93,10 +93,9 @@ impl PermIds {
let mut ids = [0u32; 6];
for (i, name) in names.iter().enumerate() {
let rows = client.send(&Command::new("permidgetbyname").arg("permsid", name)).await?;
ids[i] = rows
.first()
.and_then(|r| r.parse("permid"))
.ok_or_else(|| tsc_query::Error::Protocol(format!("unknown permission {name}")))?;
ids[i] = rows.first().and_then(|r| r.parse("permid")).ok_or_else(|| {
voelin_query::Error::Protocol(format!("unknown permission {name}"))
})?;
}
Ok(Self {
join_power: ids[0],
@@ -148,7 +147,7 @@ impl PermResolver {
client: &QueryClient,
cldbid: u64,
cid: u64,
) -> tsc_query::Result<Vec<Entry>> {
) -> voelin_query::Result<Vec<Entry>> {
if let Some((at, entries)) = self.cache.lock().unwrap().get(&(cldbid, cid))
&& at.elapsed() < CACHE_TTL
{
@@ -9,9 +9,9 @@ use base64::prelude::*;
use rand::RngExt;
use tokio::sync::broadcast::error::RecvError;
use tracing::{debug, info};
use tsc_gateway_proto::{ClientMsg, Envelope, ErrorCode, HistoryEntry, ServerMsg};
use tsc_model::{ChatTarget, Presence};
use tsc_observer::ObserverEvent;
use voelin_gateway_proto::{ClientMsg, Envelope, ErrorCode, HistoryEntry, ServerMsg};
use voelin_model::{ChatTarget, Presence};
use voelin_observer::ObserverEvent;
use crate::hub::{Denied, Hub, User};
@@ -97,7 +97,7 @@ pub async fn run(hub: Arc<Hub>, mut socket: WebSocket) {
}
async fn send(socket: &mut WebSocket, id: Option<u64>, msg: ServerMsg) -> Result<(), axum::Error> {
let env = Envelope { v: tsc_gateway_proto::VERSION, id, msg };
let env = Envelope { v: voelin_gateway_proto::VERSION, id, msg };
let text = serde_json::to_string(&env).expect("messages serialize");
socket.send(Message::Text(text.into())).await
}
File renamed without changes.
@@ -1,5 +1,5 @@
[package]
name = "tsc-media"
name = "voelin-media"
version = "0.1.0"
description = "Video frames, pixel conversion, video codecs (VP8/VP9, H.264, AV1) and screen / system-audio capture for streams."
edition.workspace = true
File renamed without changes.
@@ -26,7 +26,7 @@ use crate::{Error, Result};
const BACKEND: &str = "pipewire";
/// Name of our capture node in PipeWire.
pub const NODE_NAME: &str = "tsc-system-audio";
pub const NODE_NAME: &str = "voelin-system-audio";
/// Captures the default sink's monitor through PipeWire.
#[derive(Default)]
@@ -49,7 +49,7 @@ impl AudioCapture for PipeWireAudioCapture {
self.stop();
// Half a second at PipeWire's usual 10-20 ms quantum.
let (tx, rx) = frame_channel(50);
let thread = PwThread::spawn("tsc-pipewire-audio", None, move |core, mainloop| {
let thread = PwThread::spawn("voelin-pipewire-audio", None, move |core, mainloop| {
audio_stream(core, mainloop, tx)
})
.map_err(|reason| Error::CaptureUnavailable { backend: BACKEND, reason })?;
@@ -159,10 +159,11 @@ impl ScreenCapture for PortalCapture {
let (fd, node) = self.open(&options).await?;
let (tx, rx) = frame_channel(options.queue);
let fps = options.fps.max(1);
let thread = PwThread::spawn("tsc-portal-capture", Some(fd), move |core, mainloop| {
video_stream(core, mainloop, node, fps, tx)
})
.map_err(|e| Error::Capture { backend: BACKEND, message: e })?;
let thread =
PwThread::spawn("voelin-portal-capture", Some(fd), move |core, mainloop| {
video_stream(core, mainloop, node, fps, tx)
})
.map_err(|e| Error::Capture { backend: BACKEND, message: e })?;
self.thread = Some(thread);
Ok(rx)
})
@@ -210,7 +211,7 @@ fn video_stream(
*pw::keys::MEDIA_CATEGORY => "Capture",
*pw::keys::MEDIA_ROLE => "Screen",
};
let stream = pw::stream::StreamRc::new(core.clone(), "tsc-screen-capture", props)
let stream = pw::stream::StreamRc::new(core.clone(), "voelin-screen-capture", props)
.map_err(|e| format!("PipeWire stream: {e}"))?;
let state = VideoState {
tx,
File renamed without changes.
@@ -124,7 +124,7 @@ impl ScreenCapture for SyntheticScreen {
let (tx, rx) = frame_channel(options.queue);
let pattern = SyntheticScreen::new(self.width, self.height);
let fps = options.fps;
self.worker = Some(Worker::spawn("tsc-synthetic-video", move |stop| {
self.worker = Some(Worker::spawn("voelin-synthetic-video", move |stop| {
let mut ticker = Ticker::new(fps);
let mut n = 0;
while tx.send(pattern.frame(n, fps)) && ticker.wait(&stop) {
@@ -179,7 +179,7 @@ impl AudioCapture for SineSource {
// Half a second of audio before the oldest is dropped.
let (tx, rx) = frame_channel(50);
let tone = SineSource::new(self.frequency, self.amplitude);
self.worker = Some(Worker::spawn("tsc-synthetic-audio", move |stop| {
self.worker = Some(Worker::spawn("voelin-synthetic-audio", move |stop| {
let mut ticker = Ticker::new(100);
let mut n = 0;
while tx.send(tone.buffer(n)) && ticker.wait(&stop) {
@@ -207,7 +207,7 @@ impl AudioCapture for WasapiLoopback {
self.stop();
let (tx, rx) = frame_channel(50);
let (init_tx, init_rx) = std::sync::mpsc::channel();
self.worker = Some(Worker::spawn("tsc-wasapi-loopback", move |stop| {
self.worker = Some(Worker::spawn("voelin-wasapi-loopback", move |stop| {
if let Err(e) = loopback(&tx, &stop, &init_tx) {
// After a successful start the receiver just sees the end.
let _ = init_tx.send(Err(e.clone()));
@@ -111,7 +111,7 @@ impl ScreenCapture for X11Capture {
x.region(&source)?;
let (tx, rx) = frame_channel(options.queue);
let use_shm = self.use_shm;
self.worker = Some(Worker::spawn("tsc-x11-capture", move |stop| {
self.worker = Some(Worker::spawn("voelin-x11-capture", move |stop| {
let mut grabber = Grabber::new(&x, use_shm);
let cursor = options.cursor && x.xfixes;
let started = Instant::now();
@@ -475,7 +475,7 @@ impl Grabber {
}
fn attach(x: &Display11, size: usize) -> Result<Segment> {
let fd = rustix::fs::memfd_create("tsc-x11-capture", rustix::fs::MemfdFlags::CLOEXEC)
let fd = rustix::fs::memfd_create("voelin-x11-capture", rustix::fs::MemfdFlags::CLOEXEC)
.map_err(|e| failed(format!("memfd_create: {e}")))?;
let file = std::fs::File::from(fd);
file.set_len(size as u64)?;
File renamed without changes.
@@ -386,13 +386,14 @@ mod tests {
assert!(matches!(err, Error::CodecUnavailable { codec: Codec::H264, .. }), "{err}");
assert!(err.to_string().contains("not found"), "{err}");
let dir = std::env::temp_dir().join(format!("tsc-media-h264-{}", std::process::id()));
let dir = std::env::temp_dir().join(format!("voelin-media-h264-{}", std::process::id()));
assert!(OpenH264::find_in(&dir).is_err());
}
#[test]
fn unknown_file_is_rejected() {
let dir = std::env::temp_dir().join(format!("tsc-media-h264-bad-{}", std::process::id()));
let dir =
std::env::temp_dir().join(format!("voelin-media-h264-bad-{}", std::process::id()));
std::fs::create_dir_all(&dir).unwrap();
let fake = dir.join(platform_library_name().unwrap_or("libopenh264.so"));
std::fs::write(&fake, b"not a library").unwrap();
File renamed without changes.
@@ -8,7 +8,7 @@
//! VP9 and H.264 (`c2.android.*`).
//!
//! H.264 is encoded as High profile without B-frames (the Constrained High
//! stream TeamSpeak negotiates, see `tsc-stream`), SPS/PPS in front of every
//! stream TeamSpeak negotiates, see `voelin-stream`), SPS/PPS in front of every
//! keyframe.
// AMediaCodec handles are used from one thread at a time (`&mut self`), which
@@ -162,7 +162,7 @@ impl EncoderConfig {
}
}
/// One encoded frame, ready for `tsc_stream::Peer::write`.
/// One encoded frame, ready for `voelin_stream::Peer::write`.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct EncodedFrame {
pub data: Vec<u8>,
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -15,7 +15,7 @@
//! plus WASAPI loopback on Windows
//! - [`queue`]: the bounded, drop-oldest channel capture backends deliver on
//!
//! Encoded frames go to `tsc_stream::Peer::write` with an RTP time of
//! Encoded frames go to `voelin_stream::Peer::write` with an RTP time of
//! [`EncodedFrame::pts_90khz`] (90 kHz clock); received `MediaFrame`s go to
//! [`VideoDecoder::decode`].
File renamed without changes.
@@ -3,8 +3,8 @@
use std::time::Duration;
use tsc_media::capture::synthetic::{BACKGROUND, RECT_COLOR, SyntheticScreen, TEXT_COLOR};
use tsc_media::{
use voelin_media::capture::synthetic::{BACKGROUND, RECT_COLOR, SyntheticScreen, TEXT_COLOR};
use voelin_media::{
CaptureOptions, Codec, Codecs, EncoderBackend, EncoderConfig, ScreenCapture, SourceId,
VideoFrame, convert,
};
@@ -1,16 +1,16 @@
//! H.264 through Cisco's OpenH264, loaded at runtime.
//!
//! Without the library only the "unavailable" paths run. To test encoding
//! and decoding, point `TSC_OPENH264_LIB` at Cisco's library (for example the
//! and decoding, point `VOELIN_OPENH264_LIB` at Cisco's library (for example the
//! file the ignored `download_and_roundtrip` test fetches:
//! `cargo test -p tsc-media --test openh264 -- --ignored`).
//! `cargo test -p voelin-media --test openh264 -- --ignored`).
#![cfg(feature = "openh264")]
use std::path::PathBuf;
use tsc_media::capture::synthetic::{RECT_COLOR, SyntheticScreen};
use tsc_media::codec::h264::{H264Profile, OpenH264};
use tsc_media::{
use voelin_media::capture::synthetic::{RECT_COLOR, SyntheticScreen};
use voelin_media::codec::h264::{H264Profile, OpenH264};
use voelin_media::{
Codec, Codecs, EncoderBackend, EncoderConfig, Error, VideoEncoder, VideoFrame, convert,
};
@@ -100,8 +100,8 @@ fn roundtrip(library: OpenH264) {
#[test]
fn roundtrip_with_library_from_env() {
let Some(path) = std::env::var_os("TSC_OPENH264_LIB") else {
eprintln!("skipped: TSC_OPENH264_LIB is not set");
let Some(path) = std::env::var_os("VOELIN_OPENH264_LIB") else {
eprintln!("skipped: VOELIN_OPENH264_LIB is not set");
return;
};
roundtrip(OpenH264::load(PathBuf::from(path)).unwrap());
@@ -112,14 +112,14 @@ fn roundtrip_with_library_from_env() {
#[tokio::test]
#[ignore = "downloads from ciscobinary.openh264.org"]
async fn download_and_roundtrip() {
if tsc_media::codec::h264::platform_library_name().is_none() {
if voelin_media::codec::h264::platform_library_name().is_none() {
return;
}
let dir = std::env::temp_dir().join(format!("tsc-media-openh264-{}", std::process::id()));
let library = tsc_media::codec::h264::download_openh264(&dir).await.unwrap();
let dir = std::env::temp_dir().join(format!("voelin-media-openh264-{}", std::process::id()));
let library = voelin_media::codec::h264::download_openh264(&dir).await.unwrap();
assert!(library.path().starts_with(&dir));
// A second call reuses the verified file.
let again = tsc_media::codec::h264::download_openh264(&dir).await.unwrap();
let again = voelin_media::codec::h264::download_openh264(&dir).await.unwrap();
assert_eq!(again, library);
tokio::task::spawn_blocking(move || roundtrip(library)).await.unwrap();
std::fs::remove_dir_all(&dir).unwrap();
@@ -3,13 +3,13 @@
//! VP8 and back.
//!
//! Needs `DISPLAY` (e.g. `Xvfb :101 -screen 0 1280x720x24 & DISPLAY=:101
//! cargo test -p tsc-media --test x11_capture`); skipped without it.
//! cargo test -p voelin-media --test x11_capture`); skipped without it.
#![cfg(all(target_os = "linux", feature = "x11", feature = "vpx"))]
use std::time::Duration;
use tsc_media::capture::x11::X11Capture;
use tsc_media::{
use voelin_media::capture::x11::X11Capture;
use voelin_media::{
CaptureOptions, Codec, Codecs, EncoderConfig, FrameReceiver, ScreenCapture, SourceId,
VideoFrame, convert,
};
@@ -20,7 +20,7 @@ use x11rb::protocol::xproto::{
use x11rb::rust_connection::RustConnection;
use x11rb::wrapper::ConnectionExt as _;
const TITLE: &str = "tsc-media-x11-test";
const TITLE: &str = "voelin-media-x11-test";
const BACKGROUND: u32 = 0x202020;
const WINDOW: u32 = 0x3060c0;
const INNER: u32 = 0xf08020;
@@ -1,5 +1,5 @@
[package]
name = "tsc-model"
name = "voelin-model"
version = "0.1.0"
description = "UI-facing domain model shared by the client engine, gateway and UI (no IO)."
edition.workspace = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 197 files, more files were not shown because too many files have changed in this diff. Show more