Commit Graph
1464 Commits
Author SHA1 Message Date
Raja SubramanianandGitHub 516aeabf45 Use ParticipantTelemetryListener of LocalParticipant. (#4342)
Had made a change in remote participant case to not have telemetry
listener as telemetry does not apply to remote participant. But, that
listener ended up getting used for subscriber and became a null
listener. Use the listener of the subscriber participant for subscribed
tracks.
2026-03-05 11:24:48 +05:30
cnderrauberandGitHub b35105656c Exclude ice restart case from offer answer id mismatch warning (#4341) 2026-03-05 13:05:37 +08:00
cnderrauberandGitHub 9d418689c6 Send participant left event after track unpublished for moved (#4334)
participant
2026-02-25 13:22:33 +08:00
Raja SubramanianandGitHub b81bac0ec3 Key telemetry stats worker using combination of roomID, participantID (#4323)
Test / test (push) Failing after 17s
Release to Docker / docker (push) Failing after 3m42s
* Key telemetry stats work using combination of roomID, participantID

With forwarded participant, the same participantID can existing in two
rooms.

NOTE: This does not yet allow a participant session to report its
events/track stats into multiple rooms. That would require regitering
multiple listeners (from rooms a participant is forwarded to).

* missed file

* data channel stats

* PR comments + pass in room name so that telemetry events have proper room name also
2026-02-16 13:56:13 +05:30
Raja SubramanianandGitHub a9b8d40de4 Publish is always on publisher peer connection. (#4307) 2026-02-10 13:43:30 +05:30
Raja SubramanianandGitHub 195b17f62f Populate client_protocol field in ParticipantInfo (#4293) 2026-02-06 00:34:56 +05:30
Raja SubramanianandGitHub f3e9b68854 Do not increase max expected layer on track info update. (#4285)
* Do not increase max expected layer on track info update.

When max expected layer increases, the corresponding trackers are reset
so that first packets from those layers can trigger a layer detected
change enabling quick detection of layer start.

A track info update changing max to what is in track info could set the
max expected to be higher without resetting the tracker. And that would
cause dynacast induced max layer change to miss tracker reset too.

Sequence
- dynacast sets max expected to 0
- track info update sets it to 2
- dynacast sets it to 1 --> this should have reset tracker on layer 1,
  but because it is less than current max (2), it is skipped.

* thank you CodeRabbit

* force update on start
2026-02-04 12:19:41 +05:30
Raja SubramanianandGitHub d2bae34d53 refresh telemetry guard on participant move (#4280) 2026-02-03 15:34:16 +05:30
Raja SubramanianandGitHub d1bab17b76 Add session duration and participant kind to closing log. (#4277)
To allow using "participant closing" log entry for calculating things
like session duration by paricipant kind or some other client SDK based
attribute.
2026-02-03 07:07:24 +05:30
Raja SubramanianandGitHub 1e689e1a24 Reducing some info level logs. (#4274)
* Reducing some info level logs.

Also, relaxing the check for runaway RTCP receiver report to allow for
rollover to catch up if it is not too far away.

* set logger
2026-02-02 10:54:03 +05:30
Paul WellsandGitHub 700e1788f2 require participant broadcast when metadata/attributes are set in token (#4266) 2026-01-26 14:22:30 -08:00
cnderrauberandGitHub b61799ecd8 Ignore parse addr error when add remote candidate (#4264) 2026-01-26 14:37:02 +08:00
Anunay MaheshwariandGitHub 0c33b8c671 chore: move codecs/mime stuff to protocol (#4255) 2026-01-20 20:54:32 +05:30
Raja SubramanianandGitHub f867550716 Do not remove participant from cache on disconnect. (#4241)
Resuming participants need to know about participants disconnected
during resume.

Reverts https://github.com/livekit/livekit/pull/4234
2026-01-14 20:18:58 +05:30
Raja SubramanianandGitHub a35a6ae751 Add participant option for data track auto-subscribe. (#4240)
* Add participant option for data track auto-subscribe.

Default disabled.

* protocol update to use data track auto subscribe setting

* deps
2026-01-14 13:22:43 +05:30
Raja SubramanianandGitHub a05690d2b2 Changing field naming of data track packet (#4235)
S, F -> Start, Final of frame

changed from

F, L -> First, Last of frame as `F` could be interpreted as `Final`
also.
2026-01-13 09:42:53 +05:30
Raja SubramanianandGitHub c40150085a Clear participant version cache on disconnect (#4234)
* debug participant update

* more debug

* context logger

* log participant info

* more logging

* clear participant cache on disconnect

* clean up

* clean up
2026-01-13 09:36:09 +05:30
Raja SubramanianandGitHub ac20ccda53 Log timeout in API. (#4231)
* Log timeout in API.

* make a reset function
2026-01-12 11:22:39 +05:30
Raja SubramanianandGitHub 541a7d6c5b Change some logs to debugw (#4229) 2026-01-09 16:11:54 +05:30
Raja SubramanianandGitHub dafdc36e3e Add option to force simuclast codec. (#4226) 2026-01-08 02:13:03 +05:30
Raja SubramanianandGitHub 335f4c33fb Swap result sink atomically rather than closing and setting. (#4216)
To prevent WriteMessage after Close potentially.
2026-01-03 03:17:58 +05:30
Raja SubramanianandGitHub 08ac4ecdc5 Support preserving external supplied time. (#4212)
In some paths, it is better to preserve pre-recorded time. So, make the
base implementations preserve the RTCP Sender Report receive time.

Also, add a method to enable forwarding packet arrival time. Could be
used across relay.
2025-12-31 14:41:59 +05:30
cnderrauberandGitHub f6efccce25 report video size from media data for whip (#4211) 2025-12-31 15:52:10 +08:00
Raja SubramanianandGitHub 08793bea89 Use active at time to check for track not bound timeout. (#4206) 2025-12-29 20:32:08 +05:30
Raja SubramanianandGitHub 3606ce542f Do not warn about track not bound if participant is not ready. (#4205)
Analysed half a dozen cases and all of them were due to participant is
not active yet.

Also, some misc logging changes.
2025-12-29 18:16:11 +05:30
Raja SubramanianandGitHub b8ddd0f98c Taking interface{} -> any modernize bits (#4204) 2025-12-28 05:22:12 +05:30
Raja SubramanianandGitHub bb00c86489 Restart API on receiver. (#4200)
Can be used when track moves forward/backward.
2025-12-27 03:42:23 +05:30
Raja SubramanianandGitHub 2510b9462e Taking a bunch of go modernize suggestions. (#4194)
This is not all of it as it is not possible (or at least I do not know
of a way) to get all suggestions for a repo/project. Did this via loop
searching mainly and taking the modernize suggestions.
2025-12-25 16:55:58 +05:30
Raja SubramanianandGitHub ed8e6afcd7 Handle repair SSRC of simulcast tracks during migration. (#4193)
* Handle repair SSRC of simulcast tracks during migration.

* fix

* fix comment
2025-12-25 14:45:48 +05:30
Raja SubramanianandGitHub 8b0efb8c89 Resolve RTX pair via OnTrack also. (#4190)
* Resolve RTX pair via OnTrack also.

In simulcast probing path, the interceptor chain is not invoked
for primary stream. Not sure if this is a recent change. Due to this,
the RTX pair does not get resolved.

Use the onTrack callback to resolve the pair.

* remove debug
2025-12-24 15:27:13 +05:30
Raja SubramanianandGitHub 7c8ea11505 Refactor receiver and buffer into Base and higher layer. (#4185)
* Refactor receiver and buffer into Base and higher layer.

To be able to share code/functionality with relay.

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* clean up

* deps

* fix test

* fix test
2025-12-23 21:35:48 +05:30
Raja SubramanianandGitHub 1df1316b85 Move OnDataTrackMessage to participant listener to support replay. (#4178) 2025-12-19 13:08:44 +05:30
Raja SubramanianandGitHub e7601251bc Make data message naming a bit more consistent. (#4177)
* Make data message naming a bit more consistent.

OnDataPacket and OnDataMessage half-way in the chain made it confusing
(for me at least). Use same name throughout.
API still uses SendDataPacket, but that is not harder to read.

* test
2025-12-19 12:09:16 +05:30
Raja SubramanianandGitHub a04e566dbf Use published track for model access in data down track. (#4176)
* Use published track for model access in data down track.

No need to pass in the model.

* implementation type assertion

* remove redundant log key

* one more type

* Close interface method

* clean up redundant log key

* remove unused method

* some interface changes to support data tracks in replay

* correct mock signature
2025-12-19 11:00:18 +05:30
Raja SubramanianandGitHub cbb2c61787 Publish/Unpublish counter match. (#4173)
Published counter was bumped up only when not migrating in, but it was
decremented when a migrating participant leaves without expectation to
resume. That could have resulted in negative counts.

Always change counters irrespective of migration or expected to resume
on leave. Control events send based on migration/resume.
2025-12-18 10:16:27 +05:30
Raja SubramanianandGitHub 5c841b8ea1 Some logging changes. (#4168)
* Some logging changes.

Trying to chase a case of large sequence number gap on subscriber side
where packets are sent after a long time.

* return values instead of logging
2025-12-17 18:05:29 +05:30
Raja SubramanianandGitHub 5964efbba5 Ensure subscribe data track handles are unique (#4162) 2025-12-16 13:52:05 +05:30
Raja SubramanianandGitHub a26c48304a Add support for RTP stream restart. (#4161)
* Add support for RTP stream restart.

When an unhandled packet is encountered, try a restart sequence.
Restart happens when 5 packets with contiguous sequence numbers and same
or increasing time stamps are received. Note that this does not work for
B-frame type of scenarios, but that is true for receive path handling
even before this. As WebRTC does not use B-frames, it is fine. But,
needs to be looked at again if B-frames are necessary.

It is controlled by a config that is disabled by default.

* clean up

* debug log
2025-12-16 13:21:39 +05:30
Raja SubramanianandGitHub 386f0b3822 fix typo in clearing index when removing track from room track manager (#4158) 2025-12-14 19:57:39 +05:30
Paul WellsandGitHub 0abfb2515c deregister observability function when participant is closed (#4157)
* deregister observability function when participant is closed

* tidy
2025-12-14 04:21:07 -08:00
Raja SubramanianandGitHub 2317c29531 Fix panic while removing track from room track manager. (#4153)
Cannot range and use `slices.Delete` in the loop.
2025-12-12 14:19:18 +05:30
Raja SubramanianandGitHub a0a28ac5e3 Avoid duplicate track add to room track manager. (#4152)
* Avoid duplicate track add to room track manager.

Don't have proof that this happens, but in the leak chase, this is
another component at room level and holds references to tracks. Guessing
this is not cleaning tracks till room is closed.

* add a report
2025-12-12 12:42:04 +05:30
changgesiandGitHub d7db7cb389 chore: fix a large number of spelling issues (#4147)
Signed-off-by: changgesi <changgesi@outlook.com>
2025-12-11 09:34:13 +05:30
Raja SubramanianandGitHub 64f3d1e972 switch participant callbacks to room to listener interface (#4136)
* switch participant callbacks to room to listener interface

* mage generate

* clean up

* clear listener

* clean up

* use interface in up data track manager

* tweaks

* Paul feedback - should reduce the diff as this keeps the room handlers as is except making methods for a couple of anonymous handlers

* clean up
2025-12-08 15:59:45 +05:30
Raja SubramanianandGitHub 8c241ecf12 Fix RTCP reader leak in DownTrack. (#4131)
When a participant is closing, RTCP readers should be cleaned up from
factory even if the participant is expected to resume. The resumed
participant will be a new participant session and peer connection(s) and
everything will be set up again.
2025-12-06 17:49:23 +05:30
Raja SubramanianandGitHub 3eef869a68 Do not pause rid in SDP (#4129) 2025-12-05 15:57:31 +05:30
Raja SubramanianandGitHub 7c1a0fab7c Fix concurrent map access. (#4127)
https://github.com/livekit/livekit/issues/4126
2025-12-05 10:48:10 +05:30
Raja SubramanianandGitHub 14446b1cc1 Let participant close remove the published tracks. (#4125) 2025-12-04 22:37:08 +05:30
Raja SubramanianandGitHub 7954748d7a Data tracks (#4089)
* WIP

* WIP

* Starting to add some signalling integration testing.

* Working tests.

* fix tests

* Forward data packets (#4096)

* WIP commit

* WIP

* WIP

* fix forwarding

* address PR comments

* move some methods from LocalParticipant to Participant interface

* handle subscription update

* add extensions and tests

* more packet tests

* add test for replace extension and fix a bug

* update protocol and add config
2025-12-04 10:44:34 +05:30
Raja SubramanianandGitHub 0a2943bbc5 Clean up bits added to debug peer connection close hang. (#4114) 2025-11-28 10:30:39 +05:30