The trouble with testsounds on Android - App freezing

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

The trouble with testsounds on Android - App freezing

by lordfingle » Tue Oct 25, 2016 05:22

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: 5298
Joined: Wed Jul 08, 2015 13:20
Location: Colombia

Re: The trouble with testsounds on Android - App freezing

by MineYoshi » Sat Oct 29, 2016 22:56

Try to compile with most new and recent OpenAL lib?
Noahide with faith in G*d. | Nik Euskaraz ditz egiten dut. | Hablo Español.
 

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

Re: The trouble with testsounds on Android - App freezing

by lordfingle » Thu Nov 03, 2016 21:54

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: 5298
Joined: Wed Jul 08, 2015 13:20
Location: Colombia

Re: The trouble with testsounds on Android - App freezing

by MineYoshi » Mon Nov 07, 2016 20:57

Well...

Did compiling work?
Noahide with faith in G*d. | Nik Euskaraz ditz egiten dut. | Hablo Español.
 

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

Re: The trouble with testsounds on Android - App freezing

by lordfingle » Mon Nov 14, 2016 08:44

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
Location: Australia
GitHub: eidy
IRC: lordfingle
In-game: lordfingle

Re: The trouble with testsounds on Android - App freezing

by lordfingle » Tue Nov 15, 2016 07:26

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
 


Return to Partly official engine development



Who is online

Users browsing this forum: No registered users and 1 guest