We have a crash occurring in our iOS7-based iPhone app, but it seems to be very difficult to reproduce. A handful of our customers are experiencing it, and we are capturing as much info as possible from Crashlytics. I've attached a screenshot of the stack trace here, which unfortunately is (seemingly) not very helpful, since it's completely confined within the AudioToolbox AV classes:
We also have breadcrumbs in place, which indicate it definitely occurs after the user taps the "Record" button in our app (although I'm not sure if the crash occurs immediately or after a duration of recording).
With regards to the the 'recording' code, the app is really not doing anything special or custom/unique. Here is the setup of our property accessors for our recorder and settings (if needed to know, the sample rate is 8000.0, and the number of channels is 1):
- (AVAudioRecorder *)recorder {
if (!_recorder) {
NSError *error = nil;
_recorder = [[AVAudioRecorder alloc] initWithURL:_tmpRecordingUrl settings:self.audioSettings error:&error];
_recorder.meteringEnabled = YES;
_recorder.delegate = self;
[_recorder prepareToRecord];
if (error) {
DLog(@"Could not create audio recorder: %@", error);
return nil;
}
}
return _recorder;
}
- (NSDictionary *)audioSettings {
if (!_audioSettings) {
_audioSettings = @{
AVFormatIDKey: @(kAudioFormatLinearPCM),
AVSampleRateKey: @(kSampleRate),
AVNumberOfChannelsKey: @kNumberOfChannels,
AVLinearPCMBitDepthKey: @16,
AVLinearPCMIsBigEndianKey: @NO,
AVLinearPCMIsFloatKey: @NO,
AVEncoderAudioQualityKey: @(AVAudioQualityMedium)
};
}
return _audioSettings;
}
Then to record, we simply call the [self.recorder record]
method, and when it's done, it takes the tmpRecodingUrl and moves it to a permanent spot (although it never gets to that point in this case). There are some other things that happen when recording is kicked off, such as some UI overlays and class-level boolean settings/tracking timers, but it's all outside of the AudioToolbox, so I'm not convinced any of that is causing the issue.
I know this isn't too much to go off of, but has anyone experienced this similar type of crash? Any direction would be very helpful, thank you!