Session stuck in "Streaming paused for Desktop" indefinitely after abnormal UDP disconnect (Windows) — blocks reconnection even over a different network path

Aperta
#6,117 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start by tracing Sunshine's Windows session and UDP socket handling for the paused streaming state; the issue does not name source files or tests, so locate the code that logs UDP receive errors and changes the tray state. Reproduce or inspect how an abnormal disconnect affects later connection attempts and whether the paused session is cleared or resumed. Done means a dropped session can recover or time out so new connections are accepted; add regression coverage for that behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this?
  • I have searched the existing issues
Is your issue described in the documentation?
  • I have read the documentation
Is your issue present in the latest beta/pre-release?

I'm too lazy to test

(Reproduced on latest stable v2026.914.233613. Have not yet re-tested against the v2026.1115/v2026.1116 pre-releases since the host was deliberately left in the stuck state for diagnostics before filing this.)

Describe the Bug

After an abnormal (non-graceful) network disconnect, the session gets stuck in the "paused" state shown by the tray icon/notification (Streaming paused for Desktop) and never recovers. Every subsequent Moonlight connection attempt fails, even after switching the client to a completely different network path (see below), until Sunshine is manually restarted.

Timeline from today:

  1. Streaming normally over a Tailscale connection (confirmed direct P2P via tailscale ping, not DERP-relayed) to a Windows host.
  2. At the time, the client was connected over a slow/congested university Wi-Fi network (not the client's usual home network). The log shows a UDP receive error:
    [2026-11-16 09:43:33.925]: Error: Couldn't receive data from udp socket: 대상 컴퓨터에서 연결을 거부했으므로 연결하지 못했습니다
    
    (Korean for the localized Windows socket error 10061 / WSAECONNREFUSED — i.e. an ICMP port-unreachable was received back, meaning the destination UDP port the server was sending to was no longer bound on the client side.)
  3. ~54s later, a new session did start successfully:
    [2026-11-16 09:44:27.712]: Info: Display device configuration is disabled. Reverting any active display device configuration.
    [2026-11-16 09:44:28.225]: Info: New streaming session started [active sessions: 1]
    [2026-11-16 09:44:29.424]: Info: Creating encoder [hevc_nvenc]
    [2026-11-16 09:44:29.480]: Info: NvEnc: created encoder v1301 HEVC P4 async two-pass rfi spatial-aq
    
  4. At some point after that, the connection dropped again and this time it did not recover. The Windows notification area shows "Streaming paused for Desktop" with the paused-state tray icon, and it has stayed that way continuously for 11+ hours (still stuck as of filing this issue).
  5. While stuck, we tried reconnecting over a completely different network path (client Wi-Fi → LAN switch → host, instead of Tailscale) — same failure, no change. This rules out the network/VPN path as the cause: whatever got stuck is host-side session state, not connectivity.
  6. sunshine.log has logged nothing (no new session/error/NVENC lines) since the 09:44 entries above, even though we attempted multiple reconnects hours later over the different network path. So the host-side session/socket layer isn't even acknowledging new connection attempts while stuck in this paused state.
  7. Sunshine has deliberately not been restarted yet, in case additional diagnostics are wanted.

This looks related to the general "session stuck in paused state" bug class (e.g. #4801, which was about a different trigger — unpairing the last device), but the trigger here is a plain network drop, not unpairing, and there appears to be no timeout that ever expires/clears the paused session on its own.

Expected Behavior

Either:

  • The paused session should time out after some grace period if the client never reconnects, returning Sunshine to idle and accepting new connections normally, or
  • A reconnect attempt (even from a different IP/network path) should be able to properly resume or replace the stuck paused session instead of silently failing.
Additional Context
  • GPU encoder session count was confirmed at 0 via nvidia-smi --query-gpu=encoder.stats.sessionCount while stuck, so this is not an NVENC concurrent-session-limit issue.
  • tailscale ping to the client during the working period showed a direct P2P connection (pong from <client> via <public-ip>:<port>), not a DERP relay, so this isn't a Tailscale relay/bandwidth issue either.
  • Happy to gather more diagnostics (Process Explorer handles, ETW trace, etc.) on request — the host is currently still in the stuck state.
Host Operating System

Windows

Operating System Version

Windows 11 Pro 25H2, Build 26200.9974

Architecture

amd64/x86_64

Package

Windows - msi installer (recommended)

GPU Type

NVIDIA

GPU Model

GeForce RTX 4070 SUPER

GPU Driver/Mesa Version

617.42

Capture Method

Desktop Duplication API (Windows)

Log output
[2026-11-16 09:20:56.490]: Info: Requested frame rate [60/1 exactly 60 fps]
[2026-11-16 09:20:56.491]: Info: Creating encoder [hevc_nvenc]
[2026-11-16 09:20:56.546]: Info: NvEnc: created encoder v1301 HEVC P4 async two-pass rfi spatial-aq
[2026-11-16 09:43:33.925]: Error: Couldn't receive data from udp socket: 대상 컴퓨터에서 연결을 거부했으므로 연결하지 못했습니다
[2026-11-16 09:44:27.712]: Info: Display device configuration is disabled. Reverting any active display device configuration.
[2026-11-16 09:44:28.225]: Info: New streaming session started [active sessions: 1]
[2026-11-16 09:44:29.424]: Info: Requested frame rate [60/1 exactly 60 fps]
[2026-11-16 09:44:29.424]: Info: Creating encoder [hevc_nvenc]
[2026-11-16 09:44:29.480]: Info: NvEnc: created encoder v1301 HEVC P4 async two-pass rfi spatial-aq

No further session/error/NVENC log lines appear after this, despite multiple reconnect attempts hours later over a different network path.

Lingua principale
C++
Stelle
43k
Fork
2.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LizardByte/Sunshine

Tutte le issue di LizardByte/Sunshine

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.