Error Unity [FMOD] OutputAAudio::stop : Cannot stop stream

Every time I background my game on Android, I get this error:

2020/12/04 12:02:59.649 11711 11816 Warn AAudioStream safeStop() stream not running, state = AAUDIO_STREAM_STATE_PAUSING
2020/12/04 12:02:59.650 11711 11816 Error Unity [FMOD] OutputAAudio::stop : Cannot stop stream. Result = 0xFFFFFC81.
2020/12/04 12:02:59.650 11711 11816 Error Unity 
2020/12/04 12:02:59.650 11711 11816 Error Unity UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
2020/12/04 12:02:59.650 11711 11816 Error Unity UnityEngine.Logger:Log(LogType, Object)
2020/12/04 12:02:59.650 11711 11816 Error Unity UnityEngine.Debug:LogError(Object)
2020/12/04 12:02:59.650 11711 11816 Error Unity FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, StringWrapper, Int32, StringWrapper, StringWrapper)
2020/12/04 12:02:59.650 11711 11816 Error Unity  
2020/12/04 12:02:59.650 11711 11816 Error Unity (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
2020/12/04 12:02:59.650 11711 11816 Error Unity 
2020/12/04 12:02:59.651 11711 11816 Debug AAudio AAudioStream_close(s#2) called ---------------
2020/12/04 12:02:59.652 11711 11816 Debug AAudioStream setState(s#2) from 5 to 11
2020/12/04 12:02:59.753 11711 11816 Debug AAudioStream setState(s#2) from 11 to 11
2020/12/04 12:02:59.753 11711 11816 Error AAudioStream setState(2) tried to set to 11 but already CLOSING

Despite spitting out this error, nothing seems to be behaving wrong, but we’re collecting error data from players (those who consent to it, anyway), so this adds a lot of noise that we don’t want to sift through as well as unnecessary server requests.

This is from Android Logcat, running on a pixel 3 with latest firmware. We’re using fmod 2.00.10 and Unity 2020.1.13f1

Any idea what might be causing this? We looked into the MixerSuspend and MixerResume functions, but those seem to be getting called already.

Hey,

So this will happen as part of suspending and resuming. In order to correctly handle headphone/speaker switching while the game is inactive, it will stop/close and reinitialise. For some reason, it is finding AAudio paused (AAUDIO_ERROR_INVALID_STATE is the error code) and failing to stop the stream.

The stop failing is not a surprise - we may have to look to downgrading the message to a warning instead of an error.

Hi Tristan,

Thanks for getting back to me. If it’s not an error we should be particularly worried about, we may be able to filter it out of our error logging.

Hey Zander,

It seems that I misidentified the issue - this was actually fixed in 2.00.13.

1 Like