Commit Graph

509 Commits

Author SHA1 Message Date
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
Raja Subramanian
2438058474 Drop error logs due to pipe close (#1813) 2023-06-21 14:11:17 +05:30
Benjamin Pracht
552e3758d5 Add IngressUpdated event (#1775) 2023-06-16 10:58:49 -07:00
paulwe
0dab55556d add drain function to rtc service 2023-06-15 11:56:41 -07:00
Raja Subramanian
12db469297 Better tracking of signalling connection. (#1794)
* Better tracking of signalling connection.

- Reason for closing signaling channel.
- ConnectionID attached to request source/response sink

* Tests
2023-06-15 12:53:34 +05:30
David Colburn
8235310a92 don't save info after UpdateStream (#1779) 2023-06-07 16:27:37 -07:00
Raja Subramanian
7ed3af193a No proof that this helps (#1772) 2023-06-06 11:28:13 +05:30
Benjamin Pracht
e7879a46fc Add ingress telemetry support (#1763) 2023-06-02 17:38:19 -07:00
David Zhao
b5c8fe5294 Perform unsubscribe in parallel to avoid blocking (#1760)
* Perform unsubscribe in parallel to avoid blocking

When unsubscribing from tracks, we flush a blank frame in order to prepare
the transceivers for re-use. This process is blocking for ~200ms. If
the unsubscribes are performed serially, it would prevent other subscribe
operation from continuing.

This PR parallelizes that operation, and ensures subsequent subscribe
operations could reuse the existing transceivers.

* also perform in parallel when uptrack close

* fix a few log fields
2023-06-02 00:13:18 -07:00
Benjamin Pracht
d598e06d9f Add support for bypass_transcoding field in ingress (#1741) 2023-05-30 13:41:12 -07:00
David Zhao
956735ae05 Fix node stats updates on Windows (#1748)
Because we aren't able to get CPU count/load info on Windows, they are
stubbed out to return placeholders. This restores compatibility to run
on Windows.
2023-05-29 10:53:08 -07:00
Paul Wells
e03b7ef8de start signal relay sessions with the correct node (#1721)
* start signal relay sessions with the correct node

* enable signal relay in multiregion integration test
2023-05-18 12:39:02 -07:00
David Colburn
c3d6ecca6e check egress status on UpdateStream failure (#1716) 2023-05-17 16:46:22 -07:00
Benjamin Pracht
4244542840 Adopt WebRTCConfig from mediatransportutil (#1707)
This also adds support for inline fields in ToCLIFlagNames
2023-05-10 20:00:34 -07:00
David Colburn
0a3c22993e Remove deprecated egress client (#1701)
* remove deprecated egress client

* don't copy mutex
2023-05-09 16:54:32 -07:00
Raja Subramanian
3fb93135f5 Experimental flag to try time stamp adjustment to control drift. (#1687)
* Experimental flag to try time stamp adjustment to control drift.

There is a config to enable this.

Using a PID controller to try and keep the sample rate at expected
value. Need to be seen if this works well. Adjustment are limited
to 25 ms max at a time to ensure there are no large jumps.
And it is applied when doing RTCP sender report which happens
once in 5 seconds currently for both audio and video tracks.

A nice introduction to PID controllers - https://alphaville.github.io/qub/pid-101/#/
Implementation borrowed from - https://github.com/pms67/PID

A few things TODO
1. PID controller tuning is a process. Have picked values from test from
   that implementation above. May not be the best. Need to try.
2. Can potentially run this more often. Rather than running it only when
   running RTCP sender report (which is once in 5 seconds now), can
   potentially run it every second and limit the amount of change to
   something like 10 ms max.

* remove unused variable

* debug log a bit more
2023-05-06 11:52:57 +05:30
David Zhao
5fcd682fb0 Refactor participant metadata updates to avoid duplication (#1679)
* Refactor participant metadata updates to avoid duplication

* generated fakes
2023-05-03 13:50:45 -07:00
Benjamin Pracht
11749eace9 Add support for creating WHIP ingress (#1674) 2023-05-02 13:26:47 -07:00
Raja Subramanian
35b8319b08 Remove disallowed subscriptions on close. (#1668)
With subscription manager, there is no need to tell a publisher
about a subscriber going away. Before subscription manager,
the up track manager of a participant (i. e. the publisher side)
was holding a list of pending subscriptions for its published tracks
and that had to be cleaned up if one of the subscriber goes away.
That is not the case any more.

Also set publisherID early so that subscription permission update has
the right publisherID. In fact, saw an empty ID in the logs and saw
that we still have the disallowed subscription handling which is not
necessary any more.
2023-04-29 09:18:07 +05:30
Benjamin Pracht
a08cd23b6d Adopt pion logging initialization moving to protocol (#1667) 2023-04-28 10:51:41 -07:00
Paul Wells
fc09cacfce increase level for signal stream closed log messages (#1660)
* increase level for signal stream closed log messages

* ensure stream closes on signal close receipt

* cleanup
2023-04-27 08:30:40 -07:00
Paul Wells
f9f89cd7cf close signal with reliable message (#1658)
* close signal with reliable message

* update protocol
2023-04-26 22:59:39 -07:00
David Zhao
3f64828a77 Send Room updates when participant counts change (#1647)
Reduces the number of unneeded generation with ProtoProxy
2023-04-22 21:08:59 -07:00
Paul Wells
a77eb2a07d add room node assignment check to signal relay (#1645) 2023-04-22 07:05:07 -07:00
David Colburn
ab6c994db4 update protocol/psrpc (#1643)
* update protocol/psrpc

* metadata references
2023-04-21 12:43:20 -07:00
Paul Wells
70041f004f create signalStats from out of order join (#1640) 2023-04-20 03:27:41 -07:00
cnderrauber
09af509edb Add subscription limits (#1629)
* Add subscription limits

* Add limit to ParticipantParams

* Don't change desired of subscription when reaching limits

* Add subscription limits config

* Revert comment

* solve comments
2023-04-20 14:15:30 +08:00