Wednesday, June 17, 2009

OpenAL in the iPhone Simulator

As somebody without an iPhone, I knew off the bat that there would be a barrier to developing iPhone apps. Fortunately, the SDK and simulator are free, so I figured I had a pretty good shot at getting started and, when it became necessary, I could invest in some hardware. It turns out that day was much closer than I thought.

In the app that The Gents have started to write, we knew we would want to use OpenAL. Apple has an OpenAL sample app that you can download and try. When I tried running it in the simulator, though, I got nothing. No audio. No app. It got as far as displaying default.png before giving up the ghost and crashing back to the home screen. I was left with some cryptic messages in the run log:

AQMEIOBase::DoStartIO: timeout
AQMEDevice::StartIO: AudioOutputUnitStart returned -66681
AUIOClient_StartIO failed (-66681)

Interestingly enough, the other two bearded ones had no problems with the simulator at all.

After much Googling, I was left with speculation but no real information. Some people believed that it was a bug that Apple was fixing. Others just asserted that sound doesn't work reliably in the simulator and that you need to test on hardware, period. One person had the exact same problem as me. I decided that day to bite the bullet and buy an iPod Touch. I got mine at Sam's club, went back to The Lab, and then remembered that I had to pay my $99 Apple tax to provision it for development. That process was not exactly instantaneous. With my spare time, I decided to refresh my aging Leopard install as well.

Long story short: re-installing from scratch worked. I didn't do an "Archive and Install" - I wiped the disk and restored files from a backup by hand. It was slow, laborious, but it worked. My theory is that some sound software that I had installed long ago did something nasty to my system configuration that never manifested until I stuck the iPhone Simulator on it.

In the end, I didn't need the iPod Touch, though I think I'm glad to have bought it. It gives us another platform to develop for and test on, which is pretty awesome. I can start to see what it's like to be an iPhone user, and I get to complain about Apple's treatment of the iPod touch as a second-class citizen. Everybody wins!

No comments:

Post a Comment