Recently, we have received many feedbacks from users, saying that our software interface is a mess, and there is no way to find any button locations. That’s really difficult to resolve because we do nothing extra about the rendering part of our software.
This article will first give a conclusion to help you solve the problem and then show our investigation process.
This post is written in multiple languages. Please select yours:
中文 English
What happened
Yes, all the buttons are displayed everywhere, and covered across each other, and be positioned here and there. You can’t even read any UI texts. The UI elements change and flash after your mouse move.
The bug
Under normal circumstances, there are indeed many reasons for WPF rendering to blow up, but most of them are just broken in a single computer. But this blog talks about some widespread rendering problems that many computers are suffering from. And this time, DELL make this happen.
Now please check the NahimicOSD.dll
file which is the critical key point of this rendering issue. It may be in these locations:
- C:ProgramDataA-VoluteDellInc.AlienwareSoundCenterModulesScheduledModulesNahimicOSD.dll
- C:ProgramDataAWHeadsetDellInc.AlienwareSoundCenterModulesScheduledModulesNahimicOSD.dll
- C:ProgramDataA-VoluteA-Volute.28054DF1F58B4ModulesScheduledModulesNahimicOSD.dll
- C:ProgramDataA-VoluteA-Volute.NahimicModulesScheduledNahimicOSD.dll
- C:ProgramDataA-VoluteModulesScheduledModulesNahimicOSD.dll
All of the paths above are from DELL Alienware. Also, there are some other paths but I’m not sure whether it breaks the WPF rendering.
- C:Program FilesNahimicNahimic2UserInterfaceNahimic2OSD.dll
NahimicOSD is an on-screen display library that displays something on any software using DirectX as its rendering engine. Unfortunately, the additional rendering blooms the rendering of WPF apps (DirectX 9 application precisely).
Solutions
Solution for Users
If you’re not a developer or you just want to solve it for yourself, try these:
- Renaming the NahimicOSD.dll (because it cannot be deleted in case of being occupied)
- Restart your computer (Then it will not be injected into any programs)
- Lose your temper at this file
I’ve posted the issue on the DELL Alienware community and waiting for their reply and new driver update. You can see my discussions there:
- Solved: Area-51m R2, blurred text and images in some apps - Dell Community
- m17 R2, WPF apps distorted, disappearing window contents - Dell Community
- The WPF UI is blurring and broken while the Alienware NahimicOSD.dll injects · Issue #5708 · dotnet/wpf
Solution for Developers
If you’re a developer and want to solve this issue for your software users, you can view these two methods.
Method 1: Software Only Rendering
Write this code below before any WPF window shown:
1 | System.Windows.Media.RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly; |
---|
And your windows will render in software mode and the NahimicOSD will not break your app.
Method 2: Blacklist (Administrator Privilege Required)
Open this file C:ProgramDataA-VoluteDellInc.AlienwareSoundCenterModulesScheduledModulesConfiguratorBlackApps.dat
and append your process name at the end of it and then your process will not be injected by the NahimicOSD.dll.
This is totally a text file so it’s easy to edit.
How did we find the reason and solutions?
Some of our software users gave feedback to us with the messing UI as attachments. Most of them were DELL devices with a 10th CPU and two graphics cards which confuses us. We tried to switch the default graphics card and tried to upgrade the graphics drivers but nothing helped.
What made changes was a special user which was using a LENOVO device. We find that the DELL Alienware Sound Center was installed on his/her computer. It seems that the DELL Alienware Sound Center is the criminal. So we dumped our software and get the proves that the NahimicOSD.dll in DELL’s path was injected into our software. We deleted the NahimicOSD.dll file and everything go back to fine.
Other discussions
This GitHub issue made me surprised because this was the right topic to talk about the same issue which I was concerned about. What made me surprised more is that I was one of the talkers of them two years ago but I remember nothing.
References
- Button renders wrong after mouse leave · Issue #707 · dotnet/wpf
- Solved: Area-51m R2, blurred text and images in some apps - Dell Community
- m17 R2, WPF apps distorted, disappearing window contents - Dell Community
本文会经常更新,请阅读原文: https://blog.walterlv.com/post/wpf-renders-wrong-because-of-nahimicosd-en.html ,以避免陈旧错误知识的误导,同时有更好的阅读体验。
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名 吕毅 (包含链接: https://blog.walterlv.com ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请 与我联系 ([email protected]) 。