3

My app holds a partial wakelock (to ensure the CPU keeps running) and also uses a proximity wake lock to turn the screen off if the user holds the phone near their face. The app plays audio to the user using its own native threads and the OpenSLES api.

The problem I have is that when the proximity sensor triggers and the screen turns off the CPU appears to slow down and the native threads can no-longer keep up and the audio stutters.

Anyone know what's going on here and if there's anything I can do about it?

Regards

Phil

Philip Pearl
  • 1,523
  • 16
  • 26
  • Looking at http://stackoverflow.com/questions/7617459/how-to-keep-cpu-from-sleeping-when-screen-is-turned-off-in-android, perhaps my problem is actually wifi performance – Philip Pearl Feb 24 '12 at 13:18

1 Answers1

3

What I really needed was a high performance wifi lock - it was actually the wifi that was the problem, not the CPU.

See http://developer.android.com/reference/android/net/wifi/WifiManager.html#WIFI_MODE_FULL_HIGH_PERF

Philip Pearl
  • 1,523
  • 16
  • 26