Android 长时间待机后系统概率性无声
Posted 虫师魁拔
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 长时间待机后系统概率性无声相关的知识,希望对你有一定的参考价值。
之前一个高通平台项目出现这种问题,查看log,发现出现异常的时候,系统 audioserver 挂了,导致 audioserver 挂了log
02-24 10:12:46.724 1041 11824 11824 F DEBUG : Timestamp: 2022-02-24 10:12:46+0800
02-24 10:12:46.724 1041 11824 11824 F DEBUG : pid: 921, tid: 2441, name: TimeCheckThread >>> /system/bin/audioserver <<<
02-24 10:12:46.724 1041 11824 11824 F DEBUG : uid: 1041
02-24 10:12:46.724 1041 11824 11824 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
02-24 10:12:46.724 1041 11824 11824 F DEBUG : Abort message: 'TimeCheck timeout for IAudioPolicyService command 27'
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x0 0000000000000000 x1 0000000000000989 x2 0000000000000006 x3 00000076c9347550
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x4 fefefefefefefeff x5 fefefefefefefeff x6 fefefefefefefeff x7 7f7f7f7f7f7f7f7f
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x8 00000000000000f0 x9 1288478ff3ef6c2a x10 0000000000000000 x11 ffffffc0ffffffdf
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x12 0000000000000001 x13 0000000000000035 x14 0000000000000008 x15 ffffffffffffffff
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x16 00000079cfdf8c80 x17 00000079cfddabb0 x18 00000076c8d6a000 x19 0000000000000399
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x20 0000000000000989 x21 00000000ffffffff x22 0000000000000000 x23 b4000076eefe29b4
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x24 b4000076eefe29b4 x25 00000076c9347cc0 x26 00000076c9347ff8 x27 00000000000fc000
02-24 10:12:46.724 1041 11824 11824 F DEBUG : x28 00000076c924f000 x29 00000076c93475d0
02-24 10:12:46.724 1041 11824 11824 F DEBUG : lr 00000079cfd8e3e0 sp 00000076c9347530 pc 00000079cfd8e40c pst 0000000000000000
02-24 10:12:46.739 1041 11824 11824 F DEBUG : backtrace:
02-24 10:12:46.739 1041 11824 11824 F DEBUG : #00 pc 000000000004e40c /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: f4881cdb04823cc0d8c0fa3f95c4db2e)
02-24 10:12:46.739 1041 11824 11824 F DEBUG : #01 pc 00000000000062b0 /system/lib64/liblog.so (__android_log_default_aborter+12) (BuildId: 661d43665d5ec814ec191e5d951fe16a)
02-24 10:12:46.740 1041 11824 11824 F DEBUG : #02 pc 0000000000006e18 /system/lib64/liblog.so (__android_log_assert+336) (BuildId: 661d43665d5ec814ec191e5d951fe16a)
02-24 10:12:46.740 1041 11824 11824 F DEBUG : #03 pc 000000000002f3b8 /system/lib64/libmediautils.so (android::TimeCheck::TimeCheckThread::threadLoop()+1072) (BuildId: 63bd88e7eae47dcb70566eccec14d02f)
02-24 10:12:46.740 1041 11824 11824 F DEBUG : #04 pc 0000000000015594 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+460) (BuildId: d321d0897f4073bb16c79b0326936ea5)
02-24 10:12:46.740 1041 11824 11824 F DEBUG : #05 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) (BuildId: d321d0897f4073bb16c79b0326936ea5)
02-24 10:12:46.740 1041 11824 11824 F DEBUG : #06 pc 00000000000b008c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) (BuildId: f4881cdb04823cc0d8c0fa3f95c4db2e)
02-24 10:12:46.740 1041 11824 11824 F DEBUG : #07 pc 00000000000503c8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: f4881cdb04823cc0d8c0fa3f95c4db2e)
02-24 10:12:47.091 1000 1507 2619 I chatty : uid=1000(system) Thread-14 expire 1 line
02-24 10:12:47.918 1000 1507 1747 I chatty : uid=1000(system) ActivityManager expire 18 lines
异常信息中显示 TimeCheck timeout for IAudioPolicyService 。这条log打印原因,是由于TimeCheck 检测超时。在 audioserver 中,对于 audioserver binder 调用不能超过5s,如果超过5s就会打印这个log。TimeCheck 代码位于 frameworks/av/media/utils/TimeCheck.cpp。根据log中超时类型进行区别对待处理,保证不要超时
以上是关于Android 长时间待机后系统概率性无声的主要内容,如果未能解决你的问题,请参考以下文章
iPad长时间待机之后,不重启就无法连接罗技蓝牙键盘,是怎么回事?
案例分享——智能手表(全套解决方案:生理监测久坐提醒来电提醒OTA蓝牙通信语音播报长时间待机等)