Commit Graph

2693 Commits

Author SHA1 Message Date
Raja Subramanian 68387b41fe Minor tweak to keep RPC type at service level. (#3815) 2025-07-24 11:30:00 +05:30
Raja Subramanian a75295fcd5 More v2 signalling changes (#3814)
* More v2 signalling changes

- Use wire message in relay signal
- Generate offerId for SDP for sync mode also
- more checks for SDP offer/answer state to see if there are cases of
  missed/duplicate messages

* clean up
2025-07-24 10:14:01 +05:30
Raja Subramanian b20db94dc9 Validation end point for v2 signalling. (#3811)
* WIP

* stricter check

* WIP

* WIP

* clean up
2025-07-23 11:59:30 +05:30
Raja Subramanian fffc2ac090 Use signalling utils from protocol (#3807)
* Use signalling utils from protocol

* staticcheck
2025-07-21 18:15:06 +05:30
Raja Subramanian f5fc82d344 Filling out messages unlikely to change in v2. (#3806)
* Filling out messages unlikely to change in v2.

* deps

* remove defensive nil checks
2025-07-21 12:33:52 +05:30
Raja Subramanian 1c99b9ad5f Split signal segmenter and reassembler. (#3805)
* Split signal segmenter and reassembler.

As reassembler may need to run a goroutine for pruning, splitting it up
so that we do not have unnecessary goroutines. Keeping the UT unified
though.

Also, for now, trying to see if `Prune` can be called from external
place to avoid creating a goroutine and have extra state/functions to
close the reassembler and clean up goroutine etc. May still have to do
goroutine, but have not created one for now.

* fix: do not increase packetId for each fragment of a packet
2025-07-21 11:10:20 +05:30
Raja Subramanian 0a1bfd3092 Signal handling interfaces and participant specific HTTP PATCH. (#3804)
* HTTP PATCH on participant sid

* rename

* signal handler

* new files

* clean up

* clean up reassembly

* handle messages on server side

* deps

* staticcheck

* clean up
2025-07-20 22:47:36 +05:30
Raja Subramanian 7837c8e595 starting signaller interface (#3802)
* starting signaller interface

* WIP

* WIP

* WIP

* typo

* connect response check

* WIP

* clean up

* move signal handling to participant fully

* service methods

* type assertions for interfaces
2025-07-20 13:48:40 +05:30
Benjamin Pracht 18ce524455 Handle Metadata field from RoomConfig (#3798) 2025-07-18 10:37:23 -07:00
Raja Subramanian 2a6a9b8a4a Grouping all signal messages into participant_signal. (#3801)
Currently, it is a bit of a mish-mash
- some compose the message fully and just call send()
- some give parameters and the message is composed in
  participant_signal.go

Was thinking about making an interface for signalling and have v1/v2
impls, but did not want to repeat composing messages if there are common
messages. And some of those function reach into `ParicipantImpl` object
and use information (simple example of p.IsReady()) which would become
more elaborate if the signaller is split out into its own struct.

Maybe, just need to make an interface for the sink and send to the
correct sink based on v1 /v2 signal transport.

But, for now, just grouping all signal messaages in one file
so that it is easier to manage later.
2025-07-18 15:24:52 +05:30
Raja Subramanian 078c01fad3 Signal v2: envelope and fragments as wire message format. (#3800)
* Signal v2: envelope and fragments as wire message format.

Please see details in https://github.com/livekit/protocol/pull/1133

* log connect response
2025-07-18 15:24:32 +05:30
Raja Subramanian b9a44c3fbf Signalling V2 protocol implementation start (#3794)
* WIP

* name

* refactor validate

* WIP

* WIP

* signal cache initial impl

* HandleConnect in room manager

* generate subscriber offer

* handle ConnectRequest as stand alone

* segmentation, reassembly

* clean up

* rearrange

* lock scope

* support metadata in connect request

* prom

* add SifTrailer to ConnectResponse

* prom for get offer error counter

* RtcInit counter

* Jie feedback

* signal client

* consolidate v1 and v2 into SignalClient

* clean up

* comment

* deps

* mage generate

* fix tests

* pass around roomName and participantIdentity

* mage generate
2025-07-18 00:01:21 +05:30
Paul Wells ba702a5323 forward agent id to job state (#3786)
* forward agent id to job state

* deps
2025-07-16 14:17:13 -07:00
Benjamin Pracht 1f31d430b0 Map ErrNoResponse to ErrRequestTimedOut in StopEgress to avoid returning 503 (#3788) 2025-07-14 13:30:24 -07:00
cnderrauber 51bbe8c52b Set participant active when peerconnection connected (#3790)
Don't wait datachannel ready (sctp handshake)
2025-07-14 10:59:59 +08:00
Raja Subramanian 40028dc33c Normalize known rids. (#3779)
Normalize the rids in SDP to known patterns.
Currently,
- LK protocol uses q;h;f
- Sean's OBS WHIP uses 0;1;2

As the ordering in SDP could be different, normalize to known order.

For RIDs not in the known set, just use it as is.
2025-07-06 13:32:21 +05:30
Raja Subramanian ddd923296b Return default layer for invalid rid + track info combination. (#3778) 2025-07-05 14:43:26 +05:30
cnderrauber 8c033ce9fe Enable H265 by default (#3773) 2025-07-01 14:58:09 +08:00
Raja Subramanian 7678e08701 Set rids for all codecs. (#3772)
Back up codecs will not have pending track. The update needs to happen
on published track.

Have added a note about updating in published track. Can happen when we
have separate layers for primary and backup.
2025-07-01 11:27:03 +05:30
Raja Subramanian 5d636acffb Limit taking rids from SDP only in WHIP path. (#3771)
Some clients are not sending q;h;f; ordering which affects layer/quality
mapping.
2025-07-01 08:20:20 +05:30
Raja Subramanian 4d09e5b564 Log SDP rids to understand the mapping better. (#3770)
* Log SDP rids to understand the mapping better.

* return early when layer is invalid
2025-06-30 09:21:44 +05:30
Raja Subramanian c69f1aae87 Revert "Temporary change: use pre-defined rids" (#3769)
* Revert "Temporary change: use pre-defined rids (#3767)"

This reverts commit d11da5f5fa.

* clean up

* add test and simplify

* clean up
2025-06-30 07:34:58 +05:30
Paul Wells 8197438e5f bounds check layer index (#3768)
* bounds check layer index

* tidy
2025-06-29 18:37:26 -07:00
Raja Subramanian d11da5f5fa Temporary change: use pre-defined rids (#3767)
To address a compatibility issue across relay. Will revert this once the
compatibility is addressed.
2025-06-29 20:00:21 +05:30
Raja Subramanian 9fc4ddbe47 ClearAllReceivers interface is used to pause relay tracks. (#3761)
Restore interface.
2025-06-24 16:27:14 -07:00
Raja Subramanian 1216113b35 Do not need to just clean up receivers. Remove that interface. (#3760)
The tracks are always closed.
2025-06-24 12:54:34 -07:00
Raja Subramanian ef6c38cee5 Log previous allocation to see changes. (#3759) 2025-06-24 12:51:42 -07:00
Raja Subramanian 01bf96855d SVC with RID -> spatial layer mapping (#3754)
* SVC with RID -> spatial layer mapping

There are cases where an SVC track comes in with a RID.
As there is no RID announced in SDP, it maps to invalid layer.
Seems to happen with older browsers.

* test
2025-06-23 12:45:13 -07:00
Raja Subramanian c481396f5b offer could be nil when migrating. (#3752) 2025-06-23 09:04:16 -07:00
cnderrauber 8c2fc0bcd9 Fix svc encoding for chrome mobile on iOS (#3751)
The browser could send rtp packets of svc encoding without
DD extension while the sdp negotiates it, sfu detects extension
in rtp packet for this case.
2025-06-23 22:39:12 +08:00
David Colburn e467daa0d4 move egress roomID load to launcher (#3748)
* move egress roomID load to launcher

* regenerate
2025-06-20 16:22:19 -04:00
Anunay Maheshwari 3783ebb320 feat(cli): update to urfave/cli/v3 (#3745)
* feat(cli): update to urfave/cli/v3

* fix(cli/v3): int/uint handling with reflection

* fix(cli/v3): better type convertion handling
2025-06-20 16:58:44 +05:30
Pablo Fuente Pérez 03d3fcab43 Fix data packet ParticipantIdentity override logic in participant.go (#3735)
* Fix data packet ParticipantIdentity override logic in participant.go

https://github.com/livekit/agents/issues/2554

* Update pkg/rtc/participant.go

---------

Co-authored-by: David Zhao <david@davidzhao.com>
2025-06-19 22:58:31 -07:00
Paul Wells 068b43660b reuse compiled client config scripts (#3743) 2025-06-19 14:31:59 -07:00
cnderrauber e754a86068 return error when moving egree/agent participant (#3741) 2025-06-18 15:10:08 +08:00
cnderrauber 7542cf0723 remove unused code (#3740) 2025-06-18 10:09:30 +08:00
Raja Subramanian 9d569e2fef Take ClientInfo from request. (#3738)
This will allow WHIP client to pass in client info which can provide
more information about WHIP clients for telemetry.
2025-06-16 21:01:15 -07:00
Tobias Fried 8077426312 chore: set workerid on job creation (#3737)
* chore: set workerid on job creation

* chore: bump deps
2025-06-16 15:30:06 -06:00
Raja Subramanian 5549ab5562 Revert clearing RIDs. (#3732) 2025-06-13 23:34:01 -07:00
Raja Subramanian ae9673130f Clear rids if not present in SDP. (#3731) 2025-06-13 21:02:01 -07:00
Raja Subramanian 0e03390744 Return highest available layer if requested quality is higher than (#3729)
highest available quality.
2025-06-13 08:44:45 -07:00
cnderrauber 9ce737db31 Add log for dropping out of order reliable message (#3728) 2025-06-13 22:08:56 +08:00
cnderrauber 1b95e818c9 Don't check bindState on downtrack.Bind (#3726)
receiver can be ready before bind
2025-06-13 16:13:15 +08:00
Raja Subramanian 670f927ff6 Set and use rid/spatial layer in TrackInfo. (#3724)
* Set and use rid/spatial layer in TrackInfo.

* test
2025-06-12 23:22:11 -07:00
Raja Subramanian a9e2911645 Add Id to SDP signalling messages. (#3722)
* Add Id to SDP signalling messages.

Allows matching up offer/answer.
For now, the subscriber answer just logs if there is a mismatch.

* correct variable name

* test

* fixing rid

* revert

* clean up
2025-06-12 14:39:25 -07:00
Raja Subramanian 4ec828ce00 Fix bug with SDP rid, clear only overflow. (#3723) 2025-06-12 14:04:13 -07:00
Raja Subramanian 8f6c3a9b4e Clear rids from default for layers not published. (#3721) 2025-06-12 08:59:16 -07:00
Raja Subramanian ce07740e11 Add simulcast support for WHIP. (#3719)
* Add simulcast support for WHIP.

- General change to have rids be anything.
- One issue is rid ordering not matching quality ordering, will need
  some dynamic layer quality determination for that.

* clean up

* deps

* test
2025-06-11 19:40:38 -07:00
Raja Subramanian e98fb94fd2 Create client config manager in room manager constructor. (#3718)
* Create client config manager in room manager constructor.

Remove it from wire to be consistent with cloud which does hot reload.

* disable advanced codecs on iOS when using JS SDK
2025-06-10 21:06:49 -07:00
cnderrauber fdf9b85290 e2e reliability for data channel (#3716)
* e2e reliability for data channel

* solve comments
2025-06-11 11:14:30 +08:00