we have recently received a bug report from the Tizen Validation Team which states that the device consumes too much power when in doze mode:
<Defect>
Measured sleep current is higher than standard current while application is running. [doze mode].
It seems that application makes abnormal wake lock/wake up/suspended fail.
<Expected result>
Measured sleep current must not exceed standard current.
It seems like this is related to the CPU not able to go into idle state while an OpenAL context is active.
My first question would be is there really no way that I can retain the context while the device screen is turned off? All sounds have been paused and the active context has been set to NULL. Still the application and the pulseaudio process consume about 3% CPU each.
If I really have to discard the context, does anybody know if the OpenAL buffers can be retained? From my experiments it looks like they can.
In my pause method I do the following:
alSourceStop(openALSource); alSourcei(openALSource, AL_BUFFER, AL_NONE); alDeleteSources(1, &openALSource); alcMakeContextCurrent(NULL); alcDestroyContext(openALContext);
With this code the application and pulseaudio are no longer in the output from top.
Then when resuming the application, a new context is created:
openALContext = alcCreateContext(openALDevice, NULL); alcMakeContextCurrent(openALContext)
It seems like I can reuse my buffers as calling alIsBuffer() with a buffer created from the old context returns true and I can attach the buffer to a new source.
I just couldn't find anything in the Tizen nor OpenAL documentation whether buffers should be invalidated/destroyed when the context is removed. Would be great if someone can confirm that this is the right way to do. As otherwise I would have to recreate all buffers (possibly loading the data from the filesystem again) which would result in a huge lag/loading screen whenever the user navigates back to the application.
Thanks Andre