Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moonlight Windows Client - White Screen and Client Crash on FullScreen Display Mode. #102

Closed
xatornet opened this issue Oct 9, 2018 · 15 comments

Comments

@xatornet
Copy link

xatornet commented Oct 9, 2018

Describe the bug
Using Last Moonlight Client for Windows 10 x64 paired with a PC using GFE version 3.15.0.164 gets me a white screen and then a crash on the client app. If I set displaymode to Borderless Windows or Windows only, it works correctly. It's only Fullscreen option what causes this white screen.

Steps to reproduce
Nothing fancy, just selecting DisplayMode Fullscreen. That, and that it is the first time I try Moonlight Client since updating Windows 10 to 1809 build.

Screenshots
WhiteScreen and Crash:
crash

Moonlight settings (please complete the following information)

  • Have any settings been adjusted from defaults? Yes
  • If so, which settings have been changed? Enabled Mouse Acceleration, and Stereo Sound
  • Does the problem still occur after reverting settings back to default? Yes.
    Settings causing trouble:
    settings

Client PC details (please complete the following information)

  • OS: Windows 10 x64 1809
  • Moonlight Version: PC ver 6.0.0 beta 3 (windows x64 edition)

Logs (please attach)
Moonlight-1539103733.log
Moonlight-1539103891.log

@cgutman
Copy link
Member

cgutman commented Oct 9, 2018

Thanks for moving this over here.

Do you see any Moonlight-###.dmp files next to the Moonlight log files in %TEMP%? If so, please upload those somewhere and post a link.

Please also check if there are Moonlight dump files in %LOCALAPPDATA%\CrashDumps and upload them too.

@xatornet
Copy link
Author

xatornet commented Oct 9, 2018

You're welcome. Thanks for the fast response.

But sadly, i've searched for DMP files on both paths, and there are none. If there's any more testing to do, I'd be glad to help

I've been doing some more testing, downloading other portable versions to test if a downgrade fixes it, but same result.

@cgutman
Copy link
Member

cgutman commented Oct 9, 2018

Ok, great. I was going to ask whether downgrading would fix it.

After you get the "not responding" dialog on Moonlight v0.6.0 (before clicking anything on the dialog), can you open Task Manager, go to the details tab, find Moonlight.exe, then right click it and choose "Create dump file".

That should put a Moonlight.dmp file in %TEMP% that you can upload and share for me to take a look.

@xatornet
Copy link
Author

xatornet commented Oct 9, 2018

Here you have it:

DMP FILE

Also, I've made a weird discovery. If I attach a secondary screen, on that secondary one, Moonlight Client will work correctly even using fullscreen. But, on my main screen, it still gets a whitescreen and crash.

@cgutman
Copy link
Member

cgutman commented Oct 9, 2018

Are both screens plugged into the same GPU? What's the resolution and refresh rate of the working and non-working screen?

@xatornet
Copy link
Author

xatornet commented Oct 9, 2018

Well, here's the mindblowing thing:

As for doing the DMP file, I needed to be able to actually see the Task Manager but as the Moonlight Client Bug is happening on Fullscreen mode, in order to be able to bring the task manager upfront, I managed to use my laptop as a casting screen, and then, open task manager on that. So It was a secondary screen, but not a real one, more like a virtual one. ( I am very sorry for my poor description, my english is not that good).

This is my current setup:
photo_2018-10-09_21-11-26
As I was trying to tell, my "secondary screen" is just my PC using casting option from Win 10.

Weirdly enough, if I use Moonlight Client on my first screen, here's the bug:
photo_2018-10-09_21-12-53

But, if I just open Moonlight Client on my "secondary screen" it works:
photo_2018-10-09_21-13-05
(that's just the actual server's desktop there)

I don't know if Moonlight needs to recognize some data for the monitor or something, but seems to me that my DELL isn't of its liking.

Both screens are 1080p @ 60Hz. Nothing fancy or special here.

Man, this behaviour is driving me crazy :-P

@cgutman
Copy link
Member

cgutman commented Oct 10, 2018

OK, I looked at your crash dump and found that it appears to be related to a DLL called NahimicOSD.dll in the thread that was hung:
ntdll!NtWaitForMultipleObjects+0x14
KERNELBASE!WaitForMultipleObjectsEx+0xfe
KERNELBASE!WaitForMultipleObjects+0xe
d3d9!ThreadAffinitizedWorkerThread::PostCommand+0x49
d3d9!ProxyWindow::CreateProxyWindow+0x40
d3d9!CSwapChain::BindToDwm+0x2c6
d3d9!CSwapChain::CreateWindowed+0xa16
d3d9!CSwapChain::Reset+0x428
d3d9!CSwapChain::Init+0x43
d3d9!CBaseDevice::Init+0x489
d3d9!CEnum::CreateDeviceImpl+0x3d9
d3d9!CEnum::CreateDeviceEx+0xa1
NahimicOSD!GetHotPatchInfo+0x67d4
Moonlight!DXVA2Renderer::initializeDevice+0x26c [c:\moonlight-qt\app\streaming\video\ffmpeg-renderers\dxva2.cpp @ 564]
Moonlight!DXVA2Renderer::initialize+0xa0 [c:\moonlight-qt\app\streaming\video\ffmpeg-renderers\dxva2.cpp @ 613]
Moonlight!FFmpegVideoDecoder::initialize+0x105 [c:\moonlight-qt\app\streaming\video\ffmpeg.cpp @ 399]
Moonlight!Session::chooseDecoder+0x89 [c:\moonlight-qt\app\streaming\session.cpp @ 130]
Moonlight!Session::exec+0x95a [c:\moonlight-qt\app\streaming\session.cpp @ 1075]

Normally that should go directly from Moonlight!DXVA2Renderer::initializeDevice+0x26c to d3d9!CEnum::CreateDeviceEx but NahimicOSD.dll appears to intercept Moonlight's CreateDeviceEx() call and hang the program.

I'd suggest trying to figure out which program installed that DLL and see if removing or disabling it will fix the issue.

@xatornet
Copy link
Author

xatornet commented Oct 10, 2018

I know what that is, and sadly it is important. NahimicOSD is a dll from ASUS sound driver. Being OSD, I guess it is from SonicRadar, a Software that comes bundled with the audio driver. I'm going to try uninstalling only that, to check if the sound driver still works without it.

EDIT:
Eureka! After Uninstalling that driver app, called Sonic Radar, that comes inside ASUS' last sound driver for motherboards Z3xx series, and rebooting, moonlight works again. I hate ASUS shitty sound drivers. I wish Realtek made them again.

Anyway, thanks for your time and effort in fixing this :-P

@cgutman
Copy link
Member

cgutman commented Oct 10, 2018

Thanks, I will try to install Sonic Radar on my PC and see if I can reproduce and work around the NahimicOSD bug within Moonlight.

@xatornet
Copy link
Author

xatornet commented Oct 10, 2018

Fine, just a little heads up. ASUS has updated its audio drivers to use UWP control panel, so the Sonic Radar that I was using is also UWP.

Here's a link to the latest UWP driver from ASUS, just in case you want to run some tests on your own:
ASUS DRIVER

And once again, thanks for everything. Keep up the good work!

@cgutman
Copy link
Member

cgutman commented Oct 14, 2018

Thanks for the link. I was able to reproduce the issue with that driver installed.

I wasn't able to find a way I could get them to avoid hanging in full-screen. I suspect they just hang any full-screen DX9 app with their hooks. I ended up writing a generic anti-hooking DLL that can block known bad DLLs from loading in Moonlight, since I don't think this will be the last time we will see a bug like this.

@xatornet
Copy link
Author

I'm happy to hear, it's not only my system the one in trouble with Sonic Radar. ASUS should just leave it back, and make proper drivers instead.

Either way, I've been tinkering with several versions of ASUS' drivers, and I can tell you can always remove Sonic Radar without having any sound issues. So, if this anti-hook DLL is going to make your development of Moonlight more difficult at any given time, putting a big fat text on the wiki saying something like "This is not compatible with Sonic Radar" is always an option.

Thanks for your amazing work, time and effort. It's been a pleasure.

@HybridZach
Copy link

I am having the same issue, my laptop has Nahimic audio also, but I could not find the Radar software to uninstall. Switching to "borderless windowed" allows it to work.

@cgutman
Copy link
Member

cgutman commented Jul 27, 2022

@Ub3rZ4cH can you perform the steps mentioned here to capture a dump file and post a link to that in a new issue (this one has been closed a long time and responses are likely to be missed).

The anti-hooking code blocks DLLs by name, so it's possible that Nahimic is using a different DLL name that Moonlight doesn't know to block.

@HybridZach
Copy link

@Ub3rZ4cH can you perform the steps mentioned here to capture a dump file and post a link to that in a new issue (this one has been closed a long time and responses are likely to be missed).

The anti-hooking code blocks DLLs by name, so it's possible that Nahimic is using a different DLL name that Moonlight doesn't know to block.

Sorry it took so long to get back to this, not sure if its been patched or something, it no longer breaks, it works fine now using full screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants