AudioEngine stop loop background music on resume

Hi, background music stops after some background/foreground (using AudioEngine)

I use Cocos2d-x 3.17 with the latest patch on gitHub (cocos/audio/apple)
It happens on iOS.

Usually, after a foreground, music plays 1 seconds then in AudioEngineImpl::update I see that sourceState is AL_STOPPED and Music stops (maybe this is the effect and not the cause)

When this happens, I log AudioEngine::_audioIDInfoMap[audioID].state and the AudioState is 1 (PLAYING)

I have a simple code, only I start music in loop in the init of MainPage:

int idBackGroundMusic = AudioEngine::play2d(maintheme.mp3);
AudioEngine::setLoop(idBackGroundMusic, true);
AudioEngine::setVolume(idBackGroundMusic, 0.5f);
return true;

and pause and resume in AppDelegate

// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked.
void AppDelegate::applicationDidEnterBackground() 
{
    Director::getInstance()->stopAnimation();
    AudioEngine::pauseAll();
}

// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() 
{
  Director::getInstance()->startAnimation();
  AudioEngine::resumeAll();
}

Try with different maintheme.mp3

Could you help me?
Thank you

With very verbose active, when problem happens I received this log:

V/AudioPlayer (70): ~AudioPlayer() (0x103817430), id=1
V/AudioPlayer (84): AudioPlayer::destroy begin, id=1
V/AudioPlayer (334): Exit rotate buffer thread ...
V/AudioPlayer (124): rotateBufferThread exited!
V/AudioPlayer (140): UnqueueBuffers Before alSourceStop
V/AudioPlayer (146): Before alSourceStop
V/AudioPlayer (148): Before alSourcei
V/AudioPlayer (154): AudioPlayer::destroy end, id=1

Continuing test, I removed commit of Jul 11, 2018

Problem continues, but seems a little less frequent (maybe related with QUEUEBUFFER_TIME_STEP value??)

Hi, we are having this same issue. We also have 3.17 with that patch.