1

我必须维护一个使用MediaSessionCompatMediaPlayer从服务器流式传输音频文件的应用程序。

我在 Pixel XL 和 Nexus 5 (API 23) 上重现了一个错误,该错误不会在运行的相同设备 (API 27) 上发生。我听说过一个运行 API 28 的 XL 用户也遇到过这种情况。

当有电话打进来时,应用程序无法躲避它,所以我们暂停了。在 API 27 上,调用结束,应用程序获得音频焦点,我们再次开始播放。在 API 23(和 28?我还没有确认)上,一旦调用结束,媒体服务器就会崩溃并出现错误 100 ( MEDIA_ERROR_SERVER_DIED)。每次通话结束时可靠地崩溃。

我无法对它做出正面或反面。

有谁知道为什么它在 27 上很好但在 23 上不行,或者我可以做些什么来防止崩溃(而不是在崩溃后尝试重新启动一切)?

堆栈跟踪看起来像这样

10-31 17:36:04.499 8062-8074/? A/AudioTrackShared: Assertion failed: buffer == NULL || buffer->mFrameCount == 0 10-31 17:36:04.499 8062-8074/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 8074 (FastMixer) 10-31 17:36:04.500 1362-1362/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 10-31 17:36:04.500 1362-1362/? A/DEBUG: Build fingerprint: 'Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/5056751:userdebug/test-keys' 10-31 17:36:04.500 1362-1362/? A/DEBUG: Revision: '0' 10-31 17:36:04.500 1362-1362/? A/DEBUG: ABI: 'x86' 10-31 17:36:04.500 1362-1362/? A/DEBUG: pid: 8062, tid: 8074, name: FastMixer >>> /system/bin/mediaserver <<< 10-31 17:36:04.500 1362-1362/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 10-31 17:36:04.500 1639-1727/system_process W/NativeCrashListener: Couldn't find ProcessRecord for pid 8062 10-31 17:36:04.502 1362-1362/? A/DEBUG: Abort message: 'Assertion failed: buffer == NULL || buffer->mFrameCount == 0' 10-31 17:36:04.502 1362-1362/? E/DEBUG: AM write failed: Broken pipe 10-31 17:36:04.502 1362-1362/? A/DEBUG: eax 00000000 ebx 00001f7e ecx 00001f8a edx 00000006 10-31 17:36:04.502 1362-1362/? A/DEBUG: esi b427f980 edi 00000000 10-31 17:36:04.502 1362-1362/? A/DEBUG: xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b 10-31 17:36:04.502 1362-1362/? A/DEBUG: eip b6fb7f56 ebp 00001f8a esp b427ee80 flags 00200206 10-31 17:36:04.504 1362-1362/? A/DEBUG: backtrace: 10-31 17:36:04.504 1362-1362/? A/DEBUG: #00 pc 00083f56 /system/lib/libc.so (tgkill+22) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #01 pc 000815e8 /system/lib/libc.so (pthread_kill+70) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #02 pc 00027205 /system/lib/libc.so (raise+36) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #03 pc 000209e4 /system/lib/libc.so (abort+80) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #04 pc 0000cbc3 /system/lib/libcutils.so (__android_log_assert+128) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #05 pc 0008353d /system/lib/libmedia.so (android::ServerProxy::obtainBuffer(android::Proxy::Buffer*, bool)+669) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #06 pc 00053af7 /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #07 pc 00066155 /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #08 pc 0002630a /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #09 pc 00026d42 /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #10 pc 00025e93 /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #11 pc 0006c19a /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #12 pc 0006d88f /system/lib/libaudioflinger.so 10-31 17:36:04.504 1362-1362/? A/DEBUG: #13 pc 00014aac /system/lib/libutils.so (android::Thread::_threadLoop(void*)+418) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #14 pc 000141cf /system/lib/libutils.so (thread_data_t::trampoline(thread_data_t const*)+122) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #15 pc 00080a93 /system/lib/libc.so (__pthread_start(void*)+56) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #16 pc 00021952 /system/lib/libc.so (__start_thread+25) 10-31 17:36:04.504 1362-1362/? A/DEBUG: #17 pc 000170b6 /system/lib/libc.so (__bionic_clone+70)

4

0 回答 0