Languages

Menu
Sites
Language
[Solved] OpenAL and power consumption

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

Edited by: Andre Rudlaff on 14 Mar, 2017
View Selected Answer

Responses

3 Replies
K Johnson

Did you create the issue in JIRA system in this link?

Andre Rudlaff

No I didn't check the JIRA system before.

Did you mean I should file a bugreport for the issue or did you want to show me an existing report (The link seems to just point to the dashboard overview).

Mark as answer
Andre Rudlaff

OK, so I consider this "solved". I had to close the OpenAL device anyway as otherwise no sounds were playing after a call was made.

Therefore I need to keep the audio data around twice now - once within the OpenAL buffer and once for caching and refilling the OpenAL buffers.

This is wasting lots of memory but the app keeps working and has been approved.

 

I'd still suggesting this should be fixed in the platform.