TheElixZammuto / moonlight-xbox

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

DX12 games have artifacting and degradation issues. #89

Closed theBeaz closed 7 months ago

theBeaz commented 12 months ago

Describe the bug When streaming DX12 games via Sunshine on Windows 11 to an Xbox Series X, the stream will begin to show degradation, discoloration, rainbows, blocky artifacts (resembling a blowing fog coming over the screen). Inducing a rapid picture change will temporarily refresh the screen, but the condition will continue to worsen over time.

To Reproduce Steps to reproduce the behavior:

  1. Stream DX12 game to Xbox Series X using latest client retail (1.13.7) or latest dev (1.14.3)
  2. Moonlight must be in app mode (default option for retail, choosable in dev mode)
  3. Play game as normal - issue usually appears in 10-20 minutes at most.

Framerate, bitrate, codec, resolution, etc. have all been changed on client and host side - none of them resolve the issue.

However - running the app with the Xbox in Dev Mode and choosing to run the UWP as a Game alleviates the issue. The client behaves different in game vs. app mode.

Expected behavior Crisp picture. No degradation.

Screenshots or Videos Example of issue when left unchecked: IMG_7730

Pausing and unpausing (which in Starfield sends you to a different screen) temporarily fixes the image: IMG_7731

The issue often starts gradually with rainbowing. Areas of sharp detail (lines/textures on clothing, hair) will often rapidly discolor). IMG_7743

Logs Nothing relevant.

Guest Information:

Additional context I've been the person providing these details via Discord. Figured putting in an official bug report would be helpful.

ryaneford commented 10 months ago

seconding this exact set of errors. Win 11 streaming via retail mooonlight via sunshine

TheElixZammuto commented 10 months ago

I've refactored the shader system by using the same of moonlight-qt with version 1.15.2. Mind to try this version and let me know if it changes something?

ryaneford commented 10 months ago

I've refactored the shader system by using the same of moonlight-qt with version 1.15.2. Mind to try this version and let me know if it changes something?

For sure can. Do you know if you're able to get this version pushed to retail or will i have to go via dev?

TheElixZammuto commented 10 months ago

Retail build would be online in the following days if the certification process goes smoothly, meanwhile dev mode is already available

ryaneford commented 10 months ago

Retail build would be online in the following days if the certification process goes smoothly, meanwhile dev mode is already available

Ok sounds good! I'll give the dev mode a shot as I haven't tested it at all in that mode and i'll wait for the retail to drop.

Thanks for taking a look at this

theBeaz commented 10 months ago

Retail build would be online in the following days if the certification process goes smoothly, meanwhile dev mode is already available

Booting into dev mode now. Will run as an App and see if the issue occurs.

theBeaz commented 10 months ago

Due to the sporadic nature of the issue, I'll need to spend more time testing, but so far so good. However, there is a new graphical issue occurring. It's not as big of a deal as the whole image corruption, but still annoying.

A rapidly flashing black bar will appear at the very top of the screen. It's maybe 20 pixels high and runs the entire width of the screen. This is new with this version of the client:

https://github.com/TheElixZammuto/moonlight-xbox/assets/29100403/cbfb5b2f-ca04-4f54-b727-7959656ec35d

Note - similar to the artifacting, this issue comes and goes but without any sort of intervention. I can't figure out an exact pattern of what causes it.

But as mentioned... so far after about 30 minutes I've seen no sign of the corrupted image from before.

ryaneford commented 10 months ago

Due to the sporadic nature of the issue, I'll need to spend more time testing, but so far so good. However, there is a new graphical issue occurring. It's not as big of a deal as the whole image corruption, but still annoying.

A rapidly flashing black bar will appear at the very top of the screen. It's maybe 20 pixels high and runs the entire width of the screen. This is new with this version of the client:

IMG_0431.MOV Note - similar to the artifacting, this issue comes and goes but without any sort of intervention. I can't figure out an exact pattern of what causes it.

But as mentioned... so far after about 30 minutes I've seen no sign of the corrupted image from before.

I'll get into my SX as soon as i can tonight and test this. weird.

theBeaz commented 10 months ago

@TheElixZammuto this flickering appears to be a whole new bug. When running in Dev mode and the application as GAME or APP, the issue occurs. It will even happen outside of DX12 games - for example Steam Big Picture and Playnite Full Screen. Do you want a new issue filed for this?

theBeaz commented 10 months ago

Sorry - clicked wrong post button.

theBeaz commented 10 months ago

Regarding the actual DX12 game issue - after a few cumulative hours of testing I have not seen the DX12-related artifacting return. Outside of the flickering issue reported above, the experience has been excellent so far!

ryaneford commented 10 months ago

Tested this morning and I got the stuff at the top of the screen too but seemed to of went away and I got a little of the colour artifacting also but not nearly as bad as it was.

Top of screen https://github.com/TheElixZammuto/moonlight-xbox/assets/45504744/e5457468-9513-4591-92bc-dcd4495ec863

Artifacts https://github.com/TheElixZammuto/moonlight-xbox/assets/45504744/d857044e-655e-48ce-af38-fd1438acb610

theBeaz commented 10 months ago

Tested this morning and I got the stuff at the top of the screen too but seemed to of went away and I got a little of the colour artifacting also but not nearly as bad as it was.

Top of screen https://github.com/TheElixZammuto/moonlight-xbox/assets/45504744/e5457468-9513-4591-92bc-dcd4495ec863

Artifacts https://github.com/TheElixZammuto/moonlight-xbox/assets/45504744/d857044e-655e-48ce-af38-fd1438acb610

Dang... that artifacting is still pretty bad. I couldn't reproduce it on Starfield or Mortal Kombat 1. It looks like you're testing via Cyberpunk. Starfield was always worse than MK1 thanks to the static images. I'll have to do more testing.

blork commented 9 months ago

I'm experiencing this same issue streaming World of Warcraft - even setting it to use the DX 11 renderer. Using the retail build. image

Uberrr commented 9 months ago

Can confirm, I'm also getting this issue specifically on Starfield, SWTOR, and Star Wars Galaxies. This and HDR support are my only gripes with Moonlight, other than that it's practically perfect. My Specs: Hosting with Sunshine on Windows 10, client is Xbox Series X, 4K TV 60 FPS. This is a mild example but it gets way worse, especially in dialogue sequences. (Fixing this would be the perfect Christmas gift :D ) image0

TheElixZammuto commented 7 months ago

Any improvement/changes now that version 1.15.x is up?

theBeaz commented 7 months ago

Any improvement/changes now that version 1.15.x is up?

The rapidly flashing black bar I previously reported is now present in retail.

btskyy commented 7 months ago

I also still get a black top bar and color distortion on dx12 but only in 4k. If I switch to 1440p all issues clear up.

theBeaz commented 7 months ago

I also still get a black top bar and color distortion on dx12 but only in 4k. If I switch to 1440p all issues clear up.

  • Xbox One Series X
  • Windows 11
  • Same behavior regardless of bitrate or h.264/265
  • Version 1.15.4

By 1440p, do you mean the Moonlight stream setting or changing your Xbox to output 1440 instead of 4k?

theBeaz commented 7 months ago

Can confirm - set Moonlight to stream at 1440p and so far no artifacting of any kind and no flashing bar. Testing with Tekken 8, so I’ll keep an eye out for any of the rainbow glitch.

TheElixZammuto commented 7 months ago

Hi, Just FYI: Moonlight by default forces HEVC on 4K resolutions so to test H264 make sure you are using a resolution lower than 4K

I still haven't found the cause and I wasn't able to reproduce it, but meanwhile I did some refactoring by making the video pipeline more similar to the one found in moonlight-qt. If you want Dev Mode can you try this build and let me know if it makes some changes? https://transfer.sh/slz8PigIM3/moonlight-xbox-dx_1.15.5.0_x64.msixbundle

btskyy commented 7 months ago

Thanks for the new build. I ran it to the same result, both the top bar and color distortion.

Is there any reason for forcing HEVC on 4K other than bandwidth/reduced bitrate benefits?

TheElixZammuto commented 7 months ago

@btskyy check here, I might have fixed that https://github.com/TheElixZammuto/moonlight-xbox/issues/107#issuecomment-1925394642

btskyy commented 7 months ago

Sweet. The distortion is gone, but it looks like the stream defaults to 1080p now? Visually it looks like it too, with the image pixelated on the 4k display. I wondered if this had always happened so I went back to the retail build and confirmed the resolution is indeed 1080p "looking" (visual assessment in retail build, not logs) in both builds.

Screenshot_2024-02-03_10-03-19 Screenshot_2024-02-03_10-05-15

Edit: I would get in and guess/test some code but I had trouble getting a build setup. I'm just a web dev and the cpp/uwp world -- well maybe someday. Happy to keep testing though!

TheElixZammuto commented 7 months ago

Sweet. The distortion is gone, but it looks like the stream defaults to 1080p now? Visually it looks like it too, with the image pixelated on the 4k display. I wondered if this had always happened so I went back to the retail build and confirmed the resolution is indeed 1080p "looking" (visual assessment in retail build, not logs) in both builds.

Edit: I would get in and guess/test some code but I had trouble getting a build setup. I'm just a web dev and the cpp/uwp world -- well maybe someday. Happy to keep testing though!

Are you sure your Xbox in Dev Mode is set to 4K in settings? The Window size on the upper left corner is set to 1080p and it's set by the Xbox Settings

TheElixZammuto commented 7 months ago

Version 1.15.6 with this fix is now pending certification in the MS Store, it should be available to you in the following hours

jz5678910 commented 7 months ago

Version 1.15.6 with this fix is now pending certification in the MS Store, it should be available to you in the following hours

Just want to say thanks for all the hard work. Moonlight working on Xbox stopped me from buying a secondary streaming computer for HDMI 2.1 output. I'm very grateful that this fix came so quick. Again, thank you!

btskyy commented 7 months ago

Are you sure your Xbox in Dev Mode is set to 4K in settings? The Window size on the upper left corner is set to 1080p and it's set by the Xbox Settings

Oh my, I did have the device settings still defaulted to 1080P. This degradation issue is no longer for me. Thank you as well for this release!

jz5678910 commented 7 months ago

@TheElixZammuto The New retail build 1.15.6.70 is crashing every time I try to select a game from the menu. By crashing I mean it's going back to the Xbox home screen. No error or message of any kind. It gets hung on "Initializing" and then crashes.

Edit: Something finally popped up, not sure if it's helpful or not

PXL_20240204_184712562

PXL_20240204_184731491 MP

TheElixZammuto commented 7 months ago

Pushed version 1.15.7 that should fix the connection (#108) . It might cause regressions in issue #107 but shouldn't be. Let me know and thank you for the patience!

jz5678910 commented 7 months ago

Pushed version 1.15.7 that should fix the connection (#108) . It might cause regressions in issue #107 but shouldn't be. Let me know and thank you for the patience!

This build fixed the issues for me with no regressions!