IOThread exiting with error

I'm getting this error on my iOS app, just atfter startup. Not sure how to debug it or where it might be coming from:

ERROR:     [0x3b79000] >aurioc> 1469: AURemoteIO@0x173c8220: IOThread exiting with error 0x10004002

Any ideas?

Think I tracked it down to needing to set the category (strange as I didn't need to do this before..):

    NSError *setCategoryError = nil;
    BOOL success = [[AVAudioSession sharedInstance]
                    setCategory: AVAudioSessionCategoryPlayAndRecord
                    error: &setCategoryError];

    if (!success)
        /* handle the error in setCategoryError */
        DBG ("Error setting category AVAudioSessionCategoryPlayAndRecord");

I also needed to add AVFoundation as a framework. This is on an iPhone 4 running iOS 7.1