This has been driving me nuts, so I tried to dig into what is going on. I think I found something that may help...
My HTPC starts EventGhost at via the task scheduler, and then EventGhost starts Kodi. Like other people here, startup became very slow a while back. I would usually end up VNC-ing in, killing Kodi, opening task manager and starting a new Kodi process from there. The new Kodi process performed normally. There was no difference in the debug logs, the task scheduler -> eventghost one was just slower.
I figured there had to be some difference in the processes themselves, so I compared a "good" and "bad" Kodi process in process explorer. They were identical in every way I could see, with the exception that the bad one was associated with a Windows job object. Windows jobs are a way of managing groups of processes that not many things use, but task scheduler does. When a process associated with a job calls CreateProcess() to start a child process (most things use this function), it is implicitly associated with the parent's job. Per MSDN, the implicit association does not happen if the WMI Win32_Process.Create() method is used to start the child.
So instead of having EventGhost start Kodi directly, I now have it run a tiny script that starts Kodi using WMI. Problem went away immediately. I have absolutely no idea why being in a job would do this, and I haven't had time to set up a debugger to get to the root cause.
In case anyone else wants to use this workaround, create a text file named "kodi.vbs" and paste this in:
Code:
Option Explicit
Dim strKodiCmd, objW32Process
strKodiCmd = """C:\Program Files (x86)\Kodi\Kodi.exe"" -fs"
Set objW32Process = GetObject("winmgmts:Win32_Process")
objW32Process.Create(strKodiCmd)
Edit the strKodiCmd = line as necessary (use a pair of double quotes wherever you would normally use a double quote for escaping). Then, in whatever you use to start Kodi, have it run
Code:
wscript.exe C:\path\to\your\script\kodi.vbs
instead. You could do this in any language that can use WMI, VBScript is probably best because it's fast to start, doesn't show a console window and is included on all versions of Windows.
In case it's helpful, I'm on Win 8.1 x64 and have an AMD Radeon 5570 GPU.