x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Android] New AudioMixerAndroid in 4.17p1 results in crackling audio

EDIT: Just tested my project with 4.17P1 and the new audio mixer and unfortunately while the crackle is no where near as bad as in 4.16 it is still there on some sounds :(

Any ideas/workarounds how to prevent that? Was really hoping to use 4.17 for 3D audio in our GearVR game ...

I'm testing the new Audio Engine in 4.16P1 on android using:

"For Android, in AndroidEngine.ini set AudioDeviceModuleName=AudioMixerAndroid"

when testing on my device: Samsung S7 Edge 6.0.1 minSDK 19 armv7 I get spatialized audio finally however it has a cracking to it. I tested a few different sound files with the same result.

I can reproduce it on a blank project by importing a sound keeping all defaults and playing the sound at a distance from the player.

If I disable the new audio engine the crackling sound is gone. Are there any special sound settings required on the wav or cue itself? I was really hoping to get this working for gearvr with the 4.16 release.

Product Version: UE 4.17 Preview
Tags:
more ▼

asked Apr 26 '17 at 07:14 PM in Bug Reports

avatar image

aussieburger
1.4k 40 174 74

(comments are locked)
10|2000 characters needed characters left

4 answers: sort voted first

Hi aussieburger.

I've discussed with our audio developers and this is a known issue with the new audio engine that affects Android, iOS, and some consoles. This is being worked on.

I don't have the ticket number for reference at the moment, but if I can track that down I will follow up with additional details.

Cheers

more ▼

answered Apr 27 '17 at 01:14 PM

avatar image

Stephen Ellis ♦♦ STAFF
11.3k 322 32 480

avatar image aussieburger May 02 '17 at 06:30 PM

any update if this will be fixed for the 4.16 final?

avatar image Minus_Kelvin STAFF May 03 '17 at 06:15 PM

Apologies, but this is not going to be fixed for 4.16.

The focus for the new audio engine for 4.16 has been the PC implementation.

Specifically, the android backend implementation has a number of issues with the OpenSL ES implementation that I am fixing now. For example, the buffer callback from the platform queued voice is doing the actual audio rendering (rather than using a double-buffer approach like is used on PC). This causes immediate buffer underruns (which is the "crackling" you're hearing) even with just a small number of source voices.

The good news is that it only took a couple hours to fix up but the number of changes from the original Android implementation to the new one are significant and is way too risky to bring into 4.16 right now, especially since the new audio engine is "experimental". In other words, there isn't an expectation to work fully and no content has been made which is using it, which means there's no regression issues. Any request for code changes at this point to experimental features are generally denied since there is no reasonable expectation that it will work.

I apologize for the inconvenience, but please bare with me on this. We're trying to role out a new audio engine on 9 platforms (PC/Mac/XboxOne/PS4/iOS/Android/Linux/HTML5/Switch) that has backwards compat on all existing features, while also supporting all our internal game releases (e.g. Paragon/Fortnite/Spyjinx/Battlebreakers/RoboRecall), all the old audio engine stuff (can't have regressions!), as well as licensee and forum support. :D

To help with the back end implementations, we contracted out a "first pass" implementation on Android/iOS/Switch/Mac but I have not yet personally looked at these back ends deeply as my focus has been fixing bugs in the multi-platform audio renderer so at least PC is relatively stable and bug-free in 4.16 since that's where most users are going to be trying things out.

avatar image aussieburger May 04 '17 at 08:33 AM

ok thanks for the additional info - Can we expect it working for 4.17?

avatar image aussieburger Jul 13 '17 at 07:47 PM

Just tested my project with 4.17P1 and the new audio mixer and unfortunately while the crackle is no where near as bad as in 4.16 it is still there on some sounds :(

Any ideas/workarounds how to prevent that? Was really hoping to use 4.17 for 3D audio in our GearVR game ...

avatar image Minus_Kelvin STAFF Jul 14 '17 at 09:54 PM

How many sounds are you trying to render on android? Android is still a very limited platform (CPU-wise) for audio. You might have to reduce your channel (voice) limit to something around 10-20 voices. One of the primary reasons is CPU threads can get throttled very quickly for a number of reasons (background apps, temperature, feathers in china, etc).

I wrote some code which should mitigate this issue by queuing a bunch of rendered audio buffers so any individual buffer might take more time due to CPU throttling, but overall should be good.

However, there's still general performance issues on android and it's possible to simply "underrun" if it's trying to do too much.

avatar image Chris Babcock STAFF Jul 14 '17 at 11:05 PM

I just checked in an update for Android which uses the optimal buffer size and sample rate for the new mixer. On an S7 it seems to work properly for me with this so please give it a try.

GitHub audio fix

avatar image aussieburger Jul 17 '17 at 02:23 PM

Hey Minus_Kelvin and Chris,

I tried the github audio fix and unfortunately the same issue. I guess I found what triggers it - many of sounds I'm using I have increased the volume to match the volumes of other sounds. See this example project with one sound (played every 10secs) that crackles on my S7

I usually don't have more than 3 sounds going at once but put the channel limit to 10 just to be sure and same issue.

Increasing the volume like this did not have an effect on the old audio engine and would be nice if it was not the case with the new engine either. Now I have to go through all sounds checking their volume for crackling and lower the overall volume of each sound manually so they normalize each other - or is there a simpler way to do this?

link text

soundtest.zip (687.6 kB)
avatar image Minus_Kelvin STAFF Jul 17 '17 at 10:10 PM

Hey there,

So for projects switching content implemented in old audio engine to the new multiplatform audio mixer, I tried my best to make it as smooth as possible.

However, here's one case where I intentionally chose not to move a feature from the old audio engine to the new one. A long time ago I had added a platform-dependent headroom scaler (I believe it defaults to -3 dB). The theory on this was that different platforms have different volumes due to totally different backend APIs. In particular, I was hunting around for a way to make our our Mac backend match, volume-wise, to our PC backend.

Moving to a multiplatform audio mixer, this issue is no longer present. each platform uses the exact same math for mixing. If you want to add a headroom value to all your audio, you simply need to reduce the volume of the master sound class.

Note that in the audio mixer, I am still doing the same volume clamp per source that was being done in the old audio engine:

     CurrentVolume = FMath::Clamp<float>(CurrentVolume * AudioDevice->GetPlatformAudioHeadroom(), 0.0f, MAX_VOLUME);

I simply am not adding an addition -3dB (default) headroom reduction.

avatar image Minus_Kelvin STAFF Jul 17 '17 at 10:11 PM

Philosophically I'd prefer not to add even this clamp since MAX_VOLUME, being 4.0, isn't any real protection against clipping. The reason I kept this is that, unfortunately, it's common practice to add volume-scalers greater than 1.0 in many gain stages in UE4 and people do check in non-normalized source. A source playing at, for example, 2.0 volume scale, won't actually clip if the content in it is not normalized. This is all too common a (bad) practice since not only does it not take advantage of the full bit-depth of the source file (often the same people complaining about wanting 24/32 bit audio are using non-normalized source!).

In general, it's a bad idea to do mixing with volume value greater than 1.0 because at some point, due to the nature of digital audio, you're eventually going to get some kind of clamp. You either clamp to 1.0 in the output, or you clamp via clipping. You can also clamp via dynamic range DSP compressor, but even then it can make reasoning about your mixes difficult.

This is because, when you clamp, you're creating a non-linearity between your gain stage input and gain stage output. Non-linearity means that if you change your mix (adding a new sound class mix, change the volume of a sound source), it may or may not have a predictable effect on the final volumes of sources. Inputs do not map linearly to outputs.

We're planning on developing better tools to help you debug your gain stages, but in the meantime, I'd recommend looking over your implementation to make sure you're not adding too much volume scaling.

Note that the audio mixer actually has support for a master dynamic range compressor. You can create a dynamics processor preset in the editor, set it to be a "limiter", and then add it to the master submix in BP. It defaults to not being added currently since the old audio engine didn't have support for a master compressor.

avatar image aussieburger Jul 18 '17 at 03:00 PM

Thanks Minus_Kelvin for the detailed answer - I've still alot to learn about digital audio but definitely makes sense that volume mixing probably shouldn't go above 1. Anyway I try to reduce the master sound class else fix the volume mixing manually - I'm just glad spatialized audio for mobile VR now works! :)

avatar image jasonh2013 Jul 19 '17 at 04:16 PM

I can confirm that reducing the volume below 1, and upgrading to Preview 2 solved nearly all audio issues for me. I think at this point any audio issues I'm experiencing are probably specific to individual wav files rather than to anything else. It's really cool to have spatialization working now. Very excited when this version of the engine is released. This is a significant upgrade for the kinds of things I'm working on (android and daydream).

avatar image aussieburger Sep 27 '17 at 07:35 PM

For those still banging their head trying to remove the last crackling audio I found adjusting this setting did the trick for my project:

Project Settings - Android - Callback Buffer Size: 2048

No noticeable increase in latency and no more small random crackles :)

avatar image aussieburger Aug 20 '17 at 04:16 PM

Hi Minus_Kelvin,

We've noticed a Daydream related audio problem with the new engine. Could you take a look to see if there is a quick fix?

https://answers.unrealengine.com/questions/677850/daydream-rejection-due-to-audio-not-stopping-with.html

It does not occur with the old audio mixer. Many thanks in advance! :)

avatar image virtualHC Nov 03 '17 at 03:06 AM

UE4 4.17 and a single audio source playing and I get crackling. I tried buffers up to 4096 in size and also increasing the number of buffers but wasn't able to get clean audio. This is on a Samsung Galaxy S8.

avatar image aussieburger Nov 03 '17 at 12:00 PM

Perhaps try 4.18? I noticed further improvements with it.

avatar image virtualHC Nov 03 '17 at 09:32 PM

Sorry, my mistake. I actually meant UE4 4.18. That's the version were I get the crackling. Also I have a custom USynthComponent with custom DSP as part of a plugin that works well on Windows but produces no sound in Android (and no error messages).

EDIT: Got it to work. Somehow I had forgotten to enable the new audio engine in the ini file. Sorry for the noise.

(comments are locked)
10|2000 characters needed characters left

FYI I just tested a pitch multiplier via blueprints with 4.16 on S7 Edge/GearVR. Works... Thank you Epic finally! And with no crackling.

more ▼

answered Jun 14 '17 at 05:05 PM

avatar image

Rend
16 1 2

avatar image aussieburger Jun 14 '17 at 06:00 PM

Strange I'm still getting crackling - could you give some info on how your calling your audio? Are you calling it via playSoundAtLocation to have it spatialized?

avatar image Rend Aug 11 '17 at 05:57 PM

To answer your question it was a sound component in an actor (Helicopter). Just wanted the engine sound to change pitch with more or less load on the rotor.

In my spatialization test for 4.17 I added and empty actor to the map and added a sound component to that. Spatialization worked just fine with headphones on. However the the pitch doesn't change anymore.

I have never got the modulation to change using a sound cue on gearvr. Only by using "Set Pitch Modulation" function for the sound component in the actor itself.

(comments are locked)
10|2000 characters needed characters left

Edit: Multiplier instead of Modulation.

I have never got the modulation to change using a sound cue on gearvr. Only by using "Set Pitch Multiplier" function for the sound component in the actor itself.

more ▼

answered Aug 12 '17 at 02:14 AM

avatar image

Rend
16 1 2

(comments are locked)
10|2000 characters needed characters left

Sorry been on the road quite a bit. I was only talking about pitch modulation. Its was indeed crackling until I turned off spatialization in 4.16, Now with 4.17 spatialization works, but my pitch modulation doesn't.

Is pitch modulation now broken on gearvr 4.17?

more ▼

answered Aug 11 '17 at 05:42 PM

avatar image

Rend
16 1 2

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question