Search Unity

2019.2.1f1 Android build sounds like slow motion, but profiler looks fine

Discussion in 'Android' started by Undertaker-Infinity, Oct 28, 2019.

  1. Undertaker-Infinity

    Undertaker-Infinity

    Joined:
    May 2, 2014
    Posts:
    112
    Hi

    I've spent a good while trying to figure this one out. I even got a second cheap Android phone to test.
    I haven't tested on iOS as I'm not able to currently (no mac, no developer account).

    Using Unity 2019.2.1f1:
    My game runs fine in editor, but in device it runs at what feels like half speed. What's most puzzling of all is that SOUND also plays slowed down, not chopping but downpitched.
    I profiled and there's plenty of spare CPU time, almost half of the frame (45%) is spent waiting for vsync.
    Build is IL2CPP, game is retro 2D so no lights and texture memory is a constant 1.1MB, total allocated memory is around 32MB.

    Things I tried that made no difference:
    - Turning off vsync
    - Setting fps to 60 (profiler says it's running at 60fps and still has a bit of spare time per frame)
    - showing timescale in GUI (It's always 1 as it should)
    - Setting timescale to 2 (game logic runs a bit faster than in editor with timescale 1, yet sound is still in slow motion)

    Main third party assets I'm using:
    - ReWired
    - A* Pathfinding
    - Pooly
    - USFXR

    So I'm out of things to try. Do you have any ideas? Does Unity 2019.2.1f1 have any issues like what I'm describing?

    Thanks, I appreciate any ideas.
     
  2. Undertaker-Infinity

    Undertaker-Infinity

    Joined:
    May 2, 2014
    Posts:
    112
    Well, a bunch of time went by and I came back to this with renewed energy.
    After doing some visual tests comparing speed in device to editor, I figured the game is not slowing down.
    I'm using procedural audio at the default 44khz and turns out Android defaults to 22khz. Forced it to 44khz and that fixed the pitched down sound.