App freezes only on release build

Home Forums OpenEars App freezes only on release build

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

  • Author
    Posts
  • #1019107
    gbay2
    Participant

    Hey, in my app I set up everything upon loading and then when the user presses and holds a button I start recognition with this

    [pocketsphinxController
    startListeningWithLanguageModelAtPath:lmPath
    dictionaryAtPath:dicPath
    acousticModelAtPath:[AcousticModel pathToModel:@”AcousticModelEnglish”] // Change “AcousticModelEnglish” to “AcousticModelSpanish” to perform Spanish recognition instead of English.
    languageModelIsJSGF:NO
    ];

    and once the speech is processed I stop recognition with

    [pocketsphinxController suspendRecognition];
    [pocketsphinxController stopListening];

    When building my app through Xcode it never seems to crash but when I archive and install the ipa, the app seems to hang right I call startListeningWithLanguageModel several times

    Here’s a copy of my log

    http://pastebin.com/MNxJSjsD

    #1019108
    Halle Winkler
    Politepix

    Welcome,

    Not sure why this would happen in release only, but this is unusual:

    the app seems to hang right I call startListeningWithLanguageModel several times

    It’s unlikely to be necessary to call startListeningWithLanguageModel many times. The usual app design would have it called once and to control whether recognition is being performed with suspend and resume rather than startListening and stopListening. Is there an app requirement that leads to calling it repeatedly?

    #1019109
    gbay2
    Participant

    Thanks for replying so quickly!

    The app is an alarm clock so I’m trying to conserve battery power as the user can keep the app open in the foreground, lock the phone overnight and have their alarms go off regardless of volume settings (a standard procedure in iOS alarm apps).

    Would using suspend have any effect on my battery life?

    #1019110
    gbay2
    Participant

    I’m trying to use suspend and resume but get the following infinitely looped.

    We use our own audio session, could that be causing the problem?

    2013-12-07 15:10:22.878 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext

    log:

    2013-12-07 15:10:16.184 TinyHeartsClock[23415:d20f] Listening.
    2013-12-07 15:10:16.185 TinyHeartsClock[23415:60b] -[SpeechToTextListener pocketsphinxDidStartListening] [Line 110] Pocketsphinx is now listening.
    2013-12-07 15:10:16.984 TinyHeartsClock[23415:d20f] Speech detected…
    2013-12-07 15:10:16.985 TinyHeartsClock[23415:60b] -[SpeechToTextListener pocketsphinxDidDetectSpeech] [Line 116] Pocketsphinx has detected speech.
    2013-12-07 15:10:20.033 TinyHeartsClock[23415:d20f] Stopping audio unit.
    2013-12-07 15:10:20.035 TinyHeartsClock[23415:60b] -[SpeechToTextListener pocketsphinxDidDetectFinishedSpeech] [Line 121] Pocketsphinx has detected a period of silence, concluding an utterance.
    2013-12-07 15:10:20.162 TinyHeartsClock[23415:d20f] Audio Output Unit stopped, cleaning up variable states.
    2013-12-07 15:10:20.164 TinyHeartsClock[23415:d20f] Processing speech, please wait…
    2013-12-07 15:10:20.443 TinyHeartsClock[23415:d20f] Pocketsphinx heard “7” with a score of (-9177) and an utterance ID of 000000000.
    2013-12-07 15:10:20.445 TinyHeartsClock[23415:d20f] Checking and resetting all audio session settings.
    2013-12-07 15:10:20.447 TinyHeartsClock[23415:60b] -[SpeechToTextListener pocketsphinxDidReceiveHypothesis:recognitionScore:utteranceID:] [Line 92] poocketsphinx did receive hypothesis 7
    2013-12-07 15:10:20.449 TinyHeartsClock[23415:d20f] audioCategory is correct, we will leave it as it is.
    2013-12-07 15:10:20.450 TinyHeartsClock[23415:60b] -[SpeechRecognizerViewController speechToTextListenerDelegateDidFinishReceivingSpeech:speechToTextListener:] [Line 192] received speech 7
    2013-12-07 15:10:20.456 TinyHeartsClock[23415:60b] -[SpeechRecognizerViewController disableListener] [Line 238] disable listener
    2013-12-07 15:10:20.453 TinyHeartsClock[23415:d20f] bluetoothInput is correct, we will leave it as it is.
    2013-12-07 15:10:20.457 TinyHeartsClock[23415:60b] -[SpeechToTextListener stopListening] [Line 175] stop listening
    2013-12-07 15:10:20.460 TinyHeartsClock[23415:60b] -[SpeechToTextListener stopListening] [Line 177] stop listening 2
    2013-12-07 15:10:20.463 TinyHeartsClock[23415:60b] -[NSString(GRStringAdditions) stringAfterString:] [Line 44] remaining speech
    2013-12-07 15:10:20.460 TinyHeartsClock[23415:d20f] Output Device: SpeakerAndMicrophone.
    2013-12-07 15:10:20.467 TinyHeartsClock[23415:d20f] categoryDefaultToSpeaker is correct, we will leave it as it is.
    2013-12-07 15:10:20.474 TinyHeartsClock[23415:d20f] OverrideCategoryMixWithOthers is correct, we will leave it as it is.
    2013-12-07 15:10:20.477 TinyHeartsClock[23415:d20f] preferredBufferSize is correct, we will leave it as it is.
    2013-12-07 15:10:20.479 TinyHeartsClock[23415:d20f] preferredSampleRateCheck is correct, we will leave it as it is.
    2013-12-07 15:10:20.482 TinyHeartsClock[23415:d20f] Setting the variables for the device and starting it.
    2013-12-07 15:10:20.485 TinyHeartsClock[23415:d20f] Looping through ringbuffer sections and pre-allocating them.
    2013-12-07 15:10:20:490 TinyHeartsClock[23415:1547] TestFlight: Checkpoint Passed – VOICE_SUCCESS
    2013-12-07 15:10:20.511 TinyHeartsClock[23415:d20f] Started audio output unit.
    2013-12-07 15:10:20.608 TinyHeartsClock[23415:60b] -[SpeechToTextListener pocketsphinxDidSuspendRecognition] [Line 131] Pocketsphinx has suspended recognition.
    2013-12-07 15:10:21.462 TinyHeartsClock[23415:60b] -[SpeechRecognizerViewController reconfigureAudioForPlayingSounds] [Line 245] reconfig listener1
    2013-12-07 15:10:22.042 TinyHeartsClock[23415:60b] -[SpeechRecognizerViewController reconfigureAudioForPlayingSounds] [Line 251] reconfig listener2
    2013-12-07 15:10:22.131 TinyHeartsClock[23415:60b] -[SpeechRecognizerViewController reconfigureAudioForPlayingSounds] [Line 253] reconfig listener3
    2013-12-07 15:10:22.133 TinyHeartsClock[23415:60b] -[SpeechRecognizerViewController reconfigureAudioForPlayingSounds] [Line 255] reconfig listener4
    2013-12-07 15:10:22.134 TinyHeartsClock[23415:9103] Audio route has changed for the following reason:
    2013-12-07 15:10:22.135 TinyHeartsClock[23415:9103] There has been a change of category
    2013-12-07 15:10:22.140 TinyHeartsClock[23415:9103] The previous audio route was SpeakerAndMicrophone
    2013-12-07 15:10:22.140 TinyHeartsClock[23415:9103] This is not a case in which OpenEars performs a route change voluntarily. At the close of this function, the audio route is Speaker
    2013-12-07 15:10:22.419 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.599 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.623 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.646 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.669 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.692 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.716 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.739 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.762 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.785 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.809 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.832 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.855 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.878 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.901 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext
    2013-12-07 15:10:22.925 TinyHeartsClock[23415:7033] Audio Unit render error: kAudioUnitErr_CannotDoInCurrentContext

    #1019111
    Halle Winkler
    Politepix

    Yup, you can’t override the audio session if you use PocketsphinxController. You can try setting the property audioSessionMixing to TRUE in order to use media objects that attempt to use other session settings for better coexistence, but ultimately PocketsphinxController must be allowed to use its own audio session settings when it’s in progress or it won’t be able to render the mic stream.

    Check out whether the audio session issue is the cause of the issue you’re seeing, and if not we can troubleshoot it further. I don’t think there is any reason that performing a correct shutdown and restart of the listening loop should cause any issues in debug or release mode if you prefer to do that so that the loop is off when the phone is locked, as long as you’re sure that it isn’t getting started multiple times. The loop uses very little CPU when no speech is in progress (like 2% on newer devices), but if it is still running when the phone is locked through a night of sleep that’s probably not ideal for the battery.

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