How to reduce XMBC delay on system startup

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

How to reduce XMBC delay on system startup

Post by sequoiacpe »

How can I make XMBC effective quicker on starting my Win7 64bit system starts up? It takes quite a while before my mouse buttons follow the XMBC settings. I am so used to using the XMBC settings that I find myself wondering why a double-click is not starting things as I expect.

I find XMBCis running at High priority. Don't think it should be set higher.

I am using Startup Delayer for slowing my started applications in the Startup Folder, so system contention should not be the problem. But there are always a bunch of other started processes that are a necessary "evil".

Is there some other items that can speed up the process.

Thanks for an otherwise great product. And an indirect thanks to Kensington for making me find a better "mousetrap"!
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

What sort of delay (how long) are you seeing.
XMBC is launched at startup (on Win Vista/7 etc.) using a system service which should launch XMBC as soon as you log on. On XP and earlier, it is Launce using the old RUN registry key.

Either way there should be no significant delay.
Are there any errors in the event log (from the service) or in the XMBC log (that has timing info - is there any obvious delay between the entries:
20-07-2012 18:33:56> Hooking the mouse...
20-07-2012 18:33:57> Successfully created the main message window.
Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

I find varying times between hooking and main message window.

Most seem to be 1 second or less but i find one at 2 seconds and one at 3 seconds. Out of a population of about 110 startups.
The worst case is as follows;
24-07-2012 08:11:02> X-Mouse Button Control v2.5 (x64) Startup. Commandline '/notportable /svclaunch'
24-07-2012 08:11:02> Running on Microsoft Windows 7 Service Pack 1 (build 7601), 64-bit, Hook Timeout: 5000 ms
24-07-2012 08:11:02> Hooking the mouse...
24-07-2012 08:11:05> Successfully created the main message window.
24-07-2012 08:11:05> OnTaskBarCreated: Recreating systray icon
24-07-2012 08:11:09> Display resolution changed (1024, 768)

What does the Hook Timeout at 5000 ms do?

I don't think I am that quick at "double click" button that I would respond within 1 second, nor do I think I caught the 2 and 3 second delays.

Possibly it is the fact that I have only 1 User Account and therefor bypass the log-on screen.

I will run an empirical timing test at the next few start-ups to get a better metric of the delays I am experiencing. I will use the XMBC double click button because it only does a single click until XMBC takes over.

Bruce
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

Yes it may well be the bypassing of the logon screen that has an impact. Although I use auto-logon (although I have multi-users, I don't see the logon screen - it always logs on as me automatically) myself and don't notice a problem.


What hard disks do you have (how fast are they?). I have 2 SSD's in RAID 0 so my disk access is blisteringly fast and there is little or no disk contention at logon. On a normal drive, things start as and when they can, and services can get delayed or pushed to a lower priority to give the UI a boost during start-up. One thing that might help, if you haven't done it for a while, try doing a full defrag of your hard disk - the built in windows toll will do, but I prefer Piriform's free Defraggler and there are loads of others :). Windows 7 (by default) does some automatic maintenance but it probably wont do the whole disk.

The serivce itseld might have some unwanted delays and also, if the system is busy, the services might get a lower priority than the GUI as startup. If the service is delayed, then it does not matter what the delay is creating the hook (during startup), because the app launch itself will be delayed. I don't know of a sensible solution to this (if indeed it is the problem). XMBC has to be started by the service in order to interact with elevated processes. I will have a look at how the service works and see if I can speed that up at all - I seem to recall that at one point it was too fast and it tried to run XMBC before explorer (the desktop) was there (which didn't work so well!).

Did you check the windows application event log also? It should give timestamps not only from the XMBC service but also general things like session startup/logon etc.

The hook timeout is the amount of time windows waits before removing an unresponsive hook. i.e.. if XMBC took more than (in this case) 5 seconds, windows would simply remove the hook and XMBC would stop working. On Windows 7, MS reduced the default (it used to be 5 seconds) and this had a negative impact on XMBC.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

I found the Event Log; had to open it via the Help and Support because the Control Panel does not reveal how to do it from there.

Found a series of XMBC Event Type of Error (ID of 6) in the Last 7 Days (ID shows a quantity of 8 but looking at the list shows many more than 8; they are from more than 7 days when looking at the detail list). All are;

Process token open Error: 6 (The handle is invalid. )

There are 2 Errors that do not reveal what the error was except a system error. They are Event ID of 1.Nothing in the detail shows anything that I think would be useful; and there are only 2 in 7 days which is not the frequency of delays I experience.
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

I use a Western Digital Black SATA6 500GB at 7200RPM and 64MB buffer for WIN7. I have an old Raptor SATA 37GB 10,000RPM that I use for paging, starts at 6GB and maxes at 24GB. Most of my applications are on a 7200 180GB Sata3.

I have a 6 core 3.3GHz AMD and 8GB of 1600MHz Matched Corsair memory.

While I don't have a SSD, I find that all of my development IDE's run quite fast. Don't think the SSD is cost effective for me, and I am not particularly fond of the end-life of EEPROM like devices (I do have EEPROM's in my embedded computer projects but I take care not to update them often).

Bruce
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

OK so your system is fairly high spec and your well versed in optimising things (I had to ask though - so many of the systems I see at work, used by people who should know better are in a dire state!).

FWIW, the MTBF on my SSD's is longer than a HDD would usually last me anyway so it was a no brainier for me with the costs having come down so much recently (and it makes such a difference with 2 6Gb/s Agility 3's in raid 0 - at almost 1GB/s sequential read speeds and no seek time :)).

Anyhow, in your case, the HDD is NOT going to be the problem - so I will look into the service, and hopefully you can check the event logs - it would be particularly interesting to note any XMBC service launcher messages and see how the timestamps compares to the the times in the XMBC log.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

I have had XMBCand Win7 start-ups more recent, but here are the most recent Event Logs.

The latest Event Error, bad handle, occurred on 7/23/2012 2:20:12PM and there was an XMBC Log for hooking at 14:21:13. So the Bad Handle occurred about 1 minuter before.

The next latest Event Error, bad handle, occurred on 7/23/2012 8:08:30PM and there was an XMBC Log for hooking at 8:09:31. So the Bad Handle occurred about 1 minute before.

The event viewer has a "Send" details function but I think Mister Softee would be the recipient. How can I catch the details for your use?

This could account for the delay I have been seeing.

BTW, my company is called Sequoia CPE Consultants, started back in the late 1980's, and specialized in IBM MVS mainframe Capacity Planning and Performance Engineering (CPE). Still remember some of the performance enhancing tricks. My pitch to my clients was that if I could not improve their performance and eliminate wasted capacity, I was not doing my job; and that any cost savings they accrued should be split with me; when their savings were far in excess of my fees, they seemed to forget the split!

Bruce
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

You should be able to export the event log but Im not sure if you can export individual events... But anyway, what you have told me already might be enough. I will have to look to see what generates such errors.

Some questions that might help...

Do you have UAC On or Off?
Is your account a normal user or an administrator?

The service only really has use if you have UAC on and you are an administrator. If that is not the case then maybe it might be better to run using the old fashioned startup options and disable the service. What the service does, is look for the explorer process in the users session, and use its security token to launch XMBC into the session but with elevated permissions. It does this because otherwise, XMBC can not interoprate with other elevated processes/windows.

Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

UAC is set for Never Notify. I have been trying to find ways to get some legacy stuff to work under the Win7 restrictive environment. I can go back to running UAC if that cures the delay since I was unsuccessful with those apps.

I run as Administrator.

I also found Informational logs:
Unable to get elevated version of the user token: 1312 (A specified logon session does not exist. It may already have been terminated. )
Assuming UAC is disabled.

Bruce
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

OK it might be the UAC thing - would be good to know if you could try enabling it temporarily...
I will try and look at the service stuff over the weekend.

Thanks,
Phil
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

Yes it is UAC. The delay is close to 1 minute. The Browser may also play a secondary role.

Got no delay or handle error or user token message with UAC ON.

Repeated twice with UAC disabled and got the same 1 minute delay.

I was running with the not so robust Mozilla Firefox and got tired of the "not responding" due to possible numerous causes. Thus went to Google Chrome recently and am happy with it. I mention this since XMBC uses the browser indirectly. Both browsers exhibit the delay with UAC on. I originally was using IE9 but it has a font size problem when used with Live Mail; I don't remember the delay under IE9 but am not positive that is a correct memory (IIRC, If I Remember Correctly!). IE9 is still installed on my system but it is not the default browser; possibly causing some confusion with XMBC.

But I also was reminded that UAC enabled causes many warning messages and I don't need to be bothered and delayed when I am the only user of the system. Yes, there are viruses that UAC might catch, but I use anti-virus and never in maybe 10 years have I ever been bitten with a virus bug.

I would like to run with UAC disabled and XMBC without a start-up delay. Hope you can find a fix.

Bruce
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

OK Thansk - now I can probably reproduce it at home too :)

I have UAC turned on but set not to notify (I used the "old" vista TweakUAC tool and it seems to be perfect lol
BUT I will investigate - I guess I just need to look at the UAC setting and if it is OFF, don't try and be clever :)
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
sequoiacpe
Member
Posts: 27
Joined: Tue Jul 24, 2012 3:54 pm

Re: How to reduce XMBC delay on system startup

Post by sequoiacpe »

Phil,

I found TweakUAC and it is good for Win7 both 32 and 64. It is free.

I installed it and set it for quiet mode. This is the mode I want to run in; it mimics what XP Pro had between administrator vs user accounts. And it supposedly retains the Browser protect mode which is lost if running in true UAC turned off.

The XMBC delay is still there, TweakUAC quiet mode did not remove it. Apparently XMBC is still thinking UAC is turned off; Win7 does show that it is turned off.

Hopefully you can detect the difference between turned off and quiet mode. TweakUAC may be changed somewhat from your Vista copy to the current copy (Ver 1.0.0.0 dated 12/5/2006).

Bruce
User avatar
phil
Site Admin
Posts: 7674
Joined: Sun Apr 06, 2003 11:12 pm

Re: How to reduce XMBC delay on system startup

Post by phil »

Wierd, I use tweakuac and havent notice the delay but don't worry I will try and look at it today.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Post Reply