SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-22-2003, 06:55 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Exclamation High processor usage!

I've been using SageTV quite successfully, and until today around Noon today it had only been using just under 40% of my processor. Now, while not even recording anything it is using around 80-100%...this is making watching programs very difficult. The only thing that I can think of that I did to the computer around Noon was to One-touch recorder "Monk" and tweak the IR settings in the detailed setup. Then I put it to sleep and left. Ever since then, processor usage has been really high. The memory usage also keeps climbing and climbing...is this a memory leak somehow?

Any idea how to fix this? I've turned Intelligent Recording off, cleared hard drive space, rebooted the computer...HELP!

Just to prove it, http://stats.kjake.net will show processor usage if you click on the right link.

Oh yeah, I have an Athlon XP 1800+, 512MB RAM and a PVR-250...
Reply With Quote
  #2  
Old 06-22-2003, 06:57 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Well, this just became too much of a nuicence...and I didn't want my proc to run at 100% all the time. I removed my Music library, restarted SageTV without affect, then deleted Wiz.bin and Wiz.bak, and reloaded SageTV, now it works fine. I lost all of my intelligent recording info and favorites, but the favorites were easy to reprogram, and the intelligent recording will take some time to figure out my habits again, but it's better then not being able to use Sage.
Reply With Quote
  #3  
Old 06-22-2003, 09:10 PM
pawn's Avatar
pawn pawn is offline
Sage Expert
 
Join Date: May 2003
Posts: 516
This has happened to me a few times. The last time I noticed the Wiz.bin file was almost 9MB (it usually hovers around 2.5 MB's).

The 2nd time it happened, I saved my Wiz.bin and Properties files after setting everything up, including favourites and after watching TV for a few days. Overwriting these files with the backups seems to fix things when it happens.

I think something gets corrupted in the Wiz.bin file (maybe) once in a while.
Reply With Quote
  #4  
Old 06-23-2003, 02:08 AM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
I too have seen this. I think there should be an option to periodically automatically backup your wiz.bin, wiz.bak and properties files. Say like once a week and keep the last three weeks. I setup a batch that is run from the XP scheduler to help protect from this.
Reply With Quote
  #5  
Old 06-23-2003, 09:09 AM
grot grot is offline
Sage User
 
Join Date: May 2003
Posts: 50
I found processor spikes tended to be synchronous with changes in focus - in otherwords, i found that it only happened when some other program wanted to take control. If I rebooted sage, I was generally OK again. Not sure if this is the same as your problem.
Reply With Quote
  #6  
Old 06-23-2003, 01:42 PM
pawn's Avatar
pawn pawn is offline
Sage Expert
 
Join Date: May 2003
Posts: 516
Quote:
Originally posted by justme
I too have seen this. I think there should be an option to periodically automatically backup your wiz.bin, wiz.bak and properties files. Say like once a week and keep the last three weeks. I setup a batch that is run from the XP scheduler to help protect from this.
Not to suggest I have any clue how Sage is written, but it seems to me it's a bad idea keeping the Properties and Wiz files continuously open during operation (which I'm guessing is the case since we are always warned to close Sage or send it to bed before making changes to the Properties file).

I learned long ago to close files whenever possible in anything I write (otherwise you get corruption eventually on any system).
Reply With Quote
  #7  
Old 06-23-2003, 04:59 PM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
Quote:
If I rebooted sage, I was generally OK again.
Similar, but in my case only replacing my wiz files with new(fresh install) or older copies(about 1 week old) stopped the CPU climb. Not closing and restarting Sage, not even rebooting fixed it. My problem showed up first in 1.2.8 after about 3.5 weeks of almost continous use. I tend to run my machine 24/7 with Sage always on.
Reply With Quote
  #8  
Old 06-23-2003, 08:26 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Me too...I always have it on.
I just setup a quick perl script to copy the files and insert a date stamp in the file name so I can keep a couple copies around. I'll rewite it soon to only keep files from the last 2 weeks and to delete anything older. It runs at midnight each day of the week.
Reply With Quote
  #9  
Old 06-23-2003, 10:36 PM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
Hi Kjake,
I just have 4 bat's(each one copies the files to a different name) that run 1 each week. They just keep alternating, and I use the date modified to identify the most recent backup. I couldn't program to save my life. Could you post a copy of your scipt and how to run it?

It would be nice to have correct timestamps as part of the name. I can write batch files but that's about it. Any help would be great.
Reply With Quote
  #10  
Old 06-24-2003, 06:52 AM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Download this zip file from http://www.kjake.net/backup.zip with the date program, dll's to run the date program, and the perl script. It's up to you to go out and install perl. Activestate is the easiest to come by and install for Windows.

Then you just call 'perl sage_backup.pl' to run the script.

I sent the Linux date utility because it's more useful than the Windows version. Just make sure those DLL's are in the same directory as date.exe. You'll have to change the path in the perl script as well, but always make sure you specify the path - otherwise it will try to run the Windows version.

Feel free to ask any questions. I'll be improving this later tonight when I get home from work.

btw, the file was too large to attach to the post (1.14MB).
Reply With Quote
  #11  
Old 06-24-2003, 01:03 PM
kwallin kwallin is offline
Sage User
 
Join Date: Apr 2003
Location: Sweden
Posts: 57
Got this problem over a week ago, installed a fresh copy over the weekend but now it's back again..

I would like a solution to this problen instead of having to manually setup channels and favourites over and over again.

Any clues someone?

XML
PVR 250
WinXP Home
Intervideo decoder for Hauppauge

/Kenneth
Reply With Quote
  #12  
Old 06-24-2003, 03:04 PM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
TO kwallin:
Only the one we've discussed in this thread of periodically backing up your wiz and properties file.

TO Kjake:
Is the url correct? I could not get it to work. I just keep getting server unavailable. I could PM you my email address and you could email the file as an attachment. I just did an test and I can handle a 4Meg Att. file ok. Alternatively I could PM an FTP logon and pass that would be good for about 3 hours(We'd have to agree on a time). I really appreciate the offer and would like to check out your solution if at all possible. Still no sense in making you do all this work. No offense taken if you change your mind.

PS:Thanx for pointing me to activeperl. Looking at the Doc it seems fairly intuitive. I've been toying with learning to write VBscripts(since the interpreter is built into XP). Now maybe I'll try Perlscript instead.

Last edited by justme; 06-24-2003 at 03:12 PM.
Reply With Quote
  #13  
Old 06-24-2003, 11:59 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Sorry justme, ATT has been having problems with my routing in Chicago and I have been losing my connection. My router has not been trying to automatically release and renew my IP from them, but then again, it sounds like that is common since they told me I'd have too.

Anyway, the server is back up tonight, and I have a new Perl script. It hasn't been tested fully to see if it really works over the course of a two week span, but theoretically it should remove backup files with a creation time older than 2 weeks.

The new file has been updated in the Zip archive.
---
$date = `c:\\cygwin\\bin\\date \+\%m\%d\%Y`;
$date =~ s/\n//eg;
$sagepath = "C:\\PROGRA~1\\FREYTE~1\\SAGETV\\";
system("cp $sagepath\\Wiz.bak $sagepath\Wiz$date\.bak");
system("cp $sagepath\\Wiz.bin $sagepath\Wiz$date\.bin");
system("cp $sagepath\\sage.properties $sagepath\sage$date\.properties");
opendir(DIR,"C:\\PROGRA~1\\FREYTE~1\\SAGETV\\");
@dir = readdir(DIR);
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$now,$ctime,$blksize,$blocks) = stat("C:\\PROGRA~1\\FREYTE~1\\SAGETV\\Wiz.bin");
foreach $file(sort @dir){

if ($file =~ /Wiz[0-9]{8}/ || $file =~ /sage[0-9]{8}/)
{
$filename = $sagepath.$file;
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($filename);
$diff = $now - $ctime;
if ($diff > 1209500)
{
unlink($filename);
}
}

}
----

Last edited by KJake; 06-25-2003 at 12:30 AM.
Reply With Quote
  #14  
Old 06-25-2003, 04:51 AM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
The paragraph below is not only for KJake, but for anyone else who decides to try this. I had some problems, none KJake's fault, but I decided to describe them for others to learn from my mistakes.


Ok the version I downloaded has your original script(6 lines long). I tried it after changing the path to point to where I set everything up. I got CP is not a valid command 3 times. So I cut out the new script from your post, changed the path, and saved it as a perl script. Ran it and found out it had new errors. These were to be expected(I hate wordwrap). I like the way it told me which lines had errors. I then corrected the wordwrap errors and ran it. Still had the 3 "CP errors". Since it was obivous "cp" was the copy command, I changed all three "cp" to "copy"(see bottom of post). Bingo It works perfectly. I now have my dated backups and we'll see what happens in 2 weeks.

Thanx very much. Very cool

system("copy $sagepath\\Wiz.bak $sagepath\Wiz$date\.bak");
system("copy $sagepath\\Wiz.bin $sagepath\Wiz$date\.bin");
system("copy $sagepath\\sage.properties $sagepath\sage$date\.properties");

Last edited by justme; 06-25-2003 at 05:00 AM.
Reply With Quote
  #15  
Old 06-25-2003, 05:46 AM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Oh my gosh, I'm so sorry! I program in Unix all day long, and I have a Unix development environment on my server too, so 'cp' (Unix copy) works for me :-)...I can't believe I did that.

I really have updated the perl script in the Zip archive on the server this time (I also forgot to copy over the new archive to the server last night).

Zip file
Reply With Quote
  #16  
Old 06-25-2003, 07:55 AM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
No problem at all. You're the one helping me out right. Besides it made me look at the code rather than just install it. I honestly do love to learn new things just for the sake of learning. I'm a house husband due to disability, so I like to keep my mind busy and active learning new things. My wife would kill me if I became a couch potato.

Anyway I just downloaded the new Zip to compare it to my hacked up code. I understand the beginning of your second script, but the date check for file deletion code is a little over my head.[Edit:Actually seeing your code in proper format(new download) makes it much more readable] I'll have to decide whether or not to really get serious about learning a programming language. Perl seems not to unrelated to batch but, a little bit of a strange reliance on symbols and shorthand commands, I guess this speeds things up once you learn the formating though. I've heard that just about anything you want to do in Perl has already been made by someone else. So most of the work is in learning the structure and then putting together the pieces right? Either way I learned something new and have a useful utility for SageTV. I'd say that's a good outcome.

Thanx, justme


Last edited by justme; 06-25-2003 at 08:13 AM.
Reply With Quote
  #17  
Old 06-25-2003, 06:24 PM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
My d/\mn server is back up again...I now have written some scripts to log into my Linksys router config and release and renew my DHCP lease if the computer thinks it has lost the DSL connection.
Reply With Quote
  #18  
Old 06-26-2003, 12:56 AM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
Just goes to show except for a few companies, like Frey. We users are our own tech support now a days. That's why I love forums.
Reply With Quote
  #19  
Old 06-26-2003, 08:14 AM
KJake KJake is offline
Sage Icon
 
Join Date: May 2003
Location: West Michigan
Posts: 1,117
Yes, it's upsetting that I've had this problem. It just started happening last week when ATT notified all of their DSL single user accounts that there was emergency maintenance performed in Chicago and that you'd have to manually release and renew to get a new IP...except now it seems that I had to do it once a day...very inconvenient for trying to run a server, so I fixed it myself :-)

Does the perl script seem to be working for you? I haven't really been checking mine...
Reply With Quote
  #20  
Old 06-26-2003, 10:22 AM
justme justme is offline
Moderator
 
Join Date: Mar 2003
Location: Greater Baltimore/Washington Metropolitan area
Posts: 1,481
Quote:
Does the perl script seem to be working for you?
Yes, no problems so far. I'm now up to 3 days of backups. After I'm a little more sure of myself, I think I'll try to mod the script to store the backups in a subdir. Looking at the script it seems fairly obvious what to change.

1)I should declare my backup dir. (lets say $sageback)
2)Change the second instance of $sagepath in the 3 copy commands to $sageback.
3)Add a fourth system call to copy the current wiz.bin to $sageback with it's name unchanged. (may need to enable /y switch)
4)Change the "opendir" to point to my new backup dir's destination.
5)Change the path after "stat" to point to the copied wiz.bin in my new backup dir.
6)Lastly change the last instance of $sagepath to $sageback. (this is where you set $filepath)

Sorry, if I misused certian words like set or declare. I know there are other ways to do this, there always are. But I think this should work. I made a copy of wiz.bin in my new backup directory because as stated before I don't fully understand the date check code. This was an easy way I could mod your script to get the results I'm after.

Please don't post a version that tells me completely how to do it, I would like to try this myself first. Having said that, do you think the mods will work? I think I'll make the changes tonight. I could send my modded script as an attachment if that is ok with you. I would like you to look at it before I run or post it. Just to make sure I don't mess anything up. If I'm imposing on you please feel free to tell me.

Thanks for the script and the knowledge.
Reply With Quote
Reply


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

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


All times are GMT -6. The time now is 04:28 AM.


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