Repository navigation
CarLife: time-bounded video queue and coalesced keyframe requests - #38
Merged
Merged
Conversation
A source faster than the negotiated send rate overran the three-frame queue. Each overflow cleared the backlog and asked for a keyframe, and the large IDR overran the queue again; a 1.5 s periodic request kept the loop going. A community report against a 2.x head unit showed 30% of frames dropped and 146 keyframe requests in one session. Bound queued video by media span (600 ms), bytes (4 MiB) and frames (120). Recovery requests are at most one per second and are cancelled once a keyframe is queued; the periodic refresh only runs after 5 s without a sent keyframe. The negotiated send cadence is unchanged. The session summary gains keyframeRequestsDeferred, queueBytes, queueSpanMs and queueOverflows, and the first overflow of a session is logged with its limit. Ports iOS OpenXPlay-c8om8. Signed-off-by: Riko <symeonchen@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A CarPlay source faster than the rate the CarLife receiver negotiated overran the three-frame video queue. Every overflow cleared the backlog and requested a keyframe; the large IDR overran the queue again, and the 1.5 s periodic keyframe request kept the loop going. A community report (OnePlus 7 Pro relay, 2.x head unit, 60 fps source against 30 fps negotiated) showed 30% of frames dropped and 146 keyframe requests in one session. iOS fixed the same loop in OpenXPlay-c8om8; this ports that fix to
kotlin/carlife.Changes
CarlifeFrameQueue: bounded by media span (600 ms), bytes (4 MiB) and frame count (120) instead of three frames. An overflow resets the queue, keeps an incoming keyframe, and reports which limit was hit.keyframeRequestsDeferred,queueBytes,queueSpanMs,queueOverflows. The first overflow per session is logged with its limit, and the first eight keyframe requests are logged with their reason.Tests
New
CarlifeFrameQueueTestand a clock-injected session test for coalescing and the periodic refresh.:carlife:compileTestKotlinpasses locally; unit tests were not run locally and are left to CI. Not device-tested.