# \[iOS\] Problems with mixerSuspend and mixerResume

**URL:** <https://qa.fmod.com/t/ios-problems-with-mixersuspend-and-mixerresume/22820>\
**Category:** FMOD Engine\
**Tags:** ios, cpp\
**Created:** [April 19, 2025, 11:37am UTC](https://qa.fmod.com/t/ios-problems-with-mixersuspend-and-mixerresume/22820 "2025-04-19T11:37:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhdr](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@rhdr](https://qa.fmod.com/u/rhdr)\
**Post date:** [April 19, 2025, 11:37am UTC](https://qa.fmod.com/t/ios-problems-with-mixersuspend-and-mixerresume/22820/1 "2025-04-19T11:37:53Z")

</div>

Using fmod 2.03.07.

Calling `mixerSuspend()` when the app goes to the background sometimes shows an error in the logs, `Cannot offline render audio queue. (err: -50)`. With or without that error, when the app comes back to the foreground, and calling `mixerResume()`, the audio track that was being played before the suspend is no longer heard (the track was created by `createStream`), and new sounds can’t be played.

If the app is put into the background and brought back to the foreground again, then sounds can be played. It just happens randomly.

Calling `mixerSuspend()`:

```auto
[LOG] SystemI::mixerSuspend : Suspending output.
[ERR] CodecAudioQueue::readInternal : Cannot offline render audio queue. (err: -50)
[LOG] Thread::callback : FMOD mixer thread finished.

```

Then calling `mixerResume()`:

```auto
[LOG] SystemI::mixerResume : Resuming output.
[LOG] OutputCoreAudio::init : Hardware buffer size: 1024 samples, hardware sample rate: 48000Hz, hardware channels: 2
[LOG] OutputCoreAudio::init : Maximum hardware read size: 4096 samples, Software buffer size: 512 samples, Number of software buffers: 4.
[WRN] OutputCoreAudio::init : DSP buffer size * DSP num buffers is potentially too small.
[LOG] SystemI::startDriver : Output requires a sample rate of 48000Hz, resampling will occur.
[LOG] Thread::initThread : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: Yes, Sleep Time: 0, Looping: Yes.

```

The sounds are created by using the following:

```auto
FMOD_CREATESOUNDEXINFO info{};
info.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
info.fileuseropen = fmod_file_open_callback;
info.fileuserread = fmod_file_read_callback;
info.fileuserseek = fmod_file_seek_callback;
info.fileuserclose = fmod_file_close_callback;

```

and depending on the size of the audio file (mp3), one of the following calls is used:

```auto
result = _fmodSystem->createSound(fullPath.c_str(), FMOD_2D, &info, &sound);

```

or

```auto
result = _fmodSystem->createStream(fullPath.c_str(), FMOD_2D, &info, &sound);

```

The fileuser callbacks are set in order to use a virtual file system.

The exact same code works correctly on Android, so this is something that seems to be specific to iOS.

Is there anything I should be calling or setting to avoid this issue on iOS?

---

<div class="post-metadata">

**Author:** ![li\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/li_fmod/32/6577_2.png) [@li\_fmod](https://qa.fmod.com/u/li_fmod)\
**Post date:** [April 24, 2025, 6:13am UTC](https://qa.fmod.com/t/ios-problems-with-mixersuspend-and-mixerresume/22820/2 "2025-04-24T06:13:46Z")

</div>

Hi,

Thank you for sharing the detailed information and log output.

> [@rhdr](#):
>
> ```auto
> [LOG] SystemI::mixerResume : Resuming output.
> [LOG] OutputCoreAudio::init : Hardware buffer size: 1024 samples, hardware sample rate: 48000Hz, hardware channels: 2
> [LOG] OutputCoreAudio::init : Maximum hardware read size: 4096 samples, Software buffer size: 512 samples, Number of software buffers: 4.
> [WRN] OutputCoreAudio::init : DSP buffer size * DSP num buffers is potentially too small.
> [LOG] SystemI::startDriver : Output requires a sample rate of 48000Hz, resampling will occur.
> [LOG] Thread::initThread : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: Yes, Sleep Time: 0, Looping: Yes.
> 
> ```

These log messages suggest that the DSP buffer size may be insufficient. Could you please try using [System::setDSPBufferSize](https://fmod.com/docs/2.03/api/core-api-system.html#system_setdspbuffersize) to configure the buffer size to `(1024, 4)` before initializing FMOD, and check if the issue persists?

Additionally, I found a related discussion that might be relevant to your case: [Event callbacks don't work if other audio is playing on iOS - #4 by Leah\_FMOD](https://qa.fmod.com/t/event-callbacks-dont-work-if-other-audio-is-playing-on-ios/22465/4)

---

<div class="post-metadata">

**Author:** ![rhdr](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@rhdr](https://qa.fmod.com/u/rhdr)\
**Post date:** [April 24, 2025, 6:44am UTC](https://qa.fmod.com/t/ios-problems-with-mixersuspend-and-mixerresume/22820/3 "2025-04-24T06:44:41Z")

</div>

Thank you for the information. I’ll try upping the DSP buffer size to see if that does help, and I’ll also read through the discussion you linked.
