If I use a normal event emitter with start on create in two different scenes, it will work in both scenes on a Mac build, Windows build, in the editor, but on Android it only works in one of the two scenes and I cannot figure out why.
Some other sounds work…
There is no difference in the two objects from the two different scenes, also using the exact same audio track in FMOD.
The sound starts playing for 1 second and then simply stops.
I can see one error in my logcat logs which is:
Error setting CPU thread affinity
Once the audio randomly started working after a few minutes.
This is some very odd behaviour you’re experiencing.
As far as I know, there is no thread affinity for Android as it’s available for all cores. Can you post all FMOD errors logged from your logcat log? There might be something we’re missing.
Are you able to replicate this issue on any other Android device?
Hi Richard, thanks for the reply! I’ve not created a mobile bank and we are using ogg vorbis, that’s not ideal for mobile. So I’m trying to use a more common file format, and create a separate mobile bank and see if that solves the issue. I can’t see any FMOD error that’s the thing, the audio simply doesn’t play.
Unity audio does automatically compress it to the best fitting format specific to the platform. In FMOD does Unity still compress the sounds we add, or those it player exactly whatever we use in the bank ? Thanks
Hi Richard, what is the preferable way of resetting a sound from an emitter. Just start playing it from second 0 again. Calling Stop() and then Start() works on PC but not on mobile. Looking into the C# implementation of Stop() it looks like you are freeing the instance, could this be a cause of this weird issue ? is this a race condition ?
I can see the Stop() function contains a release and clearHandle call, so this is why it won’t work. After calling this function the event instance is no longer there to play. You can simply call start() on the event instance for it to begin again from the beginning.
This is called on a studio sound emitter, that is created in a previous seen and carried on through DontDestroyOnLoad maybe that has something to do with it… it is really weird though. Because not calling start() just unmuting works… Start works everywhere. And on mobile just sometimes, and sometimes it would just start after a few minutes out of nowhere
I’ve just experienced the issue in another scene as well. Unrelated to DontDestroyOnLoad -> some sound only randomly work, or they start out of nowhere, or just simply don’t play at all.
Are multiple regions in FMOD not fully supported on mobile ?
I think the issue might be too many concurrent parallel streaming sounds. Putting all sounds to not “streaming” seems to be working on android. I read somewhere that there is a pretty low limitation of parallel streaming sound effects.