|
SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer. |
|
Thread Tools | Search this Thread | Display Modes |
#1141
|
|||
|
|||
Quote:
As far as I can tell, the copy seems to stop in the STVs\Pheonix\Fanart folder. Not sure why. If there is a different log I can provide to help let me know.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD |
#1142
|
|||
|
|||
Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#1143
|
|||
|
|||
My scripting chops are pretty (read: very) limited. Not asking you to do it for me necessarily, just wanting a nudge in the right direction.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD |
#1144
|
|||
|
|||
Quote:
Code:
param( [Parameter(Mandatory=$true)] [int] $timeout, [string] $program, [string] $arguments = "" ) if ( $arguments -eq "" ) { $p = Start-Process $program -passthru } else { $p = Start-Process $program $arguments -passthru } if ( ! $p.WaitForExit($timeout * 1000) ) { echo "Killing $program due to timeout of $timeout seconds" $p.kill() } Code:
powershell runwithlimit.ps1 3600 notepad I saw a straight-up .bat version of this on the web. I can work on it for you if you want to go down this path. |
#1145
|
|||
|
|||
That's OS specific code that won't run on Linux, which is also a supported platform for SJQ. Forking off the code into OS specific execution paths is not something I will do.
But... you could call an exe/script that launches your mediashrink via that powershell script, which would then time itself out and clean itself up.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#1146
|
|||
|
|||
Quote:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "& C:\Program` Files` `(x86`)\SageTV\SageTV\MediaShrink\timer.ps1" 10800 'C:\Program Files (x86)\SageTV\SageTV\MediaShrink\MediaShrink.bat' d:\SageTV\video_to_convert.mpeg So next I tried it in SJQ4. I set powershell as the Executable and the rest as the Executable Args, with "$SJQ4_PATH\$SJQ4_LAST_SEGMENT" as the file at the end. Unfortunately powershell refuses to run the script due to the script execution prevention stuff. I'm running the Sage service as LocalSystem, and I don't know how to get past this. I tried running powershell as Administrator and setting the execution policy but it didn't work. I'll probably next look at a plain .bat way to do this, or maybe try signing the script. By the way, the previous version of the script doesn't kill child processes. You have to use taskkill as per my first post. Here's the full script: Code:
# Run powershell then type "Set-ExecutionPolicy RemoteSigned" to allow this # script to be executed, as well as any other local unsigned script. Or sign # it yourself. param( [Parameter(Mandatory=$true)] [int] $timeout, [string] $program, [string] $arguments = "" ) if ( $arguments -eq "" ) { $p = Start-Process $program -passthru } else { $p = Start-Process $program $arguments -passthru } if ( ! $p.WaitForExit($timeout * 1000) ) { echo "Killing $program due to timeout of $timeout seconds" taskkill /pid $p.Id /t /f } |
#1147
|
|||
|
|||
Quote:
Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#1148
|
|||
|
|||
Quote:
Next on the list, figure out how to power on the extender any time the Sage server starts/restarts.
__________________
Server: SageTV Media Center 7.1.19, Windows 7 Home Premium x64, Pentium Core2Duo, 4GB RAM, (1) Hauppauge HVR-2250, (1) Hauppauge HVR-1600, 1.5 TB of recording space Android MiniClient: Nvidia Shield TV (16GB) HDMI out to Samsung LN46C630 46" LCD Extender: STP-HD300, beta firmware "20110506-0", HDMI out to LG 37LD450 37" LCD |
#1149
|
||||
|
||||
Quote:
Power power = new Power(); power.off(IP address); power.on(IP address); You could implement your own plugin that listens to SageTV server events to wake up the extender you want. Let me know if you need more details.
__________________
Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard |
#1150
|
|||
|
|||
Quote:
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#1151
|
|||
|
|||
Why do you use IP address rather than MACID or a friendly name like "Kitchen Extender"? Don't you run the risk of your IP names switching if you don't use static IPs for your extenders? I use static IPs for my PCs but I never bothered with my Sage Extenders.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#1152
|
||||
|
||||
Quote:
Personally I always use static IP's or if the router allows a MAC->IP correlation via pre-assigned DHCP.
__________________
Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard |
#1153
|
|||
|
|||
Finding JVM heap size in Groovy
According to the Java docs Runtime.totalMemory() Returns the total amount of memory availalble in the Java virtual machine. Will this show me the amount of memory available and help me to diagnose when I am running low and may run into trouble?
If so then how do I call this from SageGroovy? Do I have to import a certain library? Is this included with the Java or do I have to download it from somewhere? When I try the command "println (Runtime.totalMemory())" I get the error: groovy.lang.MissingMethodException: No signature of method: static java.lang.Runtime.totalMemory() is applicable for argument types: () values: [] Possible solutions: totalMemory(), maxMemory(), freeMemory()
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#1154
|
|||
|
|||
Quote:
Runtime.getRuntime().totalMemory()
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#1155
|
|||
|
|||
OK - I assume that when I run this from the SageGroovy environment I am not getting the values for the Sage JVM but for a separate JVM for SageGroovy, is that correct?
If I call this from within SJQ that is initiated by Sage am I getting the memory values for the Sage JVM? Or is SJQ running in a different JVM instance? Can I use this method to write a Groovy script to monitor my free JVM memory and have it throw a System Message when I start to get low? One other question - can I use the Java runtime Garbage Collector to clean up in Sage? Or is this dangerous or will this not make a difference if Sage cleans up the garbage on its own?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#1156
|
||||
|
||||
Quote:
Quote:
Quote:
But there is a plugin that monitors this stuff and generates system messages if the free mem gets too low. ("Heap monitor" or something like that is the name of it, I think.) Quote:
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#1157
|
||||
|
||||
Java Heap Monitor is correct. It put's a nice little bar graph in the header and lets you set trigger levels for messages.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#1158
|
||||
|
||||
Slugger, I'm still running SJQv3, since it has met my--admittedly limited--needs up until now. I'm still toying with the idea of using XBMC as my front-end and was looking at bradvido's script for syncing things up. Since he isn't developing it any further, something else came to mind.
Would it be possible to use SJQv4 to save my recordings in a more XBMC-friendly naming convention? For example, XBMC would prefer a structure like this: Code:
TV Shows |----TV Show 1 | |___ TV Show 1 Media files | |----TV Show 2 | |___ TV Show 2 Media files | ----TV Show 3 |___ TV Show 3 Media files Code:
foo.s01e01.* foo.s01.e01.* foo.s01_e01.* foo_[s01]_[e01]_* foo.1x01.* foo.101.* Code:
foo (year).* Thanks for any insight.
__________________
Server: XP, SuperMicro X9SAE-V, i7 3770T, Thermalright Archon SB-E, 32GB Corsair DDR3, 2 x IBM M1015, Corsair HX1000W PSU, CoolerMaster CM Storm Stryker case Storage: 2 x Addonics 5-in-3 3.5" bays, 1 x Addonics 4-in-1 2.5" bay, 24TB Client: Windows 7 64-bit, Foxconn G9657MA-8EKRS2H, Core2Duo E6600, Zalman CNPS7500, 2GB Corsair, 320GB, HIS ATI 4650, Antec Fusion Tuners: 2 x HD-PVR (HTTP tuning), 2 x HDHR, USB-UIRT Software: SageTV 7 |
#1159
|
|||
|
|||
Quote:
In summary, can SJQv4 do this kind of thing? Absolutely. But it will require you to write some decent amount of scripts to do it - or ask wayner nicely for his solution.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#1160
|
|||
|
|||
Enforcing run times in Windows
Following up on my question about enforcing a timeout for tasks...
Below is a script I've been using successfully for a couple weeks now to constrain how long mediaShrink can run. (It's actually HandBrake that gets stuck.) I've hard-coded the command in the script, but it wouldn't be hard for one to take the arguments to the script as the command to run. Note that this script is a little complicated because I wanted the feature to stream standard output and standard error as the script runs. In a SJQ context that doesn't matter a lot, but I was trying to make the script generally useful. My SJQ task has: Executable = C:\Windows\System32\cscript.exe Executable args = "C:\path\to\script\below.vbs" "$SJQ4_PATH\$SJQ4_LAST_SEGMENT" Maximum Time = 3 hours Code:
' In seconds timeout = 1 * 60 * 60 checkInterval = 60 command = """C:\Program Files (x86)\SageTV\SageTV\MediaShrink\MediaShrink.bat"" " & WScript.Arguments.Item(0) Set fso = CreateObject("Scripting.FileSystemObject") tempOutFilePath = fso.GetSpecialFolder(2) & "\" & fso.GetTempName tempErrFilePath = fso.GetSpecialFolder(2) & "\" & fso.GetTempName Set shell = CreateObject("WScript.Shell") redirectedCommand = command & " >" & tempOutFilePath & " 2>" & tempErrFilePath Set oExec = shell.Exec(redirectedCommand) WScript.StdOut.Writeline "Process has PID " & oExec.ProcessID ' Sleep a little to give the process a time to create the output files WScript.Sleep 100 ' For checking the file size Set tempOutSizeFile = fso.GetFile(tempOutFilePath) Set tempErrSizeFile = fso.GetFile(tempErrFilePath) ' For reading the file Set tempOutReadFile = fso.OpenTextfile(tempOutFilePath) Set tempErrReadFile = fso.OpenTextfile(tempErrFilePath) oldTempOutFileSize = 0 oldTempErrFileSize = 0 startTime = Timer timeoutExpired = False While oExec.Status = 0 and timeoutExpired = False if Timer - startTime > timeout then ' WScript.StdOut.Writeline "Timeout of " & timeout & " exceeded. Killing process and all its children" shell.Run "taskkill /t /f /pid " & oExec.ProcessID, 0, True timeoutExpired = True end if if (tempOutSizeFile.Size > oldTempOutFileSize) then ' WScript.StdOut.Writeline "Passing through " & (tempOutSizeFile.Size - oldTempOutFileSize) & " more bytes of STDOUT" Wscript.StdOut.Write(tempOutReadFile.Read(tempOutSizeFile.Size - oldTempOutFileSize)) oldTempOutFileSize = tempOutSizeFile.Size end if if (tempErrSizeFile.Size > oldTempErrFileSize) then ' WScript.StdOut.Writeline "Passing through " & (tempErrSizeFile.Size - oldTempErrFileSize) & " more bytes of STDERR" Wscript.StdErr.Write(tempErrReadFile.Read(tempErrSizeFile.Size - oldTempErrFileSize)) oldTempErrFileSize = tempErrSizeFile.Size end if ' WScript.StdOut.Writeline "Waiting " & checkInterval & " more seconds. " & (timeout - (Timer - startTime)) & _ ' " seconds remain." WScript.Sleep checkInterval * 1000 Wend tempOutReadFile.Close fso.DeleteFile tempOutFilePath tempErrReadFile.Close fso.DeleteFile tempErrFilePath if timeoutExpired = True then WScript.Quit 1 else WScript.Quit oExec.ExitCode end if |
Currently Active Users Viewing This Thread: 4 (0 members and 4 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) | cslatt | SageTV Customizations | 48 | 06-11-2012 10:44 AM |
SJQv4: Technology Preview | Slugger | SageTV v7 Customizations | 39 | 12-17-2010 01:17 PM |
SageTV Plugin Developers: Any way to see stats for your plugin? | mkanet | SageTV Software | 4 | 12-12-2010 10:33 PM |
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin | deria | SageTV Customizations | 447 | 12-11-2010 07:38 PM |
SJQv4: Design Discussion | Slugger | SageTV v7 Customizations | 26 | 10-18-2010 08:22 AM |