Android Sound latency

Previous topic - Next topic

nicoatek

Hi, all!

Not sure it s a bug or may be due to my phones, but I have noticed that in my android systems, sounds are not playing at the good time.
Nothing dramatically, but... 

Wampus

Which Android systems are you using? Sound latency is a well known problem on earlier Android platforms for many developers, not just GLB devs.

spacefractal

#2
Sound is quite bad in some Android devices, example Kindle Fire (no I dont have the device my self) which have a long delay. Its a well known Android issue. Here is more info:
http://developer.coronalabs.com/forum/2011/01/01/audio-delay-android

Me thinks, the only way to fix some of them is simply use music commands for playing sound, and remove music completly. This might works better doing that, but you would only have one sound channel.

But I do thinks thee is nothing Gernot can fix me think (and you should also wrote which devices its have issues with)......

PS. Which devices do you have with that issue?
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

nicoatek

Thanks for answers,

I have got a JXD S601 (Android tablet/console), and a LG Optimus Black as phone.
Both are running Android 2.2.x.

erico

A JXD? Russian console?

Is the sound problem exact similar on both?

Wampus

On Froyo (2.2.x) sound latency is going to be bad. From what I've heard this is still ongoing, e.g. IceCream Sandwich (4.0.x) is still troublesome. There is no universal fix and what fixes can be found are often model specific. They won't work on all devices.

Audio is one area where iOS is way better than Android. Ugh.

nicoatek

QuoteA JXD? Russian console?
http://www.jxd.hk/download.asp?selectclassid=020001

I am having the same problem on each device.
Hopefully, sound latency is not so disturbing, as for the action game I am working on.

Hope this could be fixed in v11, thanks.

Wampus

Not likely to be fixed in v11. GLBasic has to rely on the installed sound libraries for Android, native or modded.

Quote from: nicoatek on 2012-Jul-31
Hopefully, sound latency is not so disturbing, as for the action game I am working on.

Most Android owners get used to it. Where it becomes a massive problem is with music programs that require very low audio latency. Gaming should be fine.

erico

yep, I have heard that even the android emulators suffer hard sound delays. :(

spacefractal

That way Android sucks very ball when its came to sound (its java and I have never liked java sound). iOS have nearly no Latency at all. I even have played Wi-Guitar on my iPhone 4 and people mistaked I played on a real guitar.

Its would been nice to test what it happens if we could change the final mixer when invoking audioInit() in SLDActivity.java with different values than those glbasic currently use? Would been nice if we could invoked that with different values which might works better for some devices to shorting the delay (and values we could set by your self).

some devices do still require to use music commands for sound and just use one channel.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

nicoatek

I've seen this on the processing forum (which is based on java), it should help:

QuoteSounds was one of the biggest problems when developing this game. First i was using ApWidgets with multiple MediaPlayers. But later in process i find out that this was very laggy on some devices. After days of searching and studying i found way to use SoundPool and get contents from /data folder ( /assets after export ). AssetManager was the solution.

Music files was too big for the SoundPool, so i had to use MediaPlayer instead.

original post from the processing forum: https://forum.processing.org/android-processing/13