Can XBMC be made to exit just before PC sleeps?
#1
Question 
I would like to XBMC to EXIT just before the PC enters sleep - when I hit the POWER button for my PC on my remote, XBMC should exit and then the PC should sleep. Right now XBMC just keeps doing what it's doing and the PC sleeps... so I'm halfway there. This has caused issues with XBMC on resume that, in many instances, has required a reboot to fix. Needless to say, this is *not* wife-friendly (and ticks me off, too).

I was thinking of just using this "Windows 7 Suspend/Resume Control" CodePlex tool and killing the XBMC process before sleep, but that's not exactly graceful. Figured there may be a script or something I can use to make this work.

Any ideas?

------------------------------------
BACKGROUND\CONFIG

- I am on Eden Beta 3
- My remote is a Harmony 900.
- IR receiver is part of an official Windows Media Center remote set.
- OS is Win7 ULT x64 on a desktop PC.

In XBMC I've done this:

1. I installed MCERemote add-in and let it apply it's settings.
2. I did steps 1.1 (option 2: Keyboard.xml), 1.2 (Green Start Button), and 2.0 (Registry Config w\ Config v1.25 ) outlined on http://xbmccustomregis.sourceforge.net/remote_manu.html.
3. "Remote control sends keyboard presses" is set inside XBMC (system\system\input devices).
4. Advanced config I have performed on Config.v1.25.reg was to change 0c,00,00,00,04,00,16,\ ; [Power] - Sends "S" to 0c,00,00,00,03,82,00,\ ; [Power] - Sends "SLEEP"
Reply
#2
from what i've been reading, eventghost should be able to accommodate this.
but, don't quote me on that...i'm still reading about eventghost. haven't implemented it yet, probably give it a go this weekend..
Reply
#3
for what it's worth, i'm using that power triggers project you linked to on my win7 box. works like a dream. no issues. i was seeing oddness on wake too.

i'm also using a scheduled task to start xbmc back up on wake. just create a task that triggers on system > kernal > event id 42.
Reply
#4
Good to hear. How did you do the task shutdown of XBMC?

EDIT: Never mind. I see the CodePlex tool has many options for doing this, and for starting something on wake too (doesn't look like scheduling a task is needed
Reply
#5
Eventghost can do the same.

you can create a macro on the power button press: something like , on power button,
quit.xbmc,
(wait xx amout of time or not)
sleep,

and when you resume from sleep you can create a macro to start a progam,
on resume ,
start xbmc

i use event ghost quit a bit with my mce remote, for updating my video music library to party mode, you can setit up to do numerous things via macros
Edit, just checked out your codeplex tool , and if u want way more customization i would go with event ghost,
Reply
#6
Very cool. I used the CodePlex tool and it works very well. Only issue I had was on resume XBMC would not respond to remote control actions until I hit the green button (which for me brings XBMC to the forefront). It was like it was behind my taskbar. I changed the settings in XBMC to use true fullscreen instead of a window and that fixed that.

@jnikle, I think the CodePlex tool may have evolved beyond what you've got. There is no need to use a scheduled task for wake. The tool has very good options for doing that too.
Reply
#7
sorry to jump on this thread guys, but i'm hoping someone can help me me with this "Power Triggers" program which i've installed.

I want to be able to do the following:-

1. On the press of XBMC Shutdown or XBMC Exit button or the Press of the Power button on computer - the PC quits xbmc and goes to sleep mode

2. On the press of the Power button - the PC Wakes up

3. On the sending Wake On Lan command from my other PC on the same network - the XBMC PC wakes up and loads XBMC


Is the above possible? If so, can anyone please tell me what options to choose to get the above?

Thanks very much!
Reply
#8
UberNewf Wrote:Good to hear. How did you do the task shutdown of XBMC?

EDIT: Never mind. I see the CodePlex tool has many options for doing this, and for starting something on wake too (doesn't look like scheduling a task is needed

I found that the CodePlex tool was buggy on the wake portion. That's why I opted for the scheduled task. I see you've had better luck with it. Maybe I'll try an updated version or something, although what I have now is working well. Thanks for the heads-up.
Reply
#9
noobnas Wrote:1. On the press of XBMC Shutdown or XBMC Exit button or the Press of the Power button on computer - the PC quits xbmc and goes to sleep mode

You can set what the "Shutdown" menu item does in XBMC's System settings. System configuration-> Power Saving -> Shutdown function to 'Suspend'. As far as the power button for your computer, those are in the Power Settings area of the Control Panel. Power Triggers will work fine for you once the above settings are changed. I'm doing this same thing at home.

noobnas Wrote:2. On the press of the Power button - the PC Wakes up

I think a tap on most power buttons on most machines does this already. Not sure of your computer specifically, but it's easy to test.

noobnas Wrote:3. On the sending Wake On Lan command from my other PC on the same network - the XBMC PC wakes up and loads XBMC

Here's a link for setting up wake on lan if you need it: http://windows7-issues.blogspot.com/2011...-easy.html. Once you have that finished, the Power Triggers tool should do what you need, although I don't use this feature personally. I've just set my netbook to wake via my remote.
Reply
#10
I do this through Eventghost.
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply
#11
If you have a Harmony Remote, just set it up through that. I have mine set so that when I'm leaving HTPC it sends commands Esc to get to the Home Menu, 1 second delay, and then sends End to close XBMC. Then the HTPC goes to sleep. (ETA: if you closed XBMC manually, sending Esc and End doesn't hurt anything anyway)

Upon waking, I have it set to send Alt+1 (I have XBMC pinned to position 1) so it launches XBMC when the HTPC wakes. There is a slight delay and I have to see my desktop for a second so I made the XBMC splash logo my desktop to make it appear more seamless.

ETA: After getting my Harmony, I uninstalled Eventghost. I can set up my remote to do anything.
Reply
#12
thanks mbbransc mate.

i'm going to be honest, but i don't have a clue on how to do this. it sounds very complicated. Any chance you can give a novice like me some guide to follow?
Reply
#13
jnikle Wrote:I found that the CodePlex tool was buggy on the wake portion. That's why I opted for the scheduled task. I see you've had better luck with it. Maybe I'll try an updated version or something, although what I have now is working well. Thanks for the heads-up.

Yes, I hear ya. I spoke too soon. Turns out the CodePlex tool will stop XBMC fine, and start it... but when it starts it on resume, XBMC is running under a different user... and one without access to my UserData. As a result XBMC starts without reading any of the settings I have, so it looks totally unconfigured. I had to exit it and stat it via remote. I messed with elevation, running the PowerTriggers service as my account instead of SYSTEM (that made it even worse), but no luck. I then tried the scheduled task on kernel-power event id 42, but that didn't work - the bloody thing crashes (XBMC Eden RC - below)! I'm about to give up and just use the remote button now. No

Log Name: Application
Source: Application Error
Date: 2/28/2012 9:12:12 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: WABUSH
Description:
Faulting application name: XBMC.exe, version: 10.5.0.0, time stamp: 0x4f4b14ad
Faulting module name: nvLsp.dll, version: 2.2.0.7305, time stamp: 0x49eb43f4
Exception code: 0x40000015
Fault offset: 0x0000f4b6
Faulting process id: 0x7ac
Faulting application start time: 0x01ccf6878b901820
Faulting application path: C:\Program Files (x86)\XBMC\XBMC.exe
Faulting module path: C:\Windows\system32\nvLsp.dll
Report Id: c9f99230-627a-11e1-ad89-00241d1f8345
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-02-29T02:12:12.000000000Z" />
<EventRecordID>23199</EventRecordID>
<Channel>Application</Channel>
<Computer>WABUSH</Computer>
<Security />
</System>
<EventData>
<Data>XBMC.exe</Data>
<Data>10.5.0.0</Data>
<Data>4f4b14ad</Data>
<Data>nvLsp.dll</Data>
<Data>2.2.0.7305</Data>
<Data>49eb43f4</Data>
<Data>40000015</Data>
<Data>0000f4b6</Data>
<Data>7ac</Data>
<Data>01ccf6878b901820</Data>
<Data>C:\Program Files (x86)\XBMC\XBMC.exe</Data>
<Data>C:\Windows\system32\nvLsp.dll</Data>
<Data>c9f99230-627a-11e1-ad89-00241d1f8345</Data>
</EventData>
</Event>
Reply
#14
mbbransc Wrote:ETA: After getting my Harmony, I uninstalled Eventghost. I can set up my remote to do anything.
Hmmm... I have been an Harmony user for quite a long time, and I love their approach. But having a PC with Eventghost allows far more sophisticated programming and, more importantly, instant checking and modification of said programming.
For troubleshooting and bug reporting please make sure you read this first (usually it's enough to follow instructions in the second post).
Reply

Logout Mark Read Team Forum Stats Members Help
Can XBMC be made to exit just before PC sleeps?0