OpenSL Android SimpleBufferQueue thread timing with sensors

29 views
Skip to first unread message

James Alvarez

unread,
Feb 22, 2015, 6:25:43 AM2/22/15
to andro...@googlegroups.com

Hello! I am having some fun with OpenSL, linking sound to sensor movements.  Specifically, I am trying to update the a sound buffer with sensor updates for the lowest latency in between sensor events and sound. I have the sensors running in their own maximum priority thread (in Java), and the Android SimpleBufferQueue OpenSL callbacks obviously occur in their own high priority thread too.

The problem is when I am counting the updates, I get the following repeating pattern:

2 x Audio Callback - 4 x Sensor Update

The problem is that on the second callback, there has been no sensor update. I realise this is a very small period of time, but is there any way to make the sensor updates to occur between the callbacks, i.e. to yield the callbacks to allow the sensor updates to come through?

Many thanks!

Reply all
Reply to author
Forward
0 new messages