Commit Graph

2538 Commits

Author SHA1 Message Date
cnderrauber
ff9115b228 Disable dd parser for vp8 if extension is not found (#3492)
Browser would not send dd extension for vp8 in some case even if
it is negotiated.
2025-03-06 17:20:00 +08:00
Benjamin Pracht
c3e06f0523 Do not attempt to create objects for URL ingresses as the ingress service will do so (#3491) 2025-03-05 15:15:02 -08:00
Raja Subramanian
f0edfbba8d Fix receiver rtt/jitter. (#3487) 2025-03-04 21:22:17 +05:30
Raja Subramanian
05dfd30d5b Take RTT and jitter from receiver view while reporting track stats for (#3483)
* Take RTT and jitter from receiver view while reporting track stats for
down stream tracks.

* adjust jitter in aggregate
2025-03-03 18:48:37 +05:30
cnderrauber
04ed56835e Don't issue TrackPublished/Unpublished event on migrated track (#3482) 2025-03-03 15:32:17 +08:00
Raja Subramanian
1cffe30cd0 Use a RED transformer to consolidate both RED -> Opus OR Opus -> RED (#3481)
* Use a RED transformer to consolidate both RED -> Opus OR Opus -> RED

* public

* clean up

* clean up debug
2025-03-02 13:29:56 +05:30
Raja Subramanian
591888f712 Fix missing RTCP sender report when forwarding RED as Opus. (#3480)
With publish RED and subscribe Opus, the RTCP sender reports were not
sent to down track as publisher sender reports were not forwarded to the
down track.
2025-03-02 11:52:17 +05:30
cnderrauber
900da73e6d Add ice candidates logs for failed peerconnection (#3473) 2025-02-27 14:47:28 +08:00
Raja Subramanian
83a839811c Transfer metadata cache over flow counter. (#3472)
* Transfer metadata cache over flow coutner.

Without that, logging was not getting sampled.

* sender
2025-02-27 11:21:11 +05:30
Raja Subramanian
6d44e433f4 Fix panic with invalid layer. (#3470)
* Fix panic with invalid layer.

Log an error so that we can understand which track porduces that.

* drop bad layer packet without forwarding
2025-02-27 09:48:13 +05:30
Raja Subramanian
fcb05e97c5 Properly initialise DD layer selector. (#3467) 2025-02-26 09:48:54 +05:30
Paul Wells
43bd251575 simplify vls base access (#3465) 2025-02-26 09:34:59 +05:30
Raja Subramanian
7350e99331 transfer from non-null for codec change (#3464) 2025-02-25 23:31:14 +05:30
Raja Subramanian
ca4526048c structured logging (#3461) 2025-02-24 11:47:35 +05:30
Raja Subramanian
83b94b31ac Do not revoke track subscription on permission update for exempt (#3458)
participants.
2025-02-21 11:25:29 +05:30
Denys Smirnov
60a09cb4be Implement SIP iterators. (#3332) 2025-02-20 13:13:21 +02:00
cnderrauber
363353d6e5 Fix codec regression failed after migration (#3455)
The backup codec could arrive before primary
in migration.
2025-02-20 15:54:11 +08:00
David Zhao
1c69a9eeed Dependent participants should not trigger count towards FirstJoinedAt (#3448)
* Dependent participants should not trigger count towards FirstJoinedAt

According to the API, empty timeout should be honored as long as no
independent participant joins the room. If we counted Agents and Egress
as part of FirstJoinedAt, it would have the side effect of using
departureTimeout instead of emptyTimeout for idle calculations.

* use Room logger
2025-02-20 00:57:40 -06:00
Paul Wells
3167266495 add datapacket stream metrics (#3450)
* add datapacket stream metrics

* normalize mime type
2025-02-19 22:28:10 -08:00
Raja Subramanian
69c8d0d165 Log migration complete (#3454) 2025-02-20 11:31:10 +05:30
cnderrauber
4b04b26a73 fix data channel slow reader test (#3453) 2025-02-20 10:40:25 +08:00
Paul Wells
f49103a003 add participant job type (#3443)
* add participant job type

* cleanup

* deps
2025-02-18 00:40:56 -08:00
cnderrauber
b2a54729f5 Don't drop message if calculate duration is too small (#3442)
* Don't drop message if calculate duration is too small

* fix test
2025-02-18 14:41:41 +08:00
Raja Subramanian
b3da3ff2cb Give more cache for RTX. (#3438)
- With probing the packet rate can get high suddenly and remote may not
  have sent receiver report as it might be sending for the non-spikey
  rate. That causes metadata cache overflows. So, give RTX more cahe.
- Don't need a large cache for primary as either reports come in
  regularly (or they are missing for a long time and having a biger
  cache is not the solution for that, so reduce primary cache size)
- Check for receiver report falling exactly back by (1 << 16). Had done
  that change in the inside for loop, but missed the top level check :-(
2025-02-15 22:43:28 +05:30
Raja Subramanian
0c966e6a7e Move a few logs to Debugw (#3437) 2025-02-15 22:16:17 +05:30
Raja Subramanian
56a61b6ce2 Safe access of proto fields. (#3436) 2025-02-15 05:51:53 +05:30
Raja Subramanian
5589637152 Seed on receiving forwarder state. (#3435)
This is mostly to clean up forwarder state cache for already started
tracks.

A scenario like the following could apply the seed twice and end up with
an incorrect state resulting in a large jump
- Participant A let's say is the one showing the problem
- Participant A migrates first. So, it tries to restore its down track states by querying state from the previous node.
- But, its down tracks start before the response can be received. However, it remains in the cache.
- Participant B migrates from a different node to where Participant A. So, the down track of Participant A gets switched from relay up track publisher -> local up track publisher.
- I am guessing the seeding gets applied twice in this case and the cached value from step 3 above causes the huge jump.

In those cases, the cache needs to be cleaned up.

(NOTE: I think this seeding of down track on migration is not necessary
as the SSRC of down track changes and the remote side seems to be
treating it like a fresh start because of that. But, doing this step
first and will remove the related parts after observing for a bit more)

Also, moving fetching forwarder state to a goroutine as it involves a
network call to the previous node via Director.
2025-02-14 15:46:08 +05:30
Raja Subramanian
9fd80c8919 Catch up if the diff is exactly (1 << 16) also. (#3433) 2025-02-14 12:50:52 +05:30
Raja Subramanian
dc0ff45fd7 Fix panic due to nil Egress (#3431) 2025-02-14 10:17:32 +05:30
cnderrauber
148a2af151 Log when dropping data packet by slow reader (#3429) 2025-02-13 15:26:22 +08:00
cnderrauber
7e4df818ee Fix timing issue between track republish (#3428) 2025-02-13 13:59:03 +08:00
Raja Subramanian
f160f6200a Do not log no packets in delta. (#3427)
Can happen a lot with dynacast layer turn off.
2025-02-13 11:25:57 +05:30
Raja Subramanian
1c3c70a136 Check for nil in sender view stats. (#3426)
Seeing some panic due to sender view being nil. It is possible to have
nil sender view and not-nil receiver view. For analytics, only sender
view is used. Handle nil properly.
2025-02-13 10:55:23 +05:30
Raja Subramanian
1ae2e48c2e Webhook analytics event. (#3423)
* Webhook analytics event.

* deps

* generate

* nil notifier
2025-02-13 10:39:45 +05:30
Raja Subramanian
7fef374b19 Split down stream snapshot into sender view and receiver view. (#3422)
Receiver view is used for connection quality.

Sender view is used for analytics. One thing that this introduces is
that sender view uses the packet loss information from receiver view as
true loss is available only in the RTCP Receiver Reports received from
the remote side. So, the time alignment is off, i. e. receiver report
happens periodically and it includes information till the time at which
it was sent from remote side, but sender could have sent more packets
after that time.

The split should ensure that analytics does not rely on remote side
sending proper receiver repoerts albeit at slight misalignment of loss
statistic for remotes that send RTCP RR (which should be majority of the
cases)
2025-02-11 16:05:00 +05:30
Raja Subramanian
5e1431f433 Do not use separate struct field for mime. (#3421) 2025-02-11 12:08:02 +05:30
cnderrauber
4b709d3d88 Fix codec match in downtrack (#3420) 2025-02-11 11:45:22 +08:00
Raja Subramanian
65d30d9e43 Ignore unknown mime in dynacast manager. (#3419)
Actually, was caused by down track not initialising mime, but it is good
to ignore unknown mime.

Also, added ulpfec sa SDP has that and there was a conversion which was
returning unknown. Also, note that the mime types use audio for RED and
video for flexfec and ulpfec although they are not media type dependent.
Maybe, at point need to introduce `MimeTypeAudioRED` and
`MimeTypeVideoRED`.
2025-02-10 14:56:52 +05:30
Raja Subramanian
3da7de76c7 Fix sense of codec match check while setting layer SSRC. (#3418) 2025-02-10 13:40:16 +05:30
Raja Subramanian
9551c52c85 Try 2 to consolidate mime type (#3407)
* Normalize mime type and add utilities.

An attempt to normalize mime type and avoid string compares remembering
to do case insensitive search.

Not the best solution. Open to ideas. But, define our own mime types
(just in case Pion changes things and Pion also does not have red mime
type defined which should be easy to add though) and tried to use it everywhere.
But, as we get a bunch of callbacks and info from Pion, needed conversion in
more places than I anticipated. And also makes it necessary to carry
that cognitive load of what comes from Pion and needing to process it
properly.

* more locations

* test

* Paul feedback

* MimeType type

* more consolidation

* Remove unused

* test

* test

* mime type as int

* use string method

* Pass error details and timeouts. (#3402)

* go mod tidy (#3408)

* Rename CHANGELOG to CHANGELOG.md (#3391)

Enables markdown features in this otherwise already markdown'ish formatted document

* Update config.go to properly process bool env vars (#3382)

Fixes issue https://github.com/livekit/livekit/issues/3381

* fix(deps): update go deps (#3341)

Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Use a Twirp server hook to send API call details to telemetry. (#3401)

* Use a Twirp server hook to send API call details to telemetry.

* mage generate and clean up

* Add project_id

* deps

* - Redact requests
- Do not store responses
- Extract top level fields room_name, room_id, participant_identity,
  participant_id, track_id as appropriate
- Store status as int

* deps

* Update pkg/sfu/mime/mimetype.go

* Fix prefer codec test

* handle down track mime changes

---------

Co-authored-by: Denys Smirnov <dennwc@pm.me>
Co-authored-by: Philzen <Philzen@users.noreply.github.com>
Co-authored-by: Pablo Fuente Pérez <pablofuenteperez@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Paul Wells <paulwe@gmail.com>
Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2025-02-10 10:44:15 +05:30
Raja Subramanian
045bd785a9 Record number of elements, keys size and values sizes separately. (#3415) 2025-02-08 13:12:48 +05:30
Raja Subramanian
99afbf587b Use a Twirp server hook to send API call details to telemetry. (#3401)
* Use a Twirp server hook to send API call details to telemetry.

* mage generate and clean up

* Add project_id

* deps

* - Redact requests
- Do not store responses
- Extract top level fields room_name, room_id, participant_identity,
  participant_id, track_id as appropriate
- Store status as int

* deps
2025-02-07 16:16:41 +05:30
Pablo Fuente Pérez
b88de555bf Update config.go to properly process bool env vars (#3382)
Fixes issue https://github.com/livekit/livekit/issues/3381
2025-02-06 18:02:21 -06:00
Denys Smirnov
ccbc988824 Pass error details and timeouts. (#3402) 2025-02-06 13:53:44 +02:00
Paul Wells
d8e325d3d4 copy track info when toggling mute (#3406)
* copy track info when toggling mute

* test
2025-02-05 20:12:11 -08:00
cnderrauber
aeec75edeb H265 supoort and codec regression (#3358)
* H265 supoort and codec regression

Support H265 codec.
Add optional codec regression for subscribers don't
support advanced codecs like H265, AV1, VP9.

* restart forwarder on upstream codec change

* tests

* Reneogitate new codec if client doesn't support change

* Add option to disable codec regression

---------

Co-authored-by: boks1971 <raja.gobi@tutanota.com>
2025-02-06 11:56:49 +08:00
Raja Subramanian
abcaa9b8ab Fix /etc/validate route (#3403) 2025-02-05 23:20:20 +05:30
Raja Subramanian
14e65f1459 AnalyticsEvent for generic reports (#3400)
* AnalyticsEvent for generic reports

* deps
2025-02-05 10:13:43 +05:30
Raja Subramanian
bb0ee1139c Drive-by misc changes. (#3399)
While working on a different service, noticed delegation of setting up
routes to the service itself. So, making that change and making some
methods internal only as there is no need to export them outside the
service.
2025-02-04 12:32:05 +05:30
Raja Subramanian
7ff4082e4a Do not skip due to large RR interval. (#3398)
* Do not skip due to large RR interval.

With sequence number adjustment, it will report some packets missing
which is fine.

* do not seed if already initialized
2025-02-04 11:08:38 +05:30