Commit Graph

1189 Commits

Author SHA1 Message Date
Raja Subramanian a3f2ca56f9 TWCC based congestion control - v0 (#3165)
* file output

* wake under lock

* keep track of RTX bytes separately

* packet group

* Packet group of 50ms

* Minor refactoring

* rate calculator

* send bit rate

* WIP

* comment

* reduce packet infos size

* extended twcc seq num

* fix packet info

* WIP

* queuing delay

* refactor

* config

* callbacks

* fixes

* clean up

* remove debug file, fix rate calculation

* fmt

* fix probes

* format

* notes

* check loss

* tweak detection settings

* 24-bit wrap

* clean up a bit

* limit symbol list to number of packets

* fmt

* clean up

* lost

* fixes

* fmt

* rename

* fixes

* fmt

* use min/max

* hold on early warning of congestion

* make note about need for all optimal allocation on hold release

* estimate trend in congested state

* tweaks

* quantized

* fmt

* TrendDetector generics

* CTR trend

* tweaks

* config

* config

* comments

* clean up

* consistent naming

* pariticpant level setting

* log usage mode

* feedback
2024-11-11 10:24:47 +05:30
Raja Subramanian 653857e42b Split out audio level config. (#3163)
* Split out audio level config.

Inline it in yaml as it is exposed/documented config.

* test

* default congestion control enable
2024-11-08 21:36:38 +05:30
Raja Subramanian 86383b2271 De-centralize some configs to where they are used. (#3162)
* De-centralize some configs to where they are used.

And make default variables.

Renaming a bit, but these are all internal config and have not been
added to documented config.

* Keep documented config as is.

* test

* typo
2024-11-08 12:47:30 +05:30
Raja Subramanian 365e63230d Some misc clean up. (#3156)
* Some misc clean up.

- Have been seeing counterfeiter warnings about efficiency for a while
  with go:generate declaration multiple times in the same package.
  Address that: https://github.com/maxbrunsfeld/counterfeiter?tab=readme-ov-file#step-2b---add-counterfeitergenerate-directives
- A bit more readability on parameters passed to `sendLeave`

* spacing

* revert some deletes as the complaint was in analytics service only

* Declare in package only once.

Although the warning is about go:generate multiple times when directly
giving the interface to generate, have `go:generate` multiple times in a
package even with `-generate` ends up generating once per invocation.
Once per package is enough to run the generation just once.
2024-11-04 11:26:41 +05:30
Raja Subramanian 35bef35d66 Clean up drop ICE candidates. (#3153)
* Clean up drop ICE candidates.

With pion/ice v2.3.37, ICE Lite will accept use-candidate from peer.
So, there is no need to drop candidates.

Still leaving the FF change to not use Lite which was added as part of
this effort initially due to how FF does nominations. Updated comment to
explain why.

* clean up test
2024-11-02 10:50:55 +05:30
Raja Subramanian 1c80ce8308 Only drop srflx if configured. (#3149) 2024-10-30 21:20:34 +05:30
Raja Subramanian da9bd7f426 make a util of IP address truncation for logging. (#3148)
* make a util of IP address truncation for logging.

* exported method
2024-10-30 19:44:41 +05:30
cnderrauber 526985f109 don't return video/rtx to client (#3142) 2024-10-26 22:29:04 +08:00
Raja Subramanian 024a75d27c display related only when address is valid (#3137) 2024-10-24 18:26:56 +05:30
Raja Subramanian fbdc2491d9 Log truncated (#3136)
* Log truncated

* add related address
2024-10-24 16:24:54 +05:30
Raja Subramanian b8c6b1f1ec Log ICE connection info on failure. (#3134)
- Truncate public remote IP
- Log only on short connection to avoid logging too much
2024-10-24 14:30:04 +05:30
Raja Subramanian de102f32db Display both pairs on selected candidate pair change (#3133)
* Display both pairs on selected canddiate pair change

* disable ICE lite for Firefox
2024-10-23 21:30:52 +05:30
Raja Subramanian 487a3fc3fb ICE candidate marking (#3128)
- Update filtered if dropping a pending candidate later.
- Ordinal for selected pair so it is easy to see which got selected
  later.
2024-10-22 20:23:55 +05:30
cnderrauber b30cc9066a Drop remote candidates based on lite option (#3127)
Only drop remote candidates if remote peer is
not lite and local peer is lite.
2024-10-22 17:53:40 +08:00
David Zhao dd7cd7eafc Handle room configuration that's set in the grant itself (#3120)
* Handle room configuration that's set in the grant itself

* ensure refresh token contains updates

* deps

* dep

---------

Co-authored-by: Paul Wells <paulwe@gmail.com>
2024-10-21 23:31:12 -07:00
David Zhao 3e7185f264 chore: add check to skip launching TrackEgress for Egress participants (#3125)
Egress participants don't publish, so there is no functionality change
2024-10-21 20:47:41 -07:00
Raja Subramanian a564f7fbe6 Add option to drop remote ICE candidates. (#3118)
Defaults to OFF.
2024-10-19 10:30:22 +05:30
Raja Subramanian 182a073353 Log ICE reconnected when selected pair changes. (#3117)
Logging selected pair when ICE connection state changed could have
picked up previous selected pair.

Also, log shortened remote IP and remote port.
2024-10-18 23:32:18 +05:30
Raja Subramanian 44a74fc06a Clean up sending raw mime as well. (#3113) 2024-10-18 00:34:29 +05:30
Raja Subramanian 40b10af960 Use monotonic time util. (#3112)
Thank you @paulwe for doing this. I was promising to do this for a
while, but just like other times, empty promises :-(
2024-10-17 10:49:24 +05:30
Raja Subramanian 792964ad1c Always add upper case mime for video to work around a prefix trim issue (#3106) 2024-10-16 15:32:37 +05:30
Raja Subramanian 634b1f9261 Populate raw mime when there is one already (#3104) 2024-10-16 13:03:26 +05:30
Raja Subramanian c8bb3345c6 Send raw mime type also in subscribed qualities. (#3103) 2024-10-16 11:45:12 +05:30
Raja Subramanian 8b604df32a Set FEC enabled properly in connection stats module. (#3098)
* Set FEC enabled properly in connection stats module.

With RED, the FEC indication is in primary codec.

Also, clean up some bits that were not necessary (TrackInfoAvailable is
not needed)

TODO: There are still a couple of things to figure out
- If codec is RED, Opus is added as second codec synthetically using
  https://github.com/livekit/livekit/blob/33098337fc17705bbdb3283c7a7034aa6b2f3745/pkg/rtc/mediaengine.go#L31
  which hard codecs FEC enabled. Ideally, we should get the primary
  codec parameters from SDP offer.
- The WebRTCReceiver does not have information about primary codec. For
  now, just setting FEC to true when RED is enabled. It is okay as it
  just affects when we declare quality drops, but ideally the primary
  codec should be retrieved from SDP offer.

* clean up and comment

* full prop check
2024-10-15 17:39:42 +05:30
cnderrauber 9147120915 Exclude session start time from publishing time (#3089) 2024-10-12 10:19:33 +08:00
cnderrauber cf59267631 Add counter for pub&sub time metrics (#3084)
* Add counter for pub&sub time metrics

The pub&sub shows large value in migration related case like
muted/disabled migration, the subscription time depends on
the time when publisher unmute the track(sending rtp packet
after migration), add a counter to distinguish since we
can't control the time in such cases and the first subscription
attemps also is more meaningful than those cases.

* Add info log for high publish delay
2024-10-11 12:07:24 +08:00
cnderrauber c8dbe8e977 reset subscription time when downtrack closed and expect resume (#3083) 2024-10-10 16:06:44 +08:00
Raja Subramanian 6829ec8600 Fix codec name normalisation. (#3081)
With lower case mime type, TrimLeft lopped off the `v` in `vp8` too and
the coded name ended up being `p8`.
2024-10-10 10:09:40 +05:30
Raja Subramanian 8589043979 Use lower case mime type in dynacast. (#3080)
Seeing instances of both lower case and upper case mime in dynacast
manager which created duplicate entries.

Also, move the dyncast files a package.

TODO: Need to do audit and come up with a consistent way to always use
lower case for mime type.
2024-10-10 07:57:54 +05:30
Paul Wells 119113a5e9 use proto logger for ice config (#3079) 2024-10-09 09:13:42 -07:00
cnderrauber 64d89dc2f8 Use difference debounce interval in negotiation (#3078)
Transport will send offer immediately if last
negotiation is before debounce interval in #1929,
it will cost two negotiation for a/v tracks if a
pubisher publishes two tracks at same time like
screenshare or enable mic/camera. This change use
a small debounce interval in this case to avoid this issue.
2024-10-09 21:13:05 +08:00
Raja Subramanian 2f674f647e Log before and after, was not logging the new one in the last change. (#3075) 2024-10-09 09:22:52 +05:30
Paul Wells 00ac004604 use AgentDispatch in internal request (#3074)
* use AgentDispatch in internal request

* deps

* deps

* deps
2024-10-08 01:25:00 -07:00
Raja Subramanian 7c26d4a75a Log track update (#3073)
* Log track update

* trackID for pending
2024-10-08 12:26:36 +05:30
Ben Cherry 2faebb6b47 Forward rpc data packets (#3067)
* forward

* remove logs

* nil checks

* log

* log
2024-10-07 22:42:18 -07:00
Paul Wells 4c2b154c41 start jobs with started state (#3070)
* start jobs with started state

* deps
2024-10-07 04:09:10 -07:00
Denys Smirnov af15f211d0 Forward new disconnect reasons for SIP. (#3056) 2024-10-03 16:36:47 +03:00
Paul Wells c9d2552cb3 accept any participant type source to BroadcastMetricsForRoom (#3063) 2024-10-03 05:51:02 -07:00
Paul Wells 119e11e191 check data messages for nil payloads (#3062)
* check data messages for nil payloads

* more checks

* cleanup
2024-10-03 05:19:27 -07:00
Raja Subramanian 8ac33a868c Splitting out rtp stats stuff into its own package. (#3060)
* Splitting out rtp stats stuff into its own package.

Going to be making some lighter versions of these.
Will be cleaner to have all of these grouped together.
So, as a first step, just making a package for it.

* tests
2024-10-03 15:51:24 +05:30
cnderrauber 3a77f2c733 change comment of disable fast negotiation for migration (#3053) 2024-09-27 15:18:34 +08:00
Raja Subramanian 45f23f6fc4 Update protocol to get lower case check for kind and source. (#3048)
Also, log kind in starting RTC session and store a clone always in
participants.
2024-09-26 15:45:42 +05:30
Raja Subramanian 49be2514e0 Use the IsAgent check for transcription forwarding. (#3047)
VideoGrant could have the agent flag set.
2024-09-26 13:12:32 +05:30
Raja Subramanian abee3c3403 Fix forwarding of transcription message. (#3044)
Had to introduce some flags in
https://github.com/livekit/livekit/pull/2950/files to do selective
forwarding, but messed up the sense of the transcription message forward
flag.
2024-09-26 10:43:09 +05:30
cnderrauber 73900be59d Set mime_type for tracks don't have simulcast_codecs (#3040)
go sdk don't have simucalst_codecs set could cause
partial track info broadcast to other nodes.
2024-09-24 15:36:08 +08:00
Paul Wells d26ade0076 add helpers for partiicpant reconnect and version (#3034) 2024-09-22 23:37:35 -07:00
cnderrauber eed925fddf avoid race condition on downtrack.Codec (#3032) 2024-09-22 14:27:26 +08:00
Paul Wells 61179d5624 simplify agent registration (#3018)
* simplify agent registration

* testutils

* deps

* fix

* gen

* cleanup

* lower job load
2024-09-19 05:58:30 -07:00
lukasIO 94d7b1708f Allow agents to override sender identities on ChatMessage (#3022)
* Allow agents to override sender identities on ChatMessage

* temporarily replace protocol

* check for empty identity

* string compare instead of identity compare

* update protocol

* Fix typo

* whitespace
2024-09-19 11:11:14 +02:00
Paul Wells 370f386dd0 add convenience methods to participant (#3016)
* add convenience methods to participant

* tidy
2024-09-19 00:20:22 -07:00