Commit Graph

1190 Commits

Author SHA1 Message Date
cnderrauber bd42caf378 export ExtrackICEExtractICECredential for server-sdk-go 2022-08-17 14:47:31 +08:00
David Zhao d9059f4f3b Do not accept websocket connection if response not received (#923)
When the instance handling the signal request did not respond to the
initial connection, we will fail the connection attempt instead of
having it hang forever.
2022-08-16 19:57:41 -07:00
Raja Subramanian 3f53dea223 Log ICE candidates on peer connection established to get remote also (#922) 2022-08-16 15:31:16 +05:30
Raja Subramanian d9fdcf8c2b Promoting a few logs to Info (#921)
* Promoting a few logs to Info

Also, adding a couple of more info logs which I will remove later
after some debugging.

* mime type

* Protect pause/max layer

* notify even if not bound
2022-08-16 13:03:14 +05:30
David Zhao 1d199d1efa Populate network field when set by clients (#919) 2022-08-15 23:28:15 -07:00
renovate[bot] 6b48fbc577 Update module github.com/urfave/cli/v2 to v2.11.2 (#914)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-15 13:36:11 -07:00
Raja Subramanian 4f19866578 TrackInfo may not be available in Bind. (#918) 2022-08-15 21:18:22 +05:30
Raja Subramanian eaaec0aae1 Only change committed quality in update. (#917) 2022-08-15 17:29:52 +05:30
cnderrauber c38d4df52f server side codec preference for publish (#916) 2022-08-15 18:46:24 +08:00
Raja Subramanian 9d22225e92 A few misc changes (#915)
- Do not update jitter on padding only packet.
Padding only packet may not have proper timestamp.
If it does, it probably has the time stamp of the
last packet with payload. That will also affect
jitter calculation, i. e. wall clock time is moving,
but RTP time is the same.
- Do not send `onMaxLayer` changed on bind.
It was probably racing with update when max layer
is updated when adaptive stream is off. There is
no need to send that update as the default would
be OFF. It will be enabled when adaptive stream
subscription turns it on or when max layer is
set when down track bind happens and adaptive stream
is off.
2022-08-15 15:57:19 +05:30
Raja Subramanian b5c023f986 Connection quality changes (#913)
* WIP commit

* Connection quality changes

- Fix Firefox showing poor quality
  o The issue was that we were using max available layer and
    calculating quality. The rationale being that even if
    server sends dynacast messages, client may not implement
    dynacast and still stream all layers. But, with Firefox
    (maybe a Firefox bug), it sends some small amount of
    data on layer 2 even when that layer is disabled.
    Guessing it is probing (or actually we might be using
    some small value for high layers as Firefox cannot turn off
    layers). That higher layer gets used in quality calculation.
    As the bit rate on that layer is extremely low, it yields low
    score.

    Fixed by considering the max expected layer. That is of most
    interest. Yes, clients may ignore dynacast and stream all layers,
    but, max expected is the one of interest. So, look for
    quality in the max expected layer and not max available layer.
- Lots of clean up around connection quality stuff
  o Use a dynamic scaling thing to ensure that we do not get bitten
    by absolute values. Calculate best possible scenario score and
    map that to maximum MOS score. This will ensure that different
    codecs, different settings do not mess up the scoring. For example,
    a client might use 1 Mbps for 720p, but a different client could
    use 2 Mbps for 720p. As an SFU/infrastructure middlebox, we do
    not have control over quality at those rates. We can only ensure
    that streaming happens smoothly at those rates. So, in that
    example, for client 1, 1 Mbps will map to MOS 5.0 and for client 2,
    2 Mbps will map to MOS 5.0. Any impairments after that will
    reflect in the score.
  o Penalise for missing target layer by one level for one layer missed.
  o Move tests to connection quality directory. The participant test
    was not super useful.

* Add missed file

* Remove debug code

* use more constants and initialise normalisation factor

* rtcscore pointer
2022-08-15 13:21:07 +05:30
Raja Subramanian dbcc53f04e Use media payload size in scoring. (#912)
* Use media payload size in scoring.

Subtract out header bytes when calculating score.
This does not seem to affect the score (under perfect conditions),
but, using header bytes will inflate the bit rate and
will affect scoring.

* Add header bytes to ToProto

* protocol pointer

* fix test
2022-08-14 13:22:58 +05:30
renovate[bot] d41f5587e6 Update module go.uber.org/atomic to v1.10.0 (#906)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-12 13:10:54 -07:00
renovate[bot] 1c11bb29e3 Update module github.com/pion/sdp/v3 to v3.0.6 (#903)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-12 13:10:19 -07:00
Raja Subramanian 6acd2944bc As "remote" is a logging context key already, use a different name. (#910) 2022-08-12 23:51:20 +05:30
Raja Subramanian b7c44f1ecd Move reset of local description sent on ICE restart internally (#909) 2022-08-12 13:04:06 +05:30
Raja Subramanian 692c4d804f Cache local candidates till local description is sent (#908) 2022-08-12 12:31:26 +05:30
Raja Subramanian 641f8d4519 Transport refactor (#907)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* fix tests

* debug logs

* Remove comments

* Fix data channel creation on migration and clean up unused stuff

* log offer/answer send/receive
2022-08-12 11:20:54 +05:30
David Zhao a611fe017a Add twitter follow badge (#880) 2022-08-11 13:01:40 -07:00
David Zhao f09885825e Return ServerInfo to clients on join (#904)
* checkpoint

* Return ServerInfo in join response

* also include node information

* less verbose quality score

* update go modules
2022-08-10 17:04:17 -07:00
renovate[bot] 1b7c8ddba4 Update golang Docker tag to v1.19 (#905)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-10 14:11:33 -07:00
Raja Subramanian 2192b0fc8d Limit dynacast to video and media loss proxy to audio (#902)
* Limit dynacast to video and media loss proxy to audio

Was looking at keeping the track type out of those modules
and do a check at a higher level, but it is a bit unwieldy.
So, adding checks to the modules.

Also, ensuring that media loss proxy does not reset unconditionally
every second. Audio RTCP happens once in 5 seconds or so.
So, if server proxied let say 2% at t = 5, t = 6 would have
proxied 0 loss which may or may not be true. So, ensure that
a report was received and proxy value is updated by an actual
report.

* Remove track type from modules
2022-08-10 11:30:49 +05:30
Raja Subramanian 49cf15cdca Fix filtering candidates (#901)
* Filter candidate after setting description

* comment

* Fix filtering candidates

- For offer/answer from remote, do filtering before setting remote
  description so that Pion does not see filtered candidates
- For offer/answer originating from server, do filtering after setting
  local description (comments in code) so that remote side does not
  see filtered candidates.
- Make logging a little consistent and use right context.

* Comment

* TCP fallback config and UT (broken now)

* log SDP only when preferring TCP

* Remove TCP fallback test attempt
2022-08-10 10:42:46 +05:30
Benjamin Pracht 67d3f21122 Only update an IngressInfo if the StartedAt field is newer or equal to the one currently in storage (#897)
This is meant to ensure that we will not overwrite the state of an ingress that already reconnected to a different server on failure or timeout
2022-08-09 19:07:56 -07:00
Raja Subramanian 4ec7e71b2d Logging negotiation as we are seeing some errors with filtering candi… (#900) 2022-08-09 16:57:15 +05:30
Raja Subramanian 82439538e7 Do not send blank frame if not sending leave (#899) 2022-08-09 15:54:59 +05:30
Raja Subramanian 4d7df612ec Refactor DynacastQuality & MediaLossProxy into separate modules (#894)
* WIP commit

* Refactor media loss proxy

* Use DynacastQuality and MediaLossProxy from MediaTrack

* fix test

* Remove unused param

* Remove unused interfaces

* Move interface methods to local

* Split out DynacastManager

* have to add codec to dynacast manager

* RUnlock

* fix restart

* Adding API to force quality and also maintain closed state

* Address PR comments
2022-08-09 11:47:06 +05:30
renovate[bot] 21ffc03a0c Update module go.uber.org/zap to v1.22.0 (#896)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-08 14:44:22 -07:00
cnderrauber 1d2bca373b queue restart ice offer while publisher pc gathering ice (#895)
* queue restart ice offer while publisher pc gathering ice

* fix test case fail
2022-08-08 15:40:45 +08:00
David Zhao 939757d2c8 Bulk update dependency versions (#889) 2022-08-06 17:11:03 -07:00
renovate[bot] 584abd5959 Update module github.com/pion/interceptor to v0.1.12 (#887)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:47:05 -07:00
renovate[bot] 9e600181c2 Update module github.com/pion/rtcp to v1.2.10 (#888)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:46:58 -07:00
David Zhao 4222f51758 updated action versions (#885)
* updated action versions

* docker to use go 1.18
2022-08-06 13:40:40 -07:00
renovate[bot] 0918670318 Update golang.org/x/sync digest to 886fb93 (#886)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:40:11 -07:00
renovate[bot] fa4c660a13 Update module github.com/pion/webrtc/v3 to v3.1.43 (#884)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:34:43 -07:00
renovate[bot] 1c57771646 Update module github.com/mackerelio/go-osstat to v0.2.2 (#882)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:28:23 -07:00
renovate[bot] 159a53254a Update module github.com/bep/debounce to v1.2.1 (#881)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-06 13:27:38 -07:00
renovate[bot] 23d8b73aa9 Configure Renovate (#879)
* Add renovate.json

* configure

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: David Zhao <dz@livekit.io>
2022-08-06 13:22:00 -07:00
Raja Subramanian 07ac4da86b Log setting ICE config in participant (#877) 2022-08-06 12:06:07 +05:30
David Zhao 15a5f447da Fix Linux install script for non-root users (#876) 2022-08-05 16:01:22 -07:00
Raja Subramanian 4703e30047 Use constants (#875) 2022-08-06 00:15:00 +05:30
Raja Subramanian ab4d57ab5b Filter out UDP candidates from SDP if allowing only TCP. (#874)
* Filter out UDP candidates from SDP if allowing only TCP.

* Do it properly

* static check

* Adding TCP candidates to test
2022-08-05 23:11:07 +05:30
David Zhao ab1ccae0c7 Respond to signal ping / pong (#871)
* Respond to signal ping / pong

* Pass back 1 for pong for now, we don't need the timestamp

* update protocol
2022-08-05 09:24:47 -07:00
Raja Subramanian c75090a0fe Use a TTL of 1 hour for ICE config cache (#873) 2022-08-05 17:31:28 +05:30
Raja Subramanian 3f16018b62 Cache ICE config in room manager. (#872)
* Cache ICE config in room manager.

* mage generate

* Read ICE config within lock
2022-08-05 12:49:19 +05:30
Raja Subramanian 339181a534 Enable fallback to TCP. (#870) 2022-08-05 10:49:34 +05:30
Benjamin Pracht 0cffbe69e9 Fix ingress stream key lookup and avoid nil dereference when room in auth claims doesn't match (#869) 2022-08-04 16:22:55 -07:00
Benjamin Pracht c333b7a026 Add support for Ingress service (#868)
Also check for Join permission on ingress API calls
2022-08-04 09:48:53 -07:00
Raja Subramanian 6b6f61b4df Adding transport fallback (#866)
* Adding transport fallback

Commented out for now so that we can gather some data.

* Promoting a few logs to info
2022-08-03 23:03:10 +05:30
Raja Subramanian 3c9a2cc66a Log selected ICE candidate pair (#865)
* Log selected ICE candidate pair

* simplify
2022-08-03 13:31:37 +05:30