SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-12-2012, 02:08 PM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 398
How can a program determine if STV service is active (record or play)?

My Windows 7 32bit SageTV system has lost the ability to automatically sleep when idle. It has been sleeping and waking to record shows consistently for a couple of years, but started remaining awake continually a month or two ago. Nothing has changed (no new SW, HW or drivers), except the standard Windows updates.

The system is still able to sleep when I manually initiate sleep, and will wake and run properly. (more details)

I've reached the end of the line in terms of debugging the problem, so I want to implement a more active solution.

Basically, I want to run a scheduled task at 5 minutes past every hour. If the system is in use, or SageTV is playing or recording then do nothing. Otherwise, the task puts the system to sleep with "Rundll32.exe Powrprof.dll,SetSuspendState Sleep"

I think I could detect if the HD300 is connected for playback by parsing the output of NETSTAT. In case somebody is using the computer locally, I can check SystemParametersInfo to see if the monitor is in standby. I'd still pop up a dialog to allow the sleep to be cancelled, just in case.

My question is, how can an external program detect if SageTV (Service mode) is recording or preparing to record? I think this was discussed here before, but I can't find it now.
__________________
HD300 extender with SageTV V9.1.10 (service mode), Running on Windows 7 (32 bit), E8400 3GHz dual core CPU, 4G RAM, Gigabyte GA-P35-DS3L motherboard. NVidia 8600GT; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun tuner, HD-PVR Rev E1. HD-PVR 2 connected to Google Fiber GFHD200.

Last edited by timg11; 07-12-2012 at 03:24 PM.
Reply With Quote
  #2  
Old 07-12-2012, 04:54 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,132
Quote:
Originally Posted by timg11 View Post
My Windows 7 32bit SageTV system has lost the ability to automatically sleep when idle. It has been sleeping and waking to record shows consistently for a couple of years, but started remaining awake continually a month or two ago. Nothing has changed (no new SW, HW or drivers), except the standard Windows updates.

The system is still able to sleep when I manually initiate sleep, and will wake and run properly. (more details)

I've reached the end of the line in terms of debugging the problem, so I want to implement a more active solution.

Basically, I want to run a scheduled task at 5 minutes past every hour. If the system is in use, or SageTV is playing or recording then do nothing. Otherwise, the task puts the system to sleep with "Rundll32.exe Powrprof.dll,SetSuspendState Sleep"

I think I could detect if the HD300 is connected for playback by parsing the output of NETSTAT. In case somebody is using the computer locally, I can check SystemParametersInfo to see if the monitor is in standby. I'd still pop up a dialog to allow the sleep to be cancelled, just in case.

My question is, how can an external program detect if SageTV (Service mode) is recording or preparing to record? I think this was discussed here before, but I can't find it now.
Use the SageAPI by calling the SageX plugin to check if Sage is doing something. You should be able to tell if an extender is connected, if anything is recording and if anything is streaming.
Reply With Quote
  #3  
Old 07-13-2012, 09:31 PM
timg11's Avatar
timg11 timg11 is offline
Sage Aficionado
 
Join Date: Sep 2008
Posts: 398
Thanks for the pointer to SageX.

I finally found the root cause of the insomnia. We wanted to look at some photos on a server using the HD-300, and we added a folder on a server as a Sage Import Directory for Photos. When done, we left it configured in setup and forgot about it.

That is enough to prevent the system from ever sleeping again, even though it doesn't show up in POWERCFG -requests.
__________________
HD300 extender with SageTV V9.1.10 (service mode), Running on Windows 7 (32 bit), E8400 3GHz dual core CPU, 4G RAM, Gigabyte GA-P35-DS3L motherboard. NVidia 8600GT; Viewsonic LCD on one output and Mitsubishi WD57734 HDTV via DVI/HDMI on other output. HDHomeRun tuner, HD-PVR Rev E1. HD-PVR 2 connected to Google Fiber GFHD200.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Service Control indication that a recording is active stevech SageTV Software 6 11-02-2008 06:01 PM
How to tell to not record a program? cte SageTV Software 10 09-08-2008 10:01 AM
Program Did Not Record RAlfieri SageTV Software 2 03-23-2008 11:23 PM
how do i set a program to record everyday? placez SageTV Recorder Software 1 10-05-2007 07:13 PM
How to determine why a show did not record? amg SageTV Software 3 09-19-2007 01:56 PM


All times are GMT -6. The time now is 04:50 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.