精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
锐英源精品开源,禁止转载和任何形式的非法内容使用,违者必究
近期开发的语音采集App某个用户登录后界面打不开,问题是:startActivityForResult闪退和startActivityForResult无法启动。报如下的提示:
2020-10-04 16:07:53.300 1497-1497/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
2020-10-04 16:07:53.301 2282-15439/? E/AudioRecord: AudioFlinger could not create record track, status: -12
2020-10-04 16:07:53.309 2282-15439/? E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
2020-10-04 16:07:53.309 2282-15439/? E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
2020-10-04 16:07:53.309 2282-15439/? I/MicrophoneInputStream: mic_started com.google.android.apps.gsa.staticplugins.aa.c@2d41349
2020-10-04 16:07:53.311 2282-2282/? I/MicroDetectionWorker: onReady
2020-10-04 16:07:53.314 2282-15439/? I/MicrophoneInputStream: mic_close com.google.android.apps.gsa.staticplugins.aa.c@2d41349
2020-10-04 16:07:53.315 2282-14906/? I/MicroRecognitionRunner: Detection finished
2020-10-04 16:07:53.315 2282-14906/? W/ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
2020-10-04 16:07:53.315 2282-2557/? I/MicroRecognitionRunner: Stopping hotword detection.
2020-10-04 16:07:53.315 2282-14906/? W/ErrorProcessor: onFatalError, processing error from engine(4)
com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream
at com.google.android.apps.gsa.staticplugins.recognizer.j.a.a(SourceFile:28)
at com.google.android.apps.gsa.staticplugins.recognizer.j.b.run(SourceFile:15)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:14)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.a.ai.run(SourceFile:6)
Caused by: com.google.android.apps.gsa.shared.exception.GsaIOException: Error code: 393238 | Buffer overflow, no available space.
at com.google.android.apps.gsa.speech.audio.Tee.f(SourceFile:103)
at com.google.android.apps.gsa.speech.audio.au.read(SourceFile:2)
at java.io.InputStream.read(InputStream.java:101)
at com.google.android.apps.gsa.speech.audio.ao.run(SourceFile:18)
at com.google.android.apps.gsa.speech.audio.an.run(SourceFile:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:14)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.concurrent.a.bl.run(SourceFile:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
at com.google.android.apps.gsa.shared.util.concurrent.a.ai.run(SourceFile:6)
2020-10-04 16:07:53.315 2282-14906/? I/AudioController: internalShutdown
2020-10-04 16:07:53.317 2282-2282/? I/MicroDetector: Keeping mic open: false
2020-10-04 16:07:53.317 2282-14901/? I/DeviceStateChecker: DeviceStateChecker cancelled
2020-10-04 16:07:53.317 2282-2282/? I/MicroDetectionWorker: #onError(false)
2020-10-04 16:07:58.324 2282-2282/? I/MicroDetectionWorker: #updateMicroDetector [detectionMode: [mDetectionMode: [1]]]
2020-10-04 16:07:58.324 2282-2282/? I/MicroDetectionWorker: #startMicroDetector [speakerMode: 0]
2020-10-04 16:07:58.326 2282-2282/? I/AudioController: Using mInputStreamFactoryBuilder
2020-10-04 16:07:58.327 2282-2282/? I/MicroDetectionWorker: onReady
2020-10-04 16:07:58.328 2282-14898/? I/MicroRecognitionRunner: Starting detection.
2020-10-04 16:07:58.328 2282-15439/? I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.staticplugins.aa.c@6699767
2020-10-04 16:07:58.333 1497-16787/? I/AudioFlinger: AudioFlinger's thread 0xad783c80 tid=16787 ready to run
2020-10-04 16:07:58.343 1497-1614/? E/AudioFlinger: not enough memory for AudioTrack size=131296
2020-10-04 16:07:58.343 1497-1614/? D/MemoryDealer: AudioTrack (0xb15622a0, size=4194304)
0: 0xb15622b0 | 0x00000000 | 0x000200E0 | A
1: 0xb15622d0 | 0x000200E0 | 0x000200E0 | A
2: 0xb1db71f0 | 0x000401C0 | 0x000200E0 | A
3: 0xb15627b0 | 0x000602A0 | 0x000200E0 | A
4: 0xb1db73a0 | 0x00080380 | 0x000200E0 | A
5: 0xb1562970 | 0x000A0460 | 0x000200E0 | A
6: 0xb15629c0 | 0x000C0540 | 0x000200E0 | A
7: 0xb1db7560 | 0x000E0620 | 0x000200E0 | A
8: 0xb1562c60 | 0x00100700 | 0x000200E0 | A
9: 0xb1562cb0 | 0x001207E0 | 0x000200E0 | A
10: 0xb1db7770 | 0x001408C0 | 0x000200E0 | A
11: 0xb1db77f0 | 0x001609A0 | 0x000200E0 | A
12: 0xb03f6070 | 0x00180A80 | 0x000200E0 | A
13: 0xb03f60d0 | 0x001A0B60 | 0x000200E0 | A
14: 0xb1db7af0 | 0x001C0C40 | 0x000200E0 | A
15: 0xb03f6020 | 0x001E0D20 | 0x000200E0 | A
16: 0xb15627e0 | 0x00200E00 | 0x000200E0 | A
17: 0xb03f6b20 | 0x00220EE0 | 0x000200E0 | A
18: 0xb03f68b0 | 0x00240FC0 | 0x000200E0 | A
19: 0xb03f6c90 | 0x002610A0 | 0x000200E0 | A
开始对这个问题并不熟悉,用户只是说App闪退,用其它用户登录,能正常打开Intent,所以排除流程问题,也排除了audio设备对象的问题;在数据量上和其它用户对应也不高,就回到现场,设置断点跟踪,定位到startActivityForResult函数调用行,这函数打开Intent界面,Intent界面打不开,当然要怀疑界面的成员了。把界面里的数组成员注释后,问题解决。
startActivityForResult调用Intent出下面问题,Intent里有个数组,数组有数组项,项太多占内存就出问题,数组换成非数组形式传递,问题解决。
表现到audio设备对象上,可能是audio设备太占内存促成,其实和audio设备对象没关系。