[openal] OpenALSoft on Android, how to handle suspend/resume of application

Chris Robinson chris.kcat at gmail.com
Thu Aug 30 10:59:05 EDT 2018


On 08/30/2018 06:57 AM, Olle Hedman wrote:
> But at least one thing does not work for me anymore on Android, and that is
> suspending and resuming. (when application goes into background and comes
> back again). The problem is the mixing thread is still running and
> outputting (very choppy) sound for all our looping sound effects while the
> app is in background...
> 
> How am I supposed to handle this? Destroying and recreating the context is
> very inconvenient since the suspend can happen at any time and we want
> everything to restart playing exactly where suspended when we resume again.

Hi.

Since 1.16, OpenAL Soft has the ALC_SOFT_pause_device extension which 
should do what you want. It adds the alcDevicePauseSOFT function you can 
use to stop output processing (when you detect the app has been put into 
the background, for instance), and alcDeviceResumeSOFT to resume where 
it left off (when back in the foreground).

<http://kcat.strangesoft.net/openal-extensions/SOFT_pause_device.txt>

Feel free to ask if you have any questions with using it.

> Also, let me know if you are interested in knowing more about any of our
> other patches.

Sure, it would be good to know what changes you've needed or wanted.


More information about the openal mailing list