mirror of https://github.com/LX3JL/xlxd.git
master
IMRS
${ noResults }
10 Commits (abdfde69a7d64964dcee7f37cc0a89d631feab4e)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
abdfde69a7 |
feat: negotiated PCM codec for the transcoder link
Add PCM (codec 5, S16LE 8 kHz, 160 samples) to the xlxd <-> ambed transcoder protocol without changing the legacy exchange: - ambed answers AMBEDCAPS with the codecs it can serve (AMBE+/AMBE2+ only when vocodec channels exist; Codec2, IMBE and PCM in software), accepts a 24-byte extended open with up to four outputs and a transaction id, and replies with an ordered (codec, payload) list. PCM is taken from the existing vocodec channels before the signal processor and fed to the existing encoders, so no new stream type. - xlxd probes CAPS once per transcoder connection, only when a module needs PCM, on the existing control socket. Peers without CAPS keep the legacy open; legacy bytes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
3 weeks ago |
|
|
a86b16ad9a |
Cross-mode hardening: pipeline overhaul, interlink codec routing,
peer loop block, multi-peer-per-IP, protocol diagnostics
Comprehensive production-hardening release for xlxd + ambed. Covers
the D-Star egress pipeline, adaptive jitter, ambed decoupling and
PID preservation, XLX interlink codec routing (P25 support + BM-
peer compatibility), per-callsign peer loop suppression, multi-
peer-per-IP for server-style protocols, M17 synthetic EOT timing,
and enriched Wires-X diagnostics. Production-tested on XLX672
(March-June 2026) under real cross-mode traffic, WAN jitter,
source-side bursts, and peer-loop attack.
================================================================
1. Cross-mode -> D-Star egress: full JARL spec compliance + RP2C
================================================================
D-Star receivers vary in strictness. Software decoders (ircDDBGateway,
MMDVM) tolerate missing slow-data; Icom RP2C / G3 hardware does not.
Cross-mode -> AMBE+ output now generates a fully spec-compliant
21-frame slow-data cycle (cdstarslowdata.{h,cpp} new), with:
- Sync marker (0x55 0x2D 0x16 unscrambled) on frame 0
- Cycle 0: text message (4 x 6-byte scrambled segments, frames 1-8)
- Cycles 1+: header-sync (9 x 6-byte scrambled elements, frames 1-18)
- Pre-EoT marker (wire bytes 55 55 55) on the last voice frame
immediately before the EoT frame
Pre-EoT marker tracking works via m_pLastVoiceInJitter -- a non-owning
pointer to the most recent voice frame still in the jitter buffer.
When the EoT arrives, that pointer's DvData is overwritten in-place
with the pre-EoT marker before release. Strict Icom decoders that
gate on this signal can no longer mute audio at stream close.
================================================================
2. Decouple D-Star pass-through from ambed
================================================================
Pre-fix architecture: packets entered the jitter buffer ONLY after
ambed responded. UDP loss to/from ambed caused source frames to
pile up in m_LocalQueue, never reach the jitter buffer, and be
deleted at stream close -- silently destroying D-Star AMBE+ that
listeners didn't need ambed to play. Symptoms: broken tails on
D-Star -> D-Star, elevated reported BER from FEC alignment errors
at the abrupt cut-off.
New architecture: ambed is ENRICHMENT, not a GATE. Voice frames
flow through the jitter buffer on a fixed 20 ms cadence regardless
of ambed health. ambed responses fill in transcoded codec slots
(Codec2 / IMBE / AMBE+2) in-place via a PID-keyed lookup map
(m_PendingTranscode) while the packet sits in the jitter buffer.
Source-codec slot is filled at Push time; D-Star pass-through audio
reaches D-Star listeners in lockstep regardless of UDP loss to ambed,
ambed being slow, or ambed being completely offline.
PID-keyed lookup also fixes a latent bug in the previous FIFO-pop
design: a single dropped ambed return packet would silently mis-pair
every subsequent packet's transcoded slots until end of stream.
================================================================
3. Adaptive jitter buffer
================================================================
Replaces the fixed 160 ms jitter with per-stream adaptive sizing
based on observed ambed RTT and source-side inter-arrival jitter.
P95 of RTT samples (sliding window 100 = ~2 s at 50 fps) plus a
30 ms safety margin, OR max source arrival, whichever is larger.
Asymmetric hysteresis: increase target immediately when network
degrades (delta > +20 ms); decrease only after 3 consecutive
recomputes agree (delta < -20 ms each). Cold-start 160 ms, floor
80 ms (2x typical LAN RTT), ceiling 400 ms (above which real-time
conversation breaks down anyway). Stall-detection caps inter-
arrival samples at 500 ms so a silence-gap doesn't pin the buffer
at MAX for the next minute.
================================================================
4. ambed PID preservation through DVStick pipeline
================================================================
DVStick hardware response parser (IsValidChannelPacket) creates a
fresh CAmbePacket from raw USB bytes and has no way to recover the
PID that was on the corresponding input packet -- every output had
PID=0, breaking xlxd's PID-keyed response routing (every response
after the first looked like a stale duplicate).
Fix: each CVocodecChannel holds a FIFO of (pid, pushedAt) entries.
USB interface pushes when consuming input; pops when producing
output. The DVStick processes packets in FIFO order per physical
channel, so pop order matches push order. PID round-trips correctly
via FIFO pairing rather than byte-in-the-packet preservation that
the hardware protocol doesn't support.
Two desync-recovery protections:
- PopPid prunes orphaned entries (front older than 500 ms) before
returning. Bounds the mis-pairing window after a hardware drop
to ~timeout duration; without it the desync would be permanent
for the rest of the stream. 500 ms is well above healthy ambed
RTT (40-100 ms) and well below conversational silences.
- PushPid caps FIFO occupancy (drops oldest if > 200). Memory-
safety belt; only fires under pathological sustained input
overrun (4 s of frames at 50 fps).
Drops are tracked separately for diagnostics: orphan (timeout) vs
overflow (cap), different operational meanings.
================================================================
5. Stream-id allocation: per-source, randomly-seeded
================================================================
YSF/NXDN/P25/M17 now allocate per-transmission stream-ids via a
per-source map (m_SourceStates) rather than deterministic
IpToStreamId. Deterministic IDs collided on rapid rekey, producing
"multi-EoT" cross-mode incidents where a second transmission from
the same source within ~2 s appeared to be a continuation of the
first. Global monotonic counter seeded from std::random_device at
process start; per-protocol collision check against m_SourceStates
as defence-in-depth.
P25 additionally: HasActiveStreamIdForSource gate before
AllocateNewStreamIdForSource on every LDU1_VOICE1. P25 has no
explicit start-of-transmission frame type -- LDU1 fires every
360 ms mid-transmission, so allocating fresh on every LDU1_VOICE1
cut a single transmission into many short substreams and spammed
the loop detector. Allocate ONLY when there's no active mapping;
release on TDU.
================================================================
6. Overrun protection: initial-fill exemption + hybrid threshold
================================================================
The pre-codec ring buffer in CPacketStream (capped at 100 frames)
deliberately replays accumulated frames in microseconds when
AttachCodecStream completes after the AMBEd handshake. That replay
burst is *intended* to preserve audio across the handshake delay;
running overrun protection during it self-defeats. Gated on
m_bFirstReleaseDone (latches at first Phase 2 release).
Overrun threshold itself is now hybrid: max(target x 2.0,
target + 12 packets). Pure 2.0x was too tight at low targets
(8-pkt target x 2 = 16-pkt threshold, but P25 source-side WAN
jitter produced 17-packet momentary peaks). Hybrid:
- At low targets (cold-start 160 ms = 8 pkts): additive
dominates, threshold 20 (400 ms peak buffered).
- At high targets (400 ms ceiling = 20 pkts): ratio dominates,
threshold 40 (800 ms peak -- unchanged from before).
- Crossover at target=240 ms.
Slow-bleed drop cap (8 per Phase 2 tick) ensures sustained
overrun bleeds across multiple ticks rather than creating one
huge cadence-stutter event.
================================================================
7. Diagnostic instrumentation in close-time stats
================================================================
ambed-stats log line gains four new fields so the next overrun-
drop incident is self-explanatory:
ambed stats (ms) : X/Y/Z -- N sent, N returned, A late, B unfilled,
jitter X/Y/Z ms, N drops [peak=N arrival_max=Nms
drops@first=N/last=N]
Where:
- peak : max jitter-buffer occupancy seen during stream
- arrival_max : longest admitted source inter-arrival in ms
- drops@first : m_uiTotalPackets at first overrun drop
- drops@last : m_uiTotalPackets at last overrun drop
Pure additive -- no behaviour change, just observability. Caught
the 159 ms WAN gap that drove the hybrid-threshold tuning.
================================================================
8. Per-callsign peer loop block
================================================================
Production loop incident on a YSF peer: peer interlink echoed
one user's audio back at the reflector ~1 stream/second for
several minutes. The strike-based loop detector correctly fired
"strike 3 TX blocked 300s" repeatedly, but the block was dead state
-- two deliberate bypasses for peer traffic meant nothing checked it.
Bypass #1: every peer-aware protocol handler short-circuits the
gatekeeper for peer IPs: `if ( isPeer || MayTransmit(...) )`.
IsLoopSuppressed lives inside MayTransmit, so peer traffic never
sees the block.
Bypass #2: at strike-3, m_bLinkBlocked and shouldDisconnect are
gated on !isPeer. Peer interlink itself cannot be auto-killed
(correctly preserved).
P25 was the silent case: zero MayTransmit calls anywhere in
cp25protocol.cpp, so strikes accumulated unenforced.
Fix: new CGateKeeper::IsCallsignLoopBlocked() -- pure read of
m_LoopPenalties, returns true iff the callsign is inside an
active strike-backoff window. Called from six peer-aware
protocol handlers (YSF, DCS, DPlus, DExtra, NXDN, P25) on every
incoming peer-sourced header. Drop at protocol layer if blocked;
no MayTransmit whitelist/blacklist/callsign-validity work for
peer traffic (peers are trusted interlinks).
Rate-limited drop log:
Loop block: dropping incoming header from <CALLSIGN>
(block expires in <N>s via <PROTOCOL> peer)
NXDN required restructuring to defer OnDvHeaderPacketIn outside
the Peers lock (mirrors the existing deferredLastFrame pattern)
so IsCallsignLoopBlocked -> LoopMutex doesn't introduce a novel
Peers -> LoopMutex lock ordering. P25 releases the per-source
SID mapping on block so subsequent LDU cycles re-allocate and
get re-checked at Voice5 rather than orphaning frames through
OnDvFramePacketIn with no open stream. Peer link itself stays
up -- only the offending callsign is suppressed.
CTimePoint default-constructs to now() not epoch, so
m_bDropEverLogged bool gates the first rate-limited emission;
subsequent ones gate on elapsed time.
================================================================
9. Multi-peer-per-IP for YSF/NXDN/P25
================================================================
Two YSF (or NXDN, or P25) reflectors hosted on the same machine
could not both be attached as peers. The interlink-file lookup and
runtime peer routing both matched by IP-addr only, so the second
peer at the same IP collapsed into the first one's bookkeeping
silently. Scope: YSF, NXDN, and P25 -- protocols where peers listen
on well-known ports declared in xlxd.interlink and the inbound
source port equals the peer reflector's listening port (server-
style semantics). DExtra, DPlus, DCS, XLX, and M17 keep their
existing IP-only matching unchanged because they have NAT-friendly
/ fluctuating-source-port behaviour that the IP-only comment at
CPeers::FindPeer specifically documents.
New method CPeers::FindPeerByIpPort(const CIp &, int Protocol),
declaring match semantics via signature rather than a boolean
parameter or protocol-conditional switch. Nine runtime call sites
switched from FindPeer to FindPeerByIpPort (inbound-packet routing).
Callsign-keyed lookups (used by periodic reconnect-poll paths) stay
unchanged.
Three protocol-specific interlink-file helpers made port-aware
(FindYsfPeerByIp, FindNxdnPeerByIp, FindP25PeerByIp): if the
interlink entry has an explicit port (item->GetPort() != 0), match
(addr, port); if no explicit port (legacy entries), fall back to
addr-only -- preserves single-peer-per-IP behaviour for existing
operator configs.
CPeers::AddPeer conflict warning updated from GetAddr()==GetAddr()
to GetIp()==GetIp() (full endpoint match) -- otherwise two
legitimate same-IP-different-port peers would trigger a spurious
warning on every connect.
================================================================
10. CM17Protocol: synthetic EOT timing during ambed starvation
================================================================
Production incident: a 59-second D-Star -> M17 cross-mode
transmission triggered a synthetic M17 EOT just 4 seconds in while
the upstream stream was still active. Late-entry attempts from
other callsigns piled up. Close stats: 2942 sent / 2942 returned /
2774 unfilled (94% empty Codec2), peak=18, no drops. ambed itself
was healthy; the M17 output had nothing to send for most of the
transmission and the EOT timer misfired off that silence.
Root cause: m_LastFrameSentTime was updated only when buffer.size()
> 0 -- meaning only when M17 emitted wire bytes. With 94% of frames
lacking Codec2 transcode results, the timestamp froze, and 500 ms
later CheckForMissedEOT fired a synthetic EOT, tearing down the
listener-side stream state.
Fix:
- Renamed m_LastFrameSentTime -> m_LastUpstreamActivityTime to
match the actually-needed semantic.
- Moved the .Now() update out of the `if (buffer.size() > 0)`
block into a separate `if (packet->IsDvFrame())` guard. Refreshes
the timestamp on every upstream voice frame regardless of
whether ambed delivered Codec2 in time.
- Left m_bStreamActive gated on buffer.size() > 0 (its semantic
is "we told M17 listeners about this stream by emitting wire
bytes").
Does NOT address the underlying ambed starvation (94% unfilled) --
that's a separate concern. M17 listeners still hear silence on
unfilled frames, but the stream state machine stays coherent.
================================================================
11. CYsfProtocol: Wires-X diagnostic enrichment + UB closure
================================================================
Production complaint: the bare "Wires-X unknown command" log line
was useless for diagnosis -- no callsign, no IP, no bytes.
IsValidwirexPacket signature gains `const CIp &Ip` for diagnostic
labelling. Single unified log line shape:
Wires-X command from <CALLSIGN> @ <IP>:<PORT>
(<peer-or-client>) -- code XX XX XX (TAG, Dropped)
Where TAG is one of:
UNKNOWN -- code not recognised
DX_RESP -- server response 5D 51 5F 26
CONN/DISC_RESP -- server response 5D 41 5F 26
ALL_RESP -- server response 5D 46 5F 26
Server-response detection (matched with full 4-byte signature
including the 0x26 marker byte). A client sending a response code
TO xlxd is anomalous -- misconfigured peer, relay loop, RF bridge,
or probe. Packet dropped; suspicious source surfaced loudly.
ALL_REQ sub-code dispatch -- UB closure:
Pre-existing bug: the ALL_REQ family branch (5D 66 5F) checks
command[5..6] for "01" (ALL) or "11" (SEARCH) sub-codes. If
neither matched, the original code left *Cmd unset and returned
valid=true. Caller constructed CWiresxCmd with uninitialised
memory; C++ standard says this is undefined behaviour. Fixed by
always setting *Cmd = WIRESX_CMD_UNKNOWN, *Arg = 0, valid = false
on any unrecognised ALL_REQ sub-code variant. Three permanent
assignments tagged "// KEEP (UB-closure)" to document survival
requirement.
Bounds-safety guards added:
The CRC loop's end-marker position is now plumbed out into
endMarkerPos so downstream byte reads can gate on it:
- Response-signature 4-byte memcmp gated on endMarkerPos >= 4
- ALL_REQ sub-code memcmps gated on endMarkerPos >= 6
Without these, a degenerate-but-CRC-valid packet with an early
end marker could read uninitialised stack memory inside the
300-byte command buffer.
================================================================
12. XLX interlink codec routing: needed-vs-available with
source-authoritative Has-flags
================================================================
Cross-XLX P25 calls produced silence on the receiving side. Path:
USER1(P25) <-> P25REF1 <-> XLX1 <-> interlink <-> XLX2 <-> P25REF2
<-> USER2(P25). XLX1 transcoded P25 IMBE -> AMBE+/AMBE+2/Codec2
for the rev-3 interlink. The XLX rev-3 wire format has NO IMBE slot
(D-Star/DMR/M17 only). XLX2's CXlxClient::GetCodec() returns
CODEC_NONE for rev 2/3 on the assumption "all codecs are pre-
provided by the wire frame" -- true when XLX was D-Star + DMR + M17
but wrong for P25. OpenStream's gate `if ( inputCodec != CODEC_NONE )`
skipped the transcoder, IMBE was never filled, USER2 heard silence.
Same bug class affected M17 on rev-1/rev-2 XLX peers.
DESIGN -- Two-axis model:
1. Each client provides a SET of codecs (bitmask). New virtual
CClient::GetAvailableCodecs() defaults to {GetCodec()}.
CXlxClient overrides per rev:
rev 0/1: {AMBE+}
rev 2 : {AMBE+, AMBE+2}
rev 3 : {AMBE+, AMBE+2, Codec2}
2. Each module has a NEEDED codec set. AMBE+ and AMBE+2 are
always-on "core" codecs (D-Star, DMR-family coverage) --
operator policy. Codec2 added iff an M17 client is on the
module; IMBE added iff a P25 client is.
OpenStream: compute needed minus available. If non-empty AND
transcoder connected, pick source codec by preference (AMBE+2 >
AMBE+ > Codec2 > IMBE), engage transcoder. Otherwise no transcode.
HAS-FLAG GUARDS -- the wire-data preservation half:
CDvFramePacket previously had m_bHasCodec2 and m_bHasImbe flags but
not AMBE+/AMBE+2. Added m_bHasAmbe and m_bHasAmbePlus to complete
the four-codec Has-flag symmetry. SetAmbe atomically sets the
matching flag with the memcpy. All 9 constructors initialise the
flags explicitly. operator== extended.
CCodecStream Phase 1 response handler now uses fillIfMissing lambda
that guards each write on the corresponding Has-flag -- pre-populated
slots (from the wire frame) are preserved; only missing slots get
filled by the transcoder. Prevents re-transcoded data from
overwriting authoritative wire data (avoids an extra vocoder hop
for D-Star / DMR / YSF / NXDN listeners).
SOURCE-AUTHORITATIVE HAS-FLAG SEMANTIC:
A Has-flag means "authoritative data is in this slot -- the source
genuinely provides this codec, or a downstream transcoder filled
it." Authority comes from GetAvailableCodecs(), NOT the wire format.
The XLX wire-frame constructor cannot know the source (called by
IsValidDvFramePacket with just a buffer, no peer context) so it
does NOT set m_bHasAmbe or m_bHasAmbePlus -- they default false.
Source-aware code takes over: CXlxProtocol::OnDvFramePacket{,Last}In
calls a new ConformAvailableCodecs(uint32 mask) method with the
mask from the source peer's GetAvailableCodecs(). Assignment-based
(not OR) -- clears flags for codecs the source doesn't provide, sets
them for codecs it does.
This is critical for BM-style XLX peers (CXlxDmrPeer with
CXlxDmrClient -- BrandMeister, FreeDMR, FreeStar, DVSPH bridges
matching BM*/FD*/FS*/PH*). Those peers are forced to rev-2, provide
only AMBE+2, but their rev-2 wire frame reserves an AMBE+ slot that
they populate with empty/stale bytes. Without source-authoritative
Has-flags, the wire-format-set m_bHasAmbe = true would lock the
Phase 1 guard out of the very slot the transcoder needs to fill.
D-Star listeners on a BM-bridged stream would hear silence.
The mask-extract-under-lock + Conform-after-release helper
(ConformXlxPacketToSource) guards on codecMask != 0U -- if the peer
can't be identified (Ip NULL, race during disconnect), Conform is
skipped and default-false flags stand. Codec stream fills every
slot from the transcoder -- extra vocoder hops, never silence.
EFFECT MATRIX:
Source | Result
------------------------------|----------------------------------
Native CXlxClient rev 0/1 | Transcode AMBE+2/Codec2/IMBE
Native CXlxClient rev 2 | Transcode Codec2 (M17) / IMBE (P25)
Native CXlxClient rev 3 | Transcode IMBE only when P25 needed
CXlxDmrClient (BM/FD/FS/PH) | Transcode AMBE+/Codec2/IMBE
================================================================
Files changed
================================================================
ambed: cstream, cusb3xxxinterface, cvocodecchannel (PID FIFO)
xlxd: ccodecstream (jitter buffer + adaptive + hybrid threshold
+ diagnostic instrumentation + EoT marker + Phase 1
fillIfMissing guard)
cpacketstream (pre-codec ring buffer)
cgatekeeper (IsCallsignLoopBlocked + rate-limit state)
cdstarslowdata (new -- JARL slow-data synthesiser)
cdvframepacket (four-codec Has-flag symmetry + Conform)
cdvheaderpacket (DvData accessors)
cclient (GetAvailableCodecs virtual)
cxlxclient (rev-conditional GetAvailableCodecs override)
cxlxprotocol (ConformXlxPacketToSource helper)
cprotocol + cnxdnprotocol, cp25protocol, cysfprotocol,
cm17protocol (stream-id allocation, per-source state,
loop-block enforcement, EOT timing, Wires-X diagnostics)
cdcsprotocol, cdplusprotocol, cdextraprotocol
(loop-block enforcement)
cpeers (FindPeerByIpPort)
creflector (GetNeededCodecsOnModule + OpenStream rewire)
ctranscoder, main (plumbing)
|
4 months ago |
|
|
27f5678f03 |
Add M17/P25/NXDN/YSF peering, software vocoders, and comprehensive hardening
First-class M17 protocol support: - Full M17 client handling: connect (CONN/LSTN), disconnect (DISC), keepalive (PING/PONG), voice streaming with 40ms→20ms frame split - M17 base-40 callsign encoding/decoding per specification - M17 wire stream ID generation (random-seeded per module) - Codec2 3200bps frame pairing (two 8-byte frames per 40ms packet) - Synthetic EOT detection (500ms timer) for clients that don't send proper end-of-transmission, with cross-mode distribution via CDvLastFramePacket pushed to reflector stream - Byte-swapped stream ID fallback for M17 EOT packets - DISC packet sent to all M17 clients on reflector shutdown - Listen-only client support P25 and NXDN peering: - P25 peer protocol with IMBE voice frame handling - NXDN peer protocol with AMBE2+ voice frame handling - AMBE2+↔AMBE2+ gain levelling for NXDN within xlxd - AMBE2+↔AMBE2+ gain levelling for YSF mode within xlxd DCS, DPlus (REF), and DExtra (XRF) peer link management: - Automatic peer connect/disconnect from gatekeeper peer list - Peer keepalives with timeout detection and reconnection - Connection state machine (connecting/connected/disconnected) - Peer client objects for voice routing through existing reflector - Peer mirror prevention via full IP:port owner matching on DCS, DPlus, and DExtra peer send paths AMBEd software vocoder support: - Async Codec2 encoder thread in CVocodecChannel with condition variable wake-up, PCM queue, and encoded output queue - Async IMBE encoder thread (same pattern) using imbe_vocoder library - Embedded Codec2 library for M17 codec support - Embedded IMBE vocoder library for P25 codec support - Staging mechanism in CStream::Task(): hold hardware AMBE result until software codecs catch up (1s timeout safety net) - Three-codec output per stream (e.g., AMBEPLUS→AMBE2PLUS+CODEC2+IMBE) - Precomputed gain multipliers to avoid pow() per packet - Codec2 decode gain (+6dB) applied in AMBEd stream processing - IMBE encode gain (-4dB) applied to all PCM→IMBE paths - Software queue depth caps (SOFTWARE_QUEUE_MAX_DEPTH=50) Transcoding gains (tuned from live testing): - Codec2 path: CODEC2_TO_AMBEPLUS -3dB, CODEC2_TO_AMBE2PLUS -13dB, CODEC2_TO_IMBE -13dB - IMBE path: IMBE_DECODE_GAIN +18dB, IMBE_TO_AMBE2PLUS -13dB, IMBE_TO_CODEC2 -7dB - Hardware: CODECGAIN_AMBEPLUS -10dB, CODECGAIN_AMBE2PLUS +10dB - Cross-mode AMBE2+: NXDN↔DMR -3dB, DMR→YSF -4dB, YSF→DMR +10dB RX/TX thread split: - CProtocol base class: dual-thread infrastructure with RxTask/TxTask, condition variable on m_Queue for TX wake-up, backward-compatible via UsesSplitThreads() virtual. Shutdown joins RX first then TX with final drain loop - Split protocols: DCS, M17, DExtra (XRF), DPlus (REF), YSF, NXDN, P25 - Legacy single-thread: XLX interlink, DMR+ (DMRplus), DMR MMDVM - Per-slot std::mutex on stream cache items protecting shared state between RX and TX threads - Prevents transmission tail loss by ensuring TX processing never blocks inbound packet reception XLX interlink DMR peer generalisation: - Rename CBmPeer/CBmClient to CXlxDmrPeer/CXlxDmrClient - Callsign prefix matching for BM (BrandMeister), FD (FreeDMR), FS (FreeStar), PH (DVSPH) — all rev 2 AMBE2+ only D-Star end-of-transmission fixes: - Strip 0x40 end flag from D-Star PID (& 0x1F) in all five D-Star protocol parsers — the flag shifted EncodeDvPacket's sequence by 1 - Preserve DCS wire format tail (bytes 58-99) via per-module cache with m_bHasDcsTail guard for cross-mode sources - DCS HandleQueue sends EOT reliably via independent TX thread Thread safety and memory safety hardening: - CPacketStream: cache owner IP at Open() time, eliminating use-after- free on m_OwnerClient. NULL pointer under stream lock in CloseStream - Fix ABBA deadlock in all peer management (DCS, DExtra, DPlus, YSF): snapshot GateKeeper peer list before acquiring Peers/Clients locks - Fix lock ordering across all protocols to prevent ABBA deadlocks between Peers, Clients, and GateKeeper mutexes - Collect items for removal after iteration instead of modifying containers while iterating - CUdpSocket::SendVoice: EAGAIN retry (5 attempts, 1ms backoff) - AMBEd Phase 4 timeout reverted to counter-only (no packet deletion) - Remove dead CPacketQueue shadow fields, debug RouterThread logging, IsStreaming() stub. Make g_bDscpLogged atomic - Client match in keepalive/header paths uses full CIp::operator== (IP:port) preventing false matches with shared-IP peers Security hardening: - Send-time owner exclusion across all protocols using per-module client cache with snapshotted owner fields under slot lock - Echo detection for DCS, DExtra (XRF), and DPlus (REF) to reject reflected audio from peers - Reject tracker with progressive backoff for invalid connections, capped map size to prevent memory exhaustion from spoofed IPs - Sanitized log output to prevent terminal injection - std::random_device for DMR authentication seed - Bounds checks on module indices across all protocol handlers - Use-after-free fixes in OnDvHeaderPacketIn across all protocols - ARM-portable unaligned access fixes (memcpy for uint16/uint32) Performance: - Per-module client cache for DExtra/DPlus/DCS outbound packets - DSCP EF marking on voice packet sockets for QoS - Peer lookup maps built once per drain cycle instead of per-packet - Skip M17 idle packet encoding when no clients connected |
8 months ago |
|
|
99530863d5 |
fix openstream timeout issue
|
4 years ago |
|
|
3c3367fee6 |
version 2.4.2
updated ambed logging |
5 years ago |
|
|
73516e9f14 |
undo PR #176
#176 is breaking ambed connectivity when ambed on same machine than xlxd. So this revert to previous version |
6 years ago |
|
|
220da86aa0 |
Avoid using public IP for transcoder connection
|
6 years ago |
|
|
32a437c138 |
xlxd 2.2.1
* auto-reload of deride DB * interlink protocol v2.0 |
9 years ago |
|
|
8482f85478
|
Fix typo
|
9 years ago |
|
|
83278d1363 |
xlxd 2.0.0
Added compatibility with protocols DMR Homebrew (MMDVM) and DMR Plus (dongle) |
9 years ago |