LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
16.33k stars 784 forks source link

Connection Terminated. Only over internet. #2120

Closed GoTaco closed 5 months ago

GoTaco commented 5 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

Okay so i have used moonlight/sunshine for a long while but never tried over the internet for a while now. i have tried every fix related to this connection terminated i have seen idk if its directly sunshine or moonlights fault at this point so thought id post on both. With that being said i have also tried porting myself and currently using upnp both havent worked. iv tried most recent nightly release and tried changing ping timeout. as im connecting after the RTSP handshake i instantly get Connection Terminated with not a single frame being displayed on my phone.

error.txt

Expected Behavior

I expect that once i hit connect to ether my desktop or steam big picture to be able to connect and control my pc to game but when its loading i get connection terminated.

Additional Context

I do hear sunshine connect on my pc but it instantly pauses and the moonlight client never gets anything

Host Operating System

Windows

Operating System Version

Windows 10 Home 19045.3930

Architecture

64 bit

Sunshine commit or version

0.21.0.d91e2c9ecbb3cbbac4a19a0de573eb5ccad85a57

Package

Windows installer

GPU Type

NVIDIA

GPU Model

RTX 4080

GPU Driver/Mesa Version

551.23

Capture Method (Linux Only)

No response

Config

ping_timeout = 9999999999999999999999999999999999
upnp = enabled

Apps

No response

Relevant log output

i connected a text file since github is telling me the text is to long

main error i see repeated is [2024:02:09:00:36:30]: Warning: WSASendMsg() failed: 10022
cgutman commented 5 months ago

Which Moonlight client versions?

GoTaco commented 5 months ago

Which Moonlight client versions?

Hey sorry forgot to add that but it is that latest moonlight android build of 12.0.2

reddragonmps commented 5 months ago

Make sure you have all your ports open. I had this same problem but in reverse. The audio was not forwarding because I opened the wrong port. The stream had video but no audio. You have upnp enabled but have not mentioned if you have it enabled on your router (which I do not recommend). Make sure you have:

A. uPnP enabled on your router.

or

B. You have forwarded the following ports for your pc: TCP: 47989, 47984, 48010 UDP: 47998, 47999, 48000, 48002

You may also want to use Moonlight's tool to verify all connections are opened. Happy streaming!

cgutman commented 5 months ago

This should be fixed with Sunshine nightly and Moonlight Android v12.1.

maxim-saplin commented 2 months ago

I am still getting this error, Moonlight 5.0.1 macOS, v2024.527.204311 Windows 11 Pro, IPv6

...
[2024:05:28:14:42:13]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2024:05:28:14:42:13]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2024:05:28:14:42:13]: Info: Found AV1 encoder: av1_nvenc [nvenc]
[2024:05:28:14:42:13]: Info: Executing [Desktop]
[2024:05:28:14:42:13]: Info: nvprefs: No need to modify application profile settings
[2024:05:28:14:42:13]: Info: nvprefs: No need to modify global profile settings
[2024:05:28:14:42:13]: Info: WLAN interface 0 is now in low latency mode
[2024:05:28:14:42:13]: Info: A mouse was not detected. Sunshine will enable Mouse Keys while streaming to force the mouse cursor to appear.
[2024:05:28:14:42:13]: Warning: Rejected connection from [fe80::c32:1020:e2aa:a876]: it's not properly set up
[2024:05:28:14:42:13]: Info: 
Device Description : NVIDIA GeForce RTX 4090
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002684
Device Video Mem   : 24142 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 49065 MiB
Feature Level      : 0x0000B100
Capture size       : 3840x2160
Offset             : 0x0
Virtual Desktop    : 3840x2160
[2024:05:28:14:42:13]: Info: Active GPU has HAGS disabled
[2024:05:28:14:42:13]: Info: Using realtime GPU priority
[2024:05:28:14:42:13]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 10
Red Primary        : [0.694336,0.292969]
Green Primary      : [0.274414,0.65918]
Blue Primary       : [0.148438,0.0566406]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.0006 nits
Max Luminance      : 1015.27 nits
Max Full Luminance : 603.698 nits
[2024:05:28:14:42:13]: Info: Desktop resolution [3840x2160]
[2024:05:28:14:42:13]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:05:28:14:42:13]: Info: Display refresh rate [60Hz]
[2024:05:28:14:42:13]: Info: Requested frame rate [60fps]
[2024:05:28:14:42:13]: Info: Capture format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2024:05:28:14:42:13]: Info: SDR color coding [Rec. 601]
[2024:05:28:14:42:13]: Info: Color depth: 8-bit
[2024:05:28:14:42:13]: Info: Color range: [MPEG]
[2024:05:28:14:42:13]: Info: NvEnc: created encoder P4 two-pass rfi
[2024:05:28:14:42:13]: Warning: Unable to find MAC address for fe80::fb59:5408:ecb4:96a1%14
[2024:05:28:14:42:13]: Warning: WSASendMsg() failed: 10022
[2024:05:28:14:42:13]: Warning: WSASendMsg() failed: 10022
...
kirstus commented 2 months ago

I had the same issues of not properly set up and WSASendMsg() failed: 10022, i solved it by setting the Address Family and changing Sunshine UPnP rules on my router

https://github.com/LizardByte/Sunshine/discussions/1696#discussioncomment-9610955