feat: IOSurface keepalive for static screens#1
Closed
lukemarsden wants to merge 1 commit into
Closed
Conversation
When the guest screen is static (no resource_flush events), the encoder previously went idle and produced no frames. Connected clients would see a frozen stream until the next page flip. This adds a keepalive thread that periodically re-submits the last blitted IOSurface to VideoToolbox when no page flips arrive for 500ms. This produces valid H.264 frames with proper frame_num sequencing and correct reference lists — unlike the previous approach in desktop-bridge which re-sent already-encoded P-frames and corrupted the decoder's DPB. The keepalive is efficient: - No GL blit needed — the IOSurface still holds the last raw frame - Zero-copy CVPixelBuffer wrapping (same as normal path) - Only fires when clients are subscribed - Respects VT busy flags to avoid main loop stalls - ~2 FPS on idle screens (500ms interval) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thank you for your interest in the QEMU project. This repository is a read-only mirror of the project's repostories hosted QEMU welcomes contributions of code (either fixing bugs or adding new |
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.
Summary
frame_numsequencing and correct reference listsHow it works
When the guest screen is static,
virtio_gpu_cmd_resource_flushstops firing and the encoder goes idle. The keepalive thread:IOSurface[last_blit_slot]as a newCVPixelBuffer(zero-copy)VTCompressionSessionEncodeFramewith a new PTS (continuing the monotonic sequence)No GL blit is needed — the IOSurface still holds the last raw pixel data. The keepalive respects all existing safety mechanisms (
vt_busy,blit_slot_busy,fe->mutex).Files changed
hw/display/helix/helix-frame-export.h— Added keepalive fields toHelixScanoutEncoder,HELIX_KEEPALIVE_INTERVAL_MSconstanthw/display/helix/helix-frame-export.m— Keepalive thread, tracking inhelix_scanout_frame_ready(), init/resetTest plan
🤖 Generated with Claude Code