I'm trying to run an AVCaptureSession in a view controller, but within the same, I'm also calling a function from a library that uses AVAudioSession. I can't seem to get much info out of the debugger, other than it crashes exactly when I call this particular library's function. The library is libpd:
https://github.com/libpd
and it calls AVAudioSession as sharedInstance. I call libpd as:
[self.audioController configurePlaybackWithSampleRate:44100 numberChannels:2 inputEnabled:YES mixingEnabled:YES]
so mixing is enabled, but just in case, I've recompiled it so that when it inits, I do:
UInt32 doSetProperty = 1;
AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof(doSetProperty), &doSetProperty);
but, no luck. Moving the calls to libpd to viewWillAppear within the view controller didn't work either. However, if I take the code that calls libpd out of my viewcontroller, and put it in the app delegate within didFinishLaunchingWithOptions, it then starts just fine, and the two sessions seem to co-exist without crashing.
Am I missing something about AVCaptureSession and mixing? How do I go about both sessions co-existing? I'm not using AVCapture to capture audio, only camera input, so shouldn't I be able to somehow have both going on?