feat: SRTLA receiver support#5811
Conversation
|
|
Implements SRTLA (SRT Link Aggregation) protocol receiver as a UDP proxy server that aggregates multiple sender connections into a single SRT stream, enabling mobile IRL streaming over bonded network links (BELABOX, IRL Pro, Moblin). Resolves bluenviron#3029
Match BELABOX receiver behavior: broadcast SRT ACKs to all connections, send other packets only to the most recently active SRTLA address. Also adds config validation and matches upstream maxConnsPerGroup=8.
Wire SRTLA groups to their corresponding SRT connections for: - Per-path metrics (bytes_received, bytes_forwarded, conns_active) - Enriched logging with stream path context - Lifecycle coupling (SRT close triggers SRTLA group teardown) Use interfaceIsEmpty() for nil-safe metrics check matching SRT pattern.
Address review findings: - Lazy srtConn creation on first data packet (not during REG1) - sendReg2/sendReg3 return errors with state rollback on failure - IPv6 loopback resolution for dual-stack/IPv6-only setups - Close() atomically clears maps, preventing post-close state leaks - All network I/O moved outside mutex - cleanup() repairs lastAddr when timed-out conn was current target - All send errors logged with context - Shutdown race fix: closed check + wg.Add inside mutex - 13 regression tests (including IPv6 loopback resolution)
87b0f30 to
66351dd
Compare
|
you are a mad lad, works perfectly for me! timing couldn't have been better for an upcoming small live production |
|
I was trying to push MediaMTX a bit and managed to crash it. What I had running:
After a while, MediaMTX died with I'm not a Go expert so I can't say exactly what went wrong, but it might be some kind of race condition. The crash happened in the SRT server ( To reproduce:
I'm pretty sure it didn't even need to have a source connected. |
|
@xemles thanks for the report! un/fortunately this looks like golang runtime issue on Windows, fixed with >=1.26.2: golang/go#77975 -- would you please try compiling under newer golang compiler? thx! |
|
Yup, seems like that was the issue, been running for 2hrs with no crash, whoops! |
Adds an SRTLA receiver server that accepts bonded connections from BELABOX-compatible encoders and proxies aggregated traffic to the local SRT server.
What
srtla_groups,srtla_groups_conns_active,srtla_groups_bytes_received,srtla_groups_bytes_forwardedsrtla/srtlaAddressinmediamtx.ymlConfig
Closes #3029