android 8.1 蓝牙打不开之CLOCK_BOOTTIME_ALARM问题

    最近在配置android8.1系统的蓝牙时,按照之前android6.0的方式配置,完成后蓝牙打开不了,查看发现如下log:

07-03 17:11:36.054  1482  1498 E bt_btif_config_transcode: btif_config_transcode unable to load XML file '/data/misc/bluedroid/bt_config.xml': 3
07-03 17:11:36.054  1482  1498 E bt_btif_config: init unable to transcode legacy file; creating empty config.
07-03 17:11:36.054  1482  1498 E bt_osi_alarm: timer_create_internal unable to create timer with clock 9: Unknown error 524
07-03 17:11:36.054  1482  1498 E bt_osi_alarm: The kernel might not have support for timer_create(CLOCK_BOOTTIME_ALARM): https://lwn.net/Articles/429925/
07-03 17:11:36.054  1482  1498 E bt_osi_alarm: See following patches: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=CLOCK_BOOTTIME_ALARM
07-03 17:11:36.055  1482  1498 F         : [0703/171136:FATAL:alarm.cc(178)] Check failed: false. 
07-03 17:11:36.055  1482  1498 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1498 (stack_manager), pid 1482 (droid.bluetooth)
07-03 17:11:36.107  1503  1503 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
07-03 17:11:36.107   376   376 I /system/bin/tombstoned: received crash request for pid 1482
07-03 17:11:36.108  1503  1503 I crash_dump32: performing dump of process 1482 (target tid = 1498)
07-03 17:11:36.108  1503  1503 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-03 17:11:36.108  1503  1503 F DEBUG   : Build fingerprint: 'rockchip/rk3288/rk3288:8.1.0/OPM8.190305.001/105210:userdebug/test-keys'
07-03 17:11:36.108  1503  1503 F DEBUG   : Revision: '0'
07-03 17:11:36.108  1503  1503 F DEBUG   : ABI: 'arm'
07-03 17:11:36.108  1503  1503 F DEBUG   : pid: 1482, tid: 1498, name: stack_manager  >>> com.android.bluetooth <<<
07-03 17:11:36.108  1503  1503 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
07-03 17:11:36.114  1503  1503 F DEBUG   : Abort message: '[0703/171136:FATAL:alarm.cc(178)] Check failed: false. 
07-03 17:11:36.114  1503  1503 F DEBUG   : '
07-03 17:11:36.114  1503  1503 F DEBUG   :     r0 00000000  r1 000005da  r2 00000006  r3 00000008
07-03 17:11:36.114  1503  1503 F DEBUG   :     r4 000005ca  r5 000005da  r6 9679dc54  r7 0000010c
07-03 17:11:36.114  1503  1503 F DEBUG   :     r8 00000000  r9 9679e3d8  sl 9679dc8d  fp 9679dc8c
07-03 17:11:36.114  1503  1503 F DEBUG   :     ip 00000000  sp 9679dc40  lr b31fba2f  pc b31f543c  cpsr 20010030
07-03 17:11:36.193  1503  1503 F DEBUG   : 
07-03 17:11:36.193  1503  1503 F DEBUG   : backtrace:
07-03 17:11:36.194  1503  1503 F DEBUG   :     #00 pc 0001a43c  /system/lib/libc.so (abort+63)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #01 pc 00082d0b  /system/lib/libchrome.so (base::debug::BreakDebugger()+10)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #02 pc 00090aa1  /system/lib/libchrome.so (logging::LogMessage::~LogMessage()+304)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #03 pc 0013715f  /system/lib/hw/bluetooth.default.so (alarm_new_internal(char const*, bool)+462)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #04 pc 00066775  /system/lib/hw/bluetooth.default.so (init()+720)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #05 pc 00136567  /system/lib/hw/bluetooth.default.so (module_init(module_t const*)+70)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #06 pc 000a0f85  /system/lib/hw/bluetooth.default.so (event_init_stack(void*)+80)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #07 pc 0013dc83  /system/lib/hw/bluetooth.default.so (work_queue_read_cb(void*)+50)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #08 pc 0013c649  /system/lib/hw/bluetooth.default.so (run_reactor(reactor_t*, int)+216)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #09 pc 0013c545  /system/lib/hw/bluetooth.default.so (reactor_start(reactor_t*)+44)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #10 pc 0013d83d  /system/lib/hw/bluetooth.default.so (run_thread(void*)+136)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #11 pc 00047d3f  /system/lib/libc.so (__pthread_start(void*)+22)
07-03 17:11:36.194  1503  1503 F DEBUG   :     #12 pc 0001b029  /system/lib/libc.so (__start_thread+32)

log中的红色部分提示内核不支持CLOCK_BOOTTIME_ALARM,后面参考了其他原厂项目配置发现有在wifi和蓝牙的部分dts中添加了  clocks = <&rk808 1>;
        clock-names = "ext_clock";

这样的配置,有些是      

 clocks = <&hym8563>;
        clock-names = "ext_clock";

hym8563和rk808 都是rtc的配置,而我们配置的rtc为pcf8583,由安卓6.0上面修改过来的,应该没有支持CLOCK_BOOTTIME_ALARM.于是查找网上CLOCK_BOOTTIME_ALARM。发现CLOCK_BOOTTIME_ALARM是用于机器休眠时的时间处理,由于我们的机器不需要休眠,后面找到可以在system\bt\osi\src\alarm.cc中进行屏蔽。

--- a/system/bt/osi/src/alarm.cc
+++ b/system/bt/osi/src/alarm.cc
@@ -115,11 +115,11 @@ struct alarm_t {
 int64_t TIMER_INTERVAL_FOR_WAKELOCK_IN_MS = 3000;
 static const clockid_t CLOCK_ID = CLOCK_BOOTTIME;
 

-#if (KERNEL_MISSING_CLOCK_BOOTTIME_ALARM == TRUE)
+//#if (KERNEL_MISSING_CLOCK_BOOTTIME_ALARM == TRUE)
 static const clockid_t CLOCK_ID_ALARM = CLOCK_BOOTTIME;
-#else
-static const clockid_t CLOCK_ID_ALARM = CLOCK_BOOTTIME_ALARM;
-#endif

+//#else
+//static const clockid_t CLOCK_ID_ALARM = CLOCK_BOOTTIME_ALARM;
+//#endif

 

修改上述以后,蓝牙可以正常打开了。但是如果要保留CLOCK_BOOTTIME_ALARM功能支持,可能要对rtc驱动进行修改。

你可能感兴趣的:(android:kernel,蓝牙)