Repository navigation
Enable WARP and zero playout delay by default - #1321
Conversation
|
This PR bumps
|
There was a problem hiding this comment.
Devin Review found 1 potential issue.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| bool enableWARP = false, | ||
| bool zeroPlayoutDelay = false, | ||
| bool enableWARP = true, | ||
| bool zeroPlayoutDelay = true, |
There was a problem hiding this comment.
🟡 Room playout settings ignored by default
When native viewers join a room with configured playout limits, zeroPlayoutDelay replaces those limits with zero. Video playback ignores the room’s configured delay unless the app opts out at startup.
Learn more
LiveKit rooms can set subscriber playout limits through RoomConfiguration. The LiveKit server passes those limits to its downtrack playout-delay controller and sends them in the video RTP playout-delay extension. The native initialization path passes zeroPlayoutDelay through liveKitWebRTCInitializeOptions, and flutter_webrtc 1.6.3 sets the WebRTC-ForcePlayoutDelay field trial to min_ms:0,max_ms:0. In WebRTC m150, RtpVideoStreamReceiver2::OnReceivedPayloadData substitutes the trial values and only reads the RTP extension when the trial is absent. Changing the default therefore replaces explicit room limits, not just WebRTC's fallback for rooms without limits.
Example: A room sets a 100 ms minimum and a 500 ms maximum. A native viewer whose app calls LiveKitClient.initialize() at startup previously used the limits sent by the room. After upgrading, the receiver substitutes 0 ms for both without a change to the room configuration.
Recommended fix: Keep WARP enabled by default but leave zeroPlayoutDelay opt-in with the current dependency. To make low latency the default without breaking room settings, first add an upstream mode that uses zero delay only when the sender has not supplied playout limits. Test that a native subscriber still honors a nonzero RTP playout delay under the default settings.
Was this helpful? React with 👍 or 👎 to provide feedback.
… and zero playout delay
<!-- verwalter release --> Merging this PR releases: ## livekit_client `2.14.0` → `2.15.0` ### Minor Changes - RTCConfiguration.continualGatheringPolicy. Peer connections now gather ICE candidates continually by default, like the Swift, Android and JS SDKs, so a network change such as Wi-Fi to cellular produces new candidates without waiting for an ICE restart. Set RTCContinualGatheringPolicy.gatherOnce to keep the previous behavior. - [#1311](#1311) ([@lukasIO](https://github.com/lukasIO)) - LiveKitClient.initialize() now enables enableWARP and zeroPlayoutDelay by default. Pass false to keep the previous behavior - [#1321](#1321) ([@cloudwebrtc](https://github.com/cloudwebrtc)) - Data published without reliable: true is no longer retransmitted, because the maxRetransmits of 0 on the lossy data channel now reaches the platform - [#1323](#1323) ([@hiroshihorie](https://github.com/hiroshihorie)) - Single peer connection support - [#1025](#1025) ([@hiroshihorie](https://github.com/hiroshihorie)) ### Patch Changes - Keep one dependency descriptor extension id across the SDP bundle - [#1310](#1310) ([@cloudwebrtc](https://github.com/cloudwebrtc)) - disconnect() tears the room down locally after sending the Leave instead of waiting for the server to echo it, so it no longer stalls 10 s when the echo is lost. A disconnect() call while one is already tearing down returns at once, so one Leave is sent and one disconnect reported - [#1208](#1208) ([@hiroshihorie](https://github.com/hiroshihorie)) - A late close from a signal socket the SDK already replaced no longer starts another reconnect. In a browser it arrives up to seconds later, which made a room resume every 2 s after its first reconnect - [#1211](#1211) ([@hiroshihorie](https://github.com/hiroshihorie)) - Update the Rust core (livekit_ffi) to 0.16.0 - [#1329](#1329) ([@hiroshihorie](https://github.com/hiroshihorie)) - Mark SDK plumbing members such as `LocalVideoTrack.subscribedCodecs`, the `prevStats` fields of tracks and the proto conversions of `RpcError` as `@internal`, so the analyzer warns when an app uses them. - [#1314](#1314) ([@hiroshihorie](https://github.com/hiroshihorie)) - Offers and answers now carry offer ids, so a late answer to an offer that an ICE restart or a newer offer replaced is ignored instead of being applied to the wrong offer - [#1262](#1262) ([@hiroshihorie](https://github.com/hiroshihorie)) - A track that fails to republish after a full reconnect no longer leaves the tracks after it unpublished or the room without a `RoomReconnectedEvent`. The failure is logged, the track is reported with a `LocalTrackUnpublishedEvent`, and the remaining tracks are republished - [#1302](#1302) ([@j-mercker](https://github.com/j-mercker)) - Signal pings and the ping timeout now restart after a resume, so a signal connection that goes dead after a resume is detected and recovered instead of going unnoticed for the rest of the session - [#1328](#1328) ([@hiroshihorie](https://github.com/hiroshihorie)) - Fully reconnect when a resume cannot restart ICE because the pending offer no longer matches the last answer - [#1025](#1025) ([@hiroshihorie](https://github.com/hiroshihorie)) - A resume now ends as soon as the server asks for a full reconnect or the signal connection drops, instead of waiting out a timeout of up to 10 seconds, and a resume the server gave up on is no longer reported as reconnected before the full reconnect - [#1322](#1322) ([@hiroshihorie](https://github.com/hiroshihorie)) - A resume now waits until the publisher has finished its ICE restart before the room reports it reconnected, so reliable data sent right after a node migration is no longer lost, and a publisher that cannot reconnect leads to a full reconnect instead of repeated resumes. - [#1315](#1315) ([@hiroshihorie](https://github.com/hiroshihorie)) - Negotiate Opus NACK on every audio section in single peer connection mode, including send-only offers created before any subscriptions, enabling retransmission of lost audio in both publish and subscribe directions when RED is disabled, such as with end-to-end encryption. Accept server-offered Opus NACK in dual peer connection subscriber answers, with fallback if the modified answer is rejected - [#1025](#1025) ([@hiroshihorie](https://github.com/hiroshihorie)) - Web: a signal connection that fails after it opened no longer throws an uncaught Future already completed error - [#1303](#1303) ([@j-mercker](https://github.com/j-mercker)) - Update flutter_webrtc to 1.7.0 and WebRTC-SDK to 150.7871.09, which on iOS stops the audio engine from starting twice when an audio interruption ends and lets it start again after a failed audio session deactivation - [#1323](#1323) ([@hiroshihorie](https://github.com/hiroshihorie)) Changesets: `continual-gathering-policy.md`, `dd-extension-bundle-id.md`, `disconnect-completes-on-socket-close.md`, `enable-warp-zero-playout-by-default.md`, `ignore-replaced-socket-callbacks.md`, `livekit-ffi-0.16.md`, `lossy-data-channel-unreliable.md`, `mark-internal-api.md`, `offer-ids.md`, `republish-all-tracks-after-failure.md`, `restart-pings-after-resume.md`, `resume-pending-offer.md`, `resume-stops-on-reconnect-leave.md`, `resume-waits-for-publisher.md`, `single-pc-opus-nack.md`, `single-pc.md`, `web-websocket-error-after-open.md`, `webrtc-150-7871-09.md` --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com>
Change
LiveKitClient.initialize()now defaultsenableWARPandzeroPlayoutDelaytotrue. Apps that want the previous behavior passfalse.The example app no longer sets them explicitly, since it now gets them from the defaults.
Docs
LiveKitClient.initialize()once at startup, before connecting or using any other WebRTC API, and explains why: both options are WebRTC field trials that only take effect before WebRTC initializes.AudioManagerdoc comment: it said connecting a room runsLiveKitClient.initialize(). It doesn't. Connecting triggers flutter_webrtc's lazy initialization, which doesn't pass the LiveKit options. The comment now says that.Notes
LiveKitClient.initialize(), and it has to run before any other flutter_webrtc call. flutter_webrtc initializes itself lazily on its first method call with onlylogSeverity, and ignores any laterinitializecall. So an app that doesn't callLiveKitClient.initialize(), or calls it too late, keeps both off, same as before.liveKitWebRTCInitializeOptionsstill leaves a key out when its value isfalse. flutter_webrtc reads a missing key asfalse, so opting out works.initialize()does nothing there).minorbecause this changes default runtime behavior.