Read this: Audio thread dos and don'ts
Always good to get a refresher on the fundamentals. This article is my bible.
Ross Bencina: Real-time audio programming 101: time waits for nothing
"...allocates memory and blocks in fun and unexpected ways. You absolutely cannot be making these calls from inside your IOProc. You also cannot be making calls to any ObjC or CF objects from inside your IOProc. Doing any of these will eventually cause glitching" -- Jeff Moore, Core Audio team