Bugfix/display stream hang#1728
Merged
Merged
Conversation
Device-side syslog (captured via `pymobiledevice3 syslog live`) showed the failure mode: when iOS's idle timer dims the display, the CoreDevice host de-registers its listeners -- SpringBoard ... ActiveOn->Dimmed: "idle timer"(Idle) remoted ERROR: No listener for "com.apple.coredevice.displayservice" remoted ERROR: No listener for "com.apple.coredevice.screencaptureservice" -- so svc.connect() and svc.stop_media_stream() hang on the RemoteXPC response. The stall watchdog tried to recover by restarting the stream but the cleanup path took _stream_lock and never released it, leaving /codec and /stream.bin replying 503 forever. Three changes: 1. Hold a PreventUserIdleSystemSleep IOPMAssertion via assertion_agent for the lifetime of serve(); renew every 2 minutes well under the 5-minute timeout. This is the actual root-cause fix -- the device stops idle-locking, so the listeners stay registered. 2. Bound every device-side RPC in _stop_active_stream / _stop_audio_stream with asyncio.wait_for(..., timeout=2.0). The shutdown path already wrapped these for the same reason; the watchdog/runtime paths now match. 3. Wrap the watchdog's _ensure_fresh_stream(force=True) in a 10 s outer wait_for as a safety net covering the start side (connect / start_video_stream) too.
FPS shows the frame-delta over the previous 1 s so a stall reads as
"0.0 fps" instantly, while the status panel's `frames: N` counter
keeps the cumulative total.
The bottom-left status panel is intentionally compact (white-space:pre,
overflow:hidden) and was cutting long error messages mid-line. Mirror
log() into console.log('[serve-web]', msg) so the full text is always
recoverable from devtools without giving up the compact on-page UI.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.