The trouble with testsounds on Android - App freezing

For people working on the C++ code.
Post Reply
User avatar
lordfingle
Member
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle
Location: Australia
Contact:

The trouble with testsounds on Android - App freezing

by lordfingle » Post

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:

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?
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: The trouble with testsounds on Android - App freezing

by MineYoshi » Post

Try to compile with most new and recent OpenAL lib?
Have a nice day! :D

User avatar
lordfingle
Member
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle
Location: Australia
Contact:

Re: The trouble with testsounds on Android - App freezing

by lordfingle » Post

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.
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: The trouble with testsounds on Android - App freezing

by MineYoshi » Post

Well...

Did compiling work?
Have a nice day! :D

User avatar
lordfingle
Member
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle
Location: Australia
Contact:

Re: The trouble with testsounds on Android - App freezing

by lordfingle » Post

Tried it, no it didn't. Freezing is still happening.
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford

User avatar
lordfingle
Member
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle
Location: Australia
Contact:

Re: The trouble with testsounds on Android - App freezing

by lordfingle » Post

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)
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests