Turn off multi-tasking?

Posted by: tanstaafl.

Turn off multi-tasking? - 14/02/2010 12:21

I frequently run an application (Tunebite) that processes as many as 20 audio streams simultaneously, playing the tracks in real time, removing DRM, and encoding them as MP3 files.

This is an extremely CPU and memory intensive process, so much so that if some background task starts up (such as an AVG update or a Windows update of any sort) it corrupts some of the audio tracks.

Is there a simple way to temporarily turn off multi-tasking in Windows Vista so that when Tunebite is running, it remains the only application in process?

tanstaafl.
Posted by: Dignan

Re: Turn off multi-tasking? - 14/02/2010 14:17

I suppose you could give it higher priority in the task manager. Or you could just turn off auto-running programs like that. I mean, how many programs other than Windows Update or an antivirus do you have that run things automatically.

You could reschedule when AVG does its scans. You could change Windows Update settings so that it merely alerts you to new updates instead of downloading and installing them for you.

Also, I'm a big fan of Microsoft Security Essentials these days. I can't help but see AVG as following the exact same path that Norton and McAfee were, which made me (and, I think, thousands of others) switch to AVG in the first place. MSE is very lightweight on the system.
Posted by: Attack

Re: Turn off multi-tasking? - 14/02/2010 15:40

I removed AVG and installed Microsoft Security Essentials on my dads PC. He always shutsdown when done using the computer and this made everything SLOW when he turned it on. On a fresh bootup starting Firefox it would take about 10 - 15 seconds just to show the hourglass icon and Firefox would load about a minute after that to load. Once AVG was replaced with Microsoft Security Essentials Firefox was ready in about 15 seconds. The PC is a P4 2.4 celeron with 1GB of ram running Windows XP.
Posted by: hybrid8

Re: Turn off multi-tasking? - 14/02/2010 16:04

Why not just uninstall all the virus-scanning software? I haven't run any on my many Windows machines in the past 15 years. Do they actually do anything? Besides make your computer slow and crash other software?
Posted by: wfaulk

Re: Turn off multi-tasking? - 14/02/2010 16:09

This is akin to asking if you could turn off your brain's multitasking. Even if you could do it, it wouldn't last long without your heart pumping blood or your lungs replenishing your oxygen supply.

The best you can do, as Matt says, is increase the process's priority.
Posted by: Attack

Re: Turn off multi-tasking? - 14/02/2010 16:23

I've had many calls from both my mom and dad asking be why the virus scanner has a message up. If your running Windows without a virus scanner and you browse the web on this PC your taking a big risk on having something unwanted installed. Just do a google search for website hacked installing malware for a reason to run a virus scanner.

A good Virusscaner shouldn't make your computer slow nor should it make it crash. I run NOD32 on all of my Windows computers and the only issue I've ever seen was on a friends computer. He was unable to close iTunes and the fix was very simple. Just add iTunes.exe to the do not active scan list.
Posted by: Dignan

Re: Turn off multi-tasking? - 14/02/2010 16:35

Originally Posted By: Attack
I removed AVG and installed Microsoft Security Essentials on my dads PC. He always shutsdown when done using the computer and this made everything SLOW when he turned it on. On a fresh bootup starting Firefox it would take about 10 - 15 seconds just to show the hourglass icon and Firefox would load about a minute after that to load. Once AVG was replaced with Microsoft Security Essentials Firefox was ready in about 15 seconds. The PC is a P4 2.4 celeron with 1GB of ram running Windows XP.

That seems quite weird to me. I can't imagine why MSE would cause his computer to slow down so drastically (or at all).

Are you sure there aren't any other issues with the computer?

I've installed MSE on a complete range of Windows machines, and while it's always been to replace Norton or McAfee, the computer always ran better afterwards. That doesn't mean that AVG would have improved performance even more, though. It was my prior antivirus of choice, and I had the same average performance improvement with it. My switching to MSE was more of a proactive move, because I do not like the direction Grisoft is taking their product.

Originally Posted By: hybrid8
Why not just uninstall all the virus-scanning software? I haven't run any on my many Windows machines in the past 15 years. Do they actually do anything? Besides make your computer slow and crash other software?

It hasn't slowed my system down. Occasionally certain antivirus programs can cause problems with false-positives, but more often I've had them actively protect me from unexpected infections.

I do my best to tell my clients that antivirus programs are the least important line of defense in protection from infections, but when I tell them that the most important is their own habits, I always feel like they think I'm accusing them of something. Still, I do my best to prepare users so that they don't get infected.

Lately, that has meant that I go to great lengths to explain to them exactly what it will look when their antivirus alerts them of a problem. There are some seriously f-ed up viruses out there disguising themselves as antivirus apps. They say something like "Antivirus One has found 37 infections. Click here to run a scan and remove these infections." I've had dozens of clients click on these popups, and before you know it, the computer is completely overrun with infections, ones smart enough to prevent you from going to any antivirus websites, or even transfer antivirus install files to the system.

Long story short, on one level I agree with you Bruno. If you are sufficiently smart about using your computer, I don't think you need an active antivirus program running on your system (though it might be smart to run something like Malwarebytes on your system sometime - maybe you're infected and you don't even know it). But there is no way I'd tell the average computer user to operate their computer without an antivirus program installed, no matter how much extra business it would get me wink
Posted by: Dignan

Re: Turn off multi-tasking? - 14/02/2010 16:39

Originally Posted By: Attack
Just add iTunes.exe to the do not active scan list.

Hrmm...ideally, this is not a good idea. You shouldn't have to add exceptions like that. NOD32, of all things, should be able to handle that better...

But there have definitely been issues with false positives with several antivirus programs. I think AVG also had a problem with iTunes recently (what is it with iTunes) where it deleted a file that made it impossible to start iTunes. Preferably, the antivirus maker will learn of issues like this, and you only run the exception until a fix is issued...
Posted by: hybrid8

Re: Turn off multi-tasking? - 14/02/2010 16:47

I've never had a virus or malware (installed) on any Windows machine. I chalk it up to habits rather than luck however. I've seen plenty of links to malware sites, obvious malware or trojans attached to email messages, etc. On Windows machines I've also run IE most of the time. Started with Netscape in 1995 and then moved to IE at version 3.

I suppose how a typical consumer could find themselves infested quickly enough though.

BTW Matt, Attack meant that AVG caused his dad's computer to run slowly and that the new MS software allows it to run quickly. I had to read the paragraph twice before I got that. Just ignore the first sentence or treat it as a synopsis rather than the lead into the next. smile
Posted by: Attack

Re: Turn off multi-tasking? - 14/02/2010 16:51

I removed AVG because of how slow it was making the computer. MSE didn't seem to cause any slowness.
Posted by: drakino

Re: Turn off multi-tasking? - 14/02/2010 17:37

Originally Posted By: Dignan
It hasn't slowed my system down.

It really depends on what you do with your system. Modern multi core systems with multiple gigabytes of RAM have plenty of overhead to allow virus/malware scanners to remain active and not show a noticeable impact. In I/O bound situations though, virus scanners still have a major impact. Hard drives just haven't kept up with the speed gains in the rest of the system, so now you have multi threaded apps all trying to use a limited resource. Having a virus scanner active on the entire system is a huge mistake in a work environment like mine, where people are compiling large codebases. I don't have exact metrics with my current project, but on a previous one, virus scanners tended to slow down the compile time by a magnitude of 2-3. I remember having to talk to IT about it after they rolled out some new policies that had scanning on for the folders where we compiled from.

As for my own personal Windows installs, I don't bother. I also don't browse the web with them, or have any of them booted long enough to do much outside play Win32 specific games from time to time. In the past I went back and forth. If I used Windows as my primary platform, I'd probably keep something like MSE enabled. There have been too many high profile normal websites hacked in recent years for me to be comfortable browsing anywhere unprotected. Even if the browser wasn't vulnerable, Flash has it's own share of issues. I've seen some very locked down systems still get hit with MMO password stealing malware somehow. It's one reason why Blizzard and other MMO makers are looking towards two factor authentication so much these days. It's far cheeper for them to support the occasional lost/damaged token then it is to deal with cleaning up a hacked account.

And as to Doug's initial question, task priority should help. Isn't there a way in Windows to start a process at a higher level automatically?
Posted by: andy

Re: Turn off multi-tasking? - 14/02/2010 17:57

For me AVG free is just as good as it always has been at not slowing my PC down. That said I only use it for resident scanning, I gave up with regular full system scans years ago and I make sure I turn off the extra stuff (email and that silly link scanning stuff).
Posted by: andy

Re: Turn off multi-tasking? - 14/02/2010 18:03

Originally Posted By: hybrid8
Why not just uninstall all the virus-scanning software? I haven't run any on my many Windows machines in the past 15 years. Do they actually do anything? Besides make your computer slow and crash other software?

Use the right anti virus (with the right settings) and it doesn't slow you down or crash other software. Use the wrong anti virus and I can be a nightmare (I'm looking at you Norton).

I worked one place a few years ago that installed Norton on every machine. I caused huge hassles on our developer machines, as it would cause a huge slow down every time a new exe was created, which being developers was a dozen times an hour...

AVG has saved me from infections/trojans a handful of times in the last 10 years, all of those times when receiving files/emails from family members or colleagues. I've probably had twice as many false alarms, but at least AVG make those fairly easy to deal with.
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 14/02/2010 19:01

Originally Posted By: Dignan
I suppose you could give it higher priority in the task manager. Or you could just turn off auto-running programs like that. I mean, how many programs other than Windows Update or an antivirus do you have that run things automatically.


You would be amazed at how much stuff runs in background that you don't know about. See the attached screenshot.

AVG is not the problem. With a little help from their excellent tech support (they actually made an appointment and called me) I now turn off certain elements of AVG while Tunebite is running. This increased the number of streams I can transcode simultaneously without corruption (assuming no surprise applications start up in background!) by 25%.

Increasing priority might help, although having to manually set the priority every time I run the program will be a bit inconvenient. If Tunebite is running with Realtime priority, what happens when other scheduled tasks are started? Do they then receive so little CPU and memory resources that they have no effect on Tunebite? All it takes is one spike kicking the CPU up to 100%, or maybe going from RAM to pagefile, and I've got a dozen corrupted output files.

Bitt is right, though, I can't turn off the multitasking and hope the computer will continue to work. I guess I'll just have to keep walking that fine line between 90% CPU usage and file corruption. When I'm running more than about 12 streams at once I'll increase the priority, turn off AVG, and see what happens.

tanstaafl.
Posted by: Anonymous

Re: Turn off multi-tasking? - 14/02/2010 19:13

Originally Posted By: Dignan

Originally Posted By: hybrid8
Why not just uninstall all the virus-scanning software? I haven't run any on my many Windows machines in the past 15 years. Do they actually do anything? Besides make your computer slow and crash other software?

when I tell them that the most important is their own habits, I always feel like they think I'm accusing them of something.


- Delete Internet Explorer icons.
- Install Chrome.
- Enable the firewall
- Don't download or run sketchy software.

I never needed a virus scanner either.
Posted by: Anonymous

Re: Turn off multi-tasking? - 14/02/2010 19:22

You might consider setting up a machine dedicated to only your transcoding application. Then you can just delete and turn off anything extra like AVG. Perhaps you don't even need the machine to be on the network.
Posted by: wfaulk

Re: Turn off multi-tasking? - 14/02/2010 21:18

Ugh. Google Update. Now there's a piece of software that Google installs without your permission.
Posted by: Dignan

Re: Turn off multi-tasking? - 15/02/2010 02:41

Originally Posted By: tanstaafl.
Originally Posted By: Dignan
I suppose you could give it higher priority in the task manager. Or you could just turn off auto-running programs like that. I mean, how many programs other than Windows Update or an antivirus do you have that run things automatically.

You would be amazed at how much stuff runs in background that you don't know about. See the attached screenshot.

Heh, I do support PCs for a living, so I don't think I'd be surprised about the number of processes running in the background. Unfortunately your screenshot is completely illegible (and that doesn't look like the task manager, what is that?), but it looks like you only have ~22 processes running there. That's not unusual in the least, but besides, it's not the number of processes but what kind they are and what they're doing. The reason I said that I couldn't think of any other troublemakers is because after AVG and Windows Updates, I couldn't think of any automatic processes that came from things you didn't know about. So, I was saying that you should simply take care of the problem tasks, rather than try to somehow kill multitasking.

Besides, there's a number of ways to suss out undesired processes, if you're really worried about it. The best tool I know of for this is Process Explorer. It's a Microsoft tool, but they didn't develop it. Task Manager is light on the details for running processes, but this should give you more, or at least it's easy to Google a process from within the software. After that, if you identify any troublesome software, you can go about uninstalling, changing settings, or forcing those processes not to launch through something like msconfig.

*edit*
And of course, the best solution to all of this is to get a new PC that will handle this stuff better. There's a Core i5 system (with 3GB of DDR3 RAM) from Dell for $650 at the moment. Pretty good.
Posted by: Dignan

Re: Turn off multi-tasking? - 15/02/2010 02:48

Originally Posted By: Mojo
Originally Posted By: Dignan
when I tell them that the most important is their own habits, I always feel like they think I'm accusing them of something.

- Delete Internet Explorer icons.
- Install Chrome.
- Enable the firewall
- Don't download or run sketchy software.

Heh, easier said than done. I try not to be so pushy with my clients, and it takes enough convincing to get them to switch from Norton to something like MSE, which are apps that they rarely if ever have to interact with. Forcing a browser with a drastically different interface on them would be next to impossible. At least with the people I deal with smile
Posted by: drakino

Re: Turn off multi-tasking? - 15/02/2010 03:08

Doug was showing the Task Scheduler. Heres a link to his attachment to view it full size.
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 15/02/2010 04:21

Originally Posted By: Dignan
get a new PC that will handle this stuff better


Uhhh... it's not like I'm running a Commodore 64 here. smile

AMD Dual-Core 3 GHz CPU, 2GB RAM, 3.5 terabytes of hard drive, nVidia 8600 GTS video card with 256 MB... Even though it is nearly three years old, I think it is adequate to my needs. Since I'm running 32-bit Vista, there would be little advantage to adding another 2GB of RAM.

One thing that did work beyond my expectations was increasing the priority. As an experiment, I set the priority to "Realtime" and ran 44% more simultaneous audio streams than I had ever successfully run before (increased from 18 streams to 26) and had a flawless conversion. (This was with virus scanning temporarily disabled.) Now perhaps I was just lucky and no other processes started up during the run, but this is definitely something I will try again.

tanstaafl.
Posted by: Dignan

Re: Turn off multi-tasking? - 15/02/2010 05:53

Originally Posted By: drakino
Doug was showing the Task Scheduler. Heres a link to his attachment to view it full size.

Ahh, that's right. Couldn't tell from the severely resized screenshot.

Originally Posted By: tanstaafl.
Originally Posted By: Dignan
get a new PC that will handle this stuff better

Uhhh... it's not like I'm running a Commodore 64 here. smile

AMD Dual-Core 3 GHz CPU, 2GB RAM, 3.5 terabytes of hard drive, nVidia 8600 GTS video card with 256 MB...

Ah yes, then you're right, that should be more than enough computer for what you're trying to do.

Quote:
One thing that did work beyond my expectations was increasing the priority. As an experiment, I set the priority to "Realtime" and ran 44% more simultaneous audio streams than I had ever successfully run before...

Cool, I'm glad it worked then! Chances are, you'd probably be fine with High or just Above Normal, though.
Posted by: peter

Re: Turn off multi-tasking? - 15/02/2010 09:08

Originally Posted By: tanstaafl.
This is an extremely CPU and memory intensive process, so much so that if some background task starts up (such as an AVG update or a Windows update of any sort) it corrupts some of the audio tracks.

This reminds me a little bit of the Buzz thread, in that you're using software which is insane and broken, but not perhaps in the way you think. Why does CPU contention cause corrupt output? If I run twenty instances of the C++ compiler in parallel then my PC slows to a crawl, but it doesn't compromise the correctness of the output. Is Tunebite really using a playback engine that detects loss of realtime and skips ahead?

Peter
Posted by: Dignan

Re: Turn off multi-tasking? - 15/02/2010 12:52

I assumed it was the live streaming part that was the issue. If you're just compiling, it doesn't matter how fast the computer does it because it will eventually process everything. But if it's trying to deal with many live streams, it can't get behind on them.

I suppose the application should be smart enough to prioritize the actual capture of the streaming, and push down the transcoding tasks if CPU usage gets too intense, since that isn't time sensitive.
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 15/02/2010 13:56

Originally Posted By: Peter
Why does CPU contention cause corrupt output?


I think it is because it is playing all 20 audio streams simultaneously in real time using Windows Media Player. It doesn't speed up or slow down the streaming based on available system resources, and the transcoding is also done in real time.

The main screen of the program warns you not to try and run other applications while Tunebite is running, and I can confirm from experience that they are not kidding.

tanstaafl.
Posted by: Roger

Re: Turn off multi-tasking? - 15/02/2010 14:59

Originally Posted By: tanstaafl.
I think it is because it is playing all 20 audio streams simultaneously in real time using Windows Media Player.


So run 10 streams simultaneously.
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 15/02/2010 17:21

Originally Posted By: Roger
So run 10 streams simultaneously.

And take more than twice the time.

I frequently run batches of 100+ files, each file about an hour and a quarter in length. Even running overnight there is a limit to how long I can have my computer tied up doing this.

tanstaafl.
Posted by: mlord

Re: Turn off multi-tasking? - 15/02/2010 17:50

It really sounds like you're going about this the wrong way, on the wrong system.

Except you did mention DRM, so I suppose there aren't that many other options when the music is sourced from a nasty provider like that.

Cheers
Posted by: gbeer

Re: Turn off multi-tasking? - 15/02/2010 20:38

Most of the items that potentially interrupt Tunebite seem to be running as services. (search indexing, anti-virus, updaters...) There are command lines that can be used to stop those services, then later restart them. Put the stop commands in one batch file, then others in a second.

Or, create one batch file that stops the services runs tunebite, then restarts them.

Quote:
http://windowsitpro.com/article/articlei...mmand-line.html

How can I stop and start services from the command line?


A. This can be accomplished using the
net stop <service name>
net start <service name>
A full list of the exact services is found in the registry (run regedit.exe) under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services key.

Alternatively, you can perform the stop and start using the name that is showed in the Services Control Panel applet by putting the name in quotes, i.e.
net stop "<service>"
net start "<service>"


Edit: don't use <>'s
net stop "Windows Update"
net start "Windows Update"

Note: rebooting the machine will restart all the stopped services.
Posted by: pedrohoon

Re: Turn off multi-tasking? - 16/02/2010 06:25

Originally Posted By: tanstaafl.


I frequently run batches of 100+ files, each file about an hour and a quarter in length.



How do you even find time to listen to hundreds of hours of audio? Do you ever sleep? confused
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 16/02/2010 12:19

Originally Posted By: pedrohoon
How do you even find time to listen to hundreds of hours of audio? Do you ever sleep?


I am stockpiling. These are audio books downloaded from the public library. I remove the DRMs so I can time-shift them and listen to them on my schedule. When my library card expires I won't be able to renew it since I am living in Mexico now and renewal has to be done in person.

I am building a pretty impressive collection...

tanstaafl.
Posted by: peter

Re: Turn off multi-tasking? - 16/02/2010 13:07

Originally Posted By: tanstaafl.
One thing that did work beyond my expectations was increasing the priority. As an experiment, I set the priority to "Realtime" and ran 44% more simultaneous audio streams than I had ever successfully run before (increased from 18 streams to 26) and had a flawless conversion. (This was with virus scanning temporarily disabled.) Now perhaps I was just lucky and no other processes started up during the run, but this is definitely something I will try again.

Stop me if I'm sounding a bit like a certain other BBSer in making rash assumptions about how bits of closed-source software work, but now you mention it, that does make perfect sense. If WMP thinks it's feeding a real sound card, it will probably itself be running at an elevated priority, perhaps even "Realtime" priority. So if Tunebite's transcoder is running at a lower priority, it will get starved out completely in the case of too many WMPs, its buffers will overflow and the audio will go glitchy. However, if Tunebite is also running at "Realtime" priority, it will still get scheduled a bit even if there are lots of runnable WMPs, the two will share the CPU nicely like good little children, and there'll be no glitching even if potential CPU use is over 100% (i.e. if there's always a waiting list for CPU).

Peter
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 30/03/2010 18:09

Originally Posted By: peter
If WMP thinks it's feeding a real sound card, it will probably itself be running at an elevated priority, perhaps even "Realtime" priority. So if Tunebite's transcoder is running at a lower priority, it will get starved out completely in the case of too many WMPs, its buffers will overflow and the audio will go glitchy.


I am pretty sure I have found the root of the problem.

After five failures night before last, in which the program started feeding all 18 threads simultaneously into the speakers even though it was supposedly muted, I noticed that every time this happened it was right at the point where one thread had finished a file and was loading up the next one. A little bit of experimenting showed that if the total job contained no more files than the total number of allowed streams, there were no failures, no corrupted files. This afternoon I experimented with a 28-file, 28-stream job (28 being the maximum number of streams that the program will allow) and it went off without a hitch.

Surprisingly, CPU usage was the same as if I were running just 15 streams -- about 37%. Memory usage was way up, holding steady about 80%.

So, it looks like the way to make this work is to run 28-file batches, and reload every hour and a quarter, rather than create a batch of 150 files and let Tunebite work its way through them. It is apparently the transition from completed file to the next file in line that is causing the problem.

tanstaafl.
Posted by: tman

Re: Turn off multi-tasking? - 30/03/2010 18:24

Sounds like the caching of the next file is making I/O momentarily block and create stuttering. Good that you've found a solution.

Just curious but can you run DPC Latency Checker?
Posted by: tanstaafl.

Re: Turn off multi-tasking? - 30/03/2010 18:40

Originally Posted By: tman
Just curious but can you run DPC Latency Checker?


No reason why I couldn't... but it looks pretty complicated to run and understand. I think if this new scheme of matching the number of files to the number of streams works out, I'll just let speeping dogs lie. smile

tanstaafl.