Home

         cash                    cash

         hrx                    jrmc

An Experiment for Mac Users

Can anyone try the following experiment:

-) Listen to a track played via iTunes.
-) open a terminal window
-) start "top"
-) find the pid of coreaudio and itunes
-) remember PID_ITUNES and PID_COREAUDIO
-) quit "top"
-) renice them via

sudo renice -20 -p PID_ITUNES
sudo renice -20 -p PID_COREAUDIO

-) listen again
-) report differences

I am curious about your observations.

flatmap's picture
  Joined: .:. .:. Comments:

Thanks for the very clear instructions.

I've played with this a bit some time ago. However I did not, at that time, think to renice coreaudio. Also I've improved some other elements in my setup since that time.

Will try to give this another go during the weekend.

__________________

16/44.1 and 24/96 music files via iTunes running on a G4 Mac -> Wavelength Audio Proton USB DAC -> AKG K-702 headphones.

 
Bob Stern's picture
  Joined: .:. .:. Comments:

An easier way to discover the PID (Process ID) of iTunes and CoreAudio is to launch Activity Monitor and type Core or iTunes in the oval-shaped filter field in the upper right corner.

Incidentally, I tried writing an AppleScript to renice the Spotlight processes, but mdworker regularly quits and relaunches with a different PID each time. It's easier to simply disable Spotlight!

__________________

Mac Mini > Metric Halo LIO-8 > Parasound JC-1 > Thiel 3.7

 
umea101's picture
  Joined: .:. .:. Comments:

I am curious about what you hear.

I am running a previous generation 24" iMac into an Audio Note DAC Kit 2.1B Signature using the HagUSB input with a Tentlabs Clock via a Locus Design Polestar.
Amplifier is an Audio Note Kit One, speakers Audio Note AN-K/SPa. All other wiring Audio Note.

 
flatmap's picture
  Joined: .:. .:. Comments:

Can you tell me what I need to do in order to disable Spotlight? Is there anything else on the mac that you have turned off?

Thanks!

__________________

16/44.1 and 24/96 music files via iTunes running on a G4 Mac -> Wavelength Audio Proton USB DAC -> AKG K-702 headphones.

 
Claude's picture
  Joined: .:. .:. Comments:

You probably want us to listen unbiased. But what exactly is it that you hear?
What is "renicing"?
Claude

__________________

Amarra 1.2, I-Tunes, Mac-Mini (4GB) SSD, Transparent Cables USB, Ayre QB-9, Octave HP-500SE, all PCs Lessloss Signature, HMS Sestetto, ADAM Pencil MK2 (active)
Lessloss blackbodies (3)

 
Bob Stern's picture
  Joined: .:. .:. Comments:

The Spotlight Privacy setting allows you to exclude folders or entire disk volumes from Spotlight. If you add all your hard drives to the Spotlight Privacy list, you will effectively have turned off Spotlight.

System Preferences > Spotlight > Privacy.
Click the + button.
Select your hard drive.
(Alternatively, you can drag hard drive icons to the list window.)

Repeat the last 2 steps for each disk volume (i.e., hard drive partition).

__________________

Mac Mini > Metric Halo LIO-8 > Parasound JC-1 > Thiel 3.7

 
darascal's picture
  Joined: .:. .:. Comments:

Claude, I belive the renice (linux version of unix nice) command changes the priority of a process in the kernel's scheduler.

http://en.wikipedia.org/wiki/Nice_(Unix)

Rascal

 
Mr.C's picture
  Joined: .:. .:. Comments:

I'm tempted to say it made a difference, but I've changed too much stuff recently (headphones, music player) to be 100% sure. It makes sense that it would be positive even if the results aren't obvious.

 
umea101's picture
  Joined: .:. .:. Comments:

whether it makes a difference or not. In some ways the changes I notice are rather subtle, but if I listen for a longer time music seems to be more relaxed, fatigue free.

 
Claude's picture
  Joined: .:. .:. Comments:

Interesting. Is this Change temporary?

__________________

Amarra 1.2, I-Tunes, Mac-Mini (4GB) SSD, Transparent Cables USB, Ayre QB-9, Octave HP-500SE, all PCs Lessloss Signature, HMS Sestetto, ADAM Pencil MK2 (active)
Lessloss blackbodies (3)

 
umea101's picture
  Joined: .:. .:. Comments:

But there should be a way to tell the system on startup to start coreaudio with a lower nice value. Any geeks out there?

 
CG's picture
  Joined: .:. .:. Comments:

"Hog" mode gives any process exclusive access to the CoreAudio driver. OK, only one process at a time.

Ask your software author to offer this option.

 
Bob Stern's picture
  Joined: .:. .:. Comments:

You can create an AppleScript and save it as an Application.

Paste into AppleScript Editor:
do shell script "renice -20 -u _coreaudiod" with administrator privileges

__________________

Mac Mini > Metric Halo LIO-8 > Parasound JC-1 > Thiel 3.7

 
Bob Stern's picture
  Joined: .:. .:. Comments:

(deleted)

__________________

Mac Mini > Metric Halo LIO-8 > Parasound JC-1 > Thiel 3.7

 
leggoslave's picture
  Joined: .:. .:. Comments:

Use Speed Freak which accelerates the top most app. in this case iTunes ..activate and hold..it should say "accelerating iTunes" ..dunno if it makes much of a difference in SQ? ..but there's always the comforter effect ..aka placebo ;)

It's free btw;

http://www.versiontracker.com/dyn/moreinfo/macosx/23412

 
cfmsp's picture
  Joined: .:. .:. Comments:

"but there's always the comforter effect ..aka placebo ;)"

This 'effect' - as you call it - may be responsible for more money being spent unnecessarily (i.e. buyer can't hear the presumed improvements, but is intentionally buying because he/she believes they are buying something that is 'better') on audio gear than all the disingenuous audio marketing ever devised.

I have seen this even in non-audiophiles purchasing audio gear. More specifically, I've instructed people to go to audio store to audition a particular item (always the best known value for a particular brand's lineup) for presumed purchase - "if you like it, you should buy it, and dont let the dealer talk you into anything else."

In variably what happens - unless I am with them - is that they will come home with the next model 'up', which is not always even an improvement irrespective of the increased costs. They didn't let the dealer talk them into something else, they did it themselves!

Quite frustrating, 'cause when you ask what they liked better, the answer is usually a sheepish "well, I assumed it would be better, and I decided I could afford more than the budget I gave you when I asked for recommendations" One example that I can recall was the Adcom GFA-535 amp - someone with no need for additional power upgraded to an amp that I don't think sounded as good - the next model up.

clay

 
cfmsp's picture
  Joined: .:. .:. Comments:

Excellent, so this is like the Exclusive mode of WASAPI?

BTW, CG, did you notice someone was looking for you in another thread - to thank you for the recommendation of Play?

clay

 
CG's picture
  Joined: .:. .:. Comments:

I don't speak Winders very well, so I don't know.

"An Audio Device should, but is not required to, support an arbitrary number of clients. An error will be returned if a given device refuses to accept another client, or the device is in "hog" mode. In hog mode, a device will only allow one client at a time. This is intended to provide a client a way of ensuring that it is getting all of a device's time. Hog mode is a 'first come, first served' service."

From: http://darcs.brianweb.net/vendor/powerpc-apple-darwin/include/CoreAudio/...

There's more information on this and implications of its use if you poke around. For example, the latest version of JACK just added this feature. As far as I know (in other words, don't even bet a nickel on this) none of the audio playback applications use hog mode. Yet.

 
machinehead's picture
  Joined: .:. .:. Comments:

has anyone come to firm conclusions with this yet?
Will it work with Amarra?

__________________

G5->LynxAES->Berkeley Alpha DAC->Groneberg Interconnects->Odyssey Strattos Mono Block Special Editions ->Groneberg Speaker Cables ->Odyssey Lorelei floor standers

www.beresford-dac.com

 
CG's picture
  Joined: .:. .:. Comments:

There's at least three programs that will perform this command line operation automatically. I'm not sure if all will work right in Snow Leopard, however. Each will give whatever application you choose priority in resources.

Beats me if it works with Amarra, though.

 
Dynobot's picture
  Joined: .:. .:. Comments:

open terminal
type
sudo mdutil -a -i off

This way you will disable spotlight as root, it will ask you for your password.

 
lovejoy's picture
  Joined: .:. .:. Comments:

Hello,
I had to join this forum after reading this and trying it out for myself.
I am running a Macbook Pro with Snow Leopard through a very heavily modified Beresford TC-7510 via optical connection, into Musical Fidelity A3.2 Pre-power combo and Shahinian Arc speakers.

I've run a test with a few of my choice test tracks. The only problem I've had is that COREAUDIO does not show up in my activity monitor, so I've only renice'd the PID for iTunes, but I can certainly tell a difference for the better.

Less fatiguing, it's taken an edge off the sound, most noticeable in the fact that strong 'S' vocals are less sibilant. There also seems to be more fine detail coming through and I've noticed decay in instruments that I've never noticed before. It's as if you can suddenly look deeper into the recording. I'm mightily impressed.

__________________

----
Rich

 
umea101's picture
  Joined: .:. .:. Comments:

Hi lovejoy,

Thanks for your comment, I am hearing the same things you are hearing. The thing that was bugging me was that I was getting varying degree of performance from itunes, sometimes it would improve on a restart. If I give the process high priority the results are better and more consistent.

As for the PID of coreaudio you can try opening a terminal window and doing a "ps -Al"

This should give you a list of all running processes with their PID and also their nice value.

Hope that helps

Joachim

 
lovejoy's picture
  Joined: .:. .:. Comments:

Yes, inconsistent results. Tell me about it ;-). I've been getting that from iTunes for a long time and had no idea what it was. I put it down to my home baked power supply which I've been tweaking around with, but never really sorted the problem out. It never really occurred to me that it could have been down to the priority iTunes was being given. I'll run it more over the course of the weekend and report back on its consitency.

Thanks for the tip on finding the PID of coreaudio, I'll give that a go too.

__________________

----
Rich

 
Bob Stern's picture
  Joined: .:. .:. Comments:

If Core Audio is not showing up in Activity Monitor, it probably is because the "Show" popup menu to the left of the filter field is set to "My Processes". You should change it to "All Processes".

Because Core Audio runs under its own User ID, you can renice it without even looking up its Process ID. Instead, simply renice the Core Audio user "_coreaudioid". The required command is in my earlier post in this thread on 12/03/2009 - 10:59 PST:

In AppleScript:
do shell script "renice -20 -u _coreaudiod" with administrator privileges

In Terminal:
sudo renice -20 -u _coreaudiod

__________________

Mac Mini > Metric Halo LIO-8 > Parasound JC-1 > Thiel 3.7

 
Claude's picture
  Joined: .:. .:. Comments:

The first time I tried this I hardly heard a difference. Tonight I did
1. renice ITunes
2. renice Core Audio
3. renice Amarra

4. enjoy
5. enjoy
6. enjoy
...
Cant get the grin off of my face. I am glad I tried it again.

More Details, better separation of instruments. Less digititis... (read the other posts, I can confirm that) ... and what is most important the music is much more involving. I try not to get carried away and will report after I did a restart of the system and tried it again. Right now, I do not want to change anything.

__________________

Amarra 1.2, I-Tunes, Mac-Mini (4GB) SSD, Transparent Cables USB, Ayre QB-9, Octave HP-500SE, all PCs Lessloss Signature, HMS Sestetto, ADAM Pencil MK2 (active)
Lessloss blackbodies (3)

 
Dynobot's picture
  Joined: .:. .:. Comments:

When you do a renice.... do you have to RE-renice if the computer goes to sleep and wakes back up?

What about if you close iTunes and/or Amarra, do you have to RE-renice coreaudio when you open them back up?

Also can someone post the complete script that would automate all of this when an application is started.

For example if you start iTunes will you be able to click on a icon which controls the script which renice's iTunes, coreaudio, etc.

 
pj's picture
  Joined: .:. .:. Comments:

While it won't work for coreaudio you can always start iTunes with nice then there is no worry about determining PID etc...


command removed until I sort how to work around a "small" issue - Tunes runs as root and can't access user library.

To "fix" coreaudiod so it runs at higher priority at every startup add:


<key>Nice</key>
<integer>-20</integer>

above the closing </dict> tag in /System/Library/LaunchDaemons/com.apple.audio.coreaudiod.plist
This change needs to be done with Admin privileges and it's probably a good idea to make a backup of the original file.

The change to the coreaudiod.plist takes effect after reboot (or unload/reload with launchctl - it's almost quicker to reboot). It's worth checking the added keys are still in place after OS updates.

cheers
Paul

 
pj's picture
  Joined: .:. .:. Comments:

Ok nice is only suitable for root owned applications....

What I was looking for was a means of launching iTunes and having it run with higher priorities without having to manually mess with terminal. I came across some code that used ps and grep to find an apps PID and after a couple of tweaks and a lot of trimming I ended up with this bit of applescript:

tell application "iTunes" to activate
set iTunesPID to do shell script "ps -axww | grep '[/]iTunes '| awk '{print $1}'"
do shell script "sudo renice -15 -p " & iTunesPID user name "YourName" password "YourPassword" with administrator privileges

If you paste into Applescript Editor and change YourName and YourPassword to your username and login password respectively, then save as an app you should be able to launch and renice iTunes with one click. I'd suggest using "get info" to set Sharing & Permissions so "everyone" has no access, and storing the app somewhere secure - your Documents folder perhaps.

cheers
Paul

NNB: I had to add a space between end of "iTunes" and the closing quote of the grep statement to stop grep returning the PID for Itunes AND iTunesHelper.

 
Bob Stern's picture
  Joined: .:. .:. Comments:

Did you test your AppleScript while you were logged into a non-admin account? I don't think the sudo command works with a non-admin username. Also, "sudo" and "with admin privileges" are redundant. Since embedding an admin username and password in a script is a security risk, perhaps the best approach is to omit the username and let the system ask for an admin username and password when you run the script. That would shorten that line of code to:
do shell script "renice -15 -p " & iTunesPID with administrator privileges

Also, to be sure iTunes launches before you execute the next line of code, you could insert the following code between the 1st & 2nd lines of your script:
repeat 8 times
if application "iTunes" is running then
exit repeat
else
delay 1
end if
end repeat

__________________

Mac Mini > Metric Halo LIO-8 > Parasound JC-1 > Thiel 3.7

 
pj's picture
  Joined: .:. .:. Comments:

Bob,

Thanks, I had meant to remove the "sudo" from the posted version. I'd done so on my working copy here.

I wrote the script for a use on a headless mac mini with a single admin account. I have iTunes set to start up at login - login is set to automatic - and want to start iTunes reniced without human intervention. That is what the script does :) You are welcome to modify as you see fit.

I haven't seen any issues with start up on either my mid '09 MBP or core solo mini. If you are concerned by all means add the delay, but I suspect it won't be needed.

regards
Paul

 
Dynobot's picture
  Joined: .:. .:. Comments:

Thanks Paul and Bob.

I assume you can put a line in the script to renice 'coreaudio' as well? Or does it automatically happen?

Also, another assumption....I could replace iTunes with any program in the script say Amarra for example?

 
Christopher's picture
  Joined: .:. .:. Comments:

If my understanding is correct, the “sudo renice” terminal command can be used to increase the priority of a process being performed in Mac OS X. I’m running Mac OS X version 10.5.8.

If we perform this terminal command, processes with lower "nice" values will be given higher priority. Since lower nice values translate into higher priority, the process should, theoretically, receive a greater share of the computer’s processor time. Conversely, processes with higher nice values will receive lower priority, and this should result in less processor time.

In terms of scale, my understanding is that nice values range from -20 to +19. Therefore, since -20 is the lowest possible nice value, processes with a -20 nice value should have absolute priority and receive the most processor time.

That being said, here are my questions:

1. Assuming we are only running iTunes and the processor is not taxed or over-burdened with multiple demanding applications, why is it necessary to override the logic of Mac OS X? If there is plenty of processor headroom, will iTunes and Coreaudio benefit from a lower nice value? Assuming there is plenty of available processor time to properly run all applications, why should the order or schedule make a difference?

2. Assuming there are audible benefits, why should both iTunes and Coreaudio be assigned the same nice value? If -20 is the lowest possible value, will iTunes and Coreaudio be in constant competition for the most processor time? In an effort to reduce competition, is it better to assign a value of -20 to Coreaudio and -19 to iTunes?

3. I have seen at least two variations of sudo nice terminal commands. Does anyone know if there are any differences between the following?
sudo renice -20 pid
sudo renice -20 -p pid
The second version includes “-p” before the pid. Does this make a difference and, if so, why?

Thank you very much in advance.

Best regards,
Chris

__________________

iMac 2.66GHz 4GB → Amarra Mini & iTunes / Pure Music → Ayre QB-9 → Ayre K-5xeMP → Rotel RB-1080 → Tyler Acoustics Linbrook Super Towers → SVS SB12-Plus | Glyph GT 062E 3TB, Kimber USB, Nordost SPM Reference, Transparent IC, LessLoss DFPC Original, PS Audio Quintet, Furman Elite-15i

 
indirstr8s's picture
  Joined: .:. .:. Comments:

Bunch of loaded questions....

__________________

Macbook pro 15" 2.53ghz core 2 duo with Amarra, 1 TB storage, 6 GB memory -> USB locus-design nucleus cable -> EA overdrive DAC -> -> modded parasound JC1 monoblocks -> cadence ARCA loudspeakers + REL studio III

 
pj's picture
  Joined: .:. .:. Comments:

Dynobot

I've modded the plist that controls coreaudiod to start it with "nice -20". It would be just as easy to duplicate the line for iTunes and change the iTunesPID to coreaudioPID. You would also need to change the grep search term to coreaudiod.

Chris,

I think the idea is that there a number of background tasks that run without user intervention. If you are using screen sharing to admin a headless computer there are a number of process running to support that. The window server which renders the display is always running. Pop open a terminal and run ps -ev and you'll get a list of running processes. Increasing the priority of coreaudio and itunes ensures that these tasks are given priority to resources.

I'd suggest that coreaudio and itunes share equally in the task of delivering audio and neither should be have higher priority than the other. I don't think this is a case of "fighting" more that the task scheduler assigns equal processor time to competing tasks.

-p indicates that the following argument is the PID of the process you wish to renice. Both forms work on OSX but using -p make it clear that your are specifying a PID rather than a GID or an increment. Perhaps "sudo renice -n -20 -p PID" is the clearest form to use.

cheers
Paul

 
Christopher's picture
  Joined: .:. .:. Comments:

Hi Paul,

Thank you for taking the time to respond. I appreciate your feedback and you seem to be very knowledgeable about OSX command language.

As you pointed out, a number of system processes run at all times. Using Activity Monitor, I count 51 processes that automatically start and run in the background after performing a system re-start. After re-start, CPU usage is about 97% idle (this fluctuates to a certain degree). This implies that background tasks account for approximately 3% of CPU usage with my system.

When I launch iTunes, CPU usage increases and idle percentages dip to about 80%. Shortly thereafter, idle percentages return to about 95%.

When I play a 123MB 24/96 AIFF audio file with iTunes, CPU usage spikes for a moment and idle percentages dip to about 64%. After the song plays for a few moments, idle percentages quickly increase and they generally fluctuate between 80% and 95%.

My iMac system has the following specs:
2.66GHz Intel Core 2 Duo
4GB memory
700GB internal hard drive (no material storage)
Glyph 2TB external hard drive connected via FW800 (exclusive iTunes Library)
Benchmark DAC1 Pre connected via USB

Since CPU usage fluctuates dramatically in some cases, it may indeed help to instruct the task scheduler to prioritize processor time to iTunes and Coreaudio. In my case, it seems that priority will help the most when initializing a hi-rez audio track.

I’m currently experimenting with your suggested command language for both iTunes and coreaudiod. My listening tests include nice values that range from -5 to -20. While I do not have conclusive feedback at the moment, I consider this approach worth exploring.

On a side note, I sincerely hope that my questions didn’t appear confrontational or “loaded” in a negative way (respectful nod to indirstr8s). I can appreciate how easy it is to take a long list of questions the wrong way. For the record, I’m open to, and interested in, all possible approaches that may improve or enhance our computer audio experience. CA has been a fantastic resource and I value the many contributions herein.

Cheers,
Chris

__________________

iMac 2.66GHz 4GB → Amarra Mini & iTunes / Pure Music → Ayre QB-9 → Ayre K-5xeMP → Rotel RB-1080 → Tyler Acoustics Linbrook Super Towers → SVS SB12-Plus | Glyph GT 062E 3TB, Kimber USB, Nordost SPM Reference, Transparent IC, LessLoss DFPC Original, PS Audio Quintet, Furman Elite-15i

 
CG's picture
  Joined: .:. .:. Comments:

If you don't want to modify your CoreAudio property list, there's a couple alternatives.

One is to include a renice command in an AppleScript application that also launches your media player. As suggested previously, something like this:

do shell script ("renice -20 -u _coreaudiod") user name "YourName" password "YourPassword" with administrator privileges

If you save this as a Run Only Application in the AppleScript Editor, your personal settings are pretty secure. But, as was mentioned previously, you can eliminate the 'user name "YourName" password "YourPassword"' part and you will be promoted to enter your password.

This one line short program can be saved as an Application, moved to some folder like Utilities or wherever you keep these things, and then you can add it to the Login Items list for your account in System Preferences. That will give CoreAudio maximum priority whenever you start your computer.

You also don't need to use a GREP search to determine a process ID. Something like this will work:

tell application "System Events" to set unixID to unix id of process "Play"
do shell script ("renice -20 " & unixID) with administrator privileges

There's also a *free* utility that will allow you to set process priority on the fly and also see what priority your existing processes are set to.

http://www.lachoseinteractive.net/en/products/processwizard/

Heed their words about terminating processes you don't know anything about!

 
CG's picture
  Joined: .:. .:. Comments:

While this

do shell script ("renice -20 -u _coreaudiod") user name "YourName" password "YourPassword" with administrator privileges

worked just perfectly under Snow Leopard, I tried it on a Leopard based machine and it failed. The error was something like, "Didn't recognize the UID of _coreaudiod"

Any ideas??

 
pj's picture
  Joined: .:. .:. Comments:

It looks like coreaudiod runs under a UID of the root user and there is no user _coreaudiod under 10.5. So renicing coreaudiod needs to be done by PID under 10.5 and 10.4. The easy solution for something that works on 10.4,10.5,10.6 is to use grep to grab the PID.

I'd also note the saving the script as a run only app is only marginally more secure the leaving the password in textfile. You can open the app by right clicking and selecting show package contents. You can then open the script in Applescript Editor with no problems. Best keep the app in a location that is accessible to the logged in admin user ie Documents.

cheers
Paul

 
CG's picture
  Joined: .:. .:. Comments:

Using grep is not necessary for learning the Unix ID of an application like iTunes. As I said previously. Sorry if that confused you.

If you save an AppleScript as a *Run Only* Application, then you shouldn't be able to open it with AppleScript Editor. As I said previously. Sorry if that confused you.

I just tried opening the package contents for a Run Only AppleScript Application, and got the message that I couldn't. If you can open it with AppleScript Editor, you're a far better man than I am.

This is not fun.

 
Christopher's picture
  Joined: .:. .:. Comments:

After experimenting with ‘sudo renice’ commands, I’m experiencing system delays. When rebooting, desktop icons do not appear and there is a spinning pinwheel while the desktop attempts to load. Also, certain programs, like Word, take much longer to load and the same spinning pinwheel appears. Tasks that were fast and close to instantaneous before, now take 20 to 30 seconds to process.

More background and questions...

As expected, the PID for iTunes and coreaudiod change after each system re-start. I’m assuming that this is why we have to renice again after rebooting. However, what happens to the old PIDs that were previously reniced...have they been reset after re-starting, or are their nice values still -20?

For example, the PID for iTunes was 145. After rebooting, the PID (for iTunes) changed to 370. PID 145 no longer appears in Activity Monitor and I’m assuming this is the case because the PID has not been assigned to a given process.

If we renice a PID with a value of -20, then re-start, will unassigned Process ID still have a nice value of -20? If so, could the system get bogged down looking for high priority PIDs that have not been assigned to a process? Since I have been experimenting a fair amount with sudo renice commands for both iTunes and Coreaudio, there may be a lot of PIDs with values of -20 that do not appear in Activity Monitor.

Is there a way to undo all of the renice commands that I have performed? I would like to check if system performance returns to previous levels.

Also, has anyone else had a similar experience?

Thank you in advance for your help.

Best regards,
Chris

__________________

iMac 2.66GHz 4GB → Amarra Mini & iTunes / Pure Music → Ayre QB-9 → Ayre K-5xeMP → Rotel RB-1080 → Tyler Acoustics Linbrook Super Towers → SVS SB12-Plus | Glyph GT 062E 3TB, Kimber USB, Nordost SPM Reference, Transparent IC, LessLoss DFPC Original, PS Audio Quintet, Furman Elite-15i

 
umea101's picture
  Joined: .:. .:. Comments:

Hi!

I can imagine that things become slower once you assigned priority to the audio programs, although I did not notice any difference on a dual core iMac. Anyway this should be gone on reboot. As you have noticed new PIDs are assigned and the previous nice value forgotten.

Seems like the problem is elsewhere. I would check the activity monitor what is eating the processor time.

 
pj's picture
  Joined: .:. .:. Comments:

If you renice or nice a PID the change lasts only until you reboot. After reboot all task will be at default priority until you invoke nice/renice.

To revert renice you should be able to renice -n 0 -p PID. This simply renices the process to the default priority of 0.

You'll have a better idea of what is running and what priority each task is assigned if you use ps -el rather than top. You'll probably need to expand the width of your terminal window to see all the detail, but you'll get processes sorted by PID and the NI column displays current priority.

Unless you have reniced/niced a process prior to login, by altering the plist for example, there should not be any effect on rendering of desktop or application start up. If you are renicing iTunes and Coreaudio and playing music when you start Apps that will definitely impact Word startup times.

To be honest I wouldn't recommend renicing processes to -20 on a machine that is not a dedicated music server.

 
ericuco's picture
  Joined: .:. .:. Comments:

Based on the various comments/suggestions, here is what I came up with.

****

tell application "Amarra Mini" to activate
repeat 8 times
if application "Amarra Mini" is running then
exit repeat
else
delay 1
end if
end repeat
set iTunesPID to do shell script "ps -axww | grep '[/]iTunes '| awk '{print $1}'"
do shell script "sudo renice -18 -p " & iTunesPID user name "UserName" password "UserPassword" with administrator privileges
set AmarraPID to do shell script "ps -axww | grep '[/]Amarra Mini '| awk '{print $1}'"
do shell script "sudo renice -19 -p " & AmarraPID user name "UserName" password "UserPassword" with administrator privileges
do shell script "renice -20 -u _coreaudiod" with administrator privileges

***

Note: change "UserName" & "UserPassword" as appropriate.

This starts up Amarra Mini which also starts iTunes.

I used various renice values for each process (Core Audio, Amarra Mini, iTunes). No logic behind this other than not wanting to set them to all the same value. I did check with "ps -el" and the renice commands do work properly.

I saved this as an application and placed it on the Dock so I use this to launch Amarra Mini which in turn launches iTunes. Seems to work as advertised on MacBook Pro running Snow Leopard.

I am a programming hack, not a real programmer, so if a real programmer has suggestions, please provide input.

Eric
www.beresford-dac.com

__________________

Eric
www.beresford-dac.com

Macbook Pro (13") > Weiss DAC2 (firewire) > Conrad-Johnson PV-15 > Conrad-Johnson MF-2250A > ATC SCM12

 
Ridge Street Audio Designs's picture
  Joined: .:. .:. Comments:

I'm having trouble getting this to work. Is all this still applicable since I'm using Snow leopard? Or is this only applicable for older OS?

Thanks!
Robert
RSAD

__________________

Robert
Ridge Street Audio Designs

"The reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends upon the unreasonable man."
George Bernard Shaw

 
pj's picture
  Joined: .:. .:. Comments:

This does work under SL.

Based on some research and posts to another thread I'd recommend against renicing coreaudiod. It appears that coreaudiod manages system sounds and alerts. Disabling coreaudiod has no effect on iTunes playing to the default output but built-in output is no longer available as an output for system sounds. This indicates there will be zero benefit from changing priority on coreaudiod.

Cheers
Paul

 
Ridge Street Audio Designs's picture
  Joined: .:. .:. Comments:

Thank You Paul!

Kindly,
Robert
RSAD

__________________

Robert
Ridge Street Audio Designs

"The reasonable man adapts himself to the world. The unreasonable man persists in trying to adapt the world to himself. Therefore, all progress depends upon the unreasonable man."
George Bernard Shaw

 
umea101's picture
  Joined: .:. .:. Comments:

My Leopard System stops playing music when I kill coraudiod and only resumes once coreaudiod is (automatically) restarted with a new PID.

 
pj's picture
  Joined: .:. .:. Comments:

Using unix "kill" or any other brute force means of terminating coreaudiod is likely to give the results you have experienced. The fact that coreaudiod is relaunching indicates that the system expects coreaudiod to be running. The best way to disable coreaudiod is using launchctl as described at the end of this post.

cheers
Paul

 
cfmsp's picture
  Joined: .:. .:. Comments:

CG said, a couple of weeks ago:

"Ask your software author to offer this option."

Jon Reichbach has sent me an apple script that can be initiated at Login to automatically start Amarra with high priority.

As far as I know, this has not been offered on the Amarra site, and therefore is not an official Amarra release - read, not supported by Jon.

Jon gave me permission to release it 'into the wild' (my words, not his) if I heard an improvement. Since I did hear such, much to my surprise, I am sharing it here with all interested.

Those without Apple Script experience may be able to simply paste this into Apple Script and modify this to his/her heart's content.

enjoy,
clay

PS, I was unable to attach the Script itself as CA only allows certain types of attachments.

EDIT:
First 10 to do so can download the Script here:
http://rapidshare.com/files/332757319/LaunchAmarra.scpt.html

I can post an Amarra Mini Script, if anyone wants it.

AttachmentSize
Run Amarra.doc 27 KB
 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.