Issue with AudioSession interruptions

Home Forums OpenEars Issue with AudioSession interruptions

Viewing 7 posts - 1 through 7 (of 7 total)

  • Author
    Posts
  • #1024624
    cocoapriest
    Participant

    I have a problem with call interruptions while OEPocketsphinxController is listening. What I get is:
    [AVAudioSession Notify Thread] AVAudioSessionPortImpl.mm:52: ValidateRequiredFields: Unknown selected data source for Port iPhone Microphone (type: MicrophoneBuiltIn)

    Even if I stop listening in the audioSessionInterruptionDidBegin, I still get this error. But the main problem is that I can’t re-start listening after audioSessionInterruptionDidEnd:

    2015-01-29 15:16:29.729 b[1263:564436] re-starting speech engine
    
    2015-01-29 15:16:29.918 b[1263:564740] Error: couldn't set session active.: '!pri'
    2015-01-29 15:16:30.690 b[1263:564436] Local callback:  AudioSession interruption ended.
    
    2015-01-29 15:16:30.924 b[1263:564436] A request has been made to start a listening session using startListeningWithLanguageModelAtPath:dictionaryAtPath:acousticModelAtPath:languageModelIsJSGF:, however, there is already a listening session in progress which has not been stopped. Please stop this listening session first with [[OEPocketsphinxController sharedInstance] stopListening]; and wait to receive the OEEventsObserver callback pocketsphinxDidStopListening before starting a new session. You can still change models in the existing session by using OEPocketsphinxController's method changeLanguageModelToFile:withDictionary:

    Any ideas?

    #1024625
    Halle Winkler
    Politepix

    Hi,

    I don’t think that error originates from/due to OpenEars’ audio session management since it doesn’t do anything slightly out of the ordinary with ports or invoke any kind of port validation (?) – it is more likely to be due to something else related to your app architecture. If you are very sure that it is a bug in OpenEars and not due to something else about the app, you can create a replication case using the sample app:

    https://www.politepix.com/forums/topic/how-to-create-a-minimal-case-for-replication/

    #1024626
    cocoapriest
    Participant

    Hi,

    I just ran the SimpleApp untouched and got the same error:

    2015-01-29 16:24:16.763 OpenEarsSampleApp[1299:580806] Local callback: Pocketsphinx has stopped listening.
    2015-01-29 16:24:20.466 OpenEarsSampleApp[1299:580849] 16:24:20.466 ERROR:     [AVAudioSession Notify Thread] AVAudioSessionPortImpl.mm:52: ValidateRequiredFields: Unknown selected data source for Port iPhone Microphone (type: MicrophoneBuiltIn)
    2015-01-29 16:24:28.964 OpenEarsSampleApp[1299:580806] Local callback:  AudioSession interruption ended.
    2015-01-29 16:24:30.519 OpenEarsSampleApp[1299:580806] Local callback: Pocketsphinx is now listening.
    

    The only difference is that the sample app could re-start listening.

    Device: iPhone 5 (Model A1429)
    iOS: 8.1.3 (12B466)

    #1024627
    Halle Winkler
    Politepix

    OK, that demonstrates that the error isn’t an obstruction to being able to stop and start in response to an interruption, so you can compare your app and the sample app to see what the difference in the interruption handling is.

    #1024628
    cocoapriest
    Participant

    yeah, but the error itself doesn’t sound good, right?

    #1024629
    Halle Winkler
    Politepix

    No, it sounds like overlogging from deep within the AVAudioSession implementation, even down to referencing a line number inside of a C++ implementation file whose corresponding interface is private. If everything works as defined from OpenEars’ API it would be questionable to troubleshoot an implementation detail we have no access to or documentation about, for qualities (port validation) we’ve never heard of.

    #1024663
    benwirz
    Participant

    Try stopping you avaudio instances in the pocketsphinxDidStopListening call back. This solved a similar issue for me. -Ben

    – (void) pocketsphinxDidStopListening
    {
    // stop the audio sessions here after pocketspinx has already stopped
    if (_speechSynthesizer &&
    _speechSynthesizer.speaking)
    [_speechSynthesizer stopSpeakingAtBoundary: AVSpeechBoundaryImmediate];
    if (_audioPlayerVoiceControlStart &&
    _audioPlayerVoiceControlStart.playing)
    [_audioPlayerVoiceControlStart stop];

    NSLog(@”Pocketsphinx has stopped.”);
    }

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.