Windows 10 universal app startup extremely slow on Dell laptop [possibly Miracast related]

Ok, this is a weird one. Unity games built for the Windows 10 app store take about 35 seconds to start on my Dell Inspiron 7559. I’m testing with a new, blank game in Unity 5.3.1. I tried both XAML and D3D build types. I’m building the game with VS Community 2015 (fully updated) and I’ve tried debug, release, and master configurations.

Oddly, if I disable my WiFi adapter, the game launches instantly. So, I’m guessing it’s a network issue somehow.

I’ve been trying to track down the problem with Process Monitor, Process Explorer, and debugging the game in VS, but nothing’s really jumping out at me.

Another strange thing is that the problem appears to be system-dependent. My Surface Pro 2 and my brother’s Surface Pro 3 are both fine. The exact same binary (installed from the Windows Store) starts up fine on those PCs.

My laptop specs are:
Intel Core i7 6700HQ (Skylake)
16GB DDR3 RAM
Intel HD Graphics 530 + NVIDIA GeForce GTX 960M 4GB
Intel Dual Band Wireless-AC 3165
Realtek High Definition Audio

This is a new laptop and I reinstalled Windows 10 Home from MSDN so there’s no Dell bloatware and no antivirus. It’s set up virtually the same as my Surface Pro 2.

To clarify the behaviour I’m seeing… I launch the game and the dark turquoise window comes up. After about 30 seconds it either plays the Unity splash animation or, most of the time, shows a white screen for about 5 seconds. Then the main scene is loaded (I created a blank scene with a cube in the middle so I’d know for sure when the game has started). My actual game runs perfectly fine after this point.

I also tried creating a blank non-Unity Windows 10 universal app and that worked fine.

I’ve attached a log from the VS output window showing where the delays are occurring.

Some additional info from Process Monitor… There’s no activity recorded during the 7s delays (see the attached log to see when these delays occur), but before and after the delays the game seems to be enumerating audio devices in the registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses{e6327cad-dcec-4949-ae8a-991e976a79d2}). It’s accessing various other registry keys related to audio/multimedia as well.

Any suggestions would be appreciated!

2489200–171738–UnityWin10Log.txt (34.6 KB)

Are you launching the game from Visual Studio? It might be loading symbols from the web.

If you want to measure real startup time, launch it from start menu.

The symbols did take a few minutes to load the first time but they don’t add any (noticeable) time on subsequent launches.

In any case, I tried from the start menu as well and it takes just as long to start up.

Edit: Just tried something else as well. If I disconnect my WiFi (but keep the adapter enabled) then the game is still slow to start. Only disabling the adapter completely makes the game launch fast. I’ll test through a wired connection a bit later and report back.

Edit 2: I tested the laptop with a wired connection and the WiFi adapter disabled. No problems – the game launches instantly. If the WiFi adapter is enabled (even if it’s not connected) then the game still launches slowly.

I also tried leaving the WiFi adapter enabled and disabling all the protocols on the adapter instead (e.g. IPv4, IPv6, file and printer sharing, etc.) but this didn’t help.

Edit 3: Tested some different drivers for the wireless adapter but it didn’t change anything. Versions tested: 17.15.0.5, 18.12.0.3, 18.20.0.9, 18.32.0.5 (latest).

Edit 4: Random thought… could this be related to Miracast somehow? It doesn’t seem like purely a network issue because the wired ethernet adapter works fine. And Process Monitor is showing that the game is accessing various audio/multimedia related registry entries around the time the game is (or appears to be) frozen.

Tautvydas, I can provide Process Monitor logs if that would help (and if you have some time to investigate).

Process Monitor logs wouldn’t help - however, you could record a trace using Windows Performance Recorder (with first level triage and CPU event providers event), which would hopefully record the issue and allow us to figure out what’s going on.

One more thing, try Master build. Debug and Release builds have profiler enabled, which interacts with network.

Thanks for the suggestions. I’ll try this after work tonight.

I’m getting the same slow startup even with the game built with the Master configuration and launched from the start menu. :frowning:

I’ve recorded a trace with WPR. Tautvydas, I’ll PM you the link.

I started poking around the trace myself but this thing is intense and I’ve never used this tool before. :slight_smile:

I’m not entirely sure yet, but you might have hit the jackpot with miracast.

When Unity is initializing, it enumerates all available audio outputs. For some reason, it seems that the audio driver asks the miracast driver whether there are any, and then it starts their discovery over the WiFi (I’m not exactly sure how it works). Do you have some sort of miracast discovery enabled?

Hmm… I haven’t done any special configuration for Miracast, audio, graphics, or WiFi. Everything is set up with the defaults. I’m not even sure if there are any settings for Miracast, but I’ll look around.

I have used Miracast on this laptop though, a couple of weeks ago. Both audio and video worked fine.

So, I learned that there’s an app for Intel WiDi (which is Intel’s implementation of Miracast). I installed it to see what options it has. Here’s a screenshot of the app without a wireless display connected:

And here’s how it looks with a display connected:

Unfortunately, it doesn’t look like there’s anything useful here. I’m not sure why someone would install this anyway since it basically duplicates the functionality of the Windows 10 wireless display sidebar.

While I tested this I thought I’d also try running my game with a wireless display connected. The results are a bit inconsistent but interesting: most of the time the game launched instantly, but sometimes it would take about 10s.

And I found something else. When I connected a wireless display I noticed some new devices in Device Manager. One of them is called “Microsoft Wi-Fi Direct Virtual Adapter”. When viewing devices by connection it appears connected to the Intel wireless adapter:


You can also see this device without a wireless display connected if you enable “Show hidden devices” from the menu. Disabling this device fixes the slow startup issue!

So Miracast/WiDi definitely seems to be the culprit. :hushed:

Now that we’ve gathered this info, should I submit a bug? I’m concerned this could affect other people with this wireless adapter.

I have a very similar issue that is probably linked to this.

Our game, which loads quickly on Android Lollipop (LG G3 and Nexus 5x), takes a very long time to load, as described by the OP.
The difference is that I am experiencing this issue on Windows 10 Mobile (Lumia 950, Build 10586.71).

Edit:
I just turned off W-LAN and Mobile Data and it indeed massively improved the loading time for me, as well!
You are definitely onto something :wink:

Interesting… I hadn’t considered that this could impact mobile as well.

I checked with my Lumia 435 but this is a low-end device and doesn’t support Miracast. My game launches pretty quickly (which may or may not have anything to do with that!).

How long are the load times on the phone?

I ran each test multiple times and stopped the times myself:

  • LG G3 (Android 5.0)

  • Time until Unity Logo: About 2s.

  • Time until Game: About 4 to 5s.

  • Lumia 950 (10586.71)

  • WLAN turned ON

  • Time until Unity Logo: About 25s.

  • Time until Game: About 29s.

  • WLAN turned OFF

  • Time until Unity Logo: About 5s.

  • Time until Game: About 9s.

I found that turning off WLAN is enough. Turning off Mobile Data, as well, does not lead to any faster load time.

The 950 supports Miracast, but I don’t know of any way to turn it off directly, so I am turning off WLAN instead.

The first level that is being loaded is a very simple main menu prototype which does only include 4 buttons, a text element and an audio source. Loading the actual 3D levels from this main menu is fast on both devices, although there still is a difference (e.g. LG G3: 1s, Lumia 950: 2s).

Unity version is 5.3.2f1.

@kB11 does this happen only on your game, or on an empty project too?

Empty Project (Lumia 950):

  • WLAN ON

  • Unity Logo: 24s

  • Game: 28s

  • WLAN OFF

  • Unity Logo: 4s

  • Game: 8s

I simply created a new empty 3D project, pushed it to the 950 and measured these times.

So, yes, it happens in an empty project, as well.

Microsoft did a nice presentation of this issue at 13.37 :stuck_out_tongue:

2 Likes

Oh wow, that certainly looks like the issue! Takes about 30 seconds from launch to the Unity splash animation. :\

We just saw the same problem with our Windows Store App having a 20s+ hang on startup with no CPU activity. Disabling Wi-Fi made our Unity app start almost straight away (~3s).

I’d installed a Microsoft Wireless Display V2 Adapter and removing the connection to the bluetooth device fixed the startup time issue. This is not a great workaround to have to pass on to customers to be honest.

The last step of the Miracast devices section of Fix connections to Bluetooth audio devices and wireless displays was what I had to do:
To remove the device, select Start Windows logo Start button > Settings Gear-shaped Settings icon > Devices > Bluetooth & other devices. Under Wireless displays & docks, select the wireless display or adapter, then select Remove device > Yes.