Files
VoelinClient/tests/interop/README.md
T
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

47 lines
2.7 KiB
Markdown

# Browser interop test
`crates/voelin-stream/tests/browser_interop.rs` checks our str0m peers against
the WebRTC stack of Chromium (libwebrtc, the same stack as the official
TeamSpeak 6 client). `browser-peer.cjs` runs headless Chromium through
Playwright and exchanges SDP and candidates with the Rust test as JSON lines
on stdin/stdout. No TeamSpeak server is involved.
| Test | What it checks |
|---|---|
| `rust_streams_to_browser` | Our streamer offer (`PeerConfig::loopback()`, VP8 + Opus) answered by an `RTCPeerConnection`; `SyntheticSource` media for 3 s; `inbound-rtp` stats: VP8 packets and bytes, decoded frames (the synthetic frames are real 1x1 VP8 keyframes), Opus packets |
| `browser_streams_to_rust` | Chromium offers a canvas `captureStream` and an oscillator with VP8, VP9, H264 and AV1 preferred in turn (codecs the browser cannot send are skipped); our viewer `Peer::answer` must receive frames of that codec and Opus. VP8 also uses trickled browser candidates and checks that a PLI brings a keyframe |
| `trickled_candidates_reach_browser` | A server-reflexive candidate (from a fake STUN server) as our sessions trickle it (`iceCandidate` signal with the peer's mid) is accepted by `addIceCandidate` |
## Running
Needs Node.js with Playwright and its Chromium (`npx playwright install
chromium` on a new machine; `PLAYWRIGHT_BROWSERS_PATH` if the browsers live
elsewhere).
```sh
VOELIN_INTEROP=1 cargo test -p voelin-stream --test browser_interop -- --nocapture
```
Without `VOELIN_INTEROP=1` the tests return immediately, so `cargo test` passes on
machines without a browser. `VOELIN_NODE` selects the node binary; `NODE_PATH`
defaults to `npm root -g` so a global Playwright is found.
Chromium is started with `--disable-features=WebRtcHideLocalIpsWithMdns`:
without camera/microphone permission it would hide host candidates behind
mDNS names (`<uuid>.local`), which str0m cannot resolve. The official client
may do the same; see `docs/protocol-notes/ts6-streaming.md`.
## Findings
- Chromium 141 (Playwright 1.56) connects to a str0m peer on 127.0.0.1 from its
own host candidate on the primary interface; it gathers no loopback candidates.
- str0m's answer lists codecs in its own configured order, and the offerer
sends the first one. `Peer::answer` therefore configures the viewer's codecs
in the order of the offer (`accept_video_codecs` filters them).
- `Peer::write` sends on the first negotiated payload type of a kind, so a
streamer offers only the codecs its encoder produces (`video_codecs`,
default VP8 only).
- str0m mids are random strings (`a=mid:fhs`), not `0`/`1`; trickled
candidates must carry the real mid, or browsers reject them.
- Playwright's Chromium build sends VP8, VP9 and AV1, not H.264.