Page 1 of 1

The trouble with testsounds on Android - App freezing

PostPosted: Tue Oct 25, 2016 05:22
by lordfingle
If you have a "testsounds" folder, sounds will be played from there directly (on the client) rather than being downloaded via the media load.

Additionally the "0-9" suffix functionality randomly chooses between a number of similarly named files.

In my case:
SoundTrack.0.ogg
SoundTrack.1.ogg
SoundTrack.2.ogg
SoundTrack.3.ogg
SoundTrack.4.ogg
SoundTrack.5.ogg
SoundTrack.6.ogg
SoundTrack.7.ogg
SoundTrack.8.ogg
SoundTrack.9.ogg

I am using the "ambience" mod.

On Android, combining these causes a rather nasty side effect. It appears that the minetest engine tries to load all sounds from a folder into MEMORY before choosing one to play.

This resulted in freezes up to a minute on Android. It eventually unfreezes.

Here's a log:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
D/eidy    ( 6772): 2016-10-24 18:25:41: INFO[Main]: Audio file /storage/emulated/0/eidy/testsounds/SoundTrack.0.ogg loaded

E/ActivityManager(  528):     98% 6790/eidyNativeThrea: 96% user + 1.9% kernel

D/eidy    ( 6772): 2016-10-24 18:25:53: INFO[Main]: Audio file /storage/emulated/0/eidy/testsounds/SoundTrack.1.ogg loaded

D/eidy    ( 6772): 2016-10-24 18:26:03: INFO[Main]: Audio file /storage/emulated/0/eidy/testsounds/SoundTrack.2.ogg loaded

E/ActivityManager(  528):     98% 6790/eidyNativeThrea: 98% user + 0% kernel

D/eidy    ( 6772): 2016-10-24 18:26:16: INFO[Main]: Audio file /storage/emulated/0/eidy/testsounds/SoundTrack.3.ogg loaded


So I think the issue is:
- Large (1 minute) music files seem to randomly take a very long time to load
- The "random" functionality loads all files of a certain suffix prior to randomly choosing between them

The cause of the issue may be the "OpenAL" library. There have been reports of early versions of this library causing hangs on Android.

So perhaps the solution is to replace the sound engine with something else?

Opinions?

Re: The trouble with testsounds on Android - App freezing

PostPosted: Sat Oct 29, 2016 22:56
by MineYoshi
Try to compile with most new and recent OpenAL lib?

Re: The trouble with testsounds on Android - App freezing

PostPosted: Thu Nov 03, 2016 21:54
by lordfingle
Thanks @MineYoshi. I'll try.

So currently the minetest build uses this version - https://github.com/apportable/openal-soft

I couldn't see any update except for this branch - https://github.com/apportable/openal-soft/tree/li-merge

I'll try using this.

Re: The trouble with testsounds on Android - App freezing

PostPosted: Mon Nov 07, 2016 20:57
by MineYoshi
Well...

Did compiling work?

Re: The trouble with testsounds on Android - App freezing

PostPosted: Mon Nov 14, 2016 08:44
by lordfingle
Tried it, no it didn't. Freezing is still happening.

Re: The trouble with testsounds on Android - App freezing

PostPosted: Tue Nov 15, 2016 07:26
by lordfingle
I guess the main issue is that OpenALManager doesn't like loading a whole bunch of sound files simultaenously which is what this does:

SoundTrack.0.ogg
SoundTrack.1.ogg
SoundTrack.2.ogg
SoundTrack.3.ogg
SoundTrack.4.ogg
SoundTrack.5.ogg
SoundTrack.6.ogg
SoundTrack.7.ogg
SoundTrack.8.ogg
SoundTrack.9.ogg

Therefore I'll rename the music files to unique names and randomly choose them myself.
(eg original ambience mod)