Well, you would want to make sure you are packaging in Debug configuration in your Project Settings under Packaging. This way, when the project fails you will get more information in the logs.
I would also get the devices as well as the logs from the users who are experiencing the crash so you can compare and make sure they are all the same one. If you are not experiencing the crash on your end, you will also need to find steps to do so, this way you can potentially fix the issue.
Be sure the .wav file format is supported by their specific android device. If the crash is not occurring on Windows or other devices, that could be the culprit. Below is a link to the Supported Media Formats for Android.
“8- and 16-bit linear PCM (rates up to limit of hardware). Sampling rates for raw PCM recordings at 8000, 16000 and 44100 Hz.”
Yeah, you seem to be within the guidelines of what is acceptable and compatible. I would try changing the sample rate or the codec itself to another format to see if that helps. Is it only happening with this particular audio wave file, or is it when you call the PlaySound2D node anywhere?
It is any wav file, we will do some more tests now that the holiday is over.
One other thought I had:
The way our game is setup the sounds are played from audio managers which are spawned when the level starts. Or, they are in the start of a UMG blueprint that gets spawned.
Could loading an actor/widget and then playing the sound in almost an instant be an issue on some hardware?
FrontendSounds = GetWorld()->SpawnActor<AFrontendSounds>(UMyGameLibrary::GetFrontendSoundsClass());
//OnMainMenuMusic is a BP event with an immediate Play Sound 2D node
I could forsee your custom setup being a problem, since not all hardware will be able to load a level at the same rate. If your audio is attempting to play before the level has finished loading into memory and drawing to the screen, that could be a place to look for the cause of the crash. Try putting even a half second delay in between the PlaySound2D node and your execution event to see if that resolves the issue.
Same PlaySound2D node moved to level blueprint instead of using the manager, with a 1s delay. User reports same crashes. Reading the docs, BeginPlay doesn’t start until assets are loaded, correct? So thinking we might be barking up the wrong tree here.
So I really worked at trying to understand the call stack better:
That being said, the other audio crash is at the stop of a non-music sound and just has a FATAL after FREE. So maybe concurrency is another red herring.
Clearly on some environments, there is an engine level memory issue that happens 100% when the engine stops an audio source on android. There are other answer threads about this same issue that go nowhere. At this point I don’t believe it has anything to do with my setup.
Also I don’t want to just start excluding devices as I don’t know 100% if it is hardware or something else about their setup.
Someone at Epic who deeply understands the Android audio tech, and how memory is managed, should look at this further.
In order for us to effectively troubleshoot this issue and to have it entered as a bug, we need a way to reproduce it on our end. This means providing a minimal test case where the crash occurs, and or providing us with steps to reproduce the issue in a new blank project on our end.
Obviously, if it isn’t happening solely a blank project, then the issue is with your setup and how the engine is handling whatever it is you are trying to do with playback of your sounds. This could indeed be a bug with the engine, but we need a way to reproduce it on our end in order to determine that is the case.
I appreciate that Andrew, but I just said that I removed everything and just played the sound in the level BP in BeginPlay, eliminating that it has anything to do with my custom setup.
Do you have any more suggestions or should we just give up?
I mean, it is working on 95% of devices. Obviously the issue has to do with something about those problem devices whether it is hardware or software. What it could be I am stumped on though.
My hope with this thread was that someone with expertise in Android Audio tech would suggest to me what info to gather from my customers having this issue, and then give me suggestions on what the cause could be, to give me a better chance of reproing on my end and getting some real traction on this.
The suggestions I have provided thus far are the extent of my knowledge when troubleshooting audio crashes specific to certain devices. Without a repro, or project in front of me, it is hard to tell how or where to start looking exactly.
Keep in mind, not all games that are published are universally compatible with all of those devices for that Platform, so if your game is working on 95% of the devices tested, that can be used as a metric to determine what those devices share, and what could possibly be causing the crash.
Since we just returned from the holiday break, our Audio Devs and Engineers are extremely busy so getting personal attention from them is unlikely. I can try to ask, but you might have better luck continuing to investigate on your own and reaching out on the Forums for more public support.