Commit Graph
6 Commits
Author SHA1 Message Date
selikhovandClaude Opus 5.5 e7af3bd685 Resolve mDNS host candidates
Browsers and other libwebrtc builds hide their host addresses behind
mDNS names (<uuid>.local) unless they have camera or microphone
permission; the official client may do the same. str0m takes only IP
addresses, so such candidates were dropped (in the SDP silently, trickled
with a debug line), and a LAN connection worked only if the hiding side
happened to start the checks.

Candidates with an mDNS name, in a remote offer or answer or trickled,
are now resolved in the background by a multicast DNS query
(voelin_stream::mdns) and added as plain candidates; ICE takes whichever
pair works. The query goes out from port 5353, shared with the system's
responder, because Chromium's responder ignores queries from other ports
(tried: none answered from an ephemeral port, every one from 5353); where
5353 cannot be shared it goes out from a port of our own.

browser_mdns_candidates_connect runs headless Chromium with the names on
and keeps our candidates from it, so it cannot start the checks: both as
streamer and as viewer the connection comes up and the media flows (with
resolution switched off for a control run it timed out).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 23:21:45 +03:00
selikhovandClaude Opus 5.5 379eeb355f Answer a streamer's new offer on the running connection
Watching a stream from the official client failed. Its log shows why:
after our answer it decided our codec choice did not suit it ("remote peer
is using unsupported codec, realign") and sent a new offer on the same
connection, a renegotiation. Voelin answered every offer with a new peer:
new ICE credentials, new DTLS fingerprint (the official client logged both
answers, they differ), so the connection the official client kept using
was gone and no picture came.

- `Peer::renegotiate` answers a new offer on the running peer (str0m
  `accept_offer` on the same Rtc): same ICE credentials and fingerprint.
- The viewer uses it for an `offer` signal while it has a connection; a
  `reconnectOffer` still starts a new one.
- str0m answers a renegotiation in the codec order the connection was
  built with, so a streamer re-offering another codec first kept sending
  the old one; `order_like_offer` puts the answer's payload types in the
  new offer's order.

Tests: a unit test (a str0m offerer adds audio in a new offer; same ICE
credentials and fingerprint, audio answered) and the order helper; the
browser interop test `browser_renegotiates_with_rust` (Chromium streams
VP8, re-offers VP9 on the same connection, VP9 frames arrive), passing
with Chromium 152.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 22:13:31 +03:00
selikhovandClaude Opus 5.5 630ff848b2 Offer the codecs every TeamSpeak client decodes before H.264
The official client could not show a Voelin stream: its decoder was
libwebrtc's NullVideoDecoder. Its log says why. On a machine with a
hardware H.264 encoder our offer put H.264 first, with every H.264
variant str0m knows; the client answered H.264 42e01f, then had no
decoder for it, because it decodes H.264 only with an OpenH264 library it
downloads at start-up, and that download failed (HTTP 403). Its SDP
capabilities list H.264 either way. VP8, VP9 and AV1 it always decodes:
FFmpeg's decoders, dav1d and libaom are built into it.

- The hardware encoder order, the automatic stream codec
  (`preferred_codec`) and the offer (`offer_codecs`) now put the codecs
  every client decodes (`decoded_everywhere`: AV1, VP9, VP8) before
  H.264, HEVC last. A viewer answers with the first codec of the offer it
  lists, so official clients take one they can decode; H.264 stays
  offered for peers that want it, and `stream.codec` can still choose it
  (its description now says what that means for official clients).
- A streamer offers H.264 only as it encodes it (Constrained High,
  packetization mode 1), not str0m's other variants, which let a viewer
  answer a profile, or packetization mode 0, we never send. Viewers still
  accept every variant.

Tests: `crates/voelin-core/tests/browser_codecs.rs` (VOELIN_INTEROP=1)
streams the test pattern through every encoder this machine has, VA-API
also from DMA-BUFs, to headless Chromium's libwebrtc: VA-API H.264 and
AV1, libvpx VP8 and VP9, x264, SVT-AV1 and libaom all decode at
1280x720. A second test makes the offer a share makes here
([AV1, VP8, H264, H265]) and checks the browser picks and decodes a
codec every client decodes. The browser driver now takes playwright-core
with a system Chromium (VOELIN_CHROMIUM), which decodes H.264, and the
interop tests accept Chromium 152's name for the SRTP cipher. The
official client itself could not be run here (its beta needs a
myTeamSpeak sign-in on first start).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:50:37 +03:00
Claude 7b376b4050 Browser interop checks the SRTP cipher; docs on SRTP, BWE and simulcast
The interop test now reads the transport's getStats() and requires
srtpCipher AES_CM_128_HMAC_SHA1_80 in both directions, and bandwidth
estimates from Chromium's transport-cc feedback. The docs describe the SRTP
profile order, the bandwidth estimation and the simulcast layers of our
stream, and the findings with Chromium 141.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-27 03:58:29 +00:00
Claude e050148a32 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
2026-09-26 21:11:17 +00:00
Claude 23fbbf0221 tsc-stream: interop with Chromium's WebRTC stack, codec order fixes
tests/interop/browser-peer.cjs runs headless Chromium (Playwright) as the
remote peer; crates/tsc-stream/tests/browser_interop.rs (TSC_INTEROP=1)
exchanges SDP with it over stdin/stdout:

- our loopback streamer offer (VP8 + Opus) answered by Chromium: packets,
  bytes and decoded frames of the synthetic VP8 keyframes, Opus packets
- Chromium offers canvas video + oscillator audio with VP8, VP9, H264 and
  AV1 preferred in turn; our viewer peer receives that codec and Opus,
  with trickled browser candidates and a keyframe after a PLI
- a server-reflexive candidate (fake STUN server) trickled with the
  peer's mid is accepted by addIceCandidate

Fixes found on the way:
- the viewer's answer followed str0m's codec order, so the streamer's
  preference was ignored; the answer now keeps the offer's order
  (accept_video_codecs filters it)
- streamers offered VP8 and H264 by default while frames are sent on the
  first negotiated payload type: offer only VP8 by default
- H.264 offers include Constrained High (640c1f), reportedly the only
  profile the TeamSpeak client decodes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
2026-09-25 19:56:58 +00:00