Search titles only
By:
Home
Forums
New posts
Search forums
Articles
New articles
New comments
Search articles
Pinball DB
Pinball Tables
Pinball Games
What's new
New posts
New articles
New profile posts
New article comments
Latest activity
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Welcome Back to Digital Pinball Fans -
please read this first
For latest updates, follow Digital Pinball Fans on
Facebook
and
Twitter
Home
Forums
Other Talk
Frequently Asked Questions
[Explained] What Causes the Mechanical Sound Effect Delay in Android?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jaredmorgs" data-source="post: 110090" data-attributes="member: 459"><p><span style="font-size: 18px">Problem</span></p><p></p><p>Mechanical effects in all Android tables seem to be running up to a quarter second behind the action on the table.</p><p></p><p>Additionally, when game soundtrack music loops, there is a noticeable playback gap in the music stream.</p><p></p><p><span style="font-size: 18px">Background</span> </p><p></p><p>(from <a href="http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893" target="_blank">http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893</a> )</p><p></p><p><span style="color: #333333">TPA uses a custom made in-house audio mixer that mixes everything into a single channel, which is then sent as a stream to the java side (of the Android version) to be submitted in chunks to the OS.</span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><span style="font-size: 18px">Cause</span></span></p><p><span style="color: #333333"></span>(continued from <a href="http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893" target="_blank">http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893</a> )<span style="color: #333333"></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">The mixer appears to be a bit laggy: more so on some devices than others (the first-gen Kindle is particularly bad). </span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><span style="font-size: 18px">Workaround</span></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">There is no workaround to this issue, unless the mixer is completely rewritten.</span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><span style="font-size: 18px">Additional Info</span></span></p><p><span style="color: #333333"><span style="font-size: 18px"><span style="font-size: 10px">All info provide by responses from (@Ryan Routon) in the following threads:</span></span></span></p><p><span style="color: #333333"><span style="font-size: 18px"></span></span><a href="http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108944&viewfull=1#post108944" target="_blank">http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108944&viewfull=1#post108944</a> <span style="color: #333333"><span style="font-size: 18px"><span style="font-size: 10px">and </span></span></span><a href="http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893" target="_blank">http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893</a><span style="color: #333333"><span style="font-size: 18px"></span></span></p><p><span style="color: #333333"><span style="font-size: 18px"></span></span></p><p><span style="color: #333333"><strong>Q: What about the flipper sounds: they aren't affected?</strong></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">A: The flippers don't have this problem because these effects are played from a sound pool (using .ogg files directly). Unpack the apk (it's basically another name for a zip archive) and you'll see them towards the top of the tree.</span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><strong>Q: Why not provide all mechanical sounds through the sound pool?</strong></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">A: Due to the game framework it would be impossible to provide all sounds in a sound pool. All sounds are included in a big byte chunk for each table. Flippers are universal so those are fine to sound pool. </span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><strong>Q: What have you tried to fix the issue?</strong></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">Decrease the audio block size: every time I (@Ryan Routon) make the block size smaller to pass to the Stream it breaks some devices and you hear blips in between. Bugs me to no end but not sure what to do.</span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><strong>Q: Why not make the block size tunable by the user?</strong></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">A: The block size is device dependent, and is queried automatically by the OS for the most optimal block size. Anything smaller than optimal and the audio stream just does not work, which would likely result in a force closes because the buffer is trying to read bytes that aren't there.</span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"><strong>Q: So what is the underlying issue that is causing the headaches?</strong></span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333">A: It is actually the streaming aspect that is causing the delay. Even google admits that the latency issues have been a long-standing issue on Android. They have been improving since ICS, but are still not really quite right.</span></p><p><span style="color: #333333"></span></p><p><span style="color: #333333"></span></p></blockquote><p></p>
[QUOTE="jaredmorgs, post: 110090, member: 459"] [SIZE=5]Problem[/SIZE] Mechanical effects in all Android tables seem to be running up to a quarter second behind the action on the table. Additionally, when game soundtrack music loops, there is a noticeable playback gap in the music stream. [SIZE=5]Background[/SIZE] (from [URL]http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893[/URL] ) [COLOR=#333333]TPA uses a custom made in-house audio mixer that mixes everything into a single channel, which is then sent as a stream to the java side (of the Android version) to be submitted in chunks to the OS. [SIZE=5]Cause[/SIZE] [/COLOR](continued from [URL]http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893[/URL] )[COLOR=#333333] The mixer appears to be a bit laggy: more so on some devices than others (the first-gen Kindle is particularly bad). [SIZE=5]Workaround[/SIZE] There is no workaround to this issue, unless the mixer is completely rewritten. [SIZE=5]Additional Info [SIZE=2]All info provide by responses from (@Ryan Routon) in the following threads:[/SIZE] [/SIZE][/COLOR][URL]http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108944&viewfull=1#post108944[/URL] [COLOR=#333333][SIZE=5][SIZE=2]and [/SIZE][/SIZE][/COLOR][URL]http://digitalpinballfans.com/showthread.php/6182-Pack-19-Beta?p=108893&viewfull=1#post108893[/URL][COLOR=#333333][SIZE=5] [/SIZE] [B]Q: What about the flipper sounds: they aren't affected?[/B] A: The flippers don't have this problem because these effects are played from a sound pool (using .ogg files directly). Unpack the apk (it's basically another name for a zip archive) and you'll see them towards the top of the tree. [B]Q: Why not provide all mechanical sounds through the sound pool?[/B] A: Due to the game framework it would be impossible to provide all sounds in a sound pool. All sounds are included in a big byte chunk for each table. Flippers are universal so those are fine to sound pool. [B]Q: What have you tried to fix the issue?[/B] Decrease the audio block size: every time I (@Ryan Routon) make the block size smaller to pass to the Stream it breaks some devices and you hear blips in between. Bugs me to no end but not sure what to do. [B]Q: Why not make the block size tunable by the user?[/B] A: The block size is device dependent, and is queried automatically by the OS for the most optimal block size. Anything smaller than optimal and the audio stream just does not work, which would likely result in a force closes because the buffer is trying to read bytes that aren't there. [B]Q: So what is the underlying issue that is causing the headaches?[/B] A: It is actually the streaming aspect that is causing the delay. Even google admits that the latency issues have been a long-standing issue on Android. They have been improving since ICS, but are still not really quite right. [/COLOR] [/QUOTE]
Verification
Post reply
Members online
No members online now.
Latest posts
D
Anyone still playing?
Latest: Dan
Mar 3, 2025
The Pinball Arcade / Farsight Studios
Home
Forums
Other Talk
Frequently Asked Questions
[Explained] What Causes the Mechanical Sound Effect Delay in Android?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top