请教一个gsensor的问题
时间:10-02
整理:3721RD
点击:
请教一下75 4.0.4的代码,手机用着用着gsensor就会失效。
正常的DUMP信息:
DUMP OF SERVICE sensorservice:
Sensor List:
mmc328x | Aichi Steel | 0x00000002 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
mmc328x | Aichi Steel | 0x00000001 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
bma222 3-axis AcceleROMeter | The android Open Source Project | 0x00000000 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Proximity Sensor | Capella | 0x00000007 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Light Sensor | Capella | 0x00000004 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
9-axis fusion disabled (0 CLIents), gyro-rate= 0.00Hz, q=< 0, 0, 0, 0 > (0), b=< 0, 0, 0 >
5 h/w sensors:
handle=0x00000002, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000001, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000000, active-count=1, rates(ms)={ 66.7 }, selected=66.7 ms
handle=0x00000007, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000004, active-count=0, rates(ms)={ }, selected= 0.0 ms
1 active connections
Active sensors:
bma222 3-axis Accelerometer (handle=0x00000000, connections=1)
不正常的DUMP信息:
DUMP OF SERVICE sensorservice:
Sensor List:
mmc328x | Aichi Steel | 0x00000002 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
mmc328x | Aichi Steel | 0x00000001 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
bma222 3-axis Accelerometer | The Android Open Source Project | 0x00000000 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Proximity Sensor | Capella | 0x00000007 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Light Sensor | Capella | 0x00000004 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
9-axis fusion disabled (0 clients), gyro-rate= 0.00Hz, q=< 0, 0, 0, 0 > (0), b=< 0, 0, 0 >
5 h/w sensors:
handle=0x00000002, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000001, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000000, active-count=0, rates(ms)={ }, selected=66.7 ms
handle=0x00000007, active-count=0, rates(ms)={ }, selected=200.0 ms
handle=0x00000004, active-count=0, rates(ms)={ }, selected= 0.0 ms
0 active connections
Active sensors:
可以看到不正常的LOG显示gsensor没有一个活动的连接。
系统使用过程中也没有崩溃过,有时候就不能使用了,导致系统界面不能转屏
正常的DUMP信息:
DUMP OF SERVICE sensorservice:
Sensor List:
mmc328x | Aichi Steel | 0x00000002 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
mmc328x | Aichi Steel | 0x00000001 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
bma222 3-axis AcceleROMeter | The android Open Source Project | 0x00000000 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Proximity Sensor | Capella | 0x00000007 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Light Sensor | Capella | 0x00000004 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
9-axis fusion disabled (0 CLIents), gyro-rate= 0.00Hz, q=< 0, 0, 0, 0 > (0), b=< 0, 0, 0 >
5 h/w sensors:
handle=0x00000002, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000001, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000000, active-count=1, rates(ms)={ 66.7 }, selected=66.7 ms
handle=0x00000007, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000004, active-count=0, rates(ms)={ }, selected= 0.0 ms
1 active connections
Active sensors:
bma222 3-axis Accelerometer (handle=0x00000000, connections=1)
不正常的DUMP信息:
DUMP OF SERVICE sensorservice:
Sensor List:
mmc328x | Aichi Steel | 0x00000002 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
mmc328x | Aichi Steel | 0x00000001 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
bma222 3-axis Accelerometer | The Android Open Source Project | 0x00000000 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Proximity Sensor | Capella | 0x00000007 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
CM3623 Light Sensor | Capella | 0x00000004 | maxRate= 0.00Hz | last=< 0.0, 0.0, 0.0>
9-axis fusion disabled (0 clients), gyro-rate= 0.00Hz, q=< 0, 0, 0, 0 > (0), b=< 0, 0, 0 >
5 h/w sensors:
handle=0x00000002, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000001, active-count=0, rates(ms)={ }, selected= 0.0 ms
handle=0x00000000, active-count=0, rates(ms)={ }, selected=66.7 ms
handle=0x00000007, active-count=0, rates(ms)={ }, selected=200.0 ms
handle=0x00000004, active-count=0, rates(ms)={ }, selected= 0.0 ms
0 active connections
Active sensors:
可以看到不正常的LOG显示gsensor没有一个活动的连接。
系统使用过程中也没有崩溃过,有时候就不能使用了,导致系统界面不能转屏
是不是SLEEP后,就挂了?
不是,有几次是SLEEP后就不行,大多数SLEEP之后还是好的,有时候没有休眠,用着用着也突然也不行了
如果出现有问题,然后在让手机SLEEP,在SLEEP OUT后是不是会有可能就好了?
不会,休眠之后唤醒还是不好的,在状态栏上重新点自动转屏的话,有几次能恢复,有几次又不能恢复,重新启动开机,也会出现不好的现象。多启动几次,又有可能恢复
硬件查了没有问题,问题在于软件这边如上面贴的LOG的gsensor服务没有活动的连接连着,因此GSENSOR数据没有传到ANDROID上层就被丢弃了,正常的情况只要允许转屏是有活动的连接的
你现在在无效时,最低层的GSENSOR数据能出来不?
这样可以知道是上层出了问题,还是kernel出问题。
我试试看LOG
看程序应该是上层的hwsen_dev.c停止polling gsensor引起的,原因还是找不到
hwsen_dev.c 文件在哪里?
hwmsen_dev.c .......
菜鸟(195974477) 10:56:23
你把log打开。然后一直玩,出问题的时候去看下。应该是在退出睡眠的时候出现的
请问是什么ic ? 是不是博世的? 博世有最新的驱动代码,能减小失效的几率;
他们的说法是,有些mmi 写法不规范导致的 ;
我的是bma250E
这应该是上报的数据采样速率有关,你改下bma250_init_client->BMA250_SetBWRate里面的频率,将其改小到50HZ试一试
小编问题原因查到了么 求分享 谢谢