TheElixZammuto / moonlight-xbox

Moonlight port for Xbox One/Series Family of Console
GNU General Public License v3.0
346 stars 24 forks source link

Black screen on any resolution above 1080p #129

Closed beeeeswax closed 3 months ago

beeeeswax commented 4 months ago

Describe the bug If the streaming resolution is set to 1080p everything works fine but at 1440p or 2160p all I get is a black screen. I can hear audio (Steam Big Picture navigation sounds) when this happens so I know moonlight is connecting and receiving a stream.

Streaming from the same PC to the same TV via an Nvidia Shield Pro 2019 with Moonlight works fine at 1440p and 4k.

Problem is the same whether video format is set to HEVC or H264, 30/60/120 FPS within Moonlight UWP.

Logs See comment below.

Guest Information:

Host Information

Additional context Add any other context about the problem here.

beeeeswax commented 4 months ago

Captured some log info via Google Lens:

Logs and info don't appear immediately once enabled so this is what I see when I enable logging, disconnect from the black-screen session then reconnect:

App Version: 1.16.2.70
Window Size: 3840.000000 x 2160.000000
AVG Rendering time: infms
Queue Size: 0
Composition Scale: 2.000000 - 2.000000 - 2.000000
Got status 0 from gs_init
Inserted App ID 881448767
RTSP port: 48010
Initializing platform...Stage 1 started
Stage 1 completed
done
Resolving host name...Stage 2 started
Stage 2 completed
done
Initializing audio stream...Stage 3 started
Stage 3 completed
done
Starting RTSP handshake... Stage 4 started
Audio port: 48000
Video port: 47998
Control port: 47999
Stage 4 completed
done
Initializing control stream...Stage 5 started
Stage 5 completed
done
Initializing video stream...Stage 6 started
Stage 6 completed
done
Initializing input stream...Stage 7 started
Stage 7 completed
done
Starting control stream...Stage 8 started

If I then Disconnect/Close and start another 1440p60 session, I get different (better?) log info:

Waiting for IDR frame [FFMPEG] Failed setup for format d3d11: hwaccel initialisation returned error.
[FFMPEG]decode_slice_header error
[FFMPEG]no frame!
Error avcodec_send_packet: Invalid data found when processing input
Requesting IDR frame on behalf of DR
IDR frame request sent
Stopping input stream...done
Stopping audio stream...No audio traffic was ever received from the host!
ENet wait interrupted
Control stream connection failed: 10004
Audio Cleanup
done
Stopping video stream... Decoding Stopped
Decoding Clean
done
Stopping control stream...ENet peer acknowledged disconnection
done
Cleaning up input stream...done
Cleaning up video stream...done
Cleaning up control stream...done
Cleaning up audio stream...done
Cleaning up platform...done
HDR DisabledGot status 0 from gs_init
Started with creation of DXView
andremoreirafulfil commented 3 months ago

I got the same thing here, only works on 1080p

TheElixZammuto commented 3 months ago

Hi everyone and sorry for the late response.

Checko that you are using HEVC as a codec instead of H264

beeeeswax commented 3 months ago

Problem is the same using either HEVC or H.264. A stream is opened because I can hear Steam Big Picture startup and navigation sounds when moving the controller but screen is completely black,

andremoreirafulfil commented 3 months ago

I've tried to use another resolutions and different codecs, now it works fine what ever resolution and codec I chose to use

beeeeswax commented 3 months ago

I've tried to use another resolutions and different codecs, now it works fine what ever resolution and codec I chose to use

What exactly did you do to fix it? No matter what video encoder I use, I get a black screen on anything over 1080p. Are you saying you can now stream in 1440p and 2160p?

andremoreirafulfil commented 3 months ago

I'm not sure what exactly fixed it, but I was trying a lot for combination of resolution and codecs, then now I'm able to stream 4k 60fps in xss.

I remember I set it to 720p, then I changed codec and tried to put 4k then it works fine for me

beeeeswax commented 3 months ago

I'm not sure what exactly fixed it, but I was trying a lot for combination of resolution and codecs, then now I'm able to stream 4k 60fps in xss.

I remember I set it to 720p, then I changed codec and tried to put 4k then it works fine for me

Well I'm glad you fixed your problem but I've just spent the last 10 minutes flicking between different resolutions and codecs and no matter what I do, as soon as I select any resolution above 1080p, I get sound but a completely black screen.

I tried jumping from every 720p/1080p/H.264/HEVC combination to every 1440p/2160p/H.264/HEVC combination in different orders, trying the "Disconnect" and the "Disconnect/Close" options between changing resolution and nothing works. I have 2 Series X consoles in the house and they both have the same problem, there's something wrong here. Is there nothing useful in the logs I supplied?

beeeeswax commented 3 months ago

OK, my mention of this happening on both my Xboxes prompted me to look at my Sunshine config more closely and I've solved the problem. My sunshine server was set to not advertise HEVC support (due to issues with it on other Moonlight client platforms). Having now set the following options:

HEVC Support Sunshine will advertise support for HEVC Main profile

Force a Specific Encoder NVIDIA NVENC

I can stream at 1440p/60/120 and 2160p/60/120. Thanks everyone for your input, it helped me get to the bottom of this.