Kodi Community Forum

Full Version: sleep, serverWMC, ehRecvr, Legacy Kernel Caller
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good Morning,
I have been looking for a way to share live TV from my HTPC etc to other devices and I stumbled on the combination of serverWMC and XBMC recently.

The HTPC has quad tuners DVB-T, is running Windows 8.1 and Windows Media Center.
Its been running for a couple of years with windows 8 and then 8.1 since last year.
I addressed the issues of srvnet, homegroups, media streaming etc not allowing sleep over a year ago and it has been working perfectly.
Windows Media Center on the HTPC has been my sole means of watching TV


The installation of serverWMC (version 1138)was straight forward on the HTPC.
On a laptop I installed XBMC and the necessary PVR components.

The combination works well and is exactly what I am looking for.

Now, for the troubles.....
Since the installation of serverWMC, regardless of whether i run it as the application, or as a service, i am having issues getting the HTPC to sleep.

If i reboot the computer and do not make any requests by XBMC (from laptop) or Windows Media Center to the tuners. EG, if I dont use XBMC, or run Windows Media Center to watch TV......Then the computer continues to sleep normally.

However since installation, if i run Windows Media Center on the HTPC (with or WITHOUT, the app running or service started...ive tried both), then the HTPC wont sleep even after Windows Media Center is closed. Likewise if the app and/service is running and i connect from the laptop with XBMC, then the HTPC will not sleep, even after the laptop is powered off.

Both the options in the app regarding suspending sleep behavior are unchecked.

powercfg /requests now shows,
SYSTEM:
[DRIVER] Legacy Kernel Caller and;
[SERVICE] .......ehrecvr.exe (ehRecvr)

further the requestsoverride option is ignored when i tried to override these.

Any ideas would be appreciated

cheers
Andrew
UPDATE:
actually, i just deleted the service and set the config file back to running serverWMC as an app that starts automatically with Windows.
The behavior has now changed.

Running in app mode, the HTPC is now sleeping.

I will post a further update if this changes. In the meantime, any advice regarding using serverwmc as a Service, that might fix the above sleep issue would be appreciated

cheers
Andrew
I have trouble believing its a difference between swmc running as a service instead of just as an app, 99 percent of the code is the same. I think the Legacy** is related to your tv card drivers. Serverwmc leaves these alone, in either mode, until you run a live stream. You might try running a live stream now that its working, then stopping it, and seeing what powercfg says.
Thanks for the reply. I agree it is definitely related to the drivers for the tuner card. However the behavior does differ slightly.

Running powercfg with just wmc running a live stream shows the same legacy**

The behavior is the same for swmc in app mode.

However as soon as wmc is closed and the swmc clients are disconnected. ..powercfg shows nothing open.
Eg. Normal expected behavior.

Whereas previously running as a service closing wmc and stopping the swmc service resulted in those legacy** remaining until a reboot.

I'm heading out for the day now. Later I will create a restore point and see if the behavior is repeatable installing the service again. If it is i will take some screen grabs etc for debugging help.

Cheers
Okay, looking forward to what you find. Question for when you're back: Is it possible you had a live stream crash when you last ran as a service and that is why the tuner wasn't released?
Well im stumped,
I re-installed the service and sleep has continued to work...one problem fixed.

Previously i had installed, rolled back with system restore, rebooted, re installed and in each case the "insomnia" had continued.

Now it seems to be fixed. It may have been an ID10T on my part, or a quirk on my installation. Either way its working now
Thanks for your replies!!

cheers
Andrew
Well it seems i did a little too well with the sleep!.

Now that is fixed, hopefully someone can point me in the right direction with almost the exact opposite problem.

Using SWMC as an App, i can see that the XBMC client on the laptop is connected to the server.
If i play a live stream, the SWMC app prevents the HTPC from sleeping (exactly as required)

However if i play a previously recorded TV show, the HTPC still sleeps, despite the SWMC app showing that the client is still connected.

For a recorded show, is the, or can the SWMC app keep the backend server (HTPC) from sleeping? or once a show is recorded, does the "keep awake" functionality revert to the standard windows streaming sleep/wake options (i hope not as per my original post i had to override the srvnet process a long time ago).

thanks in advance

cheers
Andrew
It must be opposite day!

That behavior is different than my system, on mine if xbmc is playing a previously recorded tv show over the network, the server automatically stays awake because of the file being opened over the network.

To answer your question though, in the 'General' tab if you check "suspend sleep if a client is online", all serverwmc does - if a client is online - is periodically reset the sleep timer (the timer that measures how long its been since the user has been active). If no clients are online, it doesn't reset the timer, so it should have the normal sleep behavior.
Opposite day indeed.
So on mine having the file open across the network wont in itself keep the server from sleeping. That is because i've had the well documented sleep issues with the srvnet process. So i have had a powercfg /requestsoverride for srvnet in place since a clean install of windows 8.1 not long after it was released.

I definitely have the "suspend sleep if a client is online" option selected. And the app definitely shows clients connecting and disconnecting exactly as expected.
How can i check to see if it is actually resetting the sleep timer as intended?

Perhaps when the live stream is running my server stays awake, not because of the serverWMC app, but because of the behavior of the TV Tuner drivers as discovered yesterday. Now with that fixed, once the live stream finishes and i watched the recorded TV, the TV tuner processes complete and the server sleeps.

In either case, from another XBMC thread i found quite an elegant work around that works for more than just xbmc. The coffee, app that keeps the computer awake while the network activity is above a certain point.

Having said that if i can help debug serverWMC for my particular install, then im happy to try anything you suggest. The obvious benefit of the serverWMC implementation is that if XBMC is open remotely the server SHOULD stay awake, meaning no issues the server going to sleep while simply browsing local content etc
I see, thanks for the explanation, makes a lot of sense.

I would appreciate help in debugging it. If you go the config.xml file (see debug tab) set the following flag true:
Debug_LogSleepMode

Save the file and restart swmc. With this flag set true, it will log when the sleep timer is reset. Then we can look in the log and find out if it is even getting called and go from there.

What is your windows sleep interval set to? Possibly its failing because your sleep gets triggered at a shorter interval then this timer is reset - which by default is every 8 minutes if a client is active.

thanks.
Thanks for getting back to me. I had missed your reply and then got distracted and didn't check back.
The Coffee app has been working well.

Having said that i have just installed the latest build, turned the Coffee app off and set set the debug flag per the above and will post back with the outcomes.

cheers
Andrew
Im happy to report that either the new build of serverWMC, or the re-installation processes now has the sleep function working as designed.
The SWMC log shows the sleep timer being reset every 8 minutes.

thanks for your help.

cheers
Andrew