fix(reflector): restrict monitor-TG UDP audio to passive observers
A client with a non-zero selected TG must never receive UDP audio for a monitored TG. svxlink's priority/auto-switch for monitor TGs is driven by the TCP TalkerStart message; once svxlink decides to switch, it sends MsgSelectTG and from then on the audio arrives via the selected-TG arm of the fanout (TgFilter). The monitor arm is only meaningful for passive observers (currentTG=0).a661879(v1.3.10) introduced the monitor arm to support passive multi-hop monitoring, but gated it loosely.dc3a8c0narrowed the gate to "selected TG idle right now" — too eager, since a real QSO has 0.5-3s inter-PTT gaps where the selected TG is talkerless.5c585beadded first-talker-wins on top, masking but not fixing the leak. The net effect: while a user was mid-QSO on TG 9 with TG 110 in MONITOR_TGS, TG 110 audio bled into the inter-PTT gaps and was played by svxlink. Tragedy. Replace SelectedTgIdleFilter with PassiveObserverFilter (`m_current_tg == 0`) at all 9 UDP fanout sites in Reflector.cpp, SatelliteClient.cpp, SatelliteLink.cpp, and TrunkLink.cpp. EarliestMonitorTalkerFilter is retained — passive observers with multiple monitor TGs still need first-talker-wins to avoid Opus decoder mixing (test_44). Tests: - New test_45 pins down the contract: A select_tg=9, monitor_tgs=[110]; C continuously talks on 110; A receives zero TG 110 UDP frames. Fails on master, passes after fix. - test_43 repurposed from "first-talker-wins for selected" (a property that should never have been asserted) to the multi-monitor variant of test_45. - test_39/40/41/42/44 stay green by construction. All suites: 48 trunk + 7 mqtt + 6 logging + 15 twin = 76/76.
This commit is contained in:
1 parent
5c585bebbc
commit
d5860ad1dc
7 files changed
+120
-55
No files matched your search
@@ -1414,7 +1414,7 @@ void Reflector::udpDatagramReceived(const IpAddress& addr, uint16_t port,
|
||||
ReflectorClient::mkAndFilter(
|
||||
ReflectorClient::TgMonitorFilter(tg),
|
||||
ReflectorClient::mkAndFilter(
|
||||
ReflectorClient::SelectedTgIdleFilter(),
|
||||
ReflectorClient::PassiveObserverFilter(),
|
||||
ReflectorClient::EarliestMonitorTalkerFilter(tg))))));
|
||||
if (m_is_satellite && m_satellite_client != nullptr)
|
||||
{
|
||||
@@ -1584,7 +1584,7 @@ void Reflector::onTalkerUpdated(uint32_t tg, ReflectorClient* old_talker,
|
||||
ReflectorClient::mkAndFilter(
|
||||
ReflectorClient::TgMonitorFilter(tg),
|
||||
ReflectorClient::mkAndFilter(
|
||||
ReflectorClient::SelectedTgIdleFilter(),
|
||||
ReflectorClient::PassiveObserverFilter(),
|
||||
ReflectorClient::EarliestMonitorTalkerFilter(tg)))),
|
||||
ReflectorClient::ExceptFilter(old_talker)));
|
||||
if (m_mqtt != nullptr)
|
||||
@@ -2903,7 +2903,7 @@ void Reflector::onTrunkTalkerUpdated(uint32_t tg,
|
||||
ReflectorClient::mkAndFilter(
|
||||
ReflectorClient::TgMonitorFilter(tg),
|
||||
ReflectorClient::mkAndFilter(
|
||||
ReflectorClient::SelectedTgIdleFilter(),
|
||||
ReflectorClient::PassiveObserverFilter(),
|
||||
ReflectorClient::EarliestMonitorTalkerFilter(tg)))));
|
||||
if (m_mqtt != nullptr)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user