fix(twin): mirror inbound trunk audio across the twin link
When an external PAIRED=1 peer transmits to a twin pair, it picks a single sticky socket per transmission and sends every frame on it. The sticky-selected twin's TrunkLink::handleMsgPeerAudio used to broadcast locally and to satellites but never relayed to the partner twin — so local clients on the non-sticky twin were deaf to the audio even though the talker state was mirrored correctly. The satellite-receive path already had the symmetric forwarder (forwardSatelliteRawAudioToTwin); the trunk path was just missing it. Add Reflector::forwardTrunkAudioToTwin and forwardTrunkFlushToTwin, modelled on the satellite variants, and invoke them from TrunkLink::handleMsgPeerAudio and handleMsgPeerFlush after the local + satellite broadcasts. Loop safety: TwinLink::handleMsgPeerAudio does not re-forward to trunks, so there is no echo back to the originating peer. Requires the external peer to use PAIRED=1 with both twin hostnames in a single section — two independent trunk sections would defeat the source-trunk exclusion at the external owner and cause duplicates/echo. The docs now flag PAIRED=1 as mandatory for this topology. Test: test_twin.py::test_X4_paired_inbound_reaches_both_twins drives a refa client on TG 26201 and asserts both ref1 and ref2 receive audio frames and flush. Also rewrite test_01_twin_handshake and test_05_twin_wiring_no_errors to read /status.twin instead of scraping a 120s docker-logs window — the previous form flaked when the mesh had been up long enough for boot-time log lines to scroll off.
This commit is contained in:
1 parent
ef42da52de
commit
6a6cfadd95
6 files changed
+215
-35
No files matched your search
+24
-2
@@ -180,8 +180,8 @@ holdoff.
|
||||
### External peer view
|
||||
|
||||
An external peer (e.g. refA) that wants to trunk with a twin pair
|
||||
declares a **single** `[TRUNK_x]` section with **multiple candidate
|
||||
hosts** — one per twin — and a `PAIRED=1` flag:
|
||||
**MUST** declare a **single** `[TRUNK_x]` section with **multiple
|
||||
candidate hosts** — one per twin — and a `PAIRED=1` flag:
|
||||
|
||||
```ini
|
||||
[TRUNK_IT_DE]
|
||||
@@ -197,6 +197,15 @@ them in parallel. This requires extending `TrunkLink` to manage a list
|
||||
of TCP endpoints instead of a single outbound + inbound pair (see
|
||||
§Implementation).
|
||||
|
||||
> **Do not configure two separate trunk sections (one per twin).** That
|
||||
> form is a misconfiguration: the external peer sees the pair as two
|
||||
> independent peers, so its owner-relay (`forwardTrunkAudioToOtherTrunks`)
|
||||
> only excludes the source twin and still forwards back to the partner
|
||||
> twin — which *also* receives the audio via the intra-pair twin-mirror
|
||||
> (`forwardTrunkAudioToTwin`). The result is a duplicate on the partner
|
||||
> and an echo back to the original talker. `PAIRED=1` is the only
|
||||
> supported topology for "external reflector ↔ twin pair".
|
||||
|
||||
### Sticky per-frame routing
|
||||
|
||||
The external peer picks **one socket at a time** for a given transmission
|
||||
@@ -227,6 +236,19 @@ from keying up 262xx, just as they would be if they were on the
|
||||
receiving twin. Loop suppression: a twin does not re-mirror external
|
||||
state it learned *via* the twin link.
|
||||
|
||||
### Cross-twin external audio relay
|
||||
|
||||
State alone is not enough — the partner twin's local clients must also
|
||||
*hear* the inbound audio. `TrunkLink::handleMsgPeerAudio` therefore
|
||||
forwards the audio across the twin link via
|
||||
`Reflector::forwardTrunkAudioToTwin` (same shape as the existing
|
||||
satellite-to-twin mirror), reusing `MsgPeerAudio` on the [TWIN] socket.
|
||||
`TrunkLink::handleMsgPeerFlush` mirrors the matching flush. The
|
||||
receiving partner's `TwinLink::handleMsgPeerAudio` broadcasts to its
|
||||
local clients on the TG and fans the audio out to its own satellites;
|
||||
it does *not* re-forward to trunk peers, so there is no echo back to
|
||||
refA.
|
||||
|
||||
### refA-side socket selection policy
|
||||
|
||||
Initial socket choice: whichever TCP connection succeeds first.
|
||||
|
||||
Reference in new issue
Block a user