Permanent audio stutter on LGE Nexus 4 with the Deezer Android SDK
Asked Answered
V

1

8

Audio playback has been tested successfully on Samsung Galaxy S3 and HTC One, but is severely broken on an LGE Nexus 4 running Android 4.4. What happens is that perfectly fine audio can be heard for a fraction of a second, then there's a few seconds of silence followed by another short piece of audio, then silence, and so it goes. So it seems like the audio streaming logic ends up in an eternal start-play-underrun-stop loop.

Every second or so I see the following warning logged:

12-09 00:55:56.982  10842-14365/com.soundrop.android W/AudioTrack﹕ releaseBuffer() track 0x7b03f4e0 name=s:176;n:2;f:-1 disabled due to previous underrun, restarting
12-09 00:55:57.583  10842-14367/com.soundrop.android W/AudioTrack﹕ releaseBuffer() track 0x7b03f4e0 name=s:176;n:2;f:-1 disabled due to previous underrun, restarting
12-09 00:55:58.594  10842-14369/com.soundrop.android W/AudioTrack﹕ releaseBuffer() track 0x7b03f4e0 name=s:176;n:2;f:-1 disabled due to previous underrun, restarting
12-09 00:55:59.595  10842-14371/com.soundrop.android W/AudioTrack﹕ releaseBuffer() track 0x7b03f4e0 name=s:176;n:2;f:-1 disabled due to previous underrun, restarting
12-09 00:56:02.047  10842-14379/com.soundrop.android W/AudioTrack﹕ releaseBuffer() track 0x7b03f4e0 name=s:176;n:2;f:-1 disabled due to previous underrun, restarting

This lead me to think about possible audio buffer differences between the devices, so I did some probing:

HTC One (good playback): AudioTrack.getMinBufferSize(44100, STEREO, ENCODING_PCM_16BIT) => 16932
LGE Nexus 4 (bad playback): AudioTrack.getMinBufferSize(44100, STEREO, ENCODING_PCM_16BIT) => 7056

My speculation is that the Deezer Android SDK sets a too small buffer size on this particular device, as it seems to pick a buffer size that is 10x that of the reported minimum size.

UPDATE: Just reproduced the audio stutter on an HTC One running 4.4, where getMinBufferSize() return 16932 (like it did on Android < 4.4). So this issue is clearly not device-specific, but related to OS-specific behavioral changes starting with KitKat.

Vernavernacular answered 9/12, 2013 at 12:10 Comment(1)
See if you can find an open source example which plays on the new version without stuttering, and see if you can figure out what is different about what they are doing from what you are.Gamophyllous
A
1

This is indeed an issue raised by the Android 4.4 update. Something in the AudioTrack implementation has changed, and caused these underrun issues.

We're currently working on a fix on this problem and we'll release it as soon as possible.

Ailina answered 10/12, 2013 at 15:3 Comment(1)
I had this issue while debugging with a "Method Breakpoint", apparently that really slows down things,Birthright

© 2022 - 2024 — McMap. All rights reserved.