Making iTunes imports unnoticeable

Jan 13, '02 10:05:46AM

Contributed by: skyko

Normally when I import music into iTunes, the whole system gets rather sluggish which makes it very awkward to work with it the while.

While iTunes needs to be highly prioritized by the system during playback operations to allow for smooth sound performance without any dropouts, there is no need for this during "pure" import-only activity. So I wrote a little script that will reprioritize the iTunes app. While this may result in bad play performance (occasional dropouts -- very rare), this makes background import almost unnoticeable. The whole system runs as smoothly as normal, and the only thing you'll notice is the CD drive running continuously. Here's the script:

  #!/bin/sh
ps -ax | grep iTunes.app | grep -v grep
renice 20 -p `ps -ax | grep iTunes.app | grep -v grep | cut -c1-5`
Just put the commands above into a file in your ~/bin directory and chmod +x the file. Whenever you just want to do background import, start iTunes and run the script in Terminal window afterwards. You'll see output like:
  500  ??  S      0:01.90 /Applications/iTunes.app/Contents/MacOS/iTunes /Appli
500: old priority 0, new priority 20
To return iTunes back to original scheduling priority, just close the app and restart it.

I find myself running iTunes almost always at low priority because dropouts are very very rare (I use the "big buffers" setting).

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20020113100546192