Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Audio DSP Load value

Discussion in 'Audio & Video' started by _MGB_, May 16, 2018.

  1. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    70
    Hey all,

    Anyone know exactly what this value relates to in the stats window? I'm messing around with OnAudioFilterRead and seeing some high values.

    I'm presuming it's % of max available cpu time spent feeding the audio subsystem, but the value appears to fluctuate under steady work, and changes wildly depending on the gameObject selected in the scene hierarchy?!

    Is it another value to take with a pinch of salt like the fps?
     
  2. ilyavitek

    ilyavitek

    Joined:
    Mar 17, 2015
    Posts:
    1
    I have a quote from Coursera course from Unity:
    "Another piece of information available in the game info panel is the DSP load which is a measure of how much audio performance your app is using."
     
  3. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    586
    It's likely because you're running (and measuring) this in the Editor
     
  4. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    70
    Thanks for the posts - not much wiser though :-/
    Not found anything to measure this with in the (non-editor) profiling stuff - just basic cpu time so far.
     
    Last edited: Aug 10, 2018 at 11:25 AM
  5. mtytel

    mtytel

    Joined:
    Feb 28, 2014
    Posts:
    69
    I would only do very simple things in OnAudioFilterRead. C# is not fast enough and the speed fluctuates too much (e.g. garbage collection) for reliable audio processing.

    Back to your problem though, I've seen weird behavior as well with the DSP number, especially on Mac. The size of the Game window can make it increase the DSP percent by up to 2x. I just keep DSP as low as possible (under 15%) so it's not a problem.
     
  6. _MGB_

    _MGB_

    Joined:
    Apr 24, 2010
    Posts:
    70
    I've tried a few things in OnAudioFilterRead... I suppose the audio filter time is shared from the main cpu pool so any game-side load would affect the dsp load value.

    Using native code instead of C# only reduced dsp load by about 10% (again though, an Editor measurement, so somewhat muddied).
    The OnAudioFilterRead callback is not on the main Unity game thread and I don't allocate any memory in my processing (unless the callback process does!).

    Of course, the audio system is shrouded in secrecy and lack of in-depth docs so who knows what's happening? :(