Reply To: How to deallocate OpenEars singleton (2.0) ?

Home Forums OpenEars How to deallocate OpenEars singleton (2.0) ? Reply To: How to deallocate OpenEars singleton (2.0) ?

#1026697
pizigi
Participant

Thanks for the quick input Halle.
That’s a very good idea, to stop worrying about the headphone route changes and focus only on simple StopListening() calls.
You’re right that all StopListening() calls fail, this will make testing easier and the logs smaller.

I have modified my app to start OpenEars and after it’s fully initialized it waits 3 seconds and then calls StopListening().
I play no audio at all in this test.

Here’s the full log:

[AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-09-03 15:48:17.844 mathcommand[1655:497815] 15:48:17.844 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
2015-09-03 15:48:17.845 mathcommand[1655:497815] 15:48:17.844 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
2015-09-03 15:48:17.852 mathcommand[1655:497815] 
Dumping AVAudioSession settings:
- availableInputs:
- category: AVAudioSessionCategoryAmbient
- categoryOptions: 1
- currentRoute.inputs:
- currentRoute.outputs:
  - portName: Speaker
    - portType: Speaker
    - UID: Speaker
    - portType: Speaker
    - channels:
      - channelName: Speaker
        - owningPortUID: Speaker
        - channelNumber: 1
        - channelLabel: 4294967295
- inputAvailable: 1
- mode: AVAudioSessionModeDefault
- IOBufferDuration: 0.023220
- inputLatency: 0.000000
- inputGain: 1.000000
- inputGainSettable: 0
- maximumInputNumberOfChannels: 0
- maximumOutputNumberOfChannels: 1
- outputNumberOfChannels: 1
- outputVolume: 0.437500
- outputLatency: 0.013356
- otherAudioPlaying: 0
- preferredIOBufferDuration: 0.000000
- preferredInputNumberOfChannels: 0
- preferredOutputNumberOfChannels: 0
- preferredSampleRate: 44100.000000
- recordPermission: 1735552628
- sampleRate: 44100.000000
- secondaryAudioShouldBeSilencedHint: 0
- shouldGroupAccessibilityChildren: 0
2015-09-03 15:48:17.853 mathcommand[1655:497815] [PocketSphinx] Startup
2015-09-03 15:48:17.855 mathcommand[1655:497815] Starting OpenEars logging for OpenEars version 2.041 on 32-bit device (or build): iPhone running iOS version: 8.400000
2015-09-03 15:48:17.856 mathcommand[1655:497815] [PocketSphinx] SetupLanguage: English
[AudioController] Reset Audio System. Buffer size: 1024, numRealVoices: 32, numVirtualVoices: 512, sampleRate: 44100, speakerMode: Stereo
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-09-03 15:48:18.882 mathcommand[1655:497815] [PocketSphinx] Start Recording
2015-09-03 15:48:18.883 mathcommand[1655:498046] Creating shared instance of OEPocketsphinxController
2015-09-03 15:48:18.885 mathcommand[1655:498046] Attempting to start listening session from startListeningWithLanguageModelAtPath:
2015-09-03 15:48:18.886 mathcommand[1655:498046] User gave mic permission for this app.
2015-09-03 15:48:18.887 mathcommand[1655:498046] Valid setSecondsOfSilence value of 0.100000 will be used.
2015-09-03 15:48:18.889 mathcommand[1655:498046] Successfully started listening session from startListeningWithLanguageModelAtPath:
[PocketSphinx] Recognition Setup Completed
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-09-03 15:48:18.890 mathcommand[1655:498079] Starting listening.
2015-09-03 15:48:18.890 mathcommand[1655:498079] about to set up audio session
-> applicationWillResignActive()
2015-09-03 15:48:19.412 mathcommand[1655:498079] Creating audio session with default settings.
2015-09-03 15:48:19.458 mathcommand[1655:497815] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
Dumping AVAudioSession settings:
- availableInputs:
  - portName: MicrophoneBuiltIn
    - portType: iPhone Microphone
    - UID: Built-In Microphone
    - portType: iPhone Microphone
    - channels:
- category: AVAudioSessionCategoryPlayAndRecord
- categoryOptions: 13
- currentRoute.inputs:
  - portName: MicrophoneBuiltIn
    - portType: iPhone Microphone
    - UID: Built-In Microphone
    - portType: iPhone Microphone
    - channels:
      - channelName: iPhone Microphone
        - owningPortUID: Built-In Microphone
        - channelNumber: 1
        - channelLabel: 4294967295
- currentRoute.outputs:
  - portName: Speaker
    - portType: Speaker
    - UID: Speaker
    - portType: Speaker
    - channels:
      - channelName: Speaker
        - owningPortUID: Speaker
        - channelNumber: 1
        - channelLabel: 4294967295
- inputAvailable: 1
- inputDataSource.dataSourceID: 1835216945
- inputDataSource.dataSourceName: Bottom
- inputDataSource.orientation: Bottom
- inputDataSource.location: Lower
- mode: AVAudioSessionModeDefault
- IOBufferDuration: 0.092880
- inputLatency: 0.012494
- inputGain: 0.368421
- inputGainSettable: 1
- maximumInputNumberOfChannels: 1
- maximumOutputNumberOfChannels: 1
- outputNumberOfChannels: 1
- outputVolume: 0.437500
- outputLatency: 0.013515
- otherAudioPlaying: 0
- preferredIOBufferDuration: 0.128000
- preferredInputNumberOfChannels: 0
- preferredOutputNumberOfChannels: 0
- preferredSampleRate: 44100.000000
- recordPermission: 1735552628
- sampleRate: 44100.000000
- secondaryAudioShouldBeSilencedHint: 0
- shouldGroupAccessibilityChildren: 0
2015-09-03 15:48:19.459 mathcommand[1655:498079] done starting audio unit
INFO: cmd_ln.c(703): Parsing command line:
\
	-lm /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp \
	-vad_prespeech 10 \
	-vad_postspeech 10 \
	-vad_threshold 2.500000 \
	-remove_noise yes \
	-remove_silence yes \
	-bestpath yes \
	-lw 6.500000 \
	-dict /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic \
	-hmm /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle 

Current configuration:
[NAME]2015-09-03 15:48:19.465 mathcommand[1655:497815] Audio route has changed for the following reason:
			[DEFLT]		[VALUE]
-agc			none		none
-agcthresh		2.0		2.000000e+00
-allphone				
-allphone_ci		no		no
-alpha			0.97		9.700000e-01
-argfile				
-ascale			20.0		2.000000e+01
-aw			1		1
-backtrace		no		no
-beam			1e-48		1.000000e-48
-bestpath		yes		yes
-bestpathlw		9.5		9.500000e+00
-ceplen			13		13
-cmn			current		current
-cmninit		8.0		8.0
-compallsen		no		no
-debug					0
-dict					/private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
-dictcase		no		no
-dither			no		no
-doublebw		no		no
-ds			1		1
-fdict					
-feat			1s_c_d_dd	1s_c_d_dd
-featparams				
-fillprob		1e-8		1.000000e-08
-frate			100		100
-fsg					
-fsgusealtpron		yes		yes
-fsgusefiller		yes		yes
-fwdflat		yes		yes
-fwdflatbeam		1e-64		1.000000e-64
-fwdflatefwid		4		4
-fwdflatlw		8.5		8.500000e+00
-fwdflatsfwin		25		25
-2015-09-03 15:48:19.476 mathcommand[1655:497815] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
fwdflatwbeam		7e-29		7.000000e-29
-fwdtree		yes		yes
-hmm					/private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle
-input_endian		little		little
-jsgf					
-keyphrase				
-kws					
-kws_delay		10		10
-kws_plp		1e-1		1.000000e-01
-kws_threshold		1		1.000000e+00
-latsize		5000		5000
-lda					
-ldadim			0		0
-lifter			0		0
-lm					/private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/LanguageModel.dmp
-lmctl					
-lmname					
-logbase		1.0001		1.000100e+00
-logfn					
-logspec		no		no
-lowerf			133.33334	1.333333e+02
-lpbeam			1e-40		1.000000e-40
-lponlybeam		7e-29		7.000000e-29
-lw			6.5		6.500000e+00
-maxhmmpf		30000		30000
-maxwpf			-1		-1
-mdef					
-mean					
-mfclogdir				
-min_endfr		0		0
-mixw					
-mixwfloor		0.0000001	1.000000e-07
-mllr					
-mmap			yes		yes
-ncep			13		13
-nfft			512		512
-nfilt			40		40
-nwpen			1.0		1.000000e+00
-pbeam			1e-48		1.000000e-48
-pip			1.0		1.000000e+00
-pl_beam		1e-10		1.000000e-10
-pl_pbeam		1e-10		1.000000e-10
-pl_pip			1.0		1.000000e+00
-pl_weight		3.0		3.000000e+00
-pl_window		5		5
-rawlogdir				
-remove_dc		no		no
-remove_noise		yes		yes
-remove_silence		yes		yes
-round_filters		yes		yes
-samprate		16000		1.600000e+04
-seed			-1		-1
-sendump				
-senlogdir				
-senmgau				
-silprob		0.005		5.000000e-03
-smoothspec		no		no
-svspec					
-tmat					
-tmatfloor		0.0001		1.000000e-04
-topn			4		4
-topn_beam		0		0
-toprule				
-transform		legacy		legacy
-unit_area		yes		yes
-upperf			6855.4976	6.855498e+03
-uw			1.0		1.000000e+00
-vad_postspeech		50		10
-vad_prespeech		20		10
-vad_startspeech	10		10
-vad_threshold		2.0		2.500000e+00
-var					
-varfloor		0.0001		1.000000e-04
-varnorm		no		no
-verbose		no		no
-warp_params				
-warp_type		inverse_linear	inverse_linear
-wbeam			7e-29		7.000000e-29
-wip			0.65		6.500000e-01
-wlen			0.025625	2.562500e-02

2015-09-03 15:48:19.483 mathcommand[1655:497815] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x192118d0, 
inputs = (null); 
outputs = (
    "<AVAudioSessionPortDescription: 0x194cfde0, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
)>.
INFO: cmd_ln.c(703): Parsing command line:
\
	-nfilt 25 \
	-lowerf 130 \
	-upperf 6800 \
	-feat 1s_c_d_dd \
	-svspec 0-12/13-25/26-38 \
	-agc none \
	-cmn current \
	-varnorm no \
	-transform dct \
	-lifter 22 \
	-cmninit 40 

Current configuration:
[NAME]			[DEFLT]		[VALUE]
-agc			none		none
-agcthresh		2.0		2.000000e+00
-alpha			0.97		9.700000e-01
-ceplen			13		13
-cmn			current		current
-cmninit		8.0		40
-dither			no		no
-doublebw		no		no
-feat			1s_c_d_dd	1s_c_d_dd
-frate			100		100
-input_endian		little		little
-lda					
2015-09-03 15:48:19.507 mathcommand[1655:497815] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
Dumping AVAudioSession settings:
- availableInputs:
  - portName: MicrophoneBuiltIn
    - portType: iPhone Microphone
    - UID: Built-In Microphone
    - portType: iPhone Microphone
    - channels:
- category: AVAudioSessionCategoryPlayAndRecord
- categoryOptions: 13
- currentRoute.inputs:
  - portName: MicrophoneBuiltIn
    - portType: iPhone Microphone
    - UID: Built-In Microphone
    - portType: iPhone Microphone
    - channels:
      - channelName: iPhone Microphone
        - owningPortUID: Built-In Microphone
        - channelNumber: 1
        - channelLabel: 4294967295
- currentRoute.outputs:
  - portName: Speaker
    - portType: Speaker
    - UID: Speaker
    - portType: Speaker
    - channels:
      - channelName: Speaker
        - owningPortUID: Speaker
        - channelNumber: 1
        - channelLabel: 4294967295
- inputAvailable: 1
- inputDataSource.dataSourceID: 1835216945
- inputDataSource.dataSourceName: Bottom
- inputDataSource.orientation: Bottom
- inputDataSource.location: Lower
- mode: AVAudioSessionModeDefault
- IOBufferDuration: 0.092880
- inputLatency: 0.012494
- inputGain: 0.368421
- inputGainSettable: 1
- maximumInputNumberOfChannels: 1
- maximumOutputNumberOfChannels: 1
- outputNumberOfChannels: 1
- outputVolume: 0.437500
- outputLatency: 0.013515
- otherAudioPlaying: 0
- preferredIOBufferDuration: 0.128000
- preferredInputNumberOfChannels: 0
- preferredOutputNumberOfChannels: 0
- preferredSampleRate: 44100.000000
- recordPermission: 1735552628
- sampleRate: 44100.000000
- secondaryAudioShouldBeSilencedHint: 0
- shouldGroupAccessibilityChildren: 0
-ldadim			0		0
-lifter			0		22
-logspec		no		no
-lowerf			133.33334	1.300000e+02
-ncep			13		13
-nfft			512		512
-nfilt			40		25
-remove_dc		no		no
-remove_noise		yes		yes
-remove_silence		yes		yes
-round_filters		yes		yes
-samprate		16000		1.600000e+04
-seed			-1		-1
-smoothspec		no		no
-svspec					0-12/13-25/26-38
-transform		legacy		dct
-unit_area		yes		yes
-upperf			6855.4976	6.800000e+03
-vad_postspeech		50		10
-vad_prespeech		20		10
-vad_startspeech	10		10
-vad_threshold		2.0		2.500000e+00
-varnorm		no		no
-verbose		no		no
-warp_params				
-warp_type		inverse_linear	inverse_linear
-wlen			0.025625	2.562500e-02

INFO: acmod.c(252): Parsed model-specific feature parameters from /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/feat.params
INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='current', VARNORM='no', AGC='none'
INFO: cmn.c(143): mean[0]= 12.00, mean[1..12]= 0.0
INFO: acmod.c(171): Using subvector specification 0-12/13-25/26-38
INFO: mdef.c(518): Reading model definition: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/mdef
INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
INFO: bin_mdef.c(336): Reading binary model definition: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/mdef
2015-09-03 15:48:19.517 mathcommand[1655:497815] Audio route has changed for the following reason:
2015-09-03 15:48:19.528 mathcommand[1655:497815] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
2015-09-03 15:48:19.531 mathcommand[1655:497815] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---SpeakerMicrophoneBuiltIn---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x17f15850, 
inputs = (
    "<AVAudioSessionPortDescription: 0x17f14e90, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
); 
outputs = (
    "<AVAudioSessionPortDescription: 0x1920e640, type = Receiver; name = Receiver; UID = Built-In Receiver; selectedDataSource = (null)>"
)>.
INFO: bin_mdef.c(516): 46 CI-phone, 168344 CD-phone, 3 emitstate/phone, 138 CI-sen, 6138 Sen, 32881 Sen-Seq
INFO: tmat.c(206): Reading HMM transition probability matrices: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/transition_matrices
INFO: acmod.c(124): Attempting to use PTM computation module
INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/means
INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/variances
INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(354): 0 variance values floored
INFO: ptm_mgau.c(805): Number of codebooks doesn't match number of ciphones, doesn't look like PTM: 1 != 46
INFO: acmod.c(126): Attempting to use semi-continuous computation module
INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/means
INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(198): Reading mixture gaussian parameter: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/variances
INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: 
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(294):  512x13
INFO: ms_gauden.c(354): 0 variance values floored
INFO: s2_semi_mgau.c(904): Loading senones from dump file /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/sendump
INFO: s2_semi_mgau.c(928): BEGIN FILE FORMAT DESCRIPTION
INFO: s2_semi_mgau.c(991): Rows: 512, Columns: 6138
INFO: s2_semi_mgau.c(1023): Using memory-mapped I/O for senones
INFO: s2_semi_mgau.c(1294): Maximum top-N: 4 Top-N beams: 0 0 0
INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
INFO: dict.c(320): Allocating 4224 * 20 bytes (82 KiB) for word entries
INFO: dict.c(333): Reading main dictionary: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/LanguageModels.bundle/EnglishLanguageModel.dic
INFO: dict.c(213): Allocated 0 KiB for strings, 1 KiB for phones
INFO: dict.c(336): 119 words read
INFO: dict.c(358): Reading filler dictionary: /private/var/mobile/Containers/Bundle/Application/25F37846-7E70-4001-8470-9CCAF099746A/mathcommand.app/AcousticModelEnglish.bundle/noisedict
INFO: dict.c(213): Allocated 0 KiB for strings, 0 KiB for phones
INFO: dict.c(361): 9 words read
INFO: dict2pid.c(396): Building PID tables for dictionary
INFO: dict2pid.c(406): Allocating 46^3 * 2 bytes (190 KiB) for word-initial triphones
INFO: dict2pid.c(132): Allocated 25576 bytes (24 KiB) for word-final triphones
INFO: dict2pid.c(196): Allocated 25576 bytes (24 KiB) for single-phone word triphones
INFO: ngram_model_arpa.c(77): No \data\ mark in LM file
INFO: ngram_model_dmp.c(166): Will use memory-mapped I/O for LM file
INFO: ngram_model_dmp.c(220): ngrams 1=119, 2=234, 3=117
INFO: ngram_model_dmp.c(266):      119 = LM.unigrams(+trailer) read
INFO: ngram_model_dmp.c(312):      234 = LM.bigrams(+trailer) read
INFO: ngram_model_dmp.c(338):      117 = LM.trigrams read
INFO: ngram_model_dmp.c(363):        3 = LM.prob2 entries read
INFO: ngram_model_dmp.c(383):        3 = LM.bo_wt2 entries read
INFO: ngram_model_dmp.c(403):        2 = LM.prob3 entries read
INFO: ngram_model_dmp.c(431):        1 = LM.tseg_base entries read
INFO: ngram_model_dmp.c(487):      119 = ascii word strings read
INFO: ngram_search_fwdtree.c(99): 18 unique initial diphones
INFO: ngram_search_fwdtree.c(148): 0 root, 0 non-root channels, 17 single-phone words
INFO: ngram_search_fwdtree.c(186): Creating search tree
INFO: ngram_search_fwdtree.c(192): before: 0 root, 0 non-root channels, 17 single-phone words
INFO: ngram_search_fwdtree.c(326): after: max nonroot chan increased to 441
INFO: ngram_search_fwdtree.c(339): after: 18 root, 313 non-root channels, 16 single-phone words
INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
2015-09-03 15:48:19.646 mathcommand[1655:498079] There was no previous CMN value in the plist so we are using the fresh CMN value 42.000000.
2015-09-03 15:48:19.647 mathcommand[1655:498079] Listening.
2015-09-03 15:48:19.647 mathcommand[1655:497815] Pocketsphinx is now listening.
2015-09-03 15:48:19.648 mathcommand[1655:498079] Project has these words or phrases in its dictionary:
0
1
10
100
11
12
13
14
15
16
17
18
19
2
20
200
21
22
23
24
25
26
27
28
29
3
30
300
31
32
33
...and 89 more.
2015-09-03 15:48:19.649 mathcommand[1655:497815] Pocketsphinx is starting up.
2015-09-03 15:48:19.649 mathcommand[1655:498079] Recognition loop has started
2015-09-03 15:48:19.888 mathcommand[1655:498079] Speech detected...
2015-09-03 15:48:19.888 mathcommand[1655:497815] Pocketsphinx has detected speech.
-> applicationDidBecomeActive()

[PocketSphinx] Start Listening
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

LoadingScreen: OnStartListening
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Speech detected
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-09-03 15:48:20.116 mathcommand[1655:498046] End of speech detected...
2015-09-03 15:48:20.117 mathcommand[1655:497815] Pocketsphinx has detected a second of silence, concluding an utterance.
INFO: cmn_prior.c(131): cmn_prior_update: from < 42.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00 >
INFO: cmn_prior.c(149): cmn_prior_update: to   < 35.80 -1.00 -12.13 -0.77  2.63  3.47 -1.96  0.33 -3.18 -0.63  4.20  5.47 -1.28 >
Speech end
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

INFO: ngram_search_fwdtree.c(1553):      271 words recognized (9/fr)
INFO: ngram_search_fwdtree.c(1555):     4537 senones evaluated (151/fr)
INFO: ngram_search_fwdtree.c(1559):     1923 channels searched (64/fr), 468 1st, 795 last
INFO: ngram_search_fwdtree.c(1562):      417 words for which last channels evaluated (13/fr)
INFO: ngram_search_fwdtree.c(1564):       72 candidate words for entering last phone (2/fr)
INFO: ngram_search_fwdtree.c(1567): fwdtree 0.11 CPU 0.365 xRT
INFO: ngram_search_fwdtree.c(1570): fwdtree 0.28 wall 0.918 xRT
INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 8 words
INFO: ngram_search_fwdflat.c(948):      237 words recognized (8/fr)
INFO: ngram_search_fwdflat.c(950):     2246 senones evaluated (75/fr)
INFO: ngram_search_fwdflat.c(952):     1083 channels searched (36/fr)
INFO: ngram_search_fwdflat.c(954):      393 words searched (13/fr)
INFO: ngram_search_fwdflat.c(957):      229 word transitions (7/fr)
INFO: ngram_search_fwdflat.c(960): fwdflat 0.00 CPU 0.010 xRT
INFO: ngram_search_fwdflat.c(963): fwdflat 0.00 wall 0.015 xRT
INFO: ngram_search.c(1280): lattice start node <s>.0 end node </s>.22
INFO: ngram_search.c(1306): Eliminated 2 nodes before end node
INFO: ngram_search.c(1411): Lattice has 124 nodes, 588 links
INFO: ps_lattice.c(1380): Bestpath score: -3012
INFO: ps_lattice.c(1384): Normalizer P(O) = alpha(</s>:22:28) = 1771340
INFO: ps_lattice.c(1441): Joint P(O,S) = 1708921 P(S|O) = -62419
INFO: ngram_search.c(899): bestpath 0.00 CPU 0.003 xRT
INFO: ngram_search.c(902): bestpath 0.00 wall 0.006 xRT
2015-09-03 15:48:20.133 mathcommand[1655:498046] Pocketsphinx heard "A" with a score of (-62419) and an utterance ID of 0.
2015-09-03 15:48:20.134 mathcommand[1655:497815] The received hypothesis is A with a score of -62419 and an ID of 0
2015-09-03 15:48:20.135 mathcommand[1655:497815] hypothesisArray is [
  {
    "Hypothesis" : "A",
    "Score" : -24100
  },
  {
    "Hypothesis" : "E",
    "Score" : -24131
  },
  {
    "Hypothesis" : "A",
    "Score" : -24229
  },
  {
    "Hypothesis" : "",
    "Score" : -65936
  },
  {
    "Hypothesis" : "A",
    "Score" : -790462
  }
]
2015-09-03 15:48:20.136 mathcommand[1655:497815] hypothesisArray is A,E,A,,A
Recognition callback: A,E,A,,A
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Speech recognition processing time: 0.02041435 seconds.
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Avg mic level: 0.05581997
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

Chartboost: didCacheInterstitial: Game Over
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-09-03 15:48:22.922 mathcommand[1655:497815] [PocketSphinx] Stop Listening
2015-09-03 15:48:22.922 mathcommand[1655:498046] Stopping listening.
Chartboost: didCacheRewardedVideo: Game Over
 
(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 65)

2015-09-03 15:48:24.399 mathcommand[1655:498046] 15:48:24.399 ERROR:     [0xd8de000] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.
2015-09-03 15:48:24.400 mathcommand[1655:498046] Error: couldn't set session inactive.: '!act'
2015-09-03 15:48:24.415 mathcommand[1655:498046] Error: there was a problem tearing down the audio session: Error Domain=NSOSStatusErrorDomain Code=560030580 "The operation couldn’t be completed. (OSStatus error 560030580.)".
2015-09-03 15:48:24.416 mathcommand[1655:498046] Unable to stop listening because because an utterance is still in progress; trying again.
2015-09-03 15:48:24.471 mathcommand[1655:498046] Attempting to stop an unstopped utterance so listening can stop.
INFO: cmn_prior.c(131): cmn_prior_update: from < 35.80 -1.00 -12.13 -0.77  2.63  3.47 -1.96  0.33 -3.18 -0.63  4.20  5.47 -1.28 >
INFO: cmn_prior.c(149): cmn_prior_update: to   < 35.80 -1.00 -12.13 -0.77  2.63  3.47 -1.96  0.33 -3.18 -0.63  4.20  5.47 -1.28 >
INFO: ngram_search_fwdflat.c(302): Utterance vocabulary contains 0 words
INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 1.41 CPU 4.869 xRT
INFO: ngram_search_fwdtree.c(435): TOTAL fwdtree 4.61 wall 15.883 xRT
INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.00 CPU 0.010 xRT
INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.00 wall 0.016 xRT
INFO: ngram_search.c(307): TOTAL bestpath 0.00 CPU 0.003 xRT
INFO: ngram_search.c(310): TOTAL bestpath 0.00 wall 0.006 xRT
2015-09-03 15:48:24.474 mathcommand[1655:498046] No longer listening.
2015-09-03 15:48:24.487 mathcommand[1655:497815] 15:48:24.487 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:111: GetProperty: AudioSessionGetProperty ('cilt') failed with error: '!siz'
2015-09-03 15:48:24.488 mathcommand[1655:497815] 15:48:24.488 ERROR:     [0x37a9f9dc] AVAudioSessionUtilities.h:124: GetProperty_DefaultToZero: AudioSessionGetProperty ('cilt') failed with error: '!siz'
2015-09-03 15:48:24.493 mathcommand[1655:497815] routeChangeReason : AVAudioSessionRouteChangeReasonCategoryChange
Dumping AVAudioSession settings:
- availableInputs:
  - portName: MicrophoneBuiltIn
    - portType: iPhone Microphone
    - UID: Built-In Microphone
    - portType: iPhone Microphone
    - channels:
- category: AVAudioSessionCategoryPlayAndRecord
- categoryOptions: 13
- currentRoute.inputs:
- currentRoute.outputs:
  - portName: Speaker
    - portType: Speaker
    - UID: Speaker
    - portType: Speaker
    - channels:
      - channelName: Speaker
        - owningPortUID: Speaker
        - channelNumber: 1
        - channelLabel: 4294967295
- inputAvailable: 1
- mode: AVAudioSessionModeDefault
- IOBufferDuration: 0.085333
- inputLatency: 0.000000
- inputGain: 1.000000
- inputGainSettable: 0
- maximumInputNumberOfChannels: 0
- maximumOutputNumberOfChannels: 1
- outputNumberOfChannels: 1
- outputVolume: 0.437500
- outputLatency: 0.013292
- otherAudioPlaying: 0
- preferredIOBufferDuration: 0.128000
- preferredInputNumberOfChannels: 0
- preferredOutputNumberOfChannels: 0
- preferredSampleRate: 48000.000000
- recordPermission: 1735552628
- sampleRate: 48000.000000
- secondaryAudioShouldBeSilencedHint: 0
- shouldGroupAccessibilityChildren: 0
2015-09-03 15:48:24.495 mathcommand[1655:497815] Audio route has changed for the following reason:
2015-09-03 15:48:24.495 mathcommand[1655:497815] There was a category change. The new category is AVAudioSessionCategoryPlayAndRecord
2015-09-03 15:48:24.497 mathcommand[1655:497815] This is not a case in which OpenEars notifies of a route change. At the close of this function, the new audio route is ---Speaker---. The previous route before changing to this route was <AVAudioSessionRouteDescription: 0x19258f50, 
inputs = (
    "<AVAudioSessionPortDescription: 0x192b68f0, type = MicrophoneBuiltIn; name = iPhone Microphone; UID = Built-In Microphone; selectedDataSource = Bottom>"
); 
outputs = (
    "<AVAudioSessionPortDescription: 0x17f25900, type = Speaker; name = Speaker; UID = Speaker; selectedDataSource = (null)>"
)>.
2015-09-03 15:48:24.498 mathcommand[1655:497815] Pocketsphinx has stopped listening.
[PocketSphinx] Stop Listening

The I/O stop error still shows up.
I still don’t have more details on the Unity audio behavior other than the audio session settings dumps, however.
Could you give me some pointers on what kind of audio information I should be adding to the logs so I can look further? The AVAudioSession settings are not enough I suppose?