问题描述
我正在读取Sony Smartwatch 3上的加速度传感器.由于Android Wear 1.5更新,无论天气如何,我使用SENSOR_DELAY_NORMAL
,SENSOR_DELAY_UI
或SENSOR_DELAY_GAME
时,采样率都不会降到60hz以下.在更新之前,SENSOR_DELAY_NORMAL
导致大约18个样本/秒的采样率.
I'm reading out the accelerometer sensor on a Sony Smartwatch 3. Since the Android Wear 1.5 update the sampling rate won't drop below about 60hz, regardless weather I use SENSOR_DELAY_NORMAL
, SENSOR_DELAY_UI
or SENSOR_DELAY_GAME
. Before the update SENSOR_DELAY_NORMAL
resulted in a sampling rate of about 18 samples/seconds.
accelerometer.getMaxDelay()
仍返回62500,这将是16个样本/秒.在sensorManager.registerSensor(this, accelerometer, 62500)
中注册传感器时,我还尝试直接设置所需的延迟,但这也不起作用.
accelerometer.getMaxDelay()
still returns 62500, which would be 16 samples/sec. I also tried setting the desired delay directly, when registering the sensor with sensorManager.registerSensor(this, accelerometer, 62500)
but this doesn't work either.
有人对我如何降低采样率有任何想法吗?对于我的应用程序来说,提高能源效率非常重要,这就是为什么低采样率很重要的原因.
Has anybody any idea of how I can reduce the sampling rate? It's very important for my app to be energy efficient, thats why the low sampling rate is important.
推荐答案
有什么不同:不是Android更新改变了行为,这是我的误解.
How could it have been different: Not the Android update changed the behavior, it was my misunderstanding.
对于每个可能在传感器分批或采样率方面遇到问题的人:
For everyone who might have problems with sensor batching or sampling rates:
- 打开或关闭显示屏时,采样率可能会有所不同.在我的情况下,打开时为60hz,关闭时为18hz.
- 当设备连接到电源时,传感器批处理可能无法进行.对我来说,我要拔掉USB电缆.在这种情况下,蓝牙调试可能会有所帮助.
这篇关于Android传感器采样率不会低于60 Hz的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!