IOS 17 - SLOW LOADING SOUNDS - createSound

,
FMOD_MANAGER->system->createSound(
                path.c_str(),
                (loop ? FMOD_LOOP_NORMAL : FMOD_DEFAULT) | FMOD_LOWMEM | FMOD_IGNORETAGS,
                nullptr,
                &sound)

In this call after the IOS 17 update, it became much slower, the application used to take a few seconds to load all the sounds, now it takes more than 10 seconds, only devices with IOS 17 have this problem, IOS 16 and below works without delay

Hi,

What version of the FMOD engine are you using? How many sounds are you attempting to load? Would it be possible to see more of the code around where this function is being called?

I am using FMOD version 2.02.19.

We have an audio library written in C++ that uses FMOD to load and play audios for iOS.

After the release of iOS 17, FMOD is taking significantly longer to load audios into memory. On iOS 16 and earlier, it took about 2 seconds to load 88 audios, but on iOS 17, it takes more than 10 seconds.

Sound::Sound(
        const string& path,
        bool loop,
        bool usePool): loop(loop), usePool(usePool), path(path)
{
    this->className = __func__;

    SoundManager::errorCheck(
        FMOD_MANAGER->system->createSound(
                path.c_str(),
                (loop ? FMOD_LOOP_NORMAL : FMOD_DEFAULT) | FMOD_LOWMEM | FMOD_IGNORETAGS,
                nullptr,
                &sound),
        LOG_LABEL);
    
    if(loop) {
        this->sound->setLoopCount(-1);
        this->sound->setMode(FMOD_LOOP_NORMAL);
    }

    this->endMs = this->getDurationMs();
}

I load each Sound object into a list. After studying the entire code flow, the part that is taking longer is in the createSound function.

Here I have 2 data samples of the time each audio took to be created. The first is from iOS 17 on the iPhone XS, and the second is from an iPad with iOS 15.

iOS 17 on iPhone XS:

  • [LOG] createSound → Execution time: 113.528 ms
  • [LOG] createSound → Execution time: 110.122 ms
  • [LOG] createSound → Execution time: 16.6693 ms
  • [LOG] createSound → Execution time: 39.201 ms
  • [LOG] createSound → Execution time: 15.7652 ms
  • [LOG] createSound → Execution time: 53.8878 ms
  • [LOG] createSound → Execution time: 10.46 ms
  • [LOG] createSound → Execution time: 10.2287 ms
  • [LOG] createSound → Execution time: 23.9872 ms
  • [LOG] createSound → Execution time: 281.556 ms
  • [LOG] createSound → Execution time: 225.761 ms
  • [LOG] createSound → Execution time: 208.398 ms
  • [LOG] createSound → Execution time: 268.543 ms
  • [LOG] createSound → Execution time: 242.886 ms
  • [LOG] createSound → Execution time: 252.196 ms
  • [LOG] createSound → Execution time: 219.289 ms
  • [LOG] createSound → Execution time: 233.939 ms
  • [LOG] createSound → Execution time: 234.37 ms
  • [LOG] createSound → Execution time: 265.433 ms
  • [LOG] createSound → Execution time: 240.321 ms
  • [LOG] createSound → Execution time: 225.238 ms
  • [LOG] createSound → Execution time: 225.844 ms
  • [LOG] createSound → Execution time: 218.499 ms
  • [LOG] createSound → Execution time: 224.706 ms
  • [LOG] createSound → Execution time: 216.933 ms
  • [LOG] createSound → Execution time: 218.761 ms
  • [LOG] createSound → Execution time: 219.701 ms
  • [LOG] createSound → Execution time: 224.82 ms
  • [LOG] createSound → Execution time: 220.774 ms
  • [LOG] createSound → Execution time: 222.076 ms
  • [LOG] createSound → Execution time: 232.615 ms
  • [LOG] createSound → Execution time: 196.018 ms
  • [LOG] createSound → Execution time: 193.505 ms
  • [LOG] createSound → Execution time: 225.665 ms
  • [LOG] createSound → Execution time: 223.32 ms
  • [LOG] createSound → Execution time: 219.989 ms
  • [LOG] createSound → Execution time: 221.098 ms
  • [LOG] createSound → Execution time: 216.872 ms
  • [LOG] createSound → Execution time: 224.665 ms
  • [LOG] createSound → Execution time: 215.54 ms
  • [LOG] createSound → Execution time: 166.287 ms
  • [LOG] createSound → Execution time: 190.805 ms
  • [LOG] createSound → Execution time: 214.247 ms
  • [LOG] createSound → Execution time: 214.258 ms
  • [LOG] createSound → Execution time: 212.448 ms
  • [LOG] createSound → Execution time: 223.816 ms
  • [LOG] createSound → Execution time: 211.255 ms
  • [LOG] createSound → Execution time: 211.464 ms
  • [LOG] createSound → Execution time: 211.791 ms
  • [LOG] createSound → Execution time: 209.953 ms
  • [LOG] createSound → Execution time: 227.954 ms
  • [LOG] createSound → Execution time: 217.158 ms
  • [LOG] createSound → Execution time: 223.649 ms
  • [LOG] createSound → Execution time: 223.447 ms
  • [LOG] createSound → Execution time: 152.13 ms
  • [LOG] createSound → Execution time: 161.187 ms
  • [LOG] createSound → Execution time: 176.256 ms
  • [LOG] createSound → Execution time: 191.085 ms
  • [LOG] createSound → Execution time: 178.598 ms
  • [LOG] createSound → Execution time: 98.8674 ms
  • [LOG] createSound → Execution time: 97.1883 ms
  • [LOG] createSound → Execution time: 221.623 ms
  • [LOG] createSound → Execution time: 206.839 ms
  • [LOG] createSound → Execution time: 232.618 ms
  • [LOG] createSound → Execution time: 210.836 ms
  • [LOG] createSound → Execution time: 223.607 ms
  • [LOG] createSound → Execution time: 239.577 ms
  • [LOG] createSound → Execution time: 225.737 ms
  • [LOG] createSound → Execution time: 207.521 ms
  • [LOG] createSound → Execution time: 210.13 ms
  • [LOG] createSound → Execution time: 218.061 ms
  • [LOG] createSound → Execution time: 209.03 ms
  • [LOG] createSound → Execution time: 209.25 ms
  • [LOG] createSound → Execution time: 210.987 ms
  • [LOG] createSound → Execution time: 210.144 ms
  • [LOG] createSound → Execution time: 217.972 ms
  • [LOG] createSound → Execution time: 207.781 ms
  • [LOG] createSound → Execution time: 168.534 ms
  • [LOG] createSound → Execution time: 209.275 ms
  • [LOG] createSound → Execution time: 208.312 ms
  • [LOG] createSound → Execution time: 239.804 ms
  • [LOG] createSound → Execution time: 208.731 ms
  • [LOG] createSound → Execution time: 207.801 ms
  • [LOG] createSound → Execution time: 176.751 ms
  • [LOG] createSound → Execution time: 212.307 ms
  • [LOG] createSound → Execution time: 223.842 ms
  • [LOG] createSound → Execution time: 212.662 ms
  • [LOG] createSound → Execution time: 207.289 ms
  • [LOG] createSound → Execution time: 205.51 ms
  • [LOG] createSound → Execution time: 212.708 ms
  • [LOG] createSound → Execution time: 221.089 ms
  • [LOG] createSound → Execution time: 206.397 ms
  • [LOG] createSound → Execution time: 224.648 ms
  • [LOG] createSound → Execution time: 153.392 ms
  • [LOG] createSound → Execution time: 194.766 ms
  • [LOG] createSound → Execution time: 187.893 ms
  • [LOG] createSound → Execution time: 185.562 ms

iOS 15 on iPad:

  • [LOG] createSound → Execution time: 66.4645 ms
  • [LOG] createSound → Execution time: 30.0425 ms
  • [LOG] createSound → Execution time: 28.4629 ms
  • [LOG] createSound → Execution time: 28.0175 ms
  • [LOG] createSound → Execution time: 28.1204 ms
  • [LOG] createSound → Execution time: 27.4174 ms
  • [LOG] createSound → Execution time: 28.628 ms
  • [LOG] createSound → Execution time: 27.3305 ms
  • [LOG] createSound → Execution time: 29.0162 ms
  • [LOG] createSound → Execution time: 27.6728 ms
  • [LOG] createSound → Execution time: 28.1165 ms
  • [LOG] createSound → Execution time: 27.7802 ms
  • [LOG] createSound → Execution time: 27.8619 ms
  • [LOG] createSound → Execution time: 28.9236 ms
  • [LOG] createSound → Execution time: 27.993 ms
  • [LOG] createSound → Execution time: 28.143 ms
  • [LOG] createSound → Execution time: 29.143 ms
  • [LOG] createSound → Execution time: 28.1175 ms
  • [LOG] createSound → Execution time: 28.1567 ms
  • [LOG] createSound → Execution time: 27.919 ms
  • [LOG] createSound → Execution time: 28.4752 ms
  • [LOG] createSound → Execution time: 28.0024 ms
  • [LOG] createSound → Execution time: 27.7509 ms
  • [LOG] createSound → Execution time: 28.1492 ms
  • [LOG] createSound → Execution time: 28.0796 ms
  • [LOG] createSound → Execution time: 27.9966 ms
  • [LOG] createSound → Execution time: 28.9962 ms
  • [LOG] createSound → Execution time: 28.439 ms
  • [LOG] createSound → Execution time: 27.2839 ms
  • [LOG] createSound → Execution time: 27.378 ms
  • [LOG] createSound → Execution time: 26.7843 ms
  • [LOG] createSound → Execution time: 28.2083 ms
  • [LOG] createSound → Execution time: 27.6546 ms
  • [LOG] createSound → Execution time: 27.5624 ms
  • [LOG] createSound → Execution time: 28.2002 ms
  • [LOG] createSound → Execution time: 28.5732 ms
  • [LOG] createSound → Execution time: 28.5959 ms
  • [LOG] createSound → Execution time: 28.562 ms
  • [LOG] createSound → Execution time: 28.436 ms
  • [LOG] createSound → Execution time: 28.6807 ms
  • [LOG] createSound → Execution time: 29.331 ms
  • [LOG] createSound → Execution time: 28.68 ms
  • [LOG] createSound → Execution time: 28.5179 ms
  • [LOG] createSound → Execution time: 28.2072 ms
  • [LOG] createSound → Execution time: 27.577 ms
  • [LOG] createSound → Execution time: 1.81137 ms
  • [LOG] createSound → Execution time: 1.809 ms
  • [LOG] createSound → Execution time: 1.74212 ms
  • [LOG] createSound → Execution time: 1.63442 ms
  • [LOG] createSound → Execution time: 1.69875 ms
  • [LOG] createSound → Execution time: 1.55525 ms
  • [LOG] createSound → Execution time: 4.56242 ms
  • [LOG] createSound → Execution time: 4.45179 ms
  • [LOG] createSound → Execution time: 4.50008 ms
  • [LOG] createSound → Execution time: 21.2828 ms
  • [LOG] createSound → Execution time: 22.1325 ms
  • [LOG] createSound → Execution time: 22.2529 ms
  • [LOG] createSound → Execution time: 2.66879 ms
  • [LOG] createSound → Execution time: 2.58629 ms
  • [LOG] createSound → Execution time: 2.55875 ms
  • [LOG] createSound → Execution time: 43.4046 ms

For some reason, in IOS 17 it is taking much longer to load the audios.

Hi,

Unfortunately, I was not able to reproduce the issue using an iPhone on IOS 17 and an iPad on IOS 15 loading 90 sounds in our example.

I see that you are using a Sound::Sound class. Would it be possible for some file IO operations you are doing to cause the delays?

If not, would it be possible to get a copy of the project or the audio files to test on my end?