Android graphics freezing when sound played in v3.13.1 and v3.14

cocos2d-x v3.12 Android build: Animations and sound are fine when playing audio files.
cocos2d-x v3.13.1 and 3.14 Android build: Animations freeze when trying to play any audio file (very small files), and no sound is played. Sometimes I can hear the start of one of one of the audio files, but then the game freezes and no more sound is played.

It works correctly when compiled for Windows in 3.12, 3.13.1 and 3.14, so it’s a specific issue with the Android code in 3.13.1 and 3.14.

Tested on Nexus 6P with Android 7.1.1.

[EDIT]
I’m seeing strange errors in the log:
01-10 14:49:22.818 15961 15988 V AudioPlayerProvider: FileInfo (0xecd7f9d8), Waitup preload (assets/SpecialSound.ogg) …
01-10 14:49:22.818 15961 15988 E AudioPlayerProvider: FileInfo (0xecd7f9d8), preloadEffect (assets/SpecialSound.ogg) failed
01-10 14:49:22.818 15961 15988 V AudioPlayerProvider: getAudioPlayer, 199 return nullptr
01-10 14:49:22.818 15961 15988 E cocos2d-x debug info: Oops, player is null …
01-10 14:49:26.519 15961 15988 V cocos2d-x debug info: play2d, _audioPlayers.size=0
01-10 14:49:26.520 15961 15988 V AudioPlayerProvider: (assets/SpecialSound.ogg) file size: 4797
01-10 14:49:26.520 15961 15988 V AudioPlayerProvider: audio (assets/SpecialSound.ogg) is being preloaded, add to callback vector!
01-10 14:49:26.520 15961 15988 V AudioPlayerProvider: FileInfo (0xecd7f9d8), Waiting preload (assets/SpecialSound.ogg) to finish …

If anyone has come across this issue before, then please do let me know, because I’m at a loss here why this started happening all of the sudden. This issue only happens on the Android build.

Could you please create a github issue?
Thanks.

Could you upload SpecialSound.ogg and the detailed log file?

btw dont use ogg, we had huge performance issue due it - when switched to MP3 got better performance.

MP3 requires a licensing fee to use (yes I realise it’s for games with distribution over 5000 units, but regardless). For the time being I would prefer to avoid using MP3 format unless absolutely required.

I’ll make a test case first to see if I can reproduce it outside of my game, and then if that happens I’ll create the github issue and upload the OGG audio file along with the log file.

never seen such state that you need to pay for using MP3 files in game. Could you please give link where u find it?

Issue submitted on github:

I’ve attached a minimal test project which contains the audio file being played (specialsound.ogg). The logcat output is also attached to that post.

This is surprise for me too :smiley:

Thank you. I will check this issue.

For anyone interested, I’ve found that AAC format files (MP4) work fine with Cocos2d-x 3.14, and they don’t require licensing fees as MP3s do. I’ll be using them for my projects, since the broken OGG support isn’t such a big deal for me personally.

I used it some time ago, but for example on Huawei P7 it froze the app completely (just playing any aac).

That’s not good. Turns out AAC format doesn’t work on Windows either (at least it’s not working for me). Will have to look into an alternative 3rd party sound engine if the cocos2d-x one doesn’t work as intended.

i has same problem, too.
and same log…
devices test on: Nexus 5 with Android v7.1.1(Custom Rom)

FYI, the majority of MP3 patents have expired in most parts of the world, with only the USA where it is still active up until mid-2017.

I think we have the same problem here with v3.14
Is this fixed in v3.15?

Testing on Galaxy S8 with Android 7.0

Is your issue the same as this one?
Could you upload the error log?

Yes
I am sure this was the same issue, but this seems to be fixed in version 3.15 since we updated and we don’t have this bug anymore. The log was pretty the same.

This is a part of our log.

05-17 13:55:15.670  9261  9286 V cocos2d-x debug info: play2d, _audioPlayers.size=1
05-17 13:55:15.670  9261  9286 V AudioPlayerProvider: (assets/KR4_Android/Sounds/Fx/Commons/kr4_selection.ogg) file size: 5787
05-17 13:55:15.670  9261  9286 V AudioPlayerProvider: audio (assets/KR4_Android/Sounds/Fx/Commons/kr4_selection.ogg) is being preloaded, add to callback vector!
05-17 13:55:15.670  9261  9286 V AudioPlayerProvider: FileInfo (0xc99df960), Waiting preload (assets/KR4_Android/Sounds/Fx/Commons/kr4_selection.ogg) to finish ...
05-17 13:55:17.670  9261  9286 V AudioPlayerProvider: FileInfo (0xc99df960), Waitup preload (assets/KR4_Android/Sounds/Fx/Commons/kr4_selection.ogg) ...
05-17 13:55:17.670  9261  9286 E AudioPlayerProvider: FileInfo (0xc99df960), preloadEffect (assets/KR4_Android/Sounds/Fx/Commons/kr4_selection.ogg) failed