Download

Android sounds are not reliable

Hi!
I am having some issues with the sound. For some reason, sometimes, the sounds are not played properly. When you click a button for example, the sound does not play. Looking at the android logs files, I saw the following.

An excerpt from when the app was starting:


Line 1482: 08-24 14:51:34.000  4962  4983 D UE4     : LogAndroidAudio: Warning: SL Entered Init HW
    Line 1483: 08-24 14:51:34.000  4962  4983 D UE4     : 
    Line 1484: 08-24 14:51:34.000  4962  4983 D UE4     : [2018.08.24-13.51.34:000]  0]LogAndroidAudio: Warning: SL Entered Init HW
    Line 1485: 08-24 14:51:34.000  4962  4983 D UE4     : LogAndroidAudio: Warning: OpenSLES Initializing HW
    Line 1486: 08-24 14:51:34.000  4962  4983 D UE4     : 
    Line 1487: 08-24 14:51:34.000  4962  4983 D UE4     : [2018.08.24-13.51.34:000]  0]LogAndroidAudio: Warning: OpenSLES Initializing HW
    Line 1488: 08-24 14:51:34.002  4962  4983 D UE4     : LogAndroidAudio: Warning: OpenSLES Initialized
    Line 1489: 08-24 14:51:34.002  4962  4983 D UE4     : 
    Line 1490: 08-24 14:51:34.002  4962  4983 D UE4     : [2018.08.24-13.51.34:002]  0]LogAndroidAudio: Warning: OpenSLES Initialized
    Line 1491: 08-24 14:51:34.002  4962  4983 D UE4     : LogAndroidAudio: Warning: OpenSLAudioDevice: Allocated 12 sources
    Line 1492: 08-24 14:51:34.002  4962  4983 D UE4     : 
    Line 1493: 08-24 14:51:34.002  4962  4983 D UE4     : [2018.08.24-13.51.34:002]  0]LogAndroidAudio: Warning: OpenSLAudioDevice: Allocated 12 sources
    Line 1494: 08-24 14:51:34.003  4962  4983 D UE4     : [2018.08.24-13.51.34:003]  0]LogInit: FAudioDevice initialized.
    Line 1495: 08-24 14:51:34.003  4962  4983 D UE4     : LogAudio: Warning: Can't increase channels past starting number!
    Line 1496: 08-24 14:51:34.003  4962  4983 D UE4     : 
    Line 1497: 08-24 14:51:34.003  4962  4983 D UE4     : [2018.08.24-13.51.34:003]  0]LogAudio: Warning: Can't increase channels past starting number!
    Line 1498: 08-24 14:51:34.006  4962  4983 D UE4     : [2018.08.24-13.51.34:005]  0]LogInit: Texture streaming: Disabled
    Line 1499: 08-24 14:51:34.006  4962  4983 D UE4     : LogOnline: Warning: FOnlineSubsystemGooglePlayModule was disabled
    Line 1500: 08-24 14:51:34.006  4962  4983 D UE4     : 
    Line 1501: 08-24 14:51:34.006  4962  4983 D UE4     : [2018.08.24-13.51.34:006]  0]LogOnline: Warning: FOnlineSubsystemGooglePlayModule was disabled
    Line 1502: 08-24 14:51:34.026  4962  4983 D UE4     : LogAudio: Warning: Can't increase channels past starting number!
    Line 1503: 08-24 14:51:34.026  4962  4983 D UE4     : 
    Line 1504: 08-24 14:51:34.027  4962  4983 D UE4     : [2018.08.24-13.51.34:026]  0]LogAudio: Warning: Can't increase channels past starting number!

And this is when a sound should be played, but is not played:


Line 2982: 08-24 14:52:04.597  4962  5733 I libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
    Line 2983: 08-24 14:52:04.598  4962  5733 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 44100 Hz, output 48000 Hz
    Line 2984: 08-24 14:52:04.598  4962  5733 D AudioTrack: Client defaulted notificationFrames to 590 for frameCount 1772
    Line 2989: 08-24 14:52:04.646  4962  4962 W Thread-2: type=1400 audit(0.0:174064): avc: denied { read } for 

I have tried to look for those errors, but I have found nothing relevant. Are you guys having some issues with any android sound? I am using Sony xperia devices.

Thanks!

Hi @Naitguolf, are you using the New Unreal Audio Mixer (currently early access)? Or are you using the default engine?

Hi Dan. I am using default UE4 audio mixer. I think the problem was somehow with the memory of the device. Because with a smaller map, the sounds seems to work. So far is working fine. But the log messages are still there, so I wonder if someone knows what they mean.

I have the same issue starting from UE 4.18

As of UE 4.24, the Audio Mixer (the new Unreal Audio Engine) has been activated by default. I would not use the old legacy engine for Android, it may have been the worst of all our legacy backends.

Can you, please, better specify how? I converted a project from 4.22 to 4.24 (Android project), and now the audio is not working.

EDIT: On a brand-new project the audio works (empty map with a blueprint that spawn a 2D sound. In the old project, with the exact same setup, same blueprint, same audio file, empty map *with this blueprint only), it doesn’t work. Maybe same setting? Not sure which one…

You can double check if your old project is using the new Audio Mixer by going to your Output Log after opening the Editor and searching for AudioMixer. You should see device initialization log lines from the category LogAudioMixer.

Thank you for the tip. I checked the initial output log, but I found the LogAudioMixer, so it was active. However, I managed to solve the problem, and I post the solution (that worked for me) here for future reference.

From the Config/DefaultEngine.ini file, I erased the following lines (which I had):


AndroidAudio=Default
AudioSampleRate=44100
AudioCallbackBufferFrameSize=1024
AudioNumBuffersToEnqueue=4
AudioMaxChannels=0
AudioNumSourceWorkers=0
SpatializationPlugin=
ReverbPlugin=
OcclusionPlugin=
CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0)


Now, the audio works as expected.