Audio Rate Mismatch Causing Lag on Some Android Devices

Anything libgdx related goes here!

Audio Rate Mismatch Causing Lag on Some Android Devices

Postby Astrimedes » Sun Sep 18, 2016 3:23 pm

Hi guys, I'm experiencing an issue on a few Android devices. Everywhere else I experience no audio issues. When playing my .wav files (which were not initially carefully encoded at any particular sample rate), on these particular devices (Moto X Pure among them), logcat shows a warning frequently occurring, some variation of: AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 4, track 44517 Hz, output 48000 Hz. When this occurs, a brief stutter is introduced that makes gameplay laggy on the affected devices. On those affected devices, the lag is not experienced and the logcat entries are not written when I disable sound using my Options menu.

I have tried resampling all my audio to 48000 Hz, but when I do get the same error, with the cited track sample rate close to, but not exactly at the desired sample rate I used within the several resampling programs I've tried. I've only used free programs (including foobar2000, Audacity, and SoX), not sure if that's an issue with the quality of the resampling or not.

I've seen some references to this issue online, including this forum (viewtopic.php?f=11&t=19041), but I haven't seen any real fix suggested.

Does anyone have any idea how to handle this? Is there a way to change settings, or resample the audio files within the Android launcher according to a query of the device's audio hardware somehow?
Astrimedes
 
Posts: 14
Joined: Fri Jul 12, 2013 6:49 pm

Re: Audio Rate Mismatch Causing Lag on Some Android Devices

Postby timo9 » Thu Jan 16, 2020 8:05 pm

Hmm weird, seems like it's a motorola thing since I have the exact same issue on a moto 5s plus. I don't have another phone to test on unfortunately
timo9
 
Posts: 14
Joined: Tue Sep 22, 2015 9:28 am

Re: Audio Rate Mismatch Causing Lag on Some Android Devices

Postby shatterblast » Fri Jan 17, 2020 2:46 pm

timo9 wrote:Hmm weird, seems like it's a motorola thing since I have the exact same issue on a moto 5s plus. I don't have another phone to test on unfortunately

Try exporting your raw audio data as 160 Hz .OGG files. You can use Audacity to do this. For whatever reason, the default of 192 Hz likes to generally fail on Mobile devices. I think it may be a setting of 5 in the Save window of Audacity when you do so, after you choose to Export.

1) https://www.audacityteam.org/
shatterblast
 
Posts: 653
Joined: Sun Jul 06, 2014 1:14 pm


Return to Libgdx

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest