Actually if you look through the source code to AudioTrack, it looks
like so:
void AudioTrack::start()
{
sp<AudioTrackThread> t = mAudioTrackThread;
LOGV("start");
if (t != 0) {
if (t->exitPending()) {
if (t->requestExitAndWait() == WOULD_BLOCK) {
LOGE("AudioTrack::start called from thread");
return;
}
}
t->mLock.lock();
}
if (android_atomic_or(1, &mActive) == 0) {
if (t != 0) {
t->run(
....etc
So this looks like it may be that start() is being called when the
AudioTrack has already been started once. Maybe make sure you are not
starting the track over and over without stopping or reloading it,
etc. (What you do depends if you are using MODE_STATIC or MODE_STREAM)
-niko
On Dec 8, 10:19 pm, niko20 <[email protected]> wrote:
> Hi,
>
> There is no limitation on running AudioTrack in a thread, I do it all
> the time, it must be something else going on.
>
> One thing you may want to try is to create the AudioTrack object and
> start() it in the same thread. Perhaps it doesn't like being created
> in a different thread than start() is called in ?
>
> -niko
>
> On Dec 8, 8:30 pm, Business Talk <[email protected]> wrote:
>
> > I am getting the 'AudioTrack::start called from thread' when starting
> > an AudioTrack. I am using it in a thread. I asume I shouldn't but
> > why? I see it as a major limitation.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en