Commit Graph
151 Commits
Author SHA1 Message Date
Claude 628bc11a04 Merge files, avatars, pokes, offline messages and contacts in the engine
Channel files with streamed transfers, avatars and icons in a bounded
cache, file links in chat, pokes, private messages to anyone, TS3/TS6
offline messages, server details and groups, and a contacts table that
drives friends' presence, blocking and the friends stream permission.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:41:47 +00:00
Claude 69312656f2 voelin-ui: keep avatars and icons next to the database on Android
The engine caches avatars and icons in the platform's cache directory,
which Android does not have (it would resolve to a relative path). A
host that names the data directory gets the cache in <data>/images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:22:47 +00:00
Claude 71d51d1271 Merge the stream audio mixer into the engine gaps branch
settings.rs: both sides added built-in keys; the list keeps the stream
audio sources and adds the cache, file transfer and privacy keys (20).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:00:34 +00:00
Claude f60d06e367 docs: server details, files, avatars, messages and contacts
The architecture document describes what the engine now offers for the
new UI: client and server details and groups in the presence, channel
files and chat file links, the avatar and icon cache, pokes, private and
offline messages, and contacts with friends' presence and blocking, with
the protocol facts they rest on (avatar file names, icon ids, TS6 unique
ids for offline messages, the transfer port).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:57:41 +00:00
Claude 556c1d0278 voelin-core: engine tests for contacts and voice requests
Through the public API without a server: every request without a voice
connection is answered with its own id (FileList, Transfer, RequestDone,
OfflineMessages), and contacts set and removed are stored in the client
database, reported with FriendPresence and loaded again by an engine
that attaches the database later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:56:57 +00:00
Claude 7b2007ea89 it-smoke: files, avatars, pokes, messages and contacts through the engine
The engine's voice features get a round trip on both servers with
voelinctl engine: a 1.5 MB upload linked in channel chat and downloaded
from the link by another client (compared byte for byte), listed by a
guest and deleted; an avatar set by one client and fetched by another
(MD5 checked); poke, private message and offline message round trips
(offline messages go to the unique id the server knows, the TeamSpeak 6
one on TS6); a friend seen online; a blocked contact's poke flagged.
Nicknames carry the run's tag so leftovers of earlier runs cannot be hit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:54:55 +00:00
Claude 6dce4ee8e9 voelin-core: offline messages to the unique id's bytes; voelinctl checks
messageadd carries the recipient's unique id as bytes (base64 on the
wire); the engine passed the base64 text itself, which the server
refused as an invalid client id.

voelinctl engine can now wait for an icon or a flagged poke (listen
--expect matches pokes, chat and icons), for a friend to be seen online
(contacts ls --expect-online), and identity show prints the unique id a
TeamSpeak 6 server knows the identity by (uid6), which offline messages
there need. Contacts commands wait for the stored contacts to load
instead of for an event they could miss.

Verified against 3.13.8 and 6.0.0-beta13.1: file upload, listing,
download, a chat link downloaded by another client, avatars (the a-p
file name on both), channel icons, pokes, private messages, offline
messages, friend presence and blocked pokes (flagged and hidden).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:51:41 +00:00
Claude 43d3468e47 ts-bookkeeping: parse TeamSpeak 6 times in milliseconds
TeamSpeak 6 (6.0.0-beta13.1) sends the `datetime` of notifyfilelist in
milliseconds. The parser read it as seconds, failed on the out-of-range
date and dropped the whole message, so every file list came back
empty. Times from 10^11 on (year 5138 in seconds) are now taken as
milliseconds.

The TS6 dev server gets its own file transfer port (30034): clients
connect to the port the server announces, and 30033 on the host is the
TS3 server's, so transfers with TS6 went to the wrong server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:41:31 +00:00
Claude 817ef1549d voelinctl: engine subcommand for files, avatars, pokes and messages
Manual and smoke testing of the engine's voice features needs a driver:
`voelinctl engine <address> <action>` runs one engine voice session and
does files (ls, upload with an optional chat link, download, rm, mkdir,
mv), avatar (set, clear, wait for someone's and check its MD5), poke,
dm, offline (send, read with --expect and --delete), contacts (set, rm,
ls in --db) or listen (pokes, chat, file links, which it can download).
It prints one line per event and fails on errors or when time is up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:37:00 +00:00
Claude d28ecebe43 voelin-core: files, avatars, icons, pokes, offline messages, contacts
The new UI needs a channel file browser, avatars and icons, pokes,
direct messages to anyone, the offline message inbox and a friends list.
The voice connection can do all of it; the engine did not offer it.

Files (module files): ListFiles, DownloadFile (to disk as <path>.part,
renamed when complete, resumable, or into memory), DownloadChatFile for
a FileRef from a chat message, UploadFile, CancelTransfer, DeleteFiles,
RenameFile, CreateDirectory. Transfers stream in 64 KiB pieces and
report Requested/Started/Progress (files.progress_interval_ms)/Done/
Failed/Cancelled; requests and transfers carry an id the caller picks.

Avatars and icons are fetched by themselves (cache.fetch_images) into a
content-addressed disk cache (module cache: avatars by MD5, icons by id,
LRU bounded by cache.max_mb, 0 = no limit, use times kept as file times,
concurrent downloads of one file deduplicated across sessions) and
reported as AvatarReady / IconReady. SetAvatar uploads ours and
announces its hash, or removes it.

Pokes are a command and a distinct event (they were stored as private
messages before). A failing voice command (e.g. a private message to a
client who left) is now an error event instead of ending the connection.
Offline messages (module offline) list, read, send, delete and mark.

Contacts (module contacts) are engine-wide and stored in the client
database: SetContact / RemoveContact, ContactsChanged, FriendPresence
across all sessions, last seen time and server, per-person volume and
mute applied in every session, blocked authors flagged in chat and
their pokes and private messages hidden or flagged (privacy.block_mode),
and stream.permissions = friends lets friends watch without asking.

ServerDetails and Groups events report the server's details and groups
when they change. The book mapping moved to its own module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:50:39 +00:00
Claude ba69a4f62d Merge the stream audio mixer and application audio sources
Stream audio is mixed from any number of sources (desktop, chosen apps,
the shared window's app, the processed microphone), each with gain,
mute and meters, changeable while live. Desktop audio now leaves out
Voelin's own playback on Linux, Windows and Android.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:49:51 +00:00
Claude 29c70c824c voelin-core: live media test checks the mixed audio goes out
ts6_test_pattern_decoded checked only the decoded video. It now also
checks that the streamer sent at least 50 Opus frames of the mixed test
tone while the viewer decoded, and that no audio source reported an
error. Passes against the TeamSpeak 6 dev server (VOELIN_LIVE=1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:36:38 +00:00
Claude 8dcd631fab voelin-store: contacts table (schema version 3)
Home's friends list, blocking and per-person volume need a place for
people the user marked. Contacts are keyed by the client's unique id
(the same on every server) and carry a nickname hint, the relation
(friend, blocked, neutral), a note, mute and volume, when they were
added and when and where they were seen last.

Migration 3 adds the table; existing data stays. touch_contacts records
many sightings in one transaction and never moves last_seen back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:26:23 +00:00
Claude 757d7c6382 docs/media.md: stream audio sources, the mixer, application capture
A "Stream audio" section covers the source kinds, how the mixer
behaves (latency, underruns, drift, limiter, meters), the audio thread's
clock and RTP time, live reconfiguration and per-source errors, the
stream.audio_sources setting, and per platform how application audio is
captured (all but ours, one app, the app list). The PipeWire note no
longer says our voices reach viewers, the pipeline diagram and streamer
bullets name the mixer, and the verification table lists the new tests
and what is only type-checked (WASAPI) or only compiled (Android).

The link manager's module doc also covers the marker property used in
sandboxes and the skipping of loopback and filter outputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:25:57 +00:00
Claude c4dd3f564b android: playback capture of one app, or of every app but us
ScreenCaptureService now keeps any number of AudioPlaybackCapture
recordings by id instead of a single one. Each matches media, game and
unknown usages, and either the uid of one app (addMatchingUid) or every
uid but ours (excludeUid), so a shared screen no longer carries our own
voices and watched streams. Recording 0 still feeds
Native.onSystemAudio; the others feed Native.onAudioInput(id, ...), which
goes to the stream mixer's inputs.

Bridge gains startAudioInput(id, package or null), which maps the
package to its uid, plus stopAudioInput(id) and launchableApps(). The
manifest declares a launcher-intent <queries> so those apps and their
uids are visible on Android 11+.

Compiled with gradlew compileDebugKotlin. javap shows the JNI
signatures match crates/voelin-android/src/bridge.rs. Not run on a
device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:24:00 +00:00
Claude 888692466d tsclientlib: fail refused file transfers on their handle
A server refuses ftinitdownload/ftinitupload (file not found, missing
permission, quota) with an error for the command's return code. The
library turned that into a MessageResult whose handle the caller never
saw, so a refused transfer just hung. The pending transfer commands are
now remembered by return code and a refusal fails the transfer with
FiletransferFailed.

A server listening on all interfaces may announce 0.0.0.0 as the
transfer address; the server's own address is used then. The return
code and transfer id counters wrap instead of panicking on overflow in
debug builds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:22:05 +00:00
Claude dccfab2545 voelin-model: client and server details, groups, file links
The new UI shows avatars, descriptions, talk power, group badges, the
host banner and welcome message, and file cards in chat. The voice
connection's book has all of it; the model did not carry it.

ClientInfo gains the avatar hash, description, talk power, channel
group, badges, icon and flags; ChannelInfo its icon; Presence the
server's details (welcome and host message, banner, host button, icon,
unique id, platform, version) and its server and channel groups. The
voice source fills everything (talking from its own talk detection), the
query observer what its rows carry. New fields are optional on the wire,
so gateways and clients of either version understand each other.

ChatMessage gains a `blocked` flag that the engine sets for authors the
user blocked (never serialized), and `file_refs()`, which parses
`[URL=ts3file://...]` links into FileRefs; FileRef::to_bbcode writes one.
Capabilities tell whether the server offers file transfer and offline
messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:21:58 +00:00
Claude 746ab6abef voelin-android: playback captures into mixer inputs (Rust side)
PlaybackAudio implements AudioProvider::start_input / stop_input / apps:
each capture gets an id, its SourceInput is kept in the capture state,
and the Kotlin side is asked (Bridge.startAudioInput) to capture
everything but our uid or the uid of one app's package, delivering to
Native.onAudioInput(id, ...), which pushes into that input from a reused
per-thread buffer. An app picked by name is looked up among the
launchable apps (label or package) and falls back to the name as a
package. Picking by process fails on Android. apps() lists the
launchable apps (Bridge.launchableApps, "label<TAB>package" lines),
because Android cannot tell which apps play.

The Kotlin counterpart follows in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:20:19 +00:00
Claude 2c655048c0 voelin-core: stream audio mixed from any number of sources
The streamer captured one audio source (system audio, or a tone with the
test pattern), so viewers also heard the voices we play back, and there
was no choice of what to share.

StreamerConfig::audio_sources now takes any number of AudioSourceSpec
(kind, gain, mute): DesktopWithoutSelf, App(name or pid), WindowAudio
(the shared window's process, on X11 and Windows), Microphone (after
noise suppression, through the voelin-audio tap) and Synthetic. They feed
a StreamMixer whose thread encodes one Opus frame every 20 ms on the
monotonic clock, stamped with the block number, so the RTP time follows
real time across silences and stalls. Mixing goes on without a sink, so
source buffers keep moving.

StreamerConfigUpdate::audio_sources changes them live: kinds that stay
keep their capture and take the new gain and mute, new ones start,
removed ones stop, and an empty list leaves a silent track. A source that
cannot capture does not fail the stream; its error shows in
StreamerStats::audio_sources (with level, state, latency and underruns),
and in Streamer::audio_error, which now returns an owned String.
StreamerStats also carries the mix level and the limiter gain;
Streamer::audio_mixer gives the handle for lock-free meters, and
media::audio_apps lists the applications for a picker.

The settings key stream.audio_sources (JSON, default: desktop audio
without Voelin) stores the sources. The UI's share reads it, and an
empty list shares without sound. StreamAudio is boxed so a LocalPreview
held inline stays small.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 12:49:52 +00:00
Claude 1725b11f07 voelin-media: BlockClock::due returns the due block numbers
A block's number is the audio's position since the start, so a caller
can stamp RTP times with it. Previously a stall past max_behind restarted
the clock at block 1 and the count said nothing about where the audio
was. Now only the newest block is due after a stall, numbered by the
elapsed time, so timestamps keep following real time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 12:43:42 +00:00
Claude 897eec031d Merge chat history and the gateway's features in the engine
Chats show their stored history at once and sync what the gateway kept
while we were away; messages seen over voice and the gateway are
stored once. Pins, reactions, topics, events, the stream directory,
activity and gateway administration are engine commands and events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 12:37:29 +00:00
Claude 90d55bd4fa voelin-media: capture chosen applications' audio, and everything but ours
Screen-share audio took the default sink's monitor on Linux, so viewers
heard the TeamSpeak voices we play, and there was no way to share one
application's sound only.

capture::playback::start_playback(filter, source) now captures what
applications play into a mixer source, with PlaybackFilter::AllButSelf
(everything except our process and its descendants) or App(Pid | Name),
and audio_apps() lists the applications that play, updated live:

- Linux: a LinkManager (capture/pipewire_links.rs) watches the PipeWire
  registry for Stream/Output/Audio nodes and their clients, and links the
  output ports of every selected stream through the link-factory into a
  capture stream of ours that the session manager leaves unlinked
  (node.autoconnect = false). PipeWire sums the links, so one capture
  stream carries any number of applications; links follow streams as
  they come and go, and a restarted application is matched by name
  again. Our own streams are recognised by process id (node, client, or
  socket credentials; /proc parent chain); loopback and filter outputs
  (node.link-group) are skipped because their sources are captured
  directly. This depends on no session-manager policy, adds no sink,
  and leaves the user's routing and volumes alone.
- Windows: WASAPI process loopback per capture, exclude mode on our
  process tree for everything, include mode on the chosen process tree
  (for a name, one capture per matching audio session's process,
  matched again every two seconds); sessions of all playback devices
  for the list; the owner of an HWND for window audio. Only
  type-checked (x86_64-pc-windows-gnu).
- Platform providers (Android) get start_input / stop_input / apps.
- X11: window_pid() reads _NET_WM_PID, so a shared window's audio can be
  selected automatically.

tests/pipewire_apps.rs runs a private PipeWire, WirePlumber and D-Bus
(skipped without them) with two tone players in other processes and one
in ours, and checks by frequency that desktop audio has both players and
not us, that name and pid captures have only their application, that a
new player is linked live, a quit one dropped, and a restarted one
matched again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 07:55:00 +00:00
Claude f13b0a804a Merge the UI foundation: Voelin design system, desktop and phone shells
Theme tokens from the mockups, Inter, Lucide icons and Twemoji (with
their notices and About credits), a component library, desktop and
phone shells, today's screens re-skinned, view models and bindings
split out of app.rs, an image cache and live ui.* settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 07:53:58 +00:00
Claude 846f8e2f21 voelin-ui: build alone for Android with image support
The icons and emoji are SVG images, whose decoders Slint enables with a
backend. The Android app always brings the Android backend, but the UI
crate alone did not, so `cargo ndk clippy -p voelin-ui` failed; it now
asks for the same backend feature (no change to the app's build).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 07:41:48 +00:00
Claude b0be382f1a Cargo.lock: rtrb for voelin-media
The lock file entry for the stream mixer's ring buffers, left out of
the mixer commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 07:36:24 +00:00
Claude 0cebc10e3b voelin-core: remember a server's addresses with the gateway's id
When voice connected while the gateway was already up, the bookmark's
voice address was not remembered with the server's unique id, so a later
visit without the gateway could not show the stored history before the
voice connection was up. Addresses are now remembered with the key in
use (the gateway's) whichever source reports last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 03:01:30 +00:00
Claude 3cdf87b75e docs: the UI's structure, components and screenshots
docs/ui.md describes the new UI for later work: the file layout, theme
tokens, the component catalogue, how to add a screen, the appearance
settings, how emoji are drawn, and the development switches for
screenshots. The screenshots are new (sample data from VOELIN_DEMO_UI,
256 colours); the old ones showed the previous design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:58:20 +00:00
Claude c1e96ac607 Docs: chat history and the gateway's features in the engine
Architecture: how messages are stored and merged, what opening a chat and
paging back emit, the history settings, the gateway's requests and
updates in the engine, and the directory as a stream discovery source.
The protocol page points to the engine's mapping, the README and the
changelog mention chat history and voelinctl's engine mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:56:49 +00:00
Claude 1338a220b9 voelin-ui: fixes from the screenshots
The volume dialog of VOELIN_OPEN=client opens once our own client is
known (the state can come after the presence), scrolling pages keep
their content to the view's width (the phone home page scrolled
sideways), the sidebar grows with the text size, and the home page's
cards and banner fit narrow windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:56:25 +00:00
Claude 3a703559e9 voelin-audio: tap for the processed microphone
The screen share should be able to carry our microphone as one of its
audio sources, and it should be the processed signal (echo
cancellation, noise suppression, gain control) the voice connection
sends, not a second raw capture of the device.

voelin_audio::tap::microphone() is a publish point the voice pipeline
feeds with every processed chunk. Without consumers that costs one
relaxed atomic load per chunk. Consumers attach a TapSink and get the
chunks on the audio thread; the publisher never waits (a try-lock that
only contends with attach and detach). Several pipelines (one per
server, the microphone test) may run at once: the tap follows one until
it is silent for 200 ms. A muted microphone publishes silence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:56:17 +00:00
Claude 2203e8f840 voelinctl, it-smoke: chat history, gateway features and the stream directory through the engine
`voelinctl gateway --engine` runs one engine session against a gateway,
optionally with voice, and prints every history batch, gateway update
and stream event as a line: --chat opens chats (with --db, stored
history), --older pages back, --request sends any gateway request as
JSON (admin config, permission rules, events, ...), --roundtrip posts,
pins, reacts, starts a topic from the post, posts into it and reads it
back, --stream-seconds streams synthetic frames (registering in the
directory) and --watch-streamer watches a stream once found.

it-smoke adds three steps with the gateway running: messages sent while a
user is offline reach its stored history on the next connect (the admin
sets relay.pinned_channels at runtime for it); the pin/react/topic round
trip as a normal user with a permission rule the admin sets; and on
TeamSpeak 6 a stream registered in the directory found and watched by a
viewer that connects later. The gateway's port can be moved
(TSGW_PORT_TS3/TS6), and default builds go to $CARGO_TARGET_DIR.

A chat's first stored page is no longer marked complete while its
gateway is still connecting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:55:29 +00:00
Claude 6d90f270e6 voelin-media: stream mixer for any number of audio sources
The stream's audio will come from several captures at once (desktop
audio without our own voices, single apps, the microphone), each
delivering at its own pace, rate and channel count. StreamMixer mixes
them on the streamer's clock into 48 kHz stereo:

- every source has a gain, a mute and any number of inputs; an input is
  a lock-free single-producer ring (rtrb) that the capture thread fills,
  mapping channels to stereo as it pushes
- each input is held at a small fixed latency (more for bursty or late
  inputs), starts once that much is buffered, fades out and waits when
  it runs dry, and never holds up the other sources
- rate conversion is per-input cubic interpolation; clock drift is
  absorbed by resampling up to 0.5 % while the buffer is off its
  settled level, otherwise 48 kHz input is copied bit-exact
- a soft limiter on the sum keeps the output within full scale
- peak/RMS meters per source and for the output are atomics that the
  UI reads without locks
- buffers are sized when sources and inputs are created; mixing
  allocates nothing per block (checked by a counting-allocator test)

Includes unit tests and a Criterion bench (benches/mix.rs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:50:45 +00:00
Claude e13fc8d785 voelin-core: tests for chat history, gateway requests and the directory
A fake gateway (a WebSocket server speaking the tsgw protocol from
memory) drives the engine: the stored page then the gateway's latest page
on open, paging back through the gateway, messages and pin changes made
while away arriving on reconnect, the stored page found by the gateway's
URL after a restart with the gateway down, our own message stored once
with the gateway's copy, pins, reactions, topics, posts and refusals as
events, and chat.store_history off keeping the database empty. The
stream tasks show a late viewer finding a stream only the gateway
directory knows, and the streamer's reports for its directory entry; the
history writer answers batched writes in order.

The writer thread no longer joins itself when a job's callback drops the
last handle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:44:46 +00:00
Claude d8077e139a voelin-ui: standard widgets follow the app theme
Scroll bars and context menus come from the standard widgets, which
follow Palette.color-scheme. The window now sets it from ui.theme: dark
or light explicitly, and in "system" mode it leaves the palette tracking
the system (or, after an explicit mode, uses the scheme seen at start,
since the tracking binding cannot be restored).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:43:04 +00:00
Claude 8982e1375d voelin-core: chat history and the gateway's features in the engine
Chat lived only in the UI's memory. Every chat message a session sees
(voice, gateway pushes, query relays, our own sends) is now stored under
the server's unique id through a writer thread that batches writes, and
opening a chat or reconnecting emits the stored page at once, then syncs
with the gateway: the latest page on first contact, afterwards everything
past the chat's revision cursor, in pages of chat.history_page.
LoadOlderHistory pages back, merging the gateway's page for that range.
Copies of one message from different sources become one row, so the UI
upserts by local id (Event::ChatHistory).

The session's gateway now runs on the typed client, keeping presence and
relayed chat as they were, and takes Command::Gateway requests (pins,
reactions, topics and topic history, events with RSVP, the stream
directory, activity, permissions, runtime config and permission rules),
answered and pushed as Event::Gateway updates. It subscribes to events,
streams and activity when offered. Our own TeamSpeak 6 stream registers
itself in the directory when it goes live and leaves it when it ends, and
the directory's registered entries feed stream discovery (also as a
StreamLookup), so streams that started before we joined are found even
when the server's lookup does not answer.

The voice connection now reports the server's unique id (SHA-1 or SHA-256
of its key, per server generation) and ours, and files our own private
messages under the receiver. Settings: chat.store_history,
chat.history_page, chat.dedupe_tolerance_ms, chat.retention_days.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:38:32 +00:00
Claude a668364bb2 Notices for the bundled font, icons and emoji
cargo-about only sees crates, so the Inter font (OFL-1.1), the Lucide
icons (ISC, with the MIT notice of the icons from Feather) and the
Twemoji graphics (CC-BY 4.0) come from about-assets.md, which
scripts/notices.sh appends to its output; --check compares the whole
file as before. The About page credits them above the notices.

Also from the screenshots: a disabled primary button keeps its label
readable, badges size to their text, buttons and fields keep their
height in rows, the chat header shows the channel name without "#",
and the toast sits above the composer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:35:53 +00:00
Claude d2a6f97b5d voelin-store: chat history schema 2 with dedupe, paging and sync cursors
The messages table was a cache nobody used: second timestamps, no source,
no gateway ids. Chat history on open needs rows that carry the gateway's
stable id and metadata, one row per message however many sources
delivered it, pages by time and a cursor per chat for gateway sync.

Migration 2 adds ts_ms, source, remote_id (unique per server and chat),
topic_id, rev, sync_state, pinned, reactions, a seen_by source mask and a
text hash for dedupe, an index for paging by (ts_ms, id), chat_cursors
and server_aliases; old rows keep their data. Migrations now run each in
one immediate transaction, so two connections opening a fresh file at
the same time cannot both apply one.

write_messages stores a batch in one transaction with cached statements
and merges copies of the same message from different sources (gateway id,
else text without relay prefix, author and a time tolerance).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:22:53 +00:00
Claude e40bce40e8 voelin-ui: design system, shells and view models for the new design
The single 1700-line app.slint becomes a design system and screens that
later waves can compose:

- theme.slint: colour, radius, spacing and type tokens (dark and light,
  a runtime font scale); icons.slint: Lucide icons as tintable images.
- components/: Button, IconButton, TextField, SearchBox, Select, Toggle,
  Slider, SegmentedTabs, Avatar, badges, Card, Meter, NavItem, ListItem,
  PopupMenu, Tooltip, Modal, Toast, ResizeHandle, Spinner, RichText and
  the EmojiPicker.
- shells/: the desktop frame (server rail, top bar, sidebar with the user
  card) and the phone frame with a bottom navigation, switched at a
  breakpoint from the settings.
- screens/: today's screens re-skinned (channels, chat, streams panel and
  viewer, settings page, home, dialogs, phone pages); all callbacks and
  properties keep their behaviour. Navigation state is the Nav global.

On the Rust side app.rs keeps setup and event glue; servers.rs, chat.rs,
settings_page.rs and appearance.rs hold the logic, vm/ the pure view
models, bind/ the callbacks, dev.rs the development switches. Models are
created once and updated row by row (vm::list::sync); each chat tab owns
its lines model, so a message appends one row. Emoji come from the
bundled Twemoji archive through a size-bounded image cache, split into
runs that wrap with the text. New settings ui.theme, ui.font_scale,
ui.narrow_breakpoint and ui.image_cache_mb apply live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:22:25 +00:00
Claude b07c77bc5f Merge the faster screen-share pipeline
Capture, conversion and encoding on their own threads with latest-wins
handoffs and frame pools, one encoder per simulcast layer, portal
DMA-BUF, a wlroots capture backend, tuned libvpx, per-stage statistics,
Streamer::reconfigure and voelinctl stream bench. Conflicts: the root
manifest (dimpl patch next to the release profile) and voelinctl's
command list (probe-stream next to the stream tools).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 02:21:24 +00:00
Claude 45889adf0b docs/media.md: before/after numbers of the streaming pipeline
`voelinctl stream bench`, release builds (fat LTO), VP8, desktop test
pattern, one layer, 8 s, shared 4-core VM, before/after interleaved.
Before: the single-threaded allocating pipeline (a89ac5f). After: the
threaded pipeline (quiet column: ffc79e6; busy column: f6a4ae3).
fps sent / CPU cores / heap allocations per encoded frame:

            quiet (load 1-3)                    busy (load 6-12)
            before              after           before             after
  720p30    29.4/0.48/7.1   30.0/0.40/1.05     7.9/1.71/10.0     6.6/1.24/1.25
  720p60    14.7/2.37/10.2  60.0/0.69/1.03     4.6/1.23/19.1     6.4/1.28/1.25
  1080p30   29.6/0.83/7.1   30.0/0.75/1.05     2.7/1.30/17.4     6.9/1.27/1.24
  1080p60   57.2/1.47/7.1   53.7/1.42/1.03     2.4/1.33/31.4     5.7/1.40/1.28
  1440p30    8.4/2.26/9.7   22.7/1.71/1.07     1.9/1.31/22.6     5.5/1.26/1.30
  1440p60   52.5/2.24/7.2    3.2/2.02/1.50*    1.5/1.22/36.9     3.6/1.30/1.45

* libvpx with one thread per core collapsed when conversion competed for
  a core (290 ms per frame); f6a4ae3 leaves a core free.

On an idle machine (load < 1, earlier) the old pipeline reached
30/60/30/58/30/60 fps at 0.4-1.8 cores; the machine never got that
quiet again for an after run. Allocations per encoded frame: 7-37 before
(5-450 MB), about 1 after (the `Arc<[u8]>` of the encoded frame, 10-130
KB); zero on the capture -> convert -> scale -> encode path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 19:06:14 +00:00
Claude 456cafb1c7 Merge the gateway extension: pins, reactions, topics, events, stream directory, activity, runtime settings
tsgw keeps runtime-edited settings and permission rules in its database
(they win over --set, environment and tsgw.toml), migrates its database
in place, and serves the new features to clients that opt in; old
clients are unaffected. voelin-core gets a typed gateway client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 18:52:12 +00:00
Claude 91d69f1933 Docs: gateway runtime configuration, permission rules and protocol
gateway-admin.md explains bootstrap keys versus seeds, the precedence
(runtime > --set > environment > file > default), reloading, every key,
the admin commands, permission rules with their defaults and the data
the database keeps. The history retention default is now to keep
messages; the doc says how to get the old 30 days back.

gateway-protocol.md is the reference of tsgw.v1+json with the new
messages. The example config marks bootstrap keys and lists the seeds.
The systemd unit reloads with SIGHUP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 18:41:25 +00:00
Claude c84eaacbf5 voelin-core: typed gateway client for the new features
The engine's gateway module now builds on the typed client of
voelin-gateway-proto: connect() logs in with the user's TeamSpeak
identity and returns a GatewayClient with one async method per request
(history cursors, sync, post into topics, pins, reactions, topics,
events and RSVP, stream directory, activity, permissions, settings and
rules), capabilities() for hiding missing features, and typed Push
events. run() keeps its interface for the engine and uses the same
client; the UI and engine commands come later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 18:38:48 +00:00
Claude f6a4ae35e7 Encoders use all CPUs but one by default
libvpx's worker threads wait on each other by spinning. With one thread
per core, an encode slows down many times over as soon as anything else
wants a core: the capture and conversion of the next frame, another
layer, the desktop. The bench on a 4-core machine showed single frames
at 1080p and 1440p taking 130-290 ms with 4 threads under load, where the
same frames took 9-17 ms with 3 threads next to two other layers. The
default (`codec::encoder_cpus`) is now all CPUs but one, for single
encoders and for the streamer's split across layers; an explicit
`EncoderConfig::threads` still wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 18:38:33 +00:00
Claude 66b9ce444e voelin-ui: bundle Inter, Lucide icons and Twemoji
The new design needs a real UI font, a consistent icon set and colour
emoji. The software renderer cannot draw colour glyphs, so emoji become
images: scripts/pack-twemoji.py packs the 3720 Twemoji SVGs into 64 KiB
raw-deflate blocks with a sorted index and picker names (1.9 MB instead
of 17 MB of files), for decoding single emoji on demand.

Inter (OFL-1.1) and the Lucide icons used by the UI (ISC) are copied with
their licenses; the app mark is our own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 13:57:16 +00:00
Claude ed86de3283 tsgw: in-process tests against a fake ServerQuery server; fix relay race
The hub, observer, relays and sessions now run in tests against a fake
raw ServerQuery server, driven over a real WebSocket by the typed
client: chat with pins, reactions and topics (including the prefix in
TeamSpeak and topic posts from official clients), old clients still
getting chat_event, unknown message types answered without a
disconnect, events with RSVP and reminders, the stream directory
following presence and linking stream events, the activity feed, and
admin settings, permission rules, quotas and rate limits applied live.
An ignored test runs the same flows against a real server and tsgw.

The relay pump subscribed to a rebuilt pool 100 ms after the old one
closed, so channel chat in that gap was lost after a nickname change.
Each pool now gets its own pump, subscribed before it opens a relay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 13:56:05 +00:00
Claude ffc79e6835 libvpx speed control: no VP8 levels below 6, react to overload at once
The bench showed the adaptive `cpu-used` oscillating: with headroom at
-6 it stepped VP8 down to -5 and -4, which on screen content cost about
ten times the encode time for under 1 dB, the encoder fell behind, frames
were dropped, and it stepped back up. VP8 now stays within -10..-6. A
single frame that takes longer than the whole frame interval makes the
encoder faster at once, and when a slower level has to be undone, the
next attempt to go slower waits twice as long (up to 16x 15 frames).

The simulcast test also checks that `EncodedSource::set_layer_bitrate`
reaches exactly that layer's encoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 13:45:13 +00:00
Claude 6c6cd5b70f tsgw: runtime settings, versioned database, pins, reactions, topics, events, streams, activity
Settings: every key is in one registry with type, default and
description. Values resolve as database (set at runtime) > --set >
TSGW_<KEY> environment > tsgw.toml > default; query login, addresses
and the database path are bootstrap-only. Changes are published on a
watch channel and applied live (relay nickname rebuilds the relay pool,
pinned channels open, retention re-prunes, capabilities are pushed).
SIGHUP or a changed file reloads it; values set at runtime keep
winning and differing keys are logged. ConfigReset falls back.

Database: user_version migrations keep existing data. Messages get
AUTOINCREMENT ids (never reused after pruning), topic ids and
revisions for sync; new tables for reactions, pins, topics, events,
RSVPs, reminder bookkeeping, the stream directory, activity and
settings. WAL with synchronous=NORMAL, cached statements, batched
inserts, an index for every query path (checked with EXPLAIN QUERY
PLAN on 12k messages). Retention 0 keeps forever; pinned messages
are kept.

No built-in caps: history pages are unlimited unless an admin sets
quota.history_page; pins, topics, events, reactions and streams have
quotas that default to none.

Permission rules per action (by server and channel groups) live in the
settings, with TeamSpeak-permission defaults. The stream directory
follows presence (left, stopped streaming, moved) and lists streams
without a registration as detected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 13:44:49 +00:00
Claude 749171605c Gateway protocol: pins, reactions, topics, events, streams, activity, admin
The new Voelin UI needs Discord-like features that TeamSpeak does not
have. They run on tsgw, so the protocol grows, additively within v1:

- capabilities in hello (server-wide) and auth_ok (per user, with admin)
- query_history with before/after id and time cursors, optional limit,
  topic filter; sync by revision for new and changed messages
- post (optionally into a topic), pins, reactions with per-user counts,
  topics, scheduled events with RSVP and reminders, the stream directory,
  the activity feed, runtime configuration and permission rules
- history entries carry topic, reactions, pinned flag and revision;
  old clients ignore the extra fields

Old clients never see a new message type: extension pushes need enable
or a subscribe request. New error codes and enums have an unknown
fallback so older clients keep parsing newer gateways.

The optional client feature adds a typed client (request/answer by
envelope id, typed pushes), shared by the app engine and the gateway's
integration tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 13:33:11 +00:00
Claude af09a2031a Criterion benches for conversion and scaling; media docs
`cargo bench -p voelin-media --bench convert` times, at 720p, 1080p and
1440p of the desktop test pattern: the old allocating one-thread
`to_i420`, the `Converter` on one thread and on all cores, the pyramid
(full, half and quarter size), and luma scaling to half (2x2 box) and to
2/3 (area average). criterion 0.8 is already in the lock file (the proto
crates use it), Apache-2.0 OR MIT.

docs/media.md describes the threaded simulcast pipeline, reconfigure and
the stats, the capture sinks, portal DMA-BUFs, the wlroots backend, the
libvpx settings, how to benchmark, the allocation behaviour, the modules
with unsafe code, and the test status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 09:06:29 +00:00