Repository navigation
Do not increase max expected layer on track info update. - #4285
Conversation
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.
📝 WalkthroughWalkthroughReplaced a manual map-copy loop with maps.Copy in dynacast manager; introduced and managed a maxExpectedLayer field in StreamTrackerManager with new initialization/reset/force-update flows; refactored slice operations to use slices utilities and replaced index-based bitrate loops with range-based iteration. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (7)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| for mime, quality := range d.maxSubscribedQuality { | ||
| d.committedMaxSubscribedQuality[mime] = quality | ||
| } | ||
| maps.Copy(d.committedMaxSubscribedQuality, d.maxSubscribedQuality) |
There was a problem hiding this comment.
taking some modernisation suggestions.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@pkg/sfu/streamtrackermanager.go`:
- Around line 596-611: The loop currently compares layer.SpatialLayer to
s.maxExpectedLayer instead of the local maxExpectedLayer; change the loop
condition in the iteration over buffer.GetVideoLayersForMimeType(s.mimeType, ti)
to use "layer.SpatialLayer > maxExpectedLayer" so maxExpectedLayer accumulates
correctly, and then guard the final assignment so you only set
s.maxExpectedLayer when maxExpectedLayer is valid and lower than the current
value (i.e. if maxExpectedLayer != buffer.InvalidLayerSpatial &&
maxExpectedLayer < s.maxExpectedLayer { s.maxExpectedLayer = maxExpectedLayer
}).
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
pkg/rtc/dynacast/dynacastmanagervideo.gopkg/sfu/streamtrackermanager.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: test
- GitHub Check: Analyze (go)
🔇 Additional comments (4)
pkg/rtc/dynacast/dynacastmanagervideo.go (1)
18-18: LGTM! Clean stdlib refactor.Using
maps.Copyfrom the standard library is cleaner and more idiomatic than a manual loop. The behavior is preserved since the destination map is freshly allocated.Also applies to: 219-220
pkg/sfu/streamtrackermanager.go (3)
151-151: LGTM!Proper initialization of
maxExpectedLayertoInvalidLayerSpatialbefore the subsequent call tomaxExpectedLayerFromTrackInfo().
522-528: LGTM! Good use of stdlibslicespackage.Using
slices.Containsandslices.Sortis cleaner and more idiomatic than manual iteration andsort.Slice.
336-341: Reset logic depends on the fix formaxExpectedLayerFromTrackInfoLocked.The intent here is correct—reset
maxExpectedLayertoInvalidLayerSpatialand then re-initialize from track info. However, this will only work correctly once the bug at line 600 is fixed (comparison should use the local variable).
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| maxExpectedLayer := buffer.InvalidLayerSpatial | ||
| ti := s.trackInfo.Load() | ||
| if ti != nil { | ||
| for _, layer := range buffer.GetVideoLayersForMimeType(s.mimeType, ti) { | ||
| if layer.SpatialLayer > s.maxExpectedLayer { | ||
| s.maxExpectedLayer = layer.SpatialLayer | ||
| maxExpectedLayer = layer.SpatialLayer | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // when max expected is higher than current max, trackers are reset | ||
| // which allows a layer start to be detected on initial packets from that higher layer, | ||
| // so update max only on track info max being lower than current max | ||
| if maxExpectedLayer < s.maxExpectedLayer { | ||
| s.maxExpectedLayer = maxExpectedLayer | ||
| } |
There was a problem hiding this comment.
Logic bug: wrong variable in comparison prevents correct max detection.
The condition at line 600 compares layer.SpatialLayer > s.maxExpectedLayer (struct field) instead of layer.SpatialLayer > maxExpectedLayer (local variable). This causes two problems:
-
RemoveAllTrackers fails: When
s.maxExpectedLayeris reset toInvalidLayerSpatial(-1), all layers pass the> -1check, but the final checkmaxExpectedLayer < s.maxExpectedLayerbecomes2 < -1= false, somaxExpectedLayerstays at -1 instead of being set from track info. -
Lowering max fails: If
s.maxExpectedLayer = 2and track info only has layers [0, 1], no layers pass> 2, so localmaxExpectedLayerstays -1, resulting ins.maxExpectedLayerbeing set to -1 instead of 1.
🐛 Proposed fix
func (s *StreamTrackerManager) maxExpectedLayerFromTrackInfoLocked() {
maxExpectedLayer := buffer.InvalidLayerSpatial
ti := s.trackInfo.Load()
if ti != nil {
for _, layer := range buffer.GetVideoLayersForMimeType(s.mimeType, ti) {
- if layer.SpatialLayer > s.maxExpectedLayer {
+ if layer.SpatialLayer > maxExpectedLayer {
maxExpectedLayer = layer.SpatialLayer
}
}
}
// when max expected is higher than current max, trackers are reset
// which allows a layer start to be detected on initial packets from that higher layer,
// so update max only on track info max being lower than current max
- if maxExpectedLayer < s.maxExpectedLayer {
+ if maxExpectedLayer != buffer.InvalidLayerSpatial && maxExpectedLayer < s.maxExpectedLayer {
s.maxExpectedLayer = maxExpectedLayer
}
}Note: An additional guard maxExpectedLayer != buffer.InvalidLayerSpatial is suggested to avoid setting max to invalid when track info has no layers.
🤖 Prompt for AI Agents
In `@pkg/sfu/streamtrackermanager.go` around lines 596 - 611, The loop currently
compares layer.SpatialLayer to s.maxExpectedLayer instead of the local
maxExpectedLayer; change the loop condition in the iteration over
buffer.GetVideoLayersForMimeType(s.mimeType, ti) to use "layer.SpatialLayer >
maxExpectedLayer" so maxExpectedLayer accumulates correctly, and then guard the
final assignment so you only set s.maxExpectedLayer when maxExpectedLayer is
valid and lower than the current value (i.e. if maxExpectedLayer !=
buffer.InvalidLayerSpatial && maxExpectedLayer < s.maxExpectedLayer {
s.maxExpectedLayer = maxExpectedLayer }).
…0 → v1.11.0) (#484) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [docker.io/livekit/livekit-server](https://github.com/livekit/livekit) | minor | `v1.9.0` → `v1.11.0` | --- ### Release Notes <details> <summary>livekit/livekit (docker.io/livekit/livekit-server)</summary> ### [`v1.11.0`](https://github.com/livekit/livekit/releases/tag/v1.11.0) [Compare Source](livekit/livekit@v1.10.1...v1.11.0) NOTE: Minor version bump that enables data tracks (<https://docs.livekit.io/transport/data/data-tracks/>) by default. ##### Added - Embedded turn test ([#​4412](livekit/livekit#4412)) - chore: log API key during worker registration ([#​4428](livekit/livekit#4428)) - Add some simple data track stats ([#​4431](livekit/livekit#4431)) - Add `Close` method for UpDataTrackManager and call it on participant ([#​4432](livekit/livekit#4432)) - Log join duration. ([#​4433](livekit/livekit#4433)) - Add subscriber stream start event notification ([#​4449](livekit/livekit#4449)) ##### Changed - Cleaning up some logs and standardising log frequency. ([#​4420](livekit/livekit#4420)) - Keep subscription synchronous when publisher is expected to resume. ([#​4424](livekit/livekit#4424), [#​4425](livekit/livekit#4425)) - Do not close publisher peer connection to aid migration. ([#​4426](livekit/livekit#4426), [#​4427](livekit/livekit#4427)) - Enable data tracks by default. ([#​4429](livekit/livekit#4429)) - chore: pin GH commits and switch to golangci-lint ([#​4444](livekit/livekit#4444)) - Switch to stdlib maps, slices ([#​4445](livekit/livekit#4445)) - Store concrete ICE candidate for remote candidates. ([#​4458](livekit/livekit#4458)) ##### Fixed - clear track notifier observers on subscription teardown ([#​4413](livekit/livekit#4413)) - Guard against timestamp inversion in RED -> Opus conversion. ([#​4414](livekit/livekit#4414), [#​4415](livekit/livekit#4415), [#​4418](livekit/livekit#4418)) - ensure participant init is correctly serialized for logging ([#​4417](livekit/livekit#4417)) - Clean up data track observers on unsubscribe. ([#​4421](livekit/livekit#4421)) - compute agent dispatch affinity from target load ([#​4442](livekit/livekit#4442)) - Apply IPFilter when get local ip ([#​4440](livekit/livekit#4440)) - Unsubscribe from data track on close ([#​4443](livekit/livekit#4443)) - Use Muted in TrackInfo to propagated published track muted. ([#​4453](livekit/livekit#4453)) - fix: limit join request and WHIP request body to http.DefaultMaxHeaderBytes ([#​4450](livekit/livekit#4450)) - fix publisher frame count reporting for simulcast streams ([#​4457](livekit/livekit#4457)) ### [`v1.10.1`](https://github.com/livekit/livekit/releases/tag/v1.10.1) [Compare Source](livekit/livekit@v1.10.0...v1.10.1) ##### Added - add packet trailer stripping support ([#​4361](livekit/livekit#4361)) - Path check helpers ([#​4392](livekit/livekit#4392)) - add deadline to dtls connect context ([#​4395](livekit/livekit#4395)) - feat(agent-dispatch): add job restart policy ([#​4401](livekit/livekit#4401)) ##### Changed - Close both peer connections to aid migration. ([#​4382](livekit/livekit#4382)) ##### Fixed - Fix TURN server URL ([#​4389](livekit/livekit#4389)) - AV1 parser overflow fix. ([#​4405](livekit/livekit#4405)) - Address malformed H264/H265 parsing issues ([#​4407](livekit/livekit#4407)) ### [`v1.10.0`](https://github.com/livekit/livekit/releases/tag/v1.10.0) [Compare Source](livekit/livekit@v1.9.12...v1.10.0) ##### PLEASE NOTE: The logging key for participant session ID (a.k.a participant SID) has been changed from `pID` to `participantID` in this release for the sake of clarity. Hence the minor version bump. ##### Added - Add option to require media sections when participant joining ([#​4347](livekit/livekit#4347), [#​4354](livekit/livekit#4354)) - Support originating calls from custom domains ([#​4349](livekit/livekit#4349)) - Add StopEgress function to the EgressLauncher interface ([#​4353](livekit/livekit#4353)) - Add option to not re-use transceiver in e2ee. ([#​4356](livekit/livekit#4356)) - Add API to restart lite stats. ([#​4366](livekit/livekit#4366), [#​4368](livekit/livekit#4368)) * handle AGENT\_ERROR disconnect reason ([#​4339](livekit/livekit#4339)) ##### Changed - Mark last run of grow bucket outside goroutine. ([#​4348](livekit/livekit#4348)) - Refine ipv6 support ([#​4352](livekit/livekit#4352)) - Sample data send error logging. ([#​4358](livekit/livekit#4358)) - Switch data track extension to 1-byte ID/length. ([#​4362](livekit/livekit#4362)) - Do not kick off migration of closed participant ([#​4363](livekit/livekit#4363)) - Do not block all ext ID determination on stream allocator listener ([#​4364](livekit/livekit#4364)) - Rename log field pID to participantID ([#​4365](livekit/livekit#4365)) - Replace deprecated io/ioutil with io in whipservice ([#​4375](livekit/livekit#4375)) - Update grpc to address CVE-2026-33186 ([#​4381](livekit/livekit#4381)) ##### Fixed - Fix repair stream ID reporting for RTX pairing. ([#​4369](livekit/livekit#4369)) ### [`v1.9.12`](https://github.com/livekit/livekit/releases/tag/v1.9.12) [Compare Source](livekit/livekit@v1.9.11...v1.9.12) ##### Added - Add silent frame for pcmu/a ([#​4258](livekit/livekit#4258)) - adds a test to ensure agent worker errors cause disconnection ([#​4273](livekit/livekit#4273)) - Populate client\_protocol field in ParticipantInfo ([#​4293](livekit/livekit#4293)) - Read client protocol from query param ([#​4294](livekit/livekit#4294)) - generate & log egressID for start egress request ([#​4303](livekit/livekit#4303)) - ESP32 Client Info ([#​4267](livekit/livekit#4267)) - feat: make INSTALL\_PATH overridable in install script ([#​3954](livekit/livekit#3954)) ##### Changed - Defer setting clock rate in RTPStats module till codec is bound. ([#​4250](livekit/livekit#4250)) - Wrapping SIP errors for invalid argument and not found ([#​4253](livekit/livekit#4253)) - Ignore parse addr error when add remote candidate ([#​4264](livekit/livekit#4264)) - Generate config flags ([#​4268](livekit/livekit#4268)) - clear reference guard when resetting signal stats ([#​4279](livekit/livekit#4279)) - refresh telemetry guard on participant move ([#​4280](livekit/livekit#4280)) - use separate allocation for signal stats telemetry guard ([#​4281](livekit/livekit#4281)) - Set up audio config in audio level module when config is updated. ([#​4290](livekit/livekit#4290)) - Update self-hosting deployment documentation link ([#​4312](livekit/livekit#4312)) - Key telemetry stats worker using combination of roomID, participantID ([#​4323](livekit/livekit#4323)) - Two phase restart when doing external restart of receiver. ([#​4329](livekit/livekit#4329)) - Send participant left event after track unpublished for moved ([#​4334](livekit/livekit#4334)) ##### Fixed - Fix receiver restart race ([#​4248](livekit/livekit#4248)) - require participant broadcast when metadata/attributes are set in token ([#​4266](livekit/livekit#4266)) - Create buffer if needed when a PLI is requested. ([#​4282](livekit/livekit#4282)) - Do not increase max expected layer on track info update. ([#​4285](livekit/livekit#4285)) - Publish is always on publisher peer connection.([#​4307](livekit/livekit#4307)) - Potential fix for code scanning alert no. 35: Workflow does not contain permissions ([#​4311](livekit/livekit#4311)) - Potential fix for code scanning alert no. 36: Workflow does not contain permissions ([#​4310](livekit/livekit#4310)) - Fix for some CodeQL reported issues ([#​4314](livekit/livekit#4314)) - Protect against incorrect temporal layer. ([#​4327](livekit/livekit#4327)) - do not discount packets lost on duplicate packets ([#​4333](livekit/livekit#4333)) - Use ParticipantTelemetryListener of LocalParticipant. ([#​4342](livekit/livekit#4342)) - Fix SIP client timeout. ([#​4345](livekit/livekit#4345)) ### [`v1.9.11`](https://github.com/livekit/livekit/releases/tag/v1.9.11) [Compare Source](livekit/livekit@v1.9.10...v1.9.11) ##### PLEASE NOTE: The previous release tag v1.9.10 hit a panic under some conditions. Sincerely regret the inconvenience caused. Although we do test rigorously, it is not guaranteed to cover all scenarios. We request you to report any issues you encounter. Thank you. ##### Added - Support OpenTelemetry tracing. Add Jaeger support. ([#​4222](livekit/livekit#4222)) - Add option to force simuclast codec. ([#​4226](livekit/livekit#4226)) - Log timeout in API ([#​4231](livekit/livekit#4231), [#​4232](livekit/livekit#4232)) - Add participant option for data track auto-subscribe. ([#​4240](livekit/livekit#4240)) ##### Changed - Remove enable arrival time forwarding method. ([#​4217](livekit/livekit#4217)) - sfu/receiver and sfu/buffer refactor ([#​4221](livekit/livekit#4221), [#​4224](livekit/livekit#4224), [#​4225](livekit/livekit#4225)) - Change some logs to debugw ([#​4229](livekit/livekit#4229)) - Changing field naming of data track packet ([#​4235](livekit/livekit#4235)) - Update Pion transport package. ([#​4237](livekit/livekit#4237)) - Wrapping the invalid request errors for CreateSipParticipant ([#​4239](livekit/livekit#4239)) ##### Fixed - Swap result sink atomically rather than closing and setting ([#​4216](livekit/livekit#4216)) - Address crash in v1.9.10 ([#​4219](livekit/livekit#4219), [#​4220](livekit/livekit#4220)) - Return on SDP fragment read error. ([#​4228](livekit/livekit#4228)) ### [`v1.9.10`](https://github.com/livekit/livekit/blob/HEAD/CHANGELOG.md#PLEASE-NOTE-The-previous-release-tag-v1910-hit-a-panic-under-some-conditions-Sincerely-regret-the-inconvenience-caused-Although-we-do-test-rigorously-it-is-not-guaranteed-to-cover-all-scenarios-We-request-you-to-report-any-issues-you-encounter-Thank-you) [Compare Source](livekit/livekit@v1.9.9...v1.9.10) ##### Added - Support OpenTelemetry tracing. Add Jaeger support. ([#​4222](livekit/livekit#4222)) - Add option to force simuclast codec. ([#​4226](livekit/livekit#4226)) - Log timeout in API ([#​4231](livekit/livekit#4231), [#​4232](livekit/livekit#4232)) - Add participant option for data track auto-subscribe. ([#​4240](livekit/livekit#4240)) ##### Changed - Remove enable arrival time forwarding method. ([#​4217](livekit/livekit#4217)) - sfu/receiver and sfu/buffer refactor ([#​4221](livekit/livekit#4221), [#​4224](livekit/livekit#4224), [#​4225](livekit/livekit#4225)) - Change some logs to debugw ([#​4229](livekit/livekit#4229)) - Changing field naming of data track packet ([#​4235](livekit/livekit#4235)) - Update Pion transport package. ([#​4237](livekit/livekit#4237)) - Wrapping the invalid request errors for CreateSipParticipant ([#​4239](livekit/livekit#4239)) ##### Fixed - Swap result sink atomically rather than closing and setting ([#​4216](livekit/livekit#4216)) - Address crash in v1.9.10 ([#​4219](livekit/livekit#4219), [#​4220](livekit/livekit#4220)) - Return on SDP fragment read error. ([#​4228](livekit/livekit#4228)) ### [`v1.9.9`](https://github.com/livekit/livekit/releases/tag/v1.9.9) [Compare Source](livekit/livekit@v1.9.8...v1.9.9) ##### Added - Add support for RTP stream restart. ([#​4161](livekit/livekit#4161)) ##### Changed - Avoid duplicate track add to room track manager. ([#​4152](livekit/livekit#4152), [#​4153](livekit/livekit#4153)) - Consistently undo update to sequence number and timestamp when the incoming packet cannot be sequenced. ([#​4156](livekit/livekit#4156)) - deregister observability function when participant is closed ([#​4157](livekit/livekit#4157)) - Ensure subscribe data track handles are unique ([#​4162](livekit/livekit#4162)) - move delete to oss service store ([#​4164](livekit/livekit#4164)) - clean up manual roomservice log redaction ([#​4165](livekit/livekit#4165)) - skip lost sequence number ranges in getIntervalStats ([#​4166](livekit/livekit#4166), [#​4169](livekit/livekit#4169)) ##### Fixed - chore: fix a large number of spelling issues ([#​4147](livekit/livekit#4147)) - Handle case of sequence number jump just after start. ([#​4150](livekit/livekit#4150)) - Drop run away receiver reports. ([#​4170](livekit/livekit#4170)) - Publish/Unpublish counter match. ([#​4173](livekit/livekit#4173)) ### [`v1.9.8`](https://github.com/livekit/livekit/releases/tag/v1.9.8) [Compare Source](livekit/livekit@v1.9.7...v1.9.8) ##### Added - Mark RTCP buffer Write as noinline. (for better heap attribution) ([#​4138](livekit/livekit#4138)) - add debug metric for tracking references ([#​4134](livekit/livekit#4134)) ##### Changed - Use isEnding to indicate if down track could be resumed. ([#​4132](livekit/livekit#4132)) - switch participant callbacks to room to listener interface ([#​4136](livekit/livekit#4136)) - protocol deps to get inactive file adjusted memory usage. ([#​4137](livekit/livekit#4137)) - update webrtc to 4.1.8 to pick up DTLS fingerprint check during handshake ([#​4140](livekit/livekit#4140)) ##### Fixed - Do not pause rid in SDP to prevent race with adaptive streaming ([#​4129](livekit/livekit#4129)) - leak fixes ([#​4131](livekit/livekit#4131), [#​4141](livekit/livekit#4141), [#​4142](livekit/livekit#4142), [#​4143](livekit/livekit#4143), [#​4144](livekit/livekit#4144)) ### [`v1.9.7`](https://github.com/livekit/livekit/releases/tag/v1.9.7) [Compare Source](livekit/livekit@v1.9.6...v1.9.7) ##### Added - Data tracks (experimental and not ready for use) ([#​4089](livekit/livekit#4089)) ##### Changed - log bucket growth ([#​4122](livekit/livekit#4122)) - Update pion/ice to stop gather first on close ([#​4123](livekit/livekit#4123)) - move utils.WrapAround to mediatransportutil ([#​4124](livekit/livekit#4124)) - Let participant close remove the published tracks. ([#​4125](livekit/livekit#4125)) ##### Fixed - Fix concurrent map access for [#​4126](livekit/livekit#4126). ([#​4127](livekit/livekit#4127)) ### [`v1.9.6`](https://github.com/livekit/livekit/releases/tag/v1.9.6) [Compare Source](livekit/livekit@v1.9.4...v1.9.6) ##### Added - Control latency of lossy data channel ([#​4088](livekit/livekit#4088)) - logger proto redaction. ([#​4090](livekit/livekit#4090)) - Record join/publish/subscribe cancellations ([#​4102](livekit/livekit#4102), [#​4104](livekit/livekit#4104)) ##### Fixed - Fix "address" typo in transport logs (addddress → address) ([#​4097](livekit/livekit#4097)) - Clear stereo=1 if stereo is not enabled. ([#​4101](livekit/livekit#4101)) - Participant session close deadlock fixes ([#​4107](livekit/livekit#4107), [#​4113](livekit/livekit#4113), [#​4116](livekit/livekit#4116)) ##### Changed - Switch forwarding latency log to Debugw ([#​4098](livekit/livekit#4098)) - Update mediatransportutil to get OWD estimator relocation ([#​4115](livekit/livekit#4115)) ### [`v1.9.4`](https://github.com/livekit/livekit/releases/tag/v1.9.4) [Compare Source](livekit/livekit@v1.9.3...v1.9.4) ##### Added - Log reason for subscriber not being able to determine codec. ([#​4071](livekit/livekit#4071)) - Kind details for connector ([#​4072](livekit/livekit#4072)) ##### Fixed - Prevent invalid track access while peer connection is shutting down. ([#​4054](livekit/livekit#4054)) ##### Changed - Update PsRPC to get redis pipeliner implementation ([#​4055](livekit/livekit#4055)) - Forwarding latency measurement. ([#​4056](livekit/livekit#4056). [#​4057](livekit/livekit#4057), [#​4059](livekit/livekit#4059), [#​4061](livekit/livekit#4061), [#​4062](livekit/livekit#4062), [#​4067](livekit/livekit#4067), [#​4080](livekit/livekit#4080)) - Update pion/transport to v3.1.1 (to get batch I/O ping-pong buffer) ([#​4070](livekit/livekit#4070)) - Use sync.Pool for objects in packet path. ([#​4066](livekit/livekit#4066)) - Bump protocol to pull sip validation changes and error mapping ([#​4081](livekit/livekit#4081)) ### [`v1.9.3`](https://github.com/livekit/livekit/releases/tag/v1.9.3) [Compare Source](livekit/livekit@v1.9.2...v1.9.3) ##### Added - Opportunistic video layer allocation on setting max spatial layer. ([#​4003](livekit/livekit#4003), [#​4030](livekit/livekit#4030), [#​4031](livekit/livekit#4031), [#​4033](livekit/livekit#4033)) - use env var for GOARCH. ([#​4012](livekit/livekit#4012)) - Use simulcast codec as default policy for audio track. ([#​4040](livekit/livekit#4040)) - Enable AbsCaptureTimeURI in RTC configuration. ([#​4043](livekit/livekit#4043)) - Add prom histogram for forwarding latency and jitter. ([#​4044](livekit/livekit#4044), [#​4045](livekit/livekit#4045)) ##### Fixed - Correct direction for request/response for prom counters. ([#​4027](livekit/livekit#4027)) - Do not bind buffer if codec is invalid. ([#​4028](livekit/livekit#4028)) - Remove \~ from rid which indicates disabled layer to get the actual rid. ([#​4032](livekit/livekit#4032)) - Prevent leakage of previous codec after codec regression. ([#​4035](livekit/livekit#4035), [#​4037](livekit/livekit#4037)) - fix: add missing Unlock() in AddReceiver. ([#​4036](livekit/livekit#4036)) ##### Changed - Some golang modernisation bits. ([#​4106](livekit/livekit#4106)) - Use rtp converter from protocol/utils. ([#​4019](livekit/livekit#4019), [#​4020](livekit/livekit#4020)) - High forwarding latency. ([#​4034](livekit/livekit#4034), [#​4038](livekit/livekit#4038)) - if RingingTimeout is provided, deadline should be set to that timeout. ([#​4018](livekit/livekit#4018)) - Don't warn 0 payload type for PCMU. ([#​4039](livekit/livekit#4039)) ### [`v1.9.2`](https://github.com/livekit/livekit/releases/tag/v1.9.2) [Compare Source](livekit/livekit@v1.9.1...v1.9.2) ##### Added - Use gzip reader pool ([#​3903](livekit/livekit#3903)) - Rpcs for ingress proxy WHIP ([#​3911](livekit/livekit#3911)) - Include agent\_name as a participant attribute ([#​3914](livekit/livekit#3914)) - Clean code as there is no oss sweeper for ingress ([#​3918](livekit/livekit#3918)) - Support simulcasting of audio ([#​3920](livekit/livekit#3920)) - Subscrbed audio codecs - update from remote nodes. ([#​3921](livekit/livekit#3921)) - Log some information around high forwarding latency. ([#​3944](livekit/livekit#3944)) - feat: server rpc apis ([#​3904](livekit/livekit#3904)) - short circuit participant broadcast filter in livestream mode ([#​3955](livekit/livekit#3955)) - Adjust for hold time when fowarding RTCP report. ([#​3956](livekit/livekit#3956)) - Add node\_ip to config-sample.yaml ([#​3960](livekit/livekit#3960)) - add idempotent reference count to telemetry stats worker ([#​3964](livekit/livekit#3964)) - add config for user data recording ([#​3966](livekit/livekit#3966)) - Provide the InputVideo/AudioState to Ingress in WHIPRTCConnectionNotify ([#​3982](livekit/livekit#3982)) - Add encryption datapacket type ([#​3869](livekit/livekit#3869)) - Allow passing inline trunk for outbound calls. ([#​3987](livekit/livekit#3987)) - Log RPC details. ([#​3991](livekit/livekit#3991)) - "Power of Two Random Choices" option for node selection ([#​3785](livekit/livekit#3785)) - Adding ProviderInfo to GetSIPTrunkAuthenticationResponse ([#​3993](livekit/livekit#3993)) - Use answer with mid -> trackID mapping when in single peer connection ([#​4005](livekit/livekit#4005)) - Include mid -> trackID in both SDP offer and answer. ([#​4007](livekit/livekit#4007)) ##### Fixed - add incoming request id to request response message ([#​3912](livekit/livekit#3912)) - Simulcast audio fixes ([#​3925](livekit/livekit#3925)) - Fix dynacast subscriber node clearing on move participant. ([#​3926](livekit/livekit#3926)) - mediatransportutil crash fix for logging local address ([#​3930](livekit/livekit#3930)) - Do DD restart only if DD structure is present. ([#​3935](livekit/livekit#3935)) - Avoid matching on empty track id. ([#​3937](livekit/livekit#3937)) - fix stats worker closed condition ([#​3965](livekit/livekit#3965)) - Update deps to fix redis issue when 1 cluster address is provided ([#​3969](livekit/livekit#3969)) - Revert unintentional change to not handle transport fallback ([#​3970](livekit/livekit#3970)) - Do not panic of redis is not configured ([#​3981](livekit/livekit#3981)) - Sort codec layers when adding track ([#​3998](livekit/livekit#3998)) - Resort to full search for requested quality is not available. ([#​4000](livekit/livekit#4000)) - Do not try to read stats from peer connection after close. ([#​4002](livekit/livekit#4002)) - Update pion/webrtc to prevent GetStats panic. ([#​4004](livekit/livekit#4004)) ##### Changed - update protocol for sip api change ([#​3902](livekit/livekit#3902)) - Refactor subscribedTrack + mediaTrackSubscriptions. ([#​3908](livekit/livekit#3908)) - Set publisher codec preferences after setting remote description ([#​3913](livekit/livekit#3913)) - update protocol for psrpc ([#​3915](livekit/livekit#3915)) - Wait for `SetRemoteDescription` before configuring senders. ([#​3924](livekit/livekit#3924)) - Update mediatransportutil to log external IP found via STUN. ([#​3929](livekit/livekit#3929)) - Add debugging from DD frame number wrap around. ([#​3933](livekit/livekit#3933)) - More debugging of DD jump ([#​3934](livekit/livekit#3934)) - Use difference in key frame counter to stop seeder. ([#​3936](livekit/livekit#3936)) - Update protocol for SipCreateParticipant ([#​3939](livekit/livekit#3939)) - mediatransportutil to log local address when validating external IP ([#​3942](livekit/livekit#3942)) - Use microseconds for forwarding stats. ([#​3943](livekit/livekit#3943)) - Tweaks tresholds for logging high forwarding latency/jitter. ([#​3945](livekit/livekit#3945)) - Flush stats when there are no packets. ([#​3947](livekit/livekit#3947)) - handle terminated job requests ([#​3948](livekit/livekit#3948)) - Switch ops queue a singly linked list. ([#​3949](livekit/livekit#3949)) - Revert "Switch ops queue a singly linked list." ([#​3950](livekit/livekit#3950)) - Adjust stream allocator ping interval based on state. ([#​3951](https://github.com/livekit/livekit/issues/3951)) - avoid logging on small values ([#​3958](https://github.com/livekit/livekit/issues/3958)) - Update protocol for EventKey helper. ([#​3963](https://github.com/livekit/livekit/issues/3963)) - Do not force codec regression between opus and red. ([#​3980](https://github.com/livekit/livekit/issues/3980)) - Do not start forawarding on out-of-order packet. ([#​3985](https://github.com/livekit/livekit/issues/3985)) - Use padding only packets for dummy start of audio. ([#​3984](https://github.com/livekit/livekit/issues/3984)) - Support Opus mixed with RED when encrypted. ([#​3986](https://github.com/livekit/livekit/issues/3986)) - Limit check to red + opus when looking for primary codec match. ([#​3988](https://github.com/livekit/livekit/issues/3988)) - Increment RTP timestamp on padding when using dummy start. ([#​3989](https://github.com/livekit/livekit/issues/3989)) - Revert to using silence packets for audio dummy start. ([#​3999](https://github.com/livekit/livekit/issues/3999)) - Count request/response packets on both client and server side. ([#​4001](https://github.com/livekit/livekit/issues/4001)) - Do not call receiver methods under settings lock. ([#​4006](https://github.com/livekit/livekit/issues/4006)) - counterfeiter needs an older version of x/tools ([#​4009](https://github.com/livekit/livekit/issues/4009)) ### [`v1.9.1`](https://github.com/livekit/livekit/blob/HEAD/CHANGELOG.md#PLEASE-NOTE-The-previous-release-tag-v1910-hit-a-panic-under-some-conditions-Sincerely-regret-the-inconvenience-caused-Although-we-do-test-rigorously-it-is-not-guaranteed-to-cover-all-scenarios-We-request-you-to-report-any-issues-you-encounter-Thank-you) [Compare Source](livekit/livekit@v1.9.0...v1.9.1) ##### Added - Support OpenTelemetry tracing. Add Jaeger support. ([#​4222](livekit/livekit#4222)) - Add option to force simuclast codec. ([#​4226](livekit/livekit#4226)) - Log timeout in API ([#​4231](livekit/livekit#4231), [#​4232](livekit/livekit#4232)) - Add participant option for data track auto-subscribe. ([#​4240](livekit/livekit#4240)) ##### Changed - Remove enable arrival time forwarding method. ([#​4217](livekit/livekit#4217)) - sfu/receiver and sfu/buffer refactor ([#​4221](livekit/livekit#4221), [#​4224](livekit/livekit#4224), [#​4225](livekit/livekit#4225)) - Change some logs to debugw ([#​4229](livekit/livekit#4229)) - Changing field naming of data track packet ([#​4235](livekit/livekit#4235)) - Update Pion transport package. ([#​4237](livekit/livekit#4237)) - Wrapping the invalid request errors for CreateSipParticipant ([#​4239](livekit/livekit#4239)) ##### Fixed - Swap result sink atomically rather than closing and setting ([#​4216](livekit/livekit#4216)) - Address crash in v1.9.10 ([#​4219](livekit/livekit#4219), [#​4220](livekit/livekit#4220)) - Return on SDP fragment read error. ([#​4228](livekit/livekit#4228)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/484
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
Summary by CodeRabbit