Sluggish iChat, Messages, Terminal, and Others in Mac OS X Lion

After about 60 days using my MacBook Pro running Mac OS X Lion (10.7.3), I saw some sluggishness in some apps. At first, it was Messages (iChat replacement for Mountain Lion). It went unresponsive and displays the rainbow wheel for a few seconds, enough to annoy an impatient user.

Then, the same behavior happened in Terminal. This is where I realize the common behavior. You know, when you press delete on an empty prompt, you get a bell. The default is the audible bell. When I change it to the visual bell, sluggishness disappeared.

On Messages, I had the default sound effect setting when messages are received or sent.

Boy was I right. In the log /var/log/system.log there were a bunch of these:

May  3 22:30:57 ADYMAC iChat[66352]: [Warning] Actions: Couldn't create SystemSound from /Applications/iChat.app/Contents/Resources/Received Message.aiff
May  3 22:31:07 ADYMAC iChat[66352]: [Warning] Unable to find a sound action ID for /Applications/iChat.app/Contents/Resources/Received Message.aiff  errorResult: 268435460
May  3 22:31:07 ADYMAC iChat[66352]: [Warning] Actions: Couldn't create SystemSound from /Applications/iChat.app/Contents/Resources/Received Message.aiff
May  3 22:31:17 ADYMAC iChat[66352]: [Warning] Unable to find a sound action ID for /Applications/iChat.app/Contents/Resources/Received Message.aiff  errorResult: 268435460

These are when I tried to change the system bell using the System Preferences application.

May 11 01:45:55 adymac System Preferences[44495]: Error 268435460 setting AlertSound
May 11 01:53:22 adymac System Preferences[44678]: Error 268435460 setting AlertSound
May 11 01:58:20 adymac System Preferences[44678]: Error 268435460 setting AlertSound
May 11 01:58:25 adymac System Preferences[44678]: Error 268435460 setting AlertSound

And so I tried a lot of things, including logging out then in, inspecting the file permissions, and also ran the verify permission utility on the hard disk using Disk Utility. Nothing worked.

Finally, I saw that there was one process called coreaudiod

_coreaudiod    45197   0.0  0.1  2453172   5228   ??  Ss   Fri02AM   0:10.52 /usr/sbin/coreaudiod

And so I tried killing it:

$ sudo killall coreaudiod

And as expected, it respawned itself and all audio effects were now working. Sluggishness and the dreaded rainbow wheel are gone.

Googling after, I saw that people mentioned that this may be a bug, and killing coreaudiod is only a workaround not the solution.

Come to think of it, it also caused unnecessary delay when making screen shots using the Command-Shift-4 key combination.

I hope this can save you some time.

Mac Messages Beta

Apple has just released the developer preview for OS X Mountain Lion yesterday and at the same time released the beta version of Messages, an upgrade of iChat. Here is the link to download Messages.

Installation is straight forward but you will be warned that the machine will need to be restarted. After installation, the spanking new icon will appear in the dock. The rightmost icon in the screenshot, not the middle one.

After installation (and configuration with your iCloud account), the familiar iChat UI will appear. Alongside with a new “iPad inspired” message list. Messages will continue to work with the existing accounts, just with additional features. As you can see in my screenshot my Google Talk (Jabber) account works fine.

I really wanted to know whether old messages from the iPhone will be imported. They were not. Which is no big deal. I’m not sure whether some background sync will happen while I use it. I’ll update if it does that.

I sent a test message to a buddy, Nazham:

At the same moment, my message and his reply appeared in both Messages for Mac and the iPhone. This is what Apple meant by “Start an iMessage conversation on your Mac and continue it on your iPad, iPhone, or iPod touch.”.

I love it.

Knowing Apple, Mountain Lion might be the only OS X I can upgrade my 2010 MacBook Pro with and I hope the price will be more or less like Lion.

Until next time, happy computing.