Reply To: [Resolved] Small bug when running on iOS 8

Home Forums OpenEars [Resolved] Small bug when running on iOS 8 Reply To: [Resolved] Small bug when running on iOS 8

Halle Winkler

OK, well first of all, I’m sorry you’re seeing this issue and I appreciate your willingness to dig into it. I’m a bit torn here because both the ancient-code AudioSessionManager and cont_ad_calib are both 100% gone in the under-testing OpenEars 2.0 due to its new VAD/lack of calibration requirements/complete code modernization, so any serious work on this is a) going in the trash in the near term and b) adding up tasks before it is possible to ship the version that probably doesn’t have this issue. However, it’s going to be a bit before it is ready so I can’t comfortably recommend waiting for the release or possible beta release if this is a serious shipping issue for you. These are the kinds of tricky situations which come up when doing a major upgrade but I think it is going to be worth it with the improvements that are coming. I definitely want to see if I can help you with this and if it’s all right, let’s see if we can keep making progress on it together without my putting it into my current task list for investigation. If that is possible, I appreciate it.

It is possible but maybe a little unlikely that bluetooth just got a lot louder in iOS8. What I think is more likely is that it isn’t working, and a non-audio signal is being passed.

The logic here in getDecibels is specifically filtering out for inf values so someone thought of this or has seen it before.

I have always checked for impossible values as part of the general error checking for bad values but I don’t recall that it was due to a particular symptom that I saw, sorry. Since that code is over four years old (but still chugging along nicely) it is unlikely that a reason for inf values then overlaps with one now, SDK-wise.

The new audio session management code in OpenEars 2.0 current sets up the audio category like this:

NSError *error = nil;
  [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionDefaultToSpeaker error:&error];
if(error) {
NSLog(@"Error setting up audio session category with options: %@", error);

If you use this modern category code rather than this in ContinuousAudioUnit.m:

            UInt32 sessionCategory = kAudioSessionCategory_PlayAndRecord;
            AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &sessionCategory);

Do you see any improvement? You may need to #import AVFoundation/AVFoundation.h.

Thanks Wes,