Commit Graph

535 Commits

Author SHA1 Message Date
Paul Wells a5abf61a56 update psrpc (#2188) 2023-10-25 20:20:49 -07:00
Paul Wells 48dba9d589 reduce closing signal stream log level (#2182) 2023-10-24 17:46:07 -07:00
David Colburn b8ac836b9b Only launch room egress once (#2175)
* only launch room egress once

* regenerate fakes
2023-10-24 13:05:23 -07:00
Paul Wells f80e87b216 skip psrpc service registration unless the config is enabled (#2181) 2023-10-24 11:41:52 -07:00
Raja Subramanian df9d6ee0f4 Update protocol. (#2177) 2023-10-24 12:59:25 +05:30
David Colburn 0f27dda281 move CreateEgress call (#2168) 2023-10-23 09:15:18 -07:00
cnderrauber eca32792b8 Add configuration to limit MaxBufferedAmount for data channel (#2170)
* Add configuration to limit MaxBufferedAmount for data channel

* comment

* Fix generate flags

* fix test

* Don't disconnect slow subscriber
2023-10-23 15:03:58 +08:00
Paul Wells 0bc932e57e fix config typo (#2172)
* fix config typo

* tidy

* add sample config

* cleanup
2023-10-22 23:43:03 -07:00
Paul Wells 325e5ca753 add psrpc room service (#2171)
* add psrpc room service

* update deps

* disable by default

* feedback

* config

* test
2023-10-22 22:49:38 -07:00
David Colburn b290c233ea fix CreateEgress not completing (#2156) 2023-10-18 23:18:53 -07:00
David Colburn 62b057b4c1 Egress store/IO cleanup (#2152)
* egress store cleanup

* client wrapper, regenerate

* put WithClusterID back

* rename clent

* infinite loops

* client wrapper -> interface

* remove StopEgress update

* remove Update from IOClient

* avoid duplicate EgressStarted events

* update protocol
2023-10-18 14:48:51 -07:00
Raja Subramanian 11c9c56a4d Defer close of source and sink to prevent error logs. (#2149)
When a room is created via room service, when `StartSession`
runs, it sees a closed request source and returns an error
and that gets logged. It is not a real error.

Defer the sink and source close so that room creation can finish without
errors.
2023-10-17 11:37:34 +05:30
Benjamin Pracht 4253845505 Create stub for update outputs in egress service (#2132) 2023-10-05 12:00:47 -07:00
cnderrauber 92a355e1f3 Add SyncStreams flag to Room (#2110)
* Add SyncStreams flag to Room

* Increase protocol version

* Revert version change

* Move flags to internal & solve comment
2023-09-28 15:41:44 +08:00
cnderrauber 1200a960a2 Use generic type cast for IDs (#2095) 2023-09-20 17:09:24 +08:00
Raja Subramanian 281d2b674b Changing some log levels (#2094)
Logging expected WS close at Infow to understand reasons for closure.
Moving "read from ws" to Debugw as it happens when signalling closes.

Also filter out a data channel abort chunk log as it shows a bunch of
errors, but those are expected though.
2023-09-20 14:13:48 +05:30
cnderrauber e46da0705a Add max playout delay config (#2089)
* Add max playout delay

* config sample
2023-09-19 11:30:38 +08:00
David Colburn 8a0d417a8c Participant egress (#2070)
* participant egress

* remove hasPublished when participant leaves room
2023-09-18 12:47:57 -07:00
David Zhao 0b0431b765 Per-session TURN credentials (#2080)
Switching to using session specific TURN credentials instead of shared
credentials per Room. Also eliminates need to load Room from Redis
during TURN authentication
2023-09-17 10:08:35 -07:00
David Zhao f351f9b2ed Allow RoomService.SendData to use participant identities (#2051)
* Allow RoomService.SendData to use participant identities

* update protocol

* update webrtc to 3.2.19
2023-09-08 16:22:56 -07:00
cnderrauber 9b9298b927 Add batch i/o to improve throughput (#2033)
* Add batch i/o to improve throughput

* remove empty line

* Solve comments

* Change rtcconfig.UDPPort to PortRange

* Fix test
2023-09-06 10:18:20 +08:00
Raja Subramanian 6509bb0325 Add option to issue full reconnect on data channel error. (#2026)
* Add option to issue full reconnect on data channel error.

There are situations where send data packet fails because of "stream
closed". It is unclear when that happens. Seems to be after an
ICERestart after ICE failed and connection type switching to TURN
from ICE.

Once the failure happens, it is not recoverable. Potentially, it is
recoverable, but unclear where the problem lies. Attempts to reproduce
looking at the pattern of failures has been unsuccesful.

In the mean time, adding an option to issue full reconnect
when send data packet fails.

* typo
2023-09-01 17:59:25 +05:30
David Zhao d5808f96df Disconnect participant when signal proxy is closed (#2024)
When signal proxy is closed, we'd want to stop writing to it and sever
WS connection with the client. Client would go into a reconnect sequence
2023-08-31 09:39:45 -07:00
Raja Subramanian 7dc8a7f80c Remove sender report warp logs. (#2007)
* Remove sender report warp logs.

They are not useful.
Also replacing drift report with proper protocol and reporting
both packet ad report drift.

Need to dig more into out-of-order sender report sending.
That requires some digging and understanding.

* record time of anachronous report

* more logging around out-of-order repair

* log time of out-of-order received sender report

* Update deps and place holder StartParticipantEgress
2023-08-29 00:30:24 +05:30
David Zhao eed8e85008 Demote more logs to debug (#1998) 2023-08-27 19:17:38 -07:00
Benjamin Pracht ce418dc6b3 Do not generate a stream key for URL pull ingress (#1993) 2023-08-24 12:50:05 -07:00
Benjamin Pracht e3ed9ff53f Validate that url pull ingress are ready to use on creation (#1939) 2023-08-07 15:44:44 -07:00
Benjamin Pracht 98c1fb598c Add support for ingress URL pull (#1938)
Also prevent update of non reusable ingress
2023-08-04 11:41:36 -07:00
David Zhao debd75fa15 Integrate logger components (#1933)
* Integrate logger components

Dividing into the following components
* pub - publisher
* pub.sfu
* sub - subscriber
* transport
* transport.pion
* transport.cc
* api
* webhook

* update go modules
2023-08-03 13:31:17 -07:00
cnderrauber eadc910bff Add PlayoutDelay to CreateRoomRequest (#1930)
* Add PlayoutDelay to CreateRoomRequest

* Remove max delay from palyoutdelay
2023-08-03 16:32:59 +08:00
cnderrauber f7a1776f4c Add control of playout delay (#1838)
* Add control of playout delay

Add config to enable playout delay. The delay will be limited by
[min,max] in the config option and calculated by upstream & downstream
RTT.

* check protocol version to enable playout delay

* Move config to room, limit playout-delay update interval, solve comments

* Remove adaptive playout-delay

* Remove unused config
2023-08-02 16:12:23 +08:00
Raja Subramanian db3fbb57ae Do not log as error on connection reset by peer (#1923) 2023-08-01 19:04:54 +05:30
David Zhao 981fb7cac7 Adding license notices (#1913)
* Adding license notices

* remove from config
2023-07-27 16:43:19 -07:00
Raja Subramanian fc7d4bd01e E2EE trailer for server injected packets. (#1908)
* Ability to use trailer with server injected frames

A 32-byte trailer generated per room.
Trailer appended when track encryption is enabled.

* E2EE trailer for server injected packets.

- Generate a 32-byte per room trailer. Too reasons for longer length
  o Laziness: utils generates a 32 byte string.
  o Longer length random string reduces chances of colliding with real data.
- Trailer sent in JoinResponse
- Trailer added to server injected frames (not to padding only packets)

* generate

* add a length check

* pass trailer in as an argument
2023-07-27 16:50:18 +05:30
Paul Wells 6c20c7eb15 add test for removing disconnected participants on signal close (#1896)
* add test for removing disconnected participants on signal close

* cleanup
2023-07-20 21:21:40 -07:00
Paul Wells 3980d049c9 close disconnected participants when signal channel fails (#1895)
* close disconnected participants when signal channel fails

* fix typefake

* update reason
2023-07-20 19:23:35 -07:00
Paul Wells 6ad1e1598d move signal server start to server start (#1894)
* move signal server start to server start

* fix test
2023-07-20 19:13:27 -07:00
kannonski cf4801064d changing key file permissions control (#1893) 2023-07-19 14:23:30 -07:00
Paul Wells 9f3c975b1c leave signal context open after stream closes (#1887) 2023-07-16 20:24:11 -07:00
Paul Wells 5535916ff2 prevent signal context from closing before room setup finishes (#1885) 2023-07-16 19:01:53 -07:00
Paul Wells 8784449fc6 manually cancel signal relay context (#1884) 2023-07-16 15:03:47 -07:00
Paul Wells 7dc60bb1bf start reading signal messages before session handler finishes (#1883)
* start reading signal messages before session handler finishes

* fix err scope
2023-07-16 13:40:53 -07:00
Benjamin Pracht 68e5fa8e1c Allow listing ingress by id (#1874) 2023-07-14 09:11:55 +08:00
David Zhao 42a7d52272 Return 404 with DeleteRoom/RemoveParticipant when deleting non-existent resources (#1860)
Fixes #1587
2023-07-08 22:30:49 -07:00
David Zhao cbec68ae44 Do not use cancellable context for Redis operations (#1859) 2023-07-08 12:06:31 -07:00
David Zhao 919355c873 Log additional details when updating participant permissions (#1855)
To help track down sporadic updateParticipant failures
2023-07-06 23:38:01 -07:00
Juan Navarro 2668073c29 Honor bind address passed as --bind also for RTC ports (#1815)
* Use net.JoinHostPort to build "host:port" strings for `net.Listen`

net.JoinHostPort provides a unified way of building strings of the form
"Host:Port", abstracting the particular syntax requirements of some
methods in the `net` package (namely, that IPv4 addresses can be given
as-is to `net.Listen`, but IPv6 addresses must be given enclosed in
square brackets).

This change makes sense because an address such as `[::1]` is *not* a
valid IPv6 address; the square brackets are just a detail particular to
the Go `net` library. As such, this syntax shouldn't be exposed to the
user, and configuration should just accept valid IPv6 addresses and
convert them as needed for usage within the code.

* Use '--bind' CLI flag to also filter RTC bind address

The local address passed to a command such as

    livekit-server --dev --bind 127.0.0.1

was being used as binding address for the TCP WebSocket port, but was
being ignored for RTC connections.

With `--dev`, the conf.RTC.UDPPort config is set to 7882, which enables
"UDP muxing" mechanism. Without interface or address filtering, Pion
would try to bind to port 7882 on *all* interfaces.

This was failing on a system with IPv6 enabled, when trying to bind to
an IPv6 address of the `docker0` interface. It seems to make sense that
the user-passed bind addresses are also honored for the RTC port
bindings.
2023-06-28 16:52:43 -07:00
Benjamin Pracht 1f6efedd31 Send updated events on state updates (#1819) 2023-06-22 09:20:58 -07:00
Paul Wells c38791ff0a stop retrying signal connection if the request context is closed (#1820) 2023-06-22 07:09:34 -07:00
Raja Subramanian 00558dee5c Close participant on full reconnect. (#1818)
* Close participant on full reconnect.

A full reconnect == irrecoverable error. Participant cannot continue.
So, close the participant when issuing a full reconnect.
That should prevent subscription manager reconcile till the participant
is finally closed down when participant is stale.

* format
2023-06-22 10:09:10 +05:30