AudioRecord/AudioTrack buffer size

288 views
Skip to first unread message

Dan Stowell

unread,
Sep 11, 2010, 5:40:51 AM9/11/10
to android-musi...@googlegroups.com
Hi,

Easy question: any general wisdom on a good choice of
AudioRecord/AudioTrack buffer size? Do you tend to make them the same?
Do they vary according to hardware, perhaps?

I'm getting lovely results on Nexus One with a buffer size of 512
frames for live audio in and out; but on my Tattoo I can't currently
find a setting that sits comfortably without leading to lots of the
dreaded "W/AudioFlinger( 57): AudioRecordThread: buffer overflow"

Thanks
Dan
--
http://www.mcld.co.uk

Martin Roth

unread,
Sep 13, 2010, 11:18:44 AM9/13/10
to android-musi...@googlegroups.com
I think that the tricky thing is that while both the Nexus and Tatto are from HTC, their audio systems may be configured differently and thus have very different behaviour. On the Tattoo, can you not get rid of the warnings with large buffer size?

Peter Brinkmann

unread,
Sep 13, 2010, 4:01:39 PM9/13/10
to Android Music Developers

Hi Dan, hi Martin,
I have no first-hand experience with the HTC Tattoo, but I did
encounter some very strange timing problems when using AudioRecord and
AudioTrack on my Motorola Droid X. Those problems seem to be genuine
bugs of the phone, and buffer sizes didn't seem to make much of a
difference. In the end I implemented a workaround that creates a
reasonable approximation of synchronized audio I/O. If you're
interested, you can find my solution in the class
org.puredata.android.io.AudioWrapper of the project pdlib/PdCore at
http://gitorious.org/pdlib.
Best,
Peter


On Sep 13, 11:18 am, Martin Roth <mhr...@gmail.com> wrote:
> I think that the tricky thing is that while both the Nexus and Tatto are
> from HTC, their audio systems may be configured differently and thus have
> very different behaviour. On the Tattoo, can you not get rid of the warnings
> with large buffer size?
>
Reply all
Reply to author
Forward
0 new messages