Commit Graph

189 Commits

Author SHA1 Message Date
Raja Subramanian
09e3aef859 Check size limits on metadata and name set from client. (#2850)
* Send error response when update metadata fails.

Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT

* Check size limits on metadata and name set from client.

Added a name length limit also.

* check name length in service update participant path also

* limit check in limit config

* update protocol

* longer keys
2024-07-12 09:57:17 +05:30
Benjamin Pracht
32a4d03c9e Implement Agents protocol addition (#2786) 2024-06-27 19:20:52 -07:00
holzgeist
6523c9c099 Feat add prometheus auth (#2252)
* feat: add support for basic auth on prometheus

* fix: properly name middleware generator

* refactor: move all prometheus configs into common object

* chore: add suggestions from review

add back old config switch and print warning if it is used

* fix: undo accidental change

* fix: rebase/merge issue
2024-06-27 02:13:51 -07:00
David Zhao
7a774cc82a Support for participant attributes (#2806)
* Support for participant attributes

* move metadata setters to LocalParticipant

* address feedback

* forward error

* update go mod

* update attributes first
2024-06-19 23:14:19 -07:00
Paul Wells
58e365847b add test helper for config yaml tags (#2791)
* add test helper for config yaml tags

* deps

* cleanup

* cleanup
2024-06-13 23:22:39 -07:00
cnderrauber
e6aa36fdd6 Add forward stats (#2725)
* Add forward metrics

* ignore packets was not forwarded

* rename
2024-05-24 17:43:28 +08:00
Paul Wells
9a5db132eb add room/participant name limit (#2704)
* add room/participant name limit

* defaults

* simplify

* omitempty

* handle 0 config

* fix race

* unlock

* tidy
2024-05-06 17:25:18 -07:00
Mathew Kamkar
10c8582a6b get cpu stats from cgroup, remove env (#2636)
* get cpu stats from cgroup, remove env

* undo rand seed removal

* tests
2024-04-08 21:15:17 -07:00
Raja Subramanian
8852d71a8a Disable audio loss proxying. (#2629)
* Disable audio loss proxying.

Added a config which is off by default.
With audio NACKs, that is the preferred repair mechanism.
With RED, repair is built in via packet redundancy to recover from
isolated losses.
So, proxying is not required. But, leaving it in there with a config
that is disabled by default.

* fix test
2024-04-06 11:28:04 +05:30
Paul Wells
d87f8aa299 use departure timeout (#2549)
* use departure timeout

* deps

* default

* remove constants

* deps

* protoproxy cache

* add sample
2024-03-05 09:05:42 -08:00
Raja Subramanian
7649e4ffab Post data and signal stats once in 5 minutes (#2518) 2024-02-27 15:45:32 +05:30
Raja Subramanian
6895eff496 Buffer size config for video and audio. (#2498)
* Buffer size config for video and audio.

There was only one buffer size in config.
In upstream, config value was used for video.
Audio used a hard coded value of 200 packets.

But, in the down stream sequencer, the config value was used for both
video and audio. So, if video was set up for high bit rate (deep
buffers), audio sequencer ended up using a lot of memory too in
sequencer.

Split config to be able to control that and also not hard code audio.

Another optimisation here would be to not instantiate sequencer unkess
NACK is negotiated.

* deprecate packet_buffer_size
2024-02-21 22:58:56 +05:30
Benjamin Pracht
b659fef8ed Add support for ingress ParticipantMetadata (#2461) 2024-02-08 13:59:26 -08:00
Paul Wells
fd35c9edfc add exponential backoff to room service check retries (#2462) 2024-02-07 19:35:58 -08:00
Paul Wells
4bce0e7ed4 fix startup with -dev and -config (#2442) 2024-02-03 14:57:07 -08:00
Paul Wells
3f2f850bdb clean up legacy rpc (#2384)
* clean up legacy rpc

* cleanup

* cleanup

* cleanup

* tidy

* cleanup

* cleanup
2024-01-14 01:49:26 -08:00
Kou
5dc87d7ac5 Fix panic occurs when starting livekit-server with key-file option (#2312) (#2313) 2023-12-20 23:18:28 -08:00
Sean DuBois
702e562f9f Add SIP Support (#2240) 2023-11-14 14:24:54 -05:00
Paul Wells
de7532b5a1 split room and participant services (#2205)
* merge

* tidy

* deps
2023-10-31 21:28:21 -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
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
David Zhao
4c9d95149d Enable SVC codecs by default (#2109) 2023-09-27 21:16:13 -07:00
Raja Subramanian
a624e30b74 Use marshal + unmarshal to ensure unmarshallable fields are not copied. (#2092)
* Use marshal + unmarshal to ensure unmarshallable fields are not copied.

Need to ensure that config structs/fields are marshallable.

There was a use of a = b copy of struct and some of the embeded structs
had locks and copying was not good.

* update protocol

* Update deps
2023-09-20 00:23:49 +05:30
cnderrauber
e46da0705a Add max playout delay config (#2089)
* Add max playout delay

* config sample
2023-09-19 11:30:38 +08:00
Raja Subramanian
83353d821c Make a config option to skip unmanaged tracks in bandwidth estimation (#2050)
* WIP commit

* Make a config option to skip unmanaged tracks in bandwidth estimation
2023-09-08 20:59:58 +05:30
cnderrauber
75ffb25d77 Parse PortRange of UDPPort from cli flag (#2039) 2023-09-06 14:17:49 +08: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
David Zhao
d6ebc081d5 Use random NodeID instead of MAC based (#2029)
Makes it possible to run multiple instances of livekit-server locally.

Also enables Signal Relay by default as default signal proxy.
2023-09-02 17:36:55 -07: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
Raja Subramanian
c1dfc9741c Stream allocator tweaks (#1936)
* Prevent re-allocation if possible

* log commitThreshold

* Collapse same values in the front
2023-08-04 13:47:54 +05:30
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
11bdda0779 Temper stream allocator more (#1920)
* Temper stream allocator more

* gofmt

* AllowPause default
2023-07-31 12:45:21 +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
38c4eba5a3 Fix spelling (#1911) 2023-07-27 12:02:12 +05:30
Raja Subramanian
ee1c23eb02 Move congestion controller channel observer params to config (#1910) 2023-07-27 11:48:22 +05:30
kannonski
cf4801064d changing key file permissions control (#1893) 2023-07-19 14:23:30 -07:00
Raja Subramanian
6198aac7a8 Make a default config variable (#1848)
* Make a default config variable

* decoder.Decode needs pointer to config
2023-07-03 23:49:03 +05:30
Raja Subramanian
69a1e572be Attempt to reduce disruption due to probe. (#1839)
* Make congestion controller probe config

* Wait for enough estimate samples

* fixes

* format

* limit number of times a packet is ACKed

* ramp up probe duration

* go format

* correct comment

* restore default

* add float64 type to generated CLI
2023-06-30 11:09:46 +05:30
Raja Subramanian
7ed3af193a No proof that this helps (#1772) 2023-06-06 11:28:13 +05:30
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
Benjamin Pracht
f401c44a46 Move TURNServers back to livekit-server (#1715) 2023-05-17 15:24:17 -07:00
Raja Subramanian
c79e0ce06f Make signal close async. (#1711)
* Make signal close async.

Left notes about async close in code.

Also reducing retry config timeout
- Timeout to 7.5 seconds (making it 1/4th of current config)
- max retry to 4 seconds
- so, it can do 4 tries now in 7.5 seconds (with retries ending at 0.5
  seconds, 1.5 seconds, 3.5 seconds, 7.5 seconds). The change of max to
  4 seconds is not really needed, but it lined up with 7.5. So, made the
  change.

* update comments a bit
2023-05-16 14:08:17 +05:30
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
Benjamin Pracht
11749eace9 Add support for creating WHIP ingress (#1674) 2023-05-02 13:26:47 -07:00