Search Unity

[SOLVED IN UNITY 5.3.4] Music popping/skipping on Andriod CPU spike ... tried everything, help?

Discussion in 'Audio & Video' started by DivideByNil, Mar 10, 2016.

  1. DivideByNil

    DivideByNil

    Joined:
    Dec 4, 2015
    Posts:
    15
    [EDIT:] Unity 5.3.4 has solved the issue. The following release note seems to correspond to the issue:
    • Android: Audio; don't select OpenSL output if the native device params are too bad for fast path (fixes audio issues on some buggy devices).
    [ORIGINAL POST FOLLOWS]

    Hello, the title says it all!

    My project has an issue with music popping and skipping which seems to be linked with very minor FPS dips. Is there anything I can do to fix this or prioritize the music over FPS? (A game can drop a few frames and still be perfectly playable, but popping audio is always unacceptable).

    Some basic info:

    1. The music sounds fine when played in a music program or DAW. There is nothing wrong with the track itself.

    2. There isn't a whole lot going on in the scene. The FPS never dips below 30 and usually sits right around 50. The pops and stutters are often random. Sometimes when there is no noticeable frame drop the music will pop. Other times, when the frame drops a bit or there is a lot of processing going on, but there won't be any pops or skips. Usually, however, the pops occur during a minor hitch. Forcing the target frame-rate to 30 does not solve the issue.

    3. I am testing on a Motorola Nexus 6 (2014). Profilers are off (when they are on, the problem is even worse).

    4. No memory issues or excessive garbage collection. The device doesn't even get warm....

    5. I haven't even attached a mixer to the scene yet. There are also no other sounds present. Spatial blend set to 0 (2d mode).

    6. Cutting the physics fixed update time in half does not solve the issue.

    7. I am using Unity 5.3.3f1

    8. Running an empty project fixes the issue.......... but that isn't exactly a good compromise

    I have tried:

    Tweaking the DSP buffer settings. No setting is effective at removing the audio pops/stutters. Changing file settings such as stream or decompressing before load. No luck. Tried OGG and MP3... similar result.

    Any help would be GREATLY appreciated.
     
    Last edited: Mar 22, 2016
  2. DivideByNil

    DivideByNil

    Joined:
    Dec 4, 2015
    Posts:
    15
    As an update: Turning on Multithreaded Rendering from the Android Player Settings helped a great deal, but the problem is not eliminated.

    Any advice?
     
  3. DivideByNil

    DivideByNil

    Joined:
    Dec 4, 2015
    Posts:
    15
    I also find this issue may be device specific, as the older, less-powerful devices I have tested do not exhibit these issues. For example, I tested the game on a Nexus 7 from 2012 and a weaker Acer A1-830 and they both do not have the audio popping issues and the game runs just fine, but the Nexus 6 from 2014 does indeed have the audio popping issue.

    Interesting.... Anyone have anything to add?
     
    Last edited: Mar 14, 2016
  4. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    In Unity 5.3 they enable OpenSL audio path , maybe it introduced some issues on certain devices.
    In the latest patch they fixed audio playing horribly on devices not properly supporting openSL, not sure it is related but you may try.
    Also try to see if the issue is present on Unity 5.2.

    You may want to tell about the issue to Yuri on this topic:
    http://forum.unity3d.com/threads/android-sound-problem.359341/page-3
     
    DivideByNil likes this.