atamize
New Member
Posts: 5
Posts: 5
|
Post by atamize on Oct 6, 2014 14:22:10 GMT
I've got a playlist set up with 2 songs, both are MP3s approximately 5 MB in size each and are set to 2D in the import settings. The playlist is set to loop and auto advance. I'm getting unwanted results depending on the import settings I use in Unity.
Example 1 Load type: Streaming Audio origin: Resource File or Clip
Result: When one song ends, there is a massive framerate drop (from 60 FPS down to about 10 FPS) for a few seconds while the next song is loading. Once the next song starts the framerate goes back to normal.
Example 2 Load type: Compressed in memory Audio origin: Resource File or Clip
Result: Both songs play fine the first time without any framerate drop between them. However, when the playlist ends and loops back to the first song in the playlist, that first song is super choppy and basically unrecognizable. Strangely, when it eventually ends the second song plays normally.
Some specs:
Device: iPad 2, Model MC706C/A OS: iOS 7.1.1 Master Audio: 3.5.5.6 Unity: 4.5.4f1 (Pro)
I did not experience these issues within the Unity Editor, just on device. My colleagues have experienced these issues on other mobile devices (e.g. iPhone) as well.
I'd rather not decompress these files into memory of course since I'm trying to cut back on memory usage. Is there any way around these issues?
|
|
|
Post by DarkTonic Dev on Oct 6, 2014 15:43:38 GMT
Regarding example 1, when you use Resource files, the thread is completely blocked as it loads (unless you're using the Load Async option in Unity 4.5). Streaming also takes tremendous amounts of memory for large songs. So this is expected on low-powered devices, although we only see it for a few frames instead of a few seconds on our game as a song loads.
Now if you're getting it on newer devices, or aren't using Resource files and still seeing it, we would like to know your settings. I've done extensive profiling on my iPad 2 a couple months ago when Unity 4.5 came out and we implemented the async load. There really wasn't anything more that could be done as it was the Unity engine itself that caused the slowdown, not Master Audio. You might want to try not streaming just to see if that is the problem.
I haven't seen or heard of example 2 happening before.
Most likely both issues are the Unity engine itself. Master Audio after all only uses Audio Sources and Audio Clips under the covers. We don't mess with or change the core audio engine.
If you would like me to do further profiling, please send me a barebones project with only the following: 1) Master Audio and your 2 songs set up in a test scene. 2) Your songs are probably long, so please put in a button to skip to 10 second before the end of the current song.
Thank you, -Brian
|
|
atamize
New Member
Posts: 5
Posts: 5
|
Post by atamize on Oct 6, 2014 19:49:25 GMT
I don't see the Load Async option...I do have Unity Pro but the only option under the "Show Resource File Settings" checkbox is "Keep Paused Resources".
I couldn't reproduce any of these issues using a barebones project, so my guess is either my game is using too much memory in general or some other unrelated thing is crapping on the audio thread.
|
|
|
Post by DarkTonic Dev on Oct 6, 2014 22:44:01 GMT
You're right, I justed fixed it. The load resources async stuff wasn't showing up on Unity 4.5.4. The fix will be in the next released version later this week.
Probably your game is using a bunch of memory in general, but if you want to try the async option with the next version, let me know if that helps.
|
|