LizardByte / Sunshine

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

stream starts but only works for 2 seconds #2978

Open fn-st-op opened 3 months ago

fn-st-op commented 3 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Stream starts but only works for 2 seconds and then sunshine freezes and even going to task manager and ending Sunshine's process doesn't close sunshine, to use sunshine again I need to restart windows 10 but the stream still only works for exactly 2 seconds both video and audio after 2 seconds just freezes.

I'm using an amd rx 6600 xt with a amd ryzen 5 5600g but I turned off the 5600g integrated graphics in the motherboard bios. I've tried changing the settings in sunshine configuration and even changed to the software encoder but the problem still there. I've changed the FEC Percentage to 1 that didn't do anything, I've also changed the Quantization Parameter to 1 it also didn't fix the problem. I've also changed to the Windows.Graphics.Capture method to see if it fixed the freeze problem but it didn't fix it.

This are the last changes I've made to the AMD AMF Encoder settings that still didn't fix the problem.

AMF Usage low latency

AMF Rate Control vbr latency

AMF Hypothetical Reference Decoder (HRD) Enforcement Disabled (default)

AMF Quality speed -- prefer speed

AMF Preanalysis Disabled (default)

AMF Variance Based Adaptive Quantization (VBAQ) Disabled

AMF Coder (H264) cavlc -- context adaptive variable-length coding - faster decode

Expected Behavior

No response

Additional Context

No response

Host Operating System

Windows

Operating System Version

Windows 10

Architecture

64 bit

Sunshine commit or version

v2024.805.184417

Package

Windows - portable

GPU Type

AMD

GPU Model

RX 6600 XT

GPU Driver/Mesa Version

24.20.01.02

Capture Method

Windows.Graphics.Capture (Windows)

Config

qp = 1
fec_percentage = 1
encoder = amdvce
amd_quality = speed
av1_mode = 1
amd_coder = cavlc
amd_usage = lowlatency
notify_pre_releases = enabled
capture = wgc
amd_vbaq = disabled
amd_rc = cbr
amd_enforce_hrd = enabled

Apps

No response

Relevant log output

[2024:08:07:14:37:54]: Info: Sunshine version: v2024.805.184417
[2024:08:07:14:37:54]: Info: nvprefs: NvAPI_Initialize() failed, ignore if you don't have NVIDIA video card
[2024:08:07:14:37:54]: Info: Compiling shaders...
[2024:08:07:14:37:54]: Info: Compiled shaders
[2024:08:07:14:37:54]: Warning: Gamepad x360 is disabled due to gamepads.vigem-not-available
[2024:08:07:14:37:54]: Warning: Gamepad ds4 is disabled due to gamepads.vigem-not-available
[2024:08:07:14:37:54]: Warning: No gamepad input is available
[2024:08:07:14:37:54]: Info: Trying encoder [amdvce]
[2024:08:07:14:37:54]: Info: System tray created
[2024:08:07:14:37:55]: Info: ddprobe.exe [1] [] returned: 0x00000000
[2024:08:07:14:37:55]: Info: Set GPU preference: 1
[2024:08:07:14:37:55]: Error: Failed to sync desktop to thread [0x000000AA]
[2024:08:07:14:37:55]: Info: 
Device Description : AMD Radeon RX 6600 XT
Device Vendor ID   : 0x00001002
Device Device ID   : 0x000073FF
Device Video Mem   : 8120 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 8118 MiB
Feature Level      : 0x0000B100
Capture size       : 3840x2160
Offset             : 0x0
Virtual Desktop    : 3840x2160
[2024:08:07:14:37:55]: Info: Active GPU has HAGS disabled
[2024:08:07:14:37:55]: Info: Using realtime GPU priority
[2024:08:07:14:37:55]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 10
Red Primary        : [0.657227,0.329102]
Green Primary      : [0.304688,0.644531]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2024:08:07:14:37:55]: Warning: Can't disable colored border around capture area on this version of Windows
[2024:08:07:14:37:55]: Info: SDR color coding [Rec. 601]
[2024:08:07:14:37:55]: Info: Color depth: 8-bit
[2024:08:07:14:37:55]: Info: Color range: [JPEG]
[2024:08:07:14:37:55]: Error: Invalid value at rbsp_stop_one_bit: bitstream ended.
[2024:08:07:14:37:55]: Error: Failed to read unit 3 (type 12).
[2024:08:07:14:37:55]: Error: Couldn't read packet: Invalid data found when processing input
[2024:08:07:14:37:55]: Info: SDR color coding [Rec. 601]
[2024:08:07:14:37:55]: Info: Color depth: 8-bit
[2024:08:07:14:37:55]: Info: Color range: [JPEG]
[2024:08:07:14:37:55]: Error: Failed to sync desktop to thread [0x000000AA]
[2024:08:07:14:37:55]: Info: 
Device Description : AMD Radeon RX 6600 XT
Device Vendor ID   : 0x00001002
Device Device ID   : 0x000073FF
Device Video Mem   : 8120 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 8118 MiB
Feature Level      : 0x0000B100
Capture size       : 3840x2160
Offset             : 0x0
Virtual Desktop    : 3840x2160
[2024:08:07:14:37:55]: Info: Active GPU has HAGS disabled
[2024:08:07:14:37:55]: Info: Using realtime GPU priority
[2024:08:07:14:37:55]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 10
Red Primary        : [0.657227,0.329102]
Green Primary      : [0.304688,0.644531]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.313477,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2024:08:07:14:37:55]: Warning: Can't disable colored border around capture area on this version of Windows
[2024:08:07:14:37:55]: Info: SDR color coding [Rec. 709]
[2024:08:07:14:37:55]: Info: Color depth: 10-bit
[2024:08:07:14:37:55]: Info: Color range: [JPEG]
[2024:08:07:14:37:55]: Warning: amdvce: h264 missing sps->vui parameters
[2024:08:07:14:37:55]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:08:07:14:37:55]: Info: 
[2024:08:07:14:37:55]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2024:08:07:14:37:55]: Info: 
[2024:08:07:14:37:55]: Info: Found H.264 encoder: h264_amf [amdvce]
[2024:08:07:14:37:55]: Info: Found HEVC encoder: hevc_amf [amdvce]
[2024:08:07:14:37:55]: Info: Configuration UI available at [https://localhost:47990]
[2024:08:07:14:37:56]: Info: Registered Sunshine mDNS service
[2024:08:07:14:38:18]: Info: Web UI: [127.0.0.1] -- not authorized
[2024:08:07:14:38:18]: Info: Web UI: [127.0.0.1] -- not authorized
Kane-Kuroneko commented 3 months ago

Can any recorded videos be provided for this issue?

fn-st-op commented 3 months ago
after freeze but before trying to close sunshine

After taking that screenshot I tried closing sunshine but it didn't do anything then I went to task manager and selected end task and it gave me a not responding message on sunshine's list inside task manager after that I didn't do anything and it took like 10 seconds for sunshine to close. This particular time sunshine did close but other times it doesn't and I have to restart the pc.

Pamalosebi commented 3 months ago

I have that too... But with linux after upgrading to 6.10.3. But that could be unrelated. Still I experience the same.

evildad69 commented 3 months ago

I am also having this issue. I've reinstalled windows on the host and client, it seems to be only one client in particular has this issue. A think centre with a i3-6100T cpu and HD graphics 530 connecting to a host with an with an amd 3600 cpu and radeon 6600 xt. The client is unable to connect even while using linux mint and fedora linux, but that host works fine with other PCs on my network. I'm currently trying older versions of sunshine on the host to see if that fixes my issue.

evildad69 commented 3 months ago

For my issue, it was an A8000 nighthawk usb wifi adapter that caused this. Didnt matter the OS either. Using another network adapter, my issue is resolved.

fn-st-op commented 3 months ago

I have the same A8000 nighthawk wifi 6 adapter, and by your recommendation I switched it out with another wifi adapter a tp-link t3u plus wifi 5 adapter and the sunshine stream worked it didn't froze like it did with the A8000 nighthawk. I think this either has to be a wifi 6 problem or a problem with the driver of the A8000 nighthawk.

muffn commented 1 month ago

I have the same issue and also a A8000 nighthawk wifi 6 adapter

rsella commented 1 week ago

I've got the same issue, on A8000 nighthawk wifi adapter.

Stream starts, 2-5 seconds, audio and input are working but video is frozen. If I force quit the game, sunshine can't start any other games and can't restart itself also (need a pc reboot)

Tried reinstalling sunshine, reinstalling wifi drivers (different versions also), changed all the relevant settings in sunshine (tried forcing software encoding without luck). Not working using android and webOS moonlight clients.

Any idea on how to solve?

pessimism commented 1 week ago

I am also affected by the same issue. Radeon RX6600M, Windows 24H2 With Fenvi AX1800 USB (Mediatek MT7921au) - video freezes after a few seconds, sunshine app hangs and is unkillable in task manager, requiring a reboot. Windows event log shows exception in KERNELBASE.dll for sunshine.

Tried disabling every USB power saving related setting on the adapter, windows power plan, and usb root hub - no improvement.

Switched to an almost 8 year old Archer T9UH wireless AC USB adapter, problem instantly disappeared.

I believe the Nighthawk adapter others have had trouble with also uses the MT7921au chipset. So maybe a driver bug with this wifi chip? Unfortunate because only MediaTek and Realtek are making new USB chipsets and neither are stellar in terms of driver updates.