Commit Graph
168 Commits
Author SHA1 Message Date
selikhovandClaude Opus 5 381a46bb11 Merge identity import from the official TeamSpeak clients
Identities live in the ProtobufItems table of both the TeamSpeak 3 and
6 client databases, as the TS3 export string inside a typed item.
Voelin reads those databases read-only and immutable, imports .ini
exports and both clients' stores, skips duplicates by unique id, and
exports back to the .ini form so identities are never trapped here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-29 18:38:04 +03:00
faumarayandClaude Opus 5 f89d4ac1c8 Say in docs/identity.md what import actually does and does not
The format description was written before the code; bring it in line with what
shipped, and be explicit about the two costs a reader would otherwise discover
the hard way: `immutable` means an identity the running client has not yet
checkpointed is not seen, and the Qt secrets file path is best-effort because
no such file existed to develop against.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-29 18:35:08 +03:00
faumarayandClaude Opus 5 04a8005679 Add voelinctl identity import, export and list
Import and export have to be reachable before the Profiles screen exists, and
a headless command is also how the round trip gets tested against a real
client installation without any of its data entering the repository.

The listing prints nothing but the nickname, the unique id and the security
level: all three are public — servers see them — while everything else in an
identity is the private key. `--dry-run` reads and stores nothing. `list`
comes along because `export <id>` is unusable without a way to learn the id.

Prove the imported key pair is whole rather than merely parseable: the
clients' format carries the public point next to the private scalar and
`Identity` keeps only the scalar, so signing a nonce and verifying it with the
key derived from that scalar shows the two halves belong together. The same
check runs over a real database when `VOELIN_IDENTITY_IMPORT_CHECK` points at
one, which keeps that verification repeatable without committing a fixture
that could only come from someone's own identities.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-29 18:34:13 +03:00
faumarayandClaude Opus 5 98c3f98526 Import identities from the official clients
Switching to Voelin should not mean starting over on every server: the unique
id is the key pair, and a user who cannot bring it along loses every server
group they have. So read the forms the official clients keep it in — the
TeamSpeak 3 `.ini` export, the `ProtobufItems` items both clients write, and
the older `Identities/<n>/…` rows — and store them through voelin-store,
skipping unique ids the store already has instead of adding a second copy.

Export back to the `.ini` form in the same module: an importer without an
exporter traps people here, which is the thing being fixed.

The clients' databases hold private keys and may be open in a running client,
so they are opened read-only and `immutable`: no lock, no shared-memory file,
no write-ahead log replay, nothing of the user's changed to read it. The cost
is that an identity written but not yet checkpointed is not seen, which is the
right way round.

Three field numbers do not earn a protobuf dependency; the wire reader is
twenty lines and skips what it does not understand. An item is taken as an
identity only when its declared type says so, never because a field number
happens to match.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-29 13:44:41 +03:00
faumarayandClaude Opus 5 06a33a18c3 Describe where TeamSpeak keeps identities
Both official clients store identities in a `ProtobufItems` table of their
`settings.db`, not in the settings rows: one protobuf item per object, the item
type in field 6 selecting which payload field carries the body, and type 1
(field 17) holding the TeamSpeak 3 export string plus a nickname. Working that
out is the prerequisite for importing, so write it down before the code.

The myTeamSpeak account record sits in the same database and is easy to mistake
for an identity store; note that it carries no key pair and that the account
service stays out of scope, so the question is not reopened.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-29 13:36:40 +03:00
Claude 5b36e27809 Merge video encoders through FFmpeg loaded at runtime
H.264, HEVC, AV1, VP9 and VP8 on VA-API, NVENC, Quick Sync, AMF, Media
Foundation, VideoToolbox and the software encoders the system FFmpeg
has, found at runtime without a version allow-list and self-tested per
backend. Viewers get the codec they answered, with one encoder per codec
only while someone needs it, and H.264's level follows the stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 06:11:26 +00:00
Claude d77a0cdda2 voelin-core: load contacts before handling the next command
The contacts read from the database replaced the list in memory when the
read finished on the writer thread. A SetContact handled meanwhile was
lost (its write was queued behind the read), which made
contacts_are_kept_in_the_database fail under load. The engine now awaits
the read at start and after AttachHistory before its next command.

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 d044da787e 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 991717f172 voelin-media: drop a needless mut in the FFmpeg bitrate test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:23:35 +00:00
Claude b8c8bc4aae 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 0924cfcc82 voelin-media: bitrate increases reach encoders that cannot change it running
VA-API, AMF, SVT-AV1 and the other wrappers without a live bitrate change
applied a new target only at the next keyframe, so a still screen kept
the bandwidth estimate's low start value for good. An increase of half or
more now reopens the session (a keyframe) once it is five seconds old;
smaller ones still wait for a keyframe, drops below half apply at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:13:44 +00:00
Claude 0844d35411 voelin-core: live test of a viewer that answers another codec
Against the TeamSpeak 6 dev server: the streamer offers VP9 (its stream
codec) and VP8, a viewer that decodes only VP8 answers VP8 and decodes
pictures from the encoder made for it, and the VP9 encoder, wanted by
nobody, idles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:12:15 +00:00
Claude 51be688631 docs: FFmpeg encoders, per-viewer codecs, how to install FFmpeg
docs/media.md: how FFmpeg is found (VOELIN_FFMPEG_DIR, VOELIN_FFMPEG,
any major version), which struct fields are read and how they are
checked, the backends and their realtime settings, runtime bitrate and
size changes, buffers, what is zero-copy and what is missing (the GPU
colour conversion), installing FFmpeg per OS, the offer with several
codecs and an encoder per codec viewers chose, the computed H.264 level,
the new API, voelinctl, licenses and what was tested how.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:10:26 +00:00
Claude cd1ccff6d1 voelin-media: DMA-BUF import into VA-API encoders, up to the GPU conversion
FfmpegEncoder::encode_dmabuf maps a DRM PRIME frame onto a VA-API surface
(av_hwframe_map) that the encoder reads without a copy. It needs
AVFrame.buf[0] and AVFrame.hw_frames_ctx, which have no accessor: their
offsets come from a table per libavutil major, buf[0] is checked on a
real frame at load and hw_frames_ctx on the encoder's first surface.
Only NV12 buffers are taken: screen capture delivers RGB, which needs a
colour conversion on the GPU (VA-API video processing) that is not
implemented; anything else is refused as unavailable so the caller maps
the buffer as before.

On the capture side, FrameSink::accepts_dmabuf / dmabuf let the portal
hand a buffer over before mapping it (and pass tiled ones through). No
sink accepts yet, and the portal still negotiates LINEAR buffers only.

The encoder ends its stream when dropped (SVT-AV1 logs an error
otherwise).

Untested on a GPU: this machine has no render node.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 01:02:36 +00:00
Claude 60a5ff7a68 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 05b8e4a143 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 2883ad712a 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 3ae804569a voelinctl: list the video encoders, bench and stream with any of them
`voelinctl stream encoders` prints the FFmpeg libraries found, every
encoder backend with its self-test result or why it cannot be used, and
the order the streamer tries them in (--encoder / --no-hardware rank as
the settings would). `stream bench` and `stream start` take --encoder,
--no-hardware and a --codec that defaults to the named encoder's codec
or the choice's first; they print the backend in use. `stream start`
feeds a FrameSource, which does not tell codecs apart, so it offers its
stream codec alone; with the test pattern the H.264 level follows its
size, rate and bitrate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:56:41 +00:00
Claude 9db2a5a3b7 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 aefe83d33a 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 e10c5ba7f4 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 dd8b628909 Merge the audio mixer (86db9c5) into the FFmpeg encoders branch
Both add to StreamerConfig, the reconfigure docs and the imports of core
media.rs and the UI's video.rs; kept both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:39:15 +00:00
Claude 64775cd868 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 40f6bb4ca6 Encode each layer once per codec its viewers chose (WIP)
Offers list the stream codec first, then the codecs of hardware encoders,
VP8 through libvpx and HEVC last; software encoders other than VP8 are
only ever the stream codec, so no answer starts an expensive one. The
streamer's peer reports the codec each answer chose, the session sends
video only to viewers of its codec and tells the encoders through
LayerFeedback which codecs are needed. Each layer's encoder thread keeps
one encoder per such codec, made when a viewer needs it and dropped when
none does; the stream codec is skipped while nobody takes it.

The H.264 profile-level-id is computed from macroblocks per second, frame
size and bitrate (Table A-1), at least 3.1 as before. Streamer takes an
encoder preference (hardware on/off, auto / software / a named backend)
that reconfigure can change live. HEVC is negotiable (str0m packetizes
it) and only offered when a hardware encoder has it.

Work in progress: committed early so it cannot be lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-29 00:33:16 +00:00
Claude f24da42aab 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 86db9c579e 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 d3594c924d 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 1b1d662fef voelin-media: test FFmpeg encoders end to end, fix what that found
The self-test and a roundtrip through our own decoders (OpenH264 for
H.264, dav1d for AV1) run for every FFmpeg software encoder present:
x264, SVT-AV1, rav1e and libaom all decode above 28 dB PSNR with the
keyframes where they were asked for.

Fixes: SVT-AV1 takes CBR from rc=2 and rejects a maximum rate equal to
the target; rav1e refuses a keyframe interval of 2^30 and holds about 20
frames even in low-latency mode, so it is only used when named; a new
session flushes the old one so delayed frames are not lost; the first
packet of a session counts as a keyframe; FFmpeg's log lines go to the
encoder they are about when backends are tested in parallel.

Codecs::builtin() gives the compiled-in codecs alone, for tests that
check libvpx or OpenH264 specifically.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:30:29 +00:00
Claude 1eb3c5ecd5 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 7e75a3be70 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 c51a97268e 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 7569e5a009 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 2e034bc7b5 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 cc3afd3dbc 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 4b008f7650 voelin-media: load FFmpeg at runtime for more video encoders (WIP)
Hardware encoders (VA-API, NVENC, Quick Sync, AMF, Media Foundation,
VideoToolbox) and more software ones (x264, OpenH264, SVT-AV1, rav1e,
libaom) through whatever FFmpeg is installed, found with libloading and
never linked. Codec settings go through AVOptions only; the few struct
fields without an accessor are located and checked at runtime, so any
major version with a matching layout works. Each backend encodes one
test frame at startup and is skipped with a reason if that fails.

Codecs gains an encoder preference (hardware on/off, auto / software /
a named backend) and a report of every backend for the UI. Codec gets
H265 for peers that negotiate HEVC.

Work in progress: committed early so it cannot be lost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-28 19:15:38 +00:00
Claude 06c0dcc851 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 caaaf8baa3 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 733f075515 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 7cc4b359c6 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 5932e9e66d 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 5bdee01439 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 d4fd2f0318 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 39b8fab1f8 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 f42a7c8736 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 9f344c3882 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 9953807f3f 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 cf87382997 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 d4b2cab80c 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 49d7e38ab8 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 e5ca83083c 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