Thursday 22 April 2010

Fixing Apple iTunes sync AppleMobileSync crash

I just updated my Windows Vista machine and after rebooting I tried syncing my iPhone and iTunes 9.1 started complaining that AppleMobileSync.exe (and some Yahoo sync crap) was crashing WTF?!

I looked into it and when I attempted to run AppleMobileSync.exe from its working directory (C:\Program Files\Common Files\Apple\Mobile Device Support\SyncServices\Clients\com.apple.MobileSync) it complained that it couldn't find objc.dll - but a quick search found it here: "C:\Program Files\Common Files\Apple\Apple Application Support", so I added that dir to my path, then it complained that DeviceLink.dll was missing - I found that here: "C:\Program Files\Common Files\Apple\Mobile Device Support" so I added that dir to my path as well - It now worked! But to get it fixed for automatic syncing I had to go into System control panel -> Advanced system settings -> Environment variables - then select the System PATH and add the two above directories to the end of the PATH (separated by ';'). BTW I did try registering the objc.dll using regsvr32 but objc.dll doesn't contain the appropriate entry points for regsvr.

Not sure why it happened and it shouldn't really need path updates but it fixes it for now...

Wednesday 14 April 2010

Finally got my Karmic box working properly!

Ever since I upgraded to Karmic (9.10) my machine has performed like a dog - well as far as keyboard and mouse input went - the mouse would linger and the system would loose my keystrokes. I tried a bunch of things to no avail....

Then I was perusing the web - frustrated by my sluggish machine - I'd read about cpu frequency scaling and wondering if this might be an issue. Well it turned out to be the root of my problem! Though in general I think more modern CPU should operate fine with cpu scaling enabled but these old AMD Opteron CPU's don't seem to be up to it so I've disabled it and the machine behaves a lot better.

To fix it - firstly I installed the cpufrequtils:
sudo aptitude install cpufrequtils
Checked the current state of my machine (You can also do it using any of: cat /proc/cpuinfo, sudo dmidecode -t processor, lshw -C processor):
sudo aptitude install cpufreq-info
 My machine was in 'ondemand' mode - I changed it to 'performance' mode - for each of my two processors:
sudo cpufreq-set -c 0 -g performance
sudo cpufreq-set -c 1 -g performance
This is actually setting the following /sys entries: /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

There a few more things you can do with the cpufreq utils.