Commit Graph

158 Commits

Author SHA1 Message Date
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
Benjamin Pracht
a08cd23b6d Adopt pion logging initialization moving to protocol (#1667) 2023-04-28 10:51: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
Paul Wells
eb095db70a Batch signal retries (#1593)
* batch signal retries

* cleanup

* update protocol

* range check message dedup

* update protocol with codegen

* block while draining

* only log send timeouts

* cleanup

* cleanup

* cleanup

* typo

* update config yaml options

* update protocol
2023-04-09 18:18:21 -07:00
David Zhao
a12f467e7a chore: added omitempty to optional config entries (#1594) 2023-04-09 17:51:33 -07:00
David Colburn
191a9e8014 update core to 0.0.5 (#1540)
* update core

* sort imports

* fix typos

* redundant types
2023-03-22 16:53:23 -07:00
Paul Wells
54bf7e0dac allow configuring signal message buffer size (#1504)
* allow configuring signal message buffer size

* update psrpc
2023-03-08 17:34:14 -08:00
Paul Wells
2c93d55e5c add stream retry middleware for signalling (#1503) 2023-03-08 00:51:19 -08:00
Paul Wells
e22de045ba add signal psrpc service (#1485)
* add signal psrpc service

* update protocol dep

* refactor for cloud

* update psrpc

* pr feedback
2023-03-03 15:49:46 -08:00
cnderrauber
c367c36d8f Add config for active red encoding (#1476) 2023-02-28 10:44:47 +08:00
David Colburn
6da9e85636 Remove deprecated ingress rpc (#1439)
* remove legacy ingress rpcs

* remove from io service
2023-02-17 11:40:38 -08:00
Raja Subramanian
85a23bfffc Cleaning up availableLayers and exemptedLayers (#1407)
* WIP commit

* Send stream state paused only when it is paused due to bandwidth limitation.

When stream is resumed after a stream is paused, an active update is
sent. Note that this means if there are intervening events like
mute/unmute between pause and resume, resume will be sent.

* WIP commit

* fix compile

* WIP commit

* fixing tests

* clean up exempted layers

* clean up unused stuff

* correct comment

* Don't need ops queue as order is not important now

* static check

* kick off allocation when callbacks are set up, calling from receiver means callbacks may not be set up
2023-02-17 13:53:11 +05:30
shishirng
8856ce6422 Bump up interval for sending telemetry stats to 30 seconds (#1430)
Signed-off-by: shishir gowda <shishir@livekit.io>
2023-02-16 15:53:58 -05:00
Dan McFaul
1848a21eda add configurable environment value (#1421)
* add configurable prometheus env label

* Update pkg/config/config.go

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>

* Update cmd/server/main.go

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>

* Update config-sample.yaml

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>

* set config.Environment value to dev when in dev mode

* be more precise for config-sample

---------

Co-authored-by: Mathew Kamkar <578302+matkam@users.noreply.github.com>
2023-02-15 14:41:44 -07:00
Trey Hakanson
ce07914e44 Allow for strict ACKs to be disabled or subscriber peer connections (#1410) 2023-02-10 22:51:03 +05:30
cnderrauber
bccf7a6842 Add ice mdns config (#1311)
* Add use_mdns config

* Update config-sample.yaml

Co-authored-by: David Zhao <dz@livekit.io>

Co-authored-by: David Zhao <dz@livekit.io>
2023-01-18 16:51:49 +08:00
Paul Wells
a052ebd644 Ingress psrpc (#1295)
* add ingress psrpc codegen

* use psrpc for ingress

* merge entity/info update psrpc services

* split update/delete ingress methods

* add race helper test

* add race context cancel test

* sync race result with mutex
2023-01-12 11:00:43 -08:00
cnderrauber
c393a5f8dd Add interface and ipfilter to udpmux option (#1270)
* Add interface and ipfilter to udpmux option

* validate external ip is accessable by client

* add context

* use external ip only for firefox

* fix mapping error

* Update pion/ice and use external ip only for firefox

* Use single external ip for NAT1To1Ips if validate failed

* update pion/ice
2022-12-30 16:01:12 +08:00
Benjamin Pracht
7778cdf2cd Do not use the egress version stored in redis to decide whether to enable PsRPC. Use a conf entry instead (#1262) 2022-12-30 09:32:55 +13:00
Raja Subramanian
41a906ce92 Using tracker type per source type which allows diffferent impl for different sources (#1269) 2022-12-28 14:07:53 +05:30
Raja Subramanian
2b031a5112 Introducing frame based stream tracker. (#1267)
* Split stream tracker impl from base

* slight re-arrangement of code

* fps based stream tracker

* MinFPS config

* switch back to packet based tracker

* use video config by default to handle sources without type
2022-12-28 13:00:21 +05:30
Raja Subramanian
1a48cc6a8b Track subscription operations per source track. (#1248) 2022-12-23 12:23:26 +05:30
cnderrauber
05132799a5 config for streamtracker (#1255) 2022-12-23 09:48:56 +08:00
David Zhao
b1ba917a01 Validate keys to ensure sufficient security. (#1217)
JWT tokens are signed with HS256, and they must be 256 bits or longer to
guarantee security.
2022-12-07 22:25:28 -08:00
Raja Subramanian
6bd5504bff Add option to issue full reconnect on a publication error. (#1214)
* Add option to issue full reconnect on a publication error.

Leaving the publication error timeout at 30 seconds as there
are some publications taking long. Also, there are cases
where the peer connection fails after 30 seconds. The peer
connection failure happens after publication error is detected.
But, 30 seconds is a good amount of time for publication to establish.

* prevent recursive lock
2022-12-06 14:46:59 +05:30
David Zhao
12ae179be2 Configurable RoomService execution timeout (#1206)
* API execution timeout is now configurable

In certain environments, it can take longer than the default 2s to
fully execute API requests. Making execution timeout a configurable option.

* do not expose api to YAML. internal for now.
2022-12-04 10:13:09 -08:00
cnderrauber
6711060cdb Add enable loopback candidate option (#1185) 2022-11-23 16:01:36 +08:00
Tom Xiong
e5dabd466e Support redis cluster mode (#1181)
* use redisConfig of protocol instead of redisConfig and use redis of protocol to create redis client to support redis cluster mode too
2022-11-22 10:36:43 -08:00
Mathew Kamkar
8c8a4d245c command to show help with hidden generated flags (#1171) 2022-11-16 19:20:22 -08:00
Mathew Kamkar
b2493b49f7 baseFlags do not need to be set (#1127) 2022-10-26 14:20:13 -07:00
Mathew Kamkar
26fe910e88 Generated CLI Flags (#1112) 2022-10-25 22:24:08 -07:00
cnderrauber
759e3bb1f2 Refine nat 1to1 mapping setting (#1094)
Now only set mapping when user_external_ip enabled or node_ip is
explicitly set. If multiple local address resolved to same external
ip, only the first one will be mapped to external, avoid candidate
conflict between different clients.
2022-10-17 16:11:52 +08:00