OSX: Rescanning AudioUnits on boot, safari visits,sys slowdown-SOLVED

DETAILED SOLUTION IN LAST POST BELOW!

THE MAJOR SLOWDOWN IS CAUSED BY APPLE’S ANCIENT QUICKTIME 32BIT LAYER, NAMELY BY “/System/Library/Frameworks/QTKit.framework/XPCServices/com.apple.qtkitserver.xpc” - RENAME THIS DIR AND PROBLEMS WILL BE GONE! YOU WILL LOOSE QUICKLOOK AND ICON PREVIEW FOR VIDEOS… I USE VLC ANYWAY… THE SPEED IMPROVEMENT IS HUGE, 10.9.4 RUNS NOW AS FAST AS 10.6.8

… YOU CAN ALWAYS RENAME IT BACK TO PROPER AT ANYTIME. IT WILL SLOWDOWN AGAIN !

EDIT: YOU WON’T EVEN LOOSE VIDEO ICON/QUICKLOOK PREVIEW, YOU JUST HAVE TO REBOOT AFTER RENAMING!

EDIT2: Attention! Do not use soution 4! It will make your system either unstartable or hide any audio app from working

EDIT3: Clear cache dirs completely after the change, in /Library/Caches and esp. in /Users/your_dir/Library/Caches . This can be done using a optimizing tool, or manually. But stay concentrated :slight_smile:


Hey

this is completely off topic, but I cannot find any solution for this and Apple forums do not help in any way here:

since upgrading to OSX 10.9.4, the system always rescans all audio units found in /Lib/audio/plugins/components after every system boot up. This also happens if I run doe application that accesses system’s audio capabilities. For example if I load Vox audio player or open a webpage with a flash plugin or a html5 audio tag inside, the system will also rescan again all audio units.

I looked around the web but cannot find any solution.

Do you have any idea what could be the cause for this?

You might check this thread … old, but I think some of these tricks are still useful:http://www.macprovideo.com/forum/audio/logic-pro/42741

Namely:

  • anything using automap?

  • what architecture are you on? do you have a mix of 32/64 bit plugs?

  • have you tried isolating the AU’s in the system directory, reboot, and see if it continues? could be a borked plug after upgrade …

Hey, thanks for trying to help!

No automap, I usually use 32bit plugins, though I guess almost all AUs are universal builds. I now did a lot of plugin scannings using Logic Pro, and moved problematic AUs out of the dir… Hope this will fix the problem.

EDIT: No, scanning scanning scanning. Damn. The only action that helps is renaming components dir and restart, since coreaudiod / hfs seems so nasty that it doesn’t care about dir renaming it instead uses some directory reference id.

Would be cool if I could get some information about this AU validation caching mechanism that came to 10.9 (or 10.8). I am not able to find any infos about it! Very strange, it seems to be secret Apple technology… :stuck_out_tongue:

Maybe the problem is system clock related… Since I use Hackintosh with some EFI bios, the clock is wrong after every wakeup from sleep… Maybe that’s the reason so the system things a future date is not a valid timestamp or something…

FIXING A LAGGY / SLOW LOADING OSX 10.9.X - 10.10.X

Hey,

in case anybody else experiences a very bad performance/a two-minute lag in OSX 10.9 or higher, if 1.) a audio player app will open or 2.) safari will be opened will a graphics rich webpage, then I guess I have found the cause of this:

Safari and also audio apps that are compatible with audio components ( audiounits, in /Library/Audio/Plug-Ins/Components ) will utilize the system component “com.apple.qtkitserver.xpc”. You can see this xlc service as a process in the activity monitor, one of the rare processes that still use 32bit emulation mode…

qtkitserver.xpc seems to be a relict of quicktime and is responsible for those finder movie previews, if you press the play button in the icon or use quicklook. It utilizes all audio components (I don’t know why…). To make sure that you have the same problem, enable a spy session with fs_eventer or the freeware “filemon”:

In new terminal window just write:

sudo fs_usage
sudo fs_usage | grepComponents

Look for intensive scanning of audio components. Surely you even can filter the output in a more sophisticated way, but I have no clue about terminal commands…

Freeware filemons for OSX:

fswatch- install with “brew install fswatch”, terminal command

fs_usage - default system installed

Filemon - frontend for fs_usage by Deep-IT.ru :slight_smile:

fseventer - Very sophisticated freeware frontend view (but useless?) by fernlightning, grab it here before it will be deleted! Vendor shut down webpage.

So if you asking me if this could be a solution to fixing a slow mac osx, look into activity monitor if there is a process opened “qtkitserver.xpc” in 32 bit, if you open safari and experience a system slow down.

EDIT: See solution 4 below.

EDIT 2: Solution 1 works! You only need to restart the system one time!

Solution 1

My current solution is to completely disable this process by renaming the file. In terminal type:

sudo mv /System/Library/Frameworks/QTKit.framework/XPCServices/com.apple.qtkitserver.xpc /System/Library/Frameworks/QTKit.framework/XPCServices/com.apple.qtkitserver.xpc__

Now restart Safari. The speed-up is impressive. Almost every tool and especially browser and audio apps will load so fast now! The drawback of this method is that you will loose video previewing in finder (I never use it). Quicktime codecs, Final Cut etc. will still work! EDIT: Also icon previews of videos and quicklook videos.

On some webpages html5 video may be broken until next reboot. So do a reboot now.

Solution 2 (not approved)

Another approach is to rebuild the xpc cache in OSX. This seemed to speed up things a bit, but not as fast as the first method:

sudo /usr/libexec/xpchelper --rebuild-cache

Don’t know if this approach will fix the problem permanently.

Solution 3 (not tested)

There is also a switch for LaunchDaemons available:

<key>EnvironmentVariables</key>
<dict>
  <key>XPC_SERVICES_UNAVAILABLE</key>
  <string>1</string>
</dict>

Maybe it could help if this option would be added to the system agents “quick look” and “webkitplugin agent”…

Addition: Disable symbol preview in Finder

Also disable any icon previewing in the Finder in places where videos are stored: Go to root level, right click in “Applications”, “Library”, “Users” and on “view options” in context menu. There, disable “symbol preview” and save as standard. Repeat this for all download dirs, system’s movies dir etc.

EDIT:

At least do solution 1+2 +addition… Man, I got my OSX back! The system is so fast now.

Solution 4

The above will break Safari’s html5 video support.You could use Firefox, or try this approach instead.

Edit: Solution 1 works!

Another more conform approach could ne:

By patching some sandbox rules files, I try to prevent coreaudiod and others to be able to access /lib/audio… I have no clue how I can do this for /sys/lib/frameworks/audiotoolbox/xpcservices/com.apple.audio.ComponentHelper for example…

EDIT: DO NOT DO THE BELOW!

Edit the following rule files by searching for “components” or out-commenting those lines by adding a “;;;” to it:

/System/Library/Sandbox/Profiles/com.apple.qtkittrustedmoviesservice.sb
/System/Library/Sandbox/Profiles/com.apple.qtkitserver.sb
/usr/share/sandbox/com.apple.audio.coreaudiod.sb

Just like this:

...
(allow file-read*
...
;;;(literal "/Library/Audio/Plug-Ins/Components")
...

You could try this, adding a file /System/Library/Sandbox/Profiles/com.apple.audio.ComponentHelper.sb with the following content:

;;;;;; NUR EIN TEST

(version 1)
(deny default)

(import "system.sb")
(import "com.apple.corefoundation.sb")

(deny file-read* (home-subpath "/Library/Audio"))
(deny file-read* (regex "^/Library/Audio/*"))

Updated

Final step for all:

Completely clear user and system caches under /Users/your_dir/Library/Caches and /Library/Caches