avatar

bill mueller

Aqua Marine

Posts: 4,350 Member Since: 20/01/2011

Lead

Jul 1 13 8:10 AM

Tags : :

After lots of experimentation and a script from Chris Clepper, I have a solution to fixing the real culprit that causes many or most of the CPU error codes in Pro Tools and many other time sensitive apps in Mac systems.

The search application Spotlight is prioritized too high in the system and when it does a search, it hogs the CPU, which is disastrous to a contiguous type app like a DAW. It does it's search at least once a minute so it's like playing Russian Roulette once a minute while recording. This forces users to increase RAM by upping their latency settings to keep from crashing, when the DAW is barely using the system.

The answer is to turn off Spotlight after starting up these types of apps. We turn Spotlight off after instantiating the DAW, because we need to establish the file hierarchy in the DAW and not lose our files when we boot the app later. This fix is easy and will help you reduce your latency to the absolute minimum on your system. I run 32 samples on an 8 core Mac Pro with 30 channels in record regularly with no CPU errors. That same system was only reliable at 256 samples with Spotlight running.

When you turn Spotlight off, it stays off even after shutting down and rebooting. So you will need to turn it back on to do a system scan and search when not using the DAW. This is no biggie after you get used to the procedure.

I suggest dragging the Terminal icon into the Dock so that you can quickly do this procedure. I also keep a page with the turn off and turn on scripts in Notes, so that I can quickly access them from the Doc.

To turn off Spotlight after starting up the DAW.

After starting up the DAW, open Terminal. Copy and paste the line below and press Enter.

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

After you press Enter, the system will ask for a Password. When you type in your password, it will appear that nothing is happening in Terminal. That is not true. Just carefully type your password and press Enter. If your password was correct the next line will be:

Name of your computer:~your name$

Spotlight will now be off.

To restart Spotlight after your session is over, open Terminal. Copy and paste the line below and press Enter.

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

And again enter your Password.

I also suggest placing a copy of the Activity Monitor in the Doc and taking a peek at %CPU before and after turning off Spotlight. With Spotlight on you will see two processes, mds and mdworker, regularly going to the top of the %CPU list. This is when we get CPU errors in PT. Turn off Spotlight and mds and mdworker stop running and stop slamming the CPU.

It is really that simple. Once you have turned off Spotlight, go to PT and set your latency to 32 samples to start, and run a test. I am confident you will find much better performance and stability. You may also want to change your Host Processors. My system runs best with only 2 out of 8 processors and 80% CPU usage. I have also set Host Engine to ignore errors and minimize additional latency but have never heard a click or pop with Spotlight turned off.

Best,

Bill

Quote    Reply   
avatar

zmix

Aqua Marine

Posts: 3,993 Member Since:20/01/2011

#5 [url]

Jul 3 13 7:53 AM

There are factors besides Spotlight which can affect DAW performance.  But just to put a final nail in the Spotlight coffin before moving on I suggest that before you disable it entirely in terminal, you first change the Spotlight Search Preferences in the OSX "System Preferences / General / Spotlight" pane. And see if it helps.

I only use spotlight to launch Apps ("apple-spacebar then the first two or three letters of the program, press "return" and boom..!)

Here are some simple

http://appletoolbox.com/2011/12/spotlight-search-preferences-ios/

and more in depth:

http://www.thexlab.com/faqs/stopspotlightindex.html

tips.

Also, try "Tinkertool"

http://www.bresink.com/osx/TinkerTool.html

Quote    Reply   
avatar

bill mueller

Aqua Marine

Posts: 4,350 Member Since:20/01/2011

#6 [url]

Jul 3 13 10:57 AM

Chuck,

I tried that first and found that it made no difference, Spotlight still does it's search even when you remove every item from the Search Results list and place ALL your drives in the Privacy folder. That's why I came up with the idea to shut the Spotlight process off entirely.

Bill

Quote    Reply   
avatar

zmix

Aqua Marine

Posts: 3,993 Member Since:20/01/2011

#8 [url]

Jul 6 13 6:30 PM

Chuck,
I tried that first and found that it made no difference, Spotlight still does it's search even when you remove every item from the Search Results list and place ALL your drives in the Privacy folder. That's why I came up with the idea to shut the Spotlight process off entirely.
Bill

-bill_mueller

Yes, I ran some tests myself... a big THANK YOU for the script, it actually saved my ass today while printing a big session... amazing tip.

Quote    Reply   
avatar

compasspnt

Diamond Forever

Posts: 21,163 Member Since:08/01/2011

#10 [url]

Jul 6 13 9:44 PM

Couldn't get the script to work for me on my G5 10.4.11 system...it works on the Mountain Lion one though.

Anyone know about getting it to go in 10.4?

Quote    Reply   
avatar

bill mueller

Aqua Marine

Posts: 4,350 Member Since:20/01/2011

#11 [url]

Jul 6 13 10:04 PM

Spotlight did change in one of the later OS's and if I recall, was not such a problem in 10.4. Have you done the Activity Monitor test with a fairly large session? It may be possible that the Apple tweaks work better in 10.4. I have a G5 with system 10.5.8 and will take a look.

Quote    Reply   
avatar

.

Posts: 1,503 Member Since:28/11/2011

#12 [url]

Jul 6 13 10:12 PM

I've done all the Apple tweaks for 10.4 ad nauseum... No love. (G4)

I was so hopeful too.

 "Real People, Real Performances."

Quote    Reply   
avatar

compasspnt

Diamond Forever

Posts: 21,163 Member Since:08/01/2011

#13 [url]

Jul 6 13 10:42 PM

I have Spotless, and it is running, and it says that Spotlight is NOT running, but I think it is, and get occasional "lockup" crashes.

Quote    Reply   
avatar

.

Posts: 1,503 Member Since:28/11/2011

#14 [url]

Jul 6 13 10:50 PM

Inevitably, once a day, PT will freeze and the beach ball appears. No way out but to hold down the power button. Today all I had up was a stereo track and a stereo VI. Crashed about an hour in..

Once it happens though, I'm good for the rest of the day. Usually. Real head scratcher, and VERY frustrating.  

 "Real People, Real Performances."

Quote    Reply   
avatar

bill mueller

Aqua Marine

Posts: 4,350 Member Since:20/01/2011

#16 [url]

Jul 7 13 10:19 AM

There is a program called Cocktail that I have read can shut off Spotlight in 10.4. The earliest version I can find however is for OS 10.5. I have contacted the company and asked both if Coctail terminates the mds and mdworker processes (not just modify indexing) and if they have a free version laying around for OS 10.4. Will report back.

Quote    Reply   
avatar

zmix

Aqua Marine

Posts: 3,993 Member Since:20/01/2011

#18 [url]

Jul 7 13 11:09 AM

Here's another tip.. it has the advantage of not disabling spotlight entirely:

http://discussions.apple.com/thread/3218309?start=30&tstart=0

  • Change Priority SPOTLIGHT : Set Spotlight indexer (mds, mdworker) to a lower processor priority:
    • sudo defaults write /System/Library/LaunchDaemons/com.apple.metadata.mds LowPriorityIO -bool true
    • sudo defaults write /System/Library/LaunchDaemons/com.apple.metadata.mds Nice -int 20

Quote    Reply   
avatar

bill mueller

Aqua Marine

Posts: 4,350 Member Since:20/01/2011

#19 [url]

Jul 7 13 11:30 AM

Chuck,

That looks pretty cool as it seems to be a set and forget.

However, I could not find in the thread a definition of what constitutes low priority. Does that mean that under certain conditions Spotlight can still pop up and cause audiocoitusintruptus?

If low priority means no mds or mdworker processes when an app is running, it would be a better solution than mine. And Terry, this might (probably will!) work in 10.4!

Quote    Reply   
avatar

natenajar

Gold Finger

Posts: 835 Member Since:14/04/2011

#20 [url]

Jul 7 13 4:09 PM

On my 2007 Mac Pro, I decided to try an experiment and I bought a new fw pci-e card to connect my prism Orpheus.  I was hoping I would achieve better latency performance.  With the mds fix at 441 and 48 I can get as low as 64 samples and 128 at 96k.  At those rates it is still too much latency, and dropping to 32/64 curiously does work but after a few moments there is a pop in the audio and then a large amount of latency begins to occur.  Every time.

With the new fw card (as opposed to using the built in fw bus on the Mac Pro) I can still only achieve the same settings, but the latency itself is greatly diminished for the same settings!  I can get manageable performance at 64 samples for 441k and 128  for 96k and while I have not measured the latency difference numerically, I can say it is noticeably better to the point that the system should be useable for monitoring though the daw.

Quote    Reply   
Add Reply

Quick Reply

bbcode help