Commit Graph

388 Commits

Author SHA1 Message Date
zarazaex69
de006acdc7 feat: remove ui completely 2026-05-03 01:32:54 +03:00
zarazaex69
71d164729f Merge branch 'transport/smux' into transport/videochannel 2026-05-03 01:24:39 +03:00
zarazaex69
5bb8178e50 feat(smux): replace internal/mux with smux over KCP
Replace the hand-rolled multiplexer (internal/mux) with xtaci/smux v2
running on top of the existing KCP-reliable vp8channel transport.

- Add internal/muxconn: io.ReadWriteCloser adapter bridging link.Link
  (message-oriented) into the byte-stream smux expects; applies AEAD
  on every write and inverts it on every received message
- Rewrite client: smux.Client session over muxconn; OpenStream per
  SOCKS5 connection; reconnect handler tears down and rebuilds session
- Rewrite server: smux.Server session; AcceptStream loop dispatches
  each stream to a proxy handler; tolerates session bounces on reconnect
- Delete internal/mux: all sequence/reorder/buffer logic is now
  handled by smux + KCP
2026-05-03 00:45:58 +03:00
zarazaex69
14f9ed72ec feat: add smux dependency for multiplexing support 2026-05-02 18:12:01 +03:00
zarazaex69
6aaf68c6b3 Merge branch 'transport/vp8-kcp' into transport/videochannel
Wrap the VP8 carrier in a KCP session so the upper layer gets reliable,
ordered, message-oriented delivery. Fixes the random 0 B/s stalls that
happened when a single VP8 frame was dropped (drainOutbound on
reconnect, inbound overflow, or RTP loss invalidating partial assembly):
mux.Stream.nextSeq would never advance past the hole and curl would
park on recv until a new mux stream was opened.

KCP retransmits recover from those losses transparently.
2026-05-02 18:07:31 +03:00
zarazaex69
cb6922dfbd build: promote kcp-go to direct dependency and update lossyconn 2026-05-02 18:05:41 +03:00
zarazaex69
35c05b654a feat(vp8channel): wrap carrier in KCP for reliable, ordered delivery
Plug a KCP session in front of the VP8 wire so the upper layer (mux/curl
tunnels) gets reliable, ordered, message-oriented delivery on top of an
otherwise unreliable carrier.

Why this fixes the random 0 B/s stalls
--------------------------------------
The previous design had no retransmits and no ACKs. A single dropped
VP8 frame (from drainOutbound on micro-reconnect, the inbound 'default:'
overflow drop, or RTP loss invalidating a partial assembly) created a
hole in mux.Stream.nextSeq that would never be filled: the receiver
parked all subsequent frames in outOfOrder forever and curl read 0 B/s
until a brand new mux stream id was opened.

KCP layer details
-----------------
* Stream mode + 4-byte big-endian length prefix. Message mode would be
  ideal but UDPSession.Write fragments anything > MSS *outside* of
  kcp.Send, leaving every fragment with frg=0 and breaking PeekSize-based
  reassembly. Length-prefix framing under stream mode is the canonical
  workaround.
* nodelay(1, 10ms, fast-resend=2, no congestion control) — KCP turbo
  preset, identical to kcptun/shadowsocks tuning. Recovers from burst
  losses in tens of ms instead of seconds.
* SndWnd/RcvWnd 4096 segments to absorb the multi-segment burst that
  a single VP8 sample can carry.
* MTU 1400 (kcp-go hardcodes mtuLimit=1500).

Wire compatibility with VP8 keepalives
--------------------------------------
KCP packets always start with the LE conv id (0x01 0xEE 0xFF 0xC0). VP8
keepalive frames start with 0x30. The receive path filters by the magic
byte before handing the buffer to KCP, so keepalives never poison the
KCP state machine.

Features() now advertises Reliable+Ordered. Drop-on-overflow paths in
the carrier are kept — KCP detects the loss via SACK and retransmits.

Refs: transport/vp8-kcp
2026-05-02 18:03:44 +03:00
zarazaex69
940b32e1fb chore: remove local replace directive for gr module 2026-05-02 15:01:10 +03:00
zarazaex69
21d46e478b refactor: remove debug logging and unused queue monitor 2026-05-02 14:56:33 +03:00
zarazaex69
602c8a7b0d refactor: remove telemetry and metrics collection 2026-05-02 14:39:49 +03:00
zarazaex69
1101528cf6 refactor: add comprehensive diagnostics and flow control to data pumping 2026-05-02 02:18:45 +03:00
zarazaex69
647f605905 feat: add inbound queue and dispatch goroutine for vp8 transport 2026-05-01 13:27:21 +03:00
zarazaex69
2a24f7f196 fix: change vp8Keepalive from P-frame to keyframe 2026-05-01 10:16:36 +03:00
zarazaex69
5ddc942405 refactor: adjust vp8 keepalive timing and queue parameters 2026-05-01 10:11:43 +03:00
zarazaex69
9a5a4b249d feat(vp8channel): drain outbound channel before reconnect callback 2026-04-30 14:13:54 +03:00
zarazaex69
4a5b255db6 refactor: calculate sample duration based on batch size 2026-04-30 13:51:55 +03:00
zarazaex69
86b92d4fc5 feat(videochannel): cache idle frame to avoid re-encoding 2026-04-30 12:24:00 +03:00
zarazaex69
2c8edeeef0 feat(thread): make 1 ffmpg tread 2026-04-30 08:29:54 +03:00
zarazaex69
bf454145ba feat(lcm): implement strict lifecycle management for both encoders and
decoders
2026-04-30 08:14:05 +03:00
zarazaex69
b4408715bb upd 2026-04-30 07:36:35 +03:00
zarazaex69
92462878d7 chore: update gr submodule (add reedsolomon for tile) 2026-04-30 07:02:07 +03:00
zarazaex69
8996b2878a fix: validate tile codec requires 1080x1080 dimensions 2026-04-30 06:56:59 +03:00
zarazaex69
ad7c9a5c3e feat: add tile as videochannel visual codec via -video-codec tile 2026-04-30 06:55:34 +03:00
zarazaex69
01494504e2 chore: add olcrtc to gitignore 2026-04-30 06:32:57 +03:00
zarazaex69
f11cf6baef refactor: remove "b" codec support 2026-04-30 05:09:07 +03:00
zarazaex69
d5cc9850ec Merge remote-tracking branch 'origin/master' into transport/videochannel 2026-04-30 05:02:20 +03:00
zarazaex69
8ee1855ba3 chore: update videochannel/gr submodule 2026-04-30 05:01:40 +03:00
zarazaex
6805a3aa40 feat: add project status 2026-04-30 05:01:24 +03:00
zarazaex69
e742a789b9 chore: update gr submodule and replace qr dependencies 2026-04-30 04:56:45 +03:00
zarazaex69
5f66d764b5 refactor(videochannel): replace qr libs with grqr codec 2026-04-30 04:56:33 +03:00
zarazaex69
d4de7a1d1c chore: add gr submodule for videochannel transport 2026-04-30 04:50:29 +03:00
zarazaex69
9c7b4e316f refactor(videochannel): remove b codec 2026-04-30 01:55:17 +03:00
zarazaex69
e848bde8de fix(videochannel): reduce QR code quiet zone from 10 to 2 2026-04-30 01:26:51 +03:00
zarazaex69
fad1f605ea fix(telemost): trigger reconnect only on failed state, not disconnected 2026-04-30 01:26:37 +03:00
zarazaex69
3064850f7c fix(telemost): exclude TURN/TURNS URLs from server hello config 2026-04-30 00:58:25 +03:00
zarazaex69
3e64c1f3cb docs: fix mage command name in readme 2026-04-30 00:31:34 +03:00
zarazaex69
5d1acf6a25 refactor(mage): rename BuildB to BuildCLIB for clarity 2026-04-30 00:31:02 +03:00
zarazaex69
e7a62a77c2 docs: add buildB command description to readme 2026-04-30 00:29:20 +03:00
zarazaex69
9025ba9b81 refactor: remove byte tracking from pumpToMux 2026-04-30 00:20:18 +03:00
zarazaex69
b83b334472 Remove periodic progress logging in pumpToMux 2026-04-28 19:18:23 +03:00
zarazaex69
689441a7f4 Add configurable QR error correction level for video transpor 2026-04-27 18:53:39 +03:00
zarazaex69
98ad27bec5 Add configurable B codec parameters 2026-04-27 06:11:25 +03:00
zarazaex69
f1f5a584f5 Remove debug logging from handleFrame 2026-04-27 04:01:54 +03:00
zarazaex69
e4aeb3ac28 Add white frame detection and debug frame capture 2026-04-27 03:59:39 +03:00
zarazaex69
12d22770b4 feat(log): Log frame length and codec in handleFrame, and B codec decode
failures in visual_b.go
2026-04-26 22:53:49 +03:00
zarazaex69
fe13ba28e3 feat(b): Add support for RGBA frame format in B visual codec 2026-04-25 21:22:13 +03:00
zarazaex69
5c36e0d95a build: add support for building with 'b' codec in magefile 2026-04-22 21:28:02 +03:00
zarazaex69
a2d1b95ffa feat: add support for 'b' visual codec in videochannel 2026-04-22 21:26:50 +03:00
zarazaex69
f124da9bbd fix: add backpressure to vp8channel via outbound buffer check in CanSend 2026-04-22 17:42:32 +03:00
zarazaex69
89505b7754 fix: make vp8-fps and vp8-batch flags required for vp8channel transport 2026-04-22 17:21:14 +03:00