Commit Graph
2 Commits
Author SHA1 Message Date
isaacandClaude Opus 4.7 3160270a35 ReferenceImpl: real audio levels via per-receiver PCM sink
Replace GroupInstanceReferenceImpl's hardcoded 0.1 synthetic
audio level (reported for every known SSRC, regardless of whether
the participant was actually producing audio) with a real
peak-amplitude reading per remote receiver.

Implementation:
- New GRAudioLevelSink (webrtc::AudioTrackSinkInterface)
  attached to each remote audio track after onRenegotiationComplete
  via the new wireRemoteAudioLevelSinks(). Tracks per-window peak
  amplitude in PCM, normalized to RFC 6464's "0 dBov = full-scale
  sine wave" reference (peak / (32768/sqrt(2))) so the value is
  comparable to CustomImpl's pow(10, -dbov/20) reading.
- pollAudioLevels() now reads consumeLevel() from each sink and
  skips entries whose sink has produced no samples since the last
  poll, eliminating phantom level entries for known-but-silent
  SSRCs.
- buildRemoteAnswer() now includes the remote SSRC on each
  recvonly audio m-line. Without a signaled SSRC the
  AudioRtpReceiver calls SetDefaultRawAudioSink and only one of N
  transceivers' RemoteAudioSource ever receives PCM (the rest stay
  silent and our sinks never fire). MID is excluded from audio
  m-lines, so BUNDLE demuxes by SSRC.
- Result for a 3000-amplitude sine through Opus: ~0.126, matching
  CustomImpl's reading.

Test infrastructure (CLI):
- New --mute-participants <ids> flag (comma-separated participant
  IDs) keeps a participant muted after join.
- ParticipantState gains a per-source-SSRC max-level map.
- validateGroupState enforces: no peer may report a muted
  participant's SSRC at level >= 0.05. The relaxed audio-received
  check applies only to unmuted participants.

This is a pre-requisite for the upcoming SSRC-discovery work
(per-receiver level sinks must already exist before
onRenegotiationComplete starts wiring them up for tap-discovered
SSRCs).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 10:44:21 +02:00
isaacandClaude Opus 4.7 aaa583f1a9 feat: add testbench (CLI tool, Go SFU, Dockerfile, docs)
Brings the testbench source into the submodule:
- tools/cli/ — C++ CLI test tool (P2P, reflector, group, group-churn modes)
- tools/go_sfu/ — Go/Pion SFU library, c-archive linked into tgcalls_cli
- Dockerfile — multi-stage Linux container build
- CLAUDE.md (top-level), tools/cli/CLAUDE.md, tools/go_sfu/CLAUDE.md — docs

Bazel build glue (.bazelrc, MODULE.bazel, third-party BUILD edits, tgcalls_core
target) remains in the outer repo since the dependency stack lives there;
labels and paths in this repo reference the outer-repo workspace root.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 19:00:55 +02:00