Skip to content

[Bug]: Windows: Stream breaks after closing/reopening laptop lid when virtual display disappears, then DDX capture falls back to Intel iGPU while NVENC uses NVIDIAΒ #696

@ganxiaozhe23

Description

@ganxiaozhe23

🏷️ Bug Category

πŸ–₯️ Virtual Display issues

πŸ“ Bug Description

When streaming from a Windows laptop using Sunshine with a virtual display, closing and reopening the laptop lid causes the active virtual display to disappear. Sunshine then falls back to the default internal display on Intel UHD Graphics, while encoding still uses NVIDIA NVENC. After that, Sunshine repeatedly recreates the encoder and logs:

  • Previous active display [\\.\DISPLAY36] is no longer present
  • Client-specified display ... DISPLAY36 not found, using default display
  • display capture uses: Intel(R) UHD Graphics
  • Failed to open shared image texture [0x80070057]
  • Could not convert image

The stream becomes unusable until reconnecting/restarting the session.

πŸ”„ Steps to Reproduce

  1. Start Sunshine as a Windows service on a laptop with hybrid graphics.
  2. Configure Sunshine to use a virtual display:
    • output_name = ZakoHDR
    • display_device_prep = ensure_only_display
  3. Connect from Moonlight and start streaming to the virtual display.
  4. Confirm the stream is using the virtual display, for example \\.\DISPLAY36 at 2160x1620.
  5. While the stream is active, close the laptop lid.
  6. Reopen the laptop lid.
  7. Observe that the stream breaks or becomes unusable. The Moonlight client shows a black screen while the touchscreen still works.
  8. Check sunshine.log.

🎯 Affected Games/Apps

No response

πŸ” Reproducibility

Always (100%)

πŸ’» Host Operating System

Windows 11

πŸ“Œ Windows Specific Version

Windows 11 23H2

β˜€οΈ Sunshine Version

v2026.515.84851.杂鱼

🎨 GPU Vendor

NVIDIA

🎨 GPU Model & Driver

No response

πŸ”§ Video Encoder

None

πŸ“± Client Device

No response

βš™οΈ Configuration Modified?

None

πŸ“‹ Modified Configuration

No response

πŸ“Έ Screenshots/Videos

No response

πŸ“œ Log Output

[2026-05-30 17:58:50.602]: Info: Starting async encoder teardown
[2026-05-30 17:58:50.905]: Info: Async encoder teardown complete
[2026-05-30 17:58:51.296]: Warning: Previous active display [\\.\DISPLAY36] is no longer present
[2026-05-30 17:58:51.297]: Warning: Client-specified display [{fc577d45-cdf4-541f-b0f4-1950e003b543}] (resolved: \\.\DISPLAY36) not found, using default display
[2026-05-30 17:58:51.297]: Info: Running in service mode, using DDX capture (WGC not available in services)
[2026-05-30 17:58:51.520]: Info: Device Description : Intel(R) UHD Graphics, Vendor ID: 0x00008086, Device ID: 0x000046A3, Video Mem: 128 MiB, Feature Level: 0x0000B100, Capture: 1920x1080, Offset: 0x0
[2026-05-30 17:58:51.521]: Info: HAGS: disabled, GPU priority: realtime
[2026-05-30 17:58:51.521]: Info: Fractional framerate: 60/1 (60 fps)
[2026-05-30 17:58:51.521]: Info: HDR: DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709, Bits: 8, Luminance: 0.5/270/270 nits
[2026-05-30 17:58:51.521]: Info: Capture gamma: sRGB (G22)
[2026-05-30 17:58:51.570]: Info: Desktop resolution [1920x1080], Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM], Display refresh rate [144.002Hz], Requested frame rate [60fps]
[2026-05-30 17:58:51.601]: Info: Display resolution changed: 2160x1620 -> 1920x1080
[2026-05-30 17:58:51.602]: Info: New encoding resolution: 1920x1080 (scale: 1x1)
[2026-05-30 17:58:51.677]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2026-05-30 17:58:51.709]: Info: Creating encoder [hevc_nvenc], Color coding: SDR (Rec. 601), Color depth: 8-bit, Color range: MPEG
[2026-05-30 17:58:51.716]: Info: Found NVIDIA GPU for NVENC encoding: NVIDIA GeForce RTX 4050 Laptop GPU (display capture uses: Intel(R) UHD Graphics)
[2026-05-30 17:58:51.997]: Info: NvEnc: created encoder v1200 HEVC P1 async cbr two-pass rfi
[2026-05-30 17:58:51.998]: Info: Minimum frame time set to 33.3333ms, based on client-requested target framerate 60.
[2026-05-30 17:58:51.998]: Error: Failed to open shared image texture [0x80070057]
[2026-05-30 17:58:51.999]: Error: Could not convert image

πŸ’¬ Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions