Skip to content

iPhone Duo: the screen stream shows the outer panel, so it is black when the device is unfolded #1457

Closed

Description

@sittingmongoose

Summary

On the iPhone Duo simulator (a foldable with two panels), the screen stream always shows the outer panel. When the device is unfolded, the outer panel is switched off, so every viewer of the stream sees a black screen, while screenshots of the active panel (for example agent-device screenshot, which passes --display=<panel>) show the unfolded screen correctly.

Environment

  • simlock 0.4.0 (worker on macOS 27.3, arm64), Xcode 27.3 (27C5020n)
  • Simulator: iPhone Duo, iOS 27.3, leased into simlock's scoped device set
  • agent-device 0.21.35 (driver for fold/rotation)
  • Viewer: a client that plays the lease's /stream/leases/<id> feed (the stream itself is the issue; viewers agree)

Steps to reproduce

  1. Lease an iPhone Duo and open its stream.
  2. agent-device fold open (inner panel on, outer panel off).
  3. Watch the stream.

Observed

  • The stream turns black after unfolding.
  • daemon.log shows each stream opening at the outer panel's shape even while the device is unfolded, for example Screen stream opened {"codec":"h264","width":494,"height":720} (494 x 720 is the 466 x 678 pt outer panel scaled to maxDimension 720; the unfolded inner panel is 669 x 951 pt, or 951 x 669 when sideways).
  • Screenshots of the active panel at the same moment show the unfolded home screen.

Expected

The stream follows the panel that is on: the outer panel when folded, the inner panel when unfolded (and its rotation), switching when the pose changes.

Likely cause

simlock-screen-capture takes no display argument (usage: simlock-screen-capture <UDID> [--codec avcc|mjpeg] [--fps N] [--bitrate BPS] [--max-dimension PX] ...) and appears to attach to the first com.apple.framebuffer.display descriptor it finds. On a multi-panel device that is the outer panel. The 0.6.0 binary has the same usage, so upgrading does not change it.

Suggested fix

  • Choose the framebuffer display that is lit (or accept --display <name> and have the worker pass the active panel, the way agent-device picks the panel for screenshots from the panel table).
  • Re-select when the panel power changes (fold/unfold), or end the stream with a clear "the active panel changed" so viewers reconnect to the right one.

Activity

  1. sittingmongoose commented on Nov 8, 2026

    @sittingmongoose
    Author

    Cause found and fixed locally (simlock 0.4.0, iPhone Duo, iOS 27.3, Xcode 27.3):

    • simlock-screen-capture always selects the smaller (cover) framebuffer panel. When the Duo is unfolded that panel is opaque black, so the stream is black.
    • Also, the capture ignores the surfaces passed to the surfaces-changed callback, so it cannot follow a panel change.

    Local fix (a patched capture program configured through drivers.ios.screenCaptureCommand):

    • It picks the lit panel by sampling content: the dark panel averages 0.000 and the lit one about 1.0.
    • It takes surfaces from the callback's arguments.
    • It rebuilds the scaler and the stream metadata when the size changes.

    Verified through the lease stream endpoint:

    • The stream opens at 506 x 720 unfolded and 494 x 720 folded for the same lease.
    • Decoded frames are non-black in both poses, and the unfolded frame shows the home screen upright.

    Limit on this host: capture surfaces look like registration-time snapshots, and a fold fires no in-process callback. So a stream held open across a fold does not switch panels; reopening the stream gives the right panel. The switch logic is in place for runtimes that do deliver new surfaces.

  2. added
    bug:new
    platform:ios
    on Nov 11, 2026
  3. V3RON commented on Nov 11, 2026

    @V3RON
    Contributor

    Being specified in #1531, which takes PR #1525 (proof of concept) as input. This issue stays open until that feature ships.

    Written by an agent.

  4. V3RON commented on Nov 15, 2026

    @V3RON
    Contributor

    Fixed on main by feature #1531: ADR 0075 (#1532, f7f9d21), the capture streams the panel in use and switches on a fold (#1536, 5eb64e1), taps land on that panel (#1559, 353dcc7).

    Written by an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:newplatform:ios

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions