Lines Matching refs:track
1287 sp<Track> track = mTracks[i]; in dumpTracks() local
1288 if (track != 0) { in dumpTracks()
1289 bool active = mActiveTracks.indexOf(track) >= 0; in dumpTracks()
1293 track->dump(buffer, SIZE, active); in dumpTracks()
1307 sp<Track> track = mActiveTracks[i].promote(); in dumpTracks() local
1308 if (track != 0 && mTracks.indexOf(track) < 0) { in dumpTracks()
1309 track->dump(buffer, SIZE, true); in dumpTracks()
1367 sp<Track> track; in createTrack_l() local
1510 track = new Track(this, client, streamType, sampleRate, format, in createTrack_l()
1514 track = TimedTrack::create(this, client, streamType, sampleRate, format, in createTrack_l()
1520 lStatus = track != 0 ? track->initCheck() : (status_t) NO_MEMORY; in createTrack_l()
1526 mTracks.add(track); in createTrack_l()
1531 track->setMainBuffer(chain->inBuffer()); in createTrack_l()
1532 chain->setStrategy(AudioSystem::getStrategyForStream(track->streamType())); in createTrack_l()
1548 return track; in createTrack_l()
1615 status_t AudioFlinger::PlaybackThread::addTrack_l(const sp<Track>& track) in addTrack_l() argument
1620 track->mRetryCount = kMaxTrackStartupRetries; in addTrack_l()
1621 if (mActiveTracks.indexOf(track) < 0) { in addTrack_l()
1625 if (track->isExternalTrack()) { in addTrack_l()
1626 TrackBase::track_state state = track->mState; in addTrack_l()
1628 status = AudioSystem::startOutput(mId, track->streamType(), track->sessionId()); in addTrack_l()
1631 if (state != track->mState) { in addTrack_l()
1634 AudioSystem::stopOutput(mId, track->streamType(), track->sessionId()); in addTrack_l()
1649 track->mFillingUpStatus = track->sharedBuffer() != 0 ? Track::FS_FILLED : Track::FS_FILLING; in addTrack_l()
1650 track->mResetDone = false; in addTrack_l()
1651 track->mPresentationCompleteFrames = 0; in addTrack_l()
1652 mActiveTracks.add(track); in addTrack_l()
1653 mWakeLockUids.add(track->uid()); in addTrack_l()
1655 mLatestActiveTrack = track; in addTrack_l()
1656 sp<EffectChain> chain = getEffectChain_l(track->sessionId()); in addTrack_l()
1659 track->sessionId()); in addTrack_l()
1670 bool AudioFlinger::PlaybackThread::destroyTrack_l(const sp<Track>& track) in destroyTrack_l() argument
1672 track->terminate(); in destroyTrack_l()
1674 bool trackActive = (mActiveTracks.indexOf(track) >= 0); in destroyTrack_l()
1675 track->mState = TrackBase::STOPPED; in destroyTrack_l()
1677 removeTrack_l(track); in destroyTrack_l()
1678 } else if (track->isFastTrack() || track->isOffloaded() || track->isDirect()) { in destroyTrack_l()
1679 track->mState = TrackBase::STOPPING_1; in destroyTrack_l()
1685 void AudioFlinger::PlaybackThread::removeTrack_l(const sp<Track>& track) in removeTrack_l() argument
1687 track->triggerEvents(AudioSystem::SYNC_EVENT_PRESENTATION_COMPLETE); in removeTrack_l()
1688 mTracks.remove(track); in removeTrack_l()
1689 deleteTrackName_l(track->name()); in removeTrack_l()
1691 track->mName = -1; in removeTrack_l()
1692 if (track->isFastTrack()) { in removeTrack_l()
1693 int index = track->mFastIndex; in removeTrack_l()
1698 track->mFastIndex = -1; in removeTrack_l()
1700 sp<EffectChain> chain = getEffectChain_l(track->sessionId()); in removeTrack_l()
1971 sp<Track> track = mTracks[i]; in hasAudioSession() local
1972 if (sessionId == track->sessionId() && !track->isInvalid()) { in hasAudioSession()
1989 sp<Track> track = mTracks[i]; in getStrategyForSession_l() local
1990 if (sessionId == track->sessionId() && !track->isInvalid()) { in getStrategyForSession_l()
1991 return AudioSystem::getStrategyForStream(track->streamType()); in getStrategyForSession_l()
2040 sp<Track> track = mTracks[i]; in setSyncEvent() local
2041 if (event->triggerSession() == track->sessionId()) { in setSyncEvent()
2042 (void) track->setSyncEvent(event); in setSyncEvent()
2061 const sp<Track>& track = tracksToRemove.itemAt(i); in threadLoop_removeTracks() local
2062 if (track->isExternalTrack()) { in threadLoop_removeTracks()
2063 AudioSystem::stopOutput(mId, track->streamType(), track->sessionId()); in threadLoop_removeTracks()
2068 if (track->isTerminated()) { in threadLoop_removeTracks()
2247 sp<Track> track = mTracks[i]; in addEffectChain_l() local
2248 if (session == track->sessionId()) { in addEffectChain_l()
2249 ALOGV("addEffectChain_l() track->setMainBuffer track %p buffer %p", track.get(), in addEffectChain_l()
2251 track->setMainBuffer(buffer); in addEffectChain_l()
2258 sp<Track> track = mActiveTracks[i].promote(); in addEffectChain_l() local
2259 if (track == 0) { in addEffectChain_l()
2262 if (session == track->sessionId()) { in addEffectChain_l()
2263 ALOGV("addEffectChain_l() activating track %p on session %d", track.get(), session); in addEffectChain_l()
2306 sp<Track> track = mActiveTracks[i].promote(); in removeEffectChain_l() local
2307 if (track == 0) { in removeEffectChain_l()
2310 if (session == track->sessionId()) { in removeEffectChain_l()
2319 sp<Track> track = mTracks[i]; in removeEffectChain_l() local
2320 if (session == track->sessionId()) { in removeEffectChain_l()
2321 track->setMainBuffer(reinterpret_cast<int16_t*>(mSinkBuffer)); in removeEffectChain_l()
2332 const sp<AudioFlinger::PlaybackThread::Track> track, int EffectId) in attachAuxEffect() argument
2335 return attachAuxEffect_l(track, EffectId); in attachAuxEffect()
2339 const sp<AudioFlinger::PlaybackThread::Track> track, int EffectId) in attachAuxEffect_l() argument
2344 track->setAuxBuffer(0, NULL); in attachAuxEffect_l()
2350 track->setAuxBuffer(EffectId, (int32_t *)effect->inBuffer()); in attachAuxEffect_l()
2364 sp<Track> track = mTracks[i]; in detachAuxEffect_l() local
2365 if (track->auxEffectId() == effectId) { in detachAuxEffect_l()
2366 attachAuxEffect_l(track, 0); in detachAuxEffect_l()
2666 const sp<Track>& track = tracksToRemove.itemAt(i); in removeTracks_l() local
2667 mActiveTracks.remove(track); in removeTracks_l()
2668 mWakeLockUids.remove(track->uid()); in removeTracks_l()
2670 ALOGV("removeTracks_l removing track on session %d", track->sessionId()); in removeTracks_l()
2671 sp<EffectChain> chain = getEffectChain_l(track->sessionId()); in removeTracks_l()
2674 track->sessionId()); in removeTracks_l()
2677 if (track->isTerminated()) { in removeTracks_l()
2678 removeTrack_l(track); in removeTracks_l()
2742 void AudioFlinger::PlaybackThread::addPatchTrack(const sp<PatchTrack>& track) in addPatchTrack() argument
2745 mTracks.add(track); in addPatchTrack()
2748 void AudioFlinger::PlaybackThread::deletePatchTrack(const sp<PatchTrack>& track) in deletePatchTrack() argument
2751 destroyTrack_l(track); in deletePatchTrack()
3197 Track* const track = t.get(); in prepareTracks_l() local
3200 if (track->isFastTrack()) { in prepareTracks_l()
3208 int j = track->mFastIndex; in prepareTracks_l()
3218 track->mObservedUnderruns.mBitFields.mFull) & UNDERRUN_MASK; in prepareTracks_l()
3220 track->mObservedUnderruns.mBitFields.mPartial) & UNDERRUN_MASK; in prepareTracks_l()
3222 track->mObservedUnderruns.mBitFields.mEmpty) & UNDERRUN_MASK; in prepareTracks_l()
3224 track->mObservedUnderruns = underruns; in prepareTracks_l()
3227 if (!(track->isStopping() || track->isPausing() || track->isStopped()) && in prepareTracks_l()
3230 track->mAudioTrackServerProxy->tallyUnderrunFrames(recentUnderruns * mFrameCount); in prepareTracks_l()
3236 switch (track->mState) { in prepareTracks_l()
3239 if (recentUnderruns > 0 || track->isTerminated()) { in prepareTracks_l()
3240 track->mState = TrackBase::STOPPING_2; in prepareTracks_l()
3245 track->setPaused(); in prepareTracks_l()
3249 track->mState = TrackBase::ACTIVE; in prepareTracks_l()
3254 track->mRetryCount = kMaxTrackRetries; in prepareTracks_l()
3261 if (track->sharedBuffer() == 0) { in prepareTracks_l()
3268 if (--(track->mRetryCount) > 0) { in prepareTracks_l()
3273 android_atomic_or(CBLK_DISABLED, &track->mCblk->mFlags); in prepareTracks_l()
3290 if (!(mStandby || track->presentationComplete(framesWritten, audioHALFrames))) { in prepareTracks_l()
3295 if (track->isStopping_2()) { in prepareTracks_l()
3296 track->mState = TrackBase::STOPPED; in prepareTracks_l()
3298 if (track->isStopped()) { in prepareTracks_l()
3308 LOG_ALWAYS_FATAL("unexpected track state %d", track->mState); in prepareTracks_l()
3314 ExtendedAudioBufferProvider *eabp = track; in prepareTracks_l()
3315 VolumeProvider *vp = track; in prepareTracks_l()
3318 fastTrack->mChannelMask = track->mChannelMask; in prepareTracks_l()
3319 fastTrack->mFormat = track->mFormat; in prepareTracks_l()
3327 track->mCachedVolume = masterVolume * mStreamTypes[track->streamType()].volume; in prepareTracks_l()
3342 tracksToRemove->add(track); in prepareTracks_l()
3344 track->mObservedUnderruns.mBitFields.mMostRecent = UNDERRUN_FULL; in prepareTracks_l()
3351 audio_track_cblk_t* cblk = track->cblk(); in prepareTracks_l()
3355 int name = track->name(); in prepareTracks_l()
3362 uint32_t sr = track->sampleRate(); in prepareTracks_l()
3370 desiredFrames += mAudioMixer->getUnreleasedFrames(track->name()); in prepareTracks_l()
3379 if ((track->sharedBuffer() == 0) && !track->isStopped() && !track->isPausing() && in prepareTracks_l()
3384 size_t framesReady = track->framesReady(); in prepareTracks_l()
3385 if ((framesReady >= minFrames) && track->isReady() && in prepareTracks_l()
3386 !track->isPaused() && !track->isTerminated()) in prepareTracks_l()
3395 if (track->mainBuffer() != mSinkBuffer && in prepareTracks_l()
3396 track->mainBuffer() != mMixerBuffer) { in prepareTracks_l()
3400 chain = getEffectChain_l(track->sessionId()); in prepareTracks_l()
3407 name, track->sessionId()); in prepareTracks_l()
3413 if (track->mFillingUpStatus == Track::FS_FILLED) { in prepareTracks_l()
3415 track->mFillingUpStatus = Track::FS_ACTIVE; in prepareTracks_l()
3416 if (track->mState == TrackBase::RESUMING) { in prepareTracks_l()
3417 track->mState = TrackBase::ACTIVE; in prepareTracks_l()
3431 if (track->isPausing() || mStreamTypes[track->streamType()].mute) { in prepareTracks_l()
3434 if (track->isPausing()) { in prepareTracks_l()
3435 track->setPaused(); in prepareTracks_l()
3440 float typeVolume = mStreamTypes[track->streamType()].volume; in prepareTracks_l()
3442 AudioTrackServerProxy *proxy = track->mAudioTrackServerProxy; in prepareTracks_l()
3481 track->mHasVolumeController = true; in prepareTracks_l()
3485 if (track->mHasVolumeController) { in prepareTracks_l()
3488 track->mHasVolumeController = false; in prepareTracks_l()
3492 mAudioMixer->setBufferProvider(name, track); in prepareTracks_l()
3501 AudioMixer::FORMAT, (void *)track->format()); in prepareTracks_l()
3505 AudioMixer::CHANNEL_MASK, (void *)(uintptr_t)track->channelMask()); in prepareTracks_l()
3512 uint32_t reqSampleRate = track->mAudioTrackServerProxy->getSampleRate(); in prepareTracks_l()
3536 && (track->mainBuffer() == mSinkBuffer in prepareTracks_l()
3537 || track->mainBuffer() == mMixerBuffer)) { in prepareTracks_l()
3556 AudioMixer::MAIN_BUFFER, (void *)track->mainBuffer()); in prepareTracks_l()
3561 AudioMixer::AUX_BUFFER, (void *)track->auxBuffer()); in prepareTracks_l()
3564 track->mRetryCount = kMaxTrackRetries; in prepareTracks_l()
3574 if (framesReady < desiredFrames && !track->isStopped() && !track->isPaused()) { in prepareTracks_l()
3575 track->mAudioTrackServerProxy->tallyUnderrunFrames(desiredFrames); in prepareTracks_l()
3579 chain = getEffectChain_l(track->sessionId()); in prepareTracks_l()
3585 if ((track->sharedBuffer() != 0) || track->isTerminated() || in prepareTracks_l()
3586 track->isStopped() || track->isPaused()) { in prepareTracks_l()
3593 if (mStandby || track->presentationComplete(framesWritten, audioHALFrames)) { in prepareTracks_l()
3594 if (track->isStopped()) { in prepareTracks_l()
3595 track->reset(); in prepareTracks_l()
3597 tracksToRemove->add(track); in prepareTracks_l()
3602 if (--(track->mRetryCount) <= 0) { in prepareTracks_l()
3604 tracksToRemove->add(track); in prepareTracks_l()
3663 Track* track = t.get(); in prepareTracks_l() local
3664 ALOG_ASSERT(track->isFastTrack() && track->isStopped()); in prepareTracks_l()
3665 track->reset(); in prepareTracks_l()
3930 void AudioFlinger::DirectOutputThread::processVolume_l(Track *track, bool lastTrack) in processVolume_l() argument
3932 audio_track_cblk_t* cblk = track->cblk(); in processVolume_l()
3935 if (mMasterMute || mStreamTypes[track->streamType()].mute) { in processVolume_l()
3938 float typeVolume = mStreamTypes[track->streamType()].volume; in processVolume_l()
3940 AudioTrackServerProxy *proxy = track->mAudioTrackServerProxy; in processVolume_l()
3994 Track* const track = t.get(); in prepareTracks_l() local
3995 audio_track_cblk_t* cblk = track->cblk(); in prepareTracks_l()
4001 bool last = l.get() == track; in prepareTracks_l()
4006 if ((track->sharedBuffer() == 0) && !track->isStopping_1() && !track->isPausing()) { in prepareTracks_l()
4012 if ((track->framesReady() >= minFrames) && track->isReady() && !track->isPaused() && in prepareTracks_l()
4013 !track->isStopping_2() && !track->isStopped()) in prepareTracks_l()
4015 ALOGVV("track %d s=%08x [OK]", track->name(), cblk->mServer); in prepareTracks_l()
4017 if (track->mFillingUpStatus == Track::FS_FILLED) { in prepareTracks_l()
4018 track->mFillingUpStatus = Track::FS_ACTIVE; in prepareTracks_l()
4021 if (track->mState == TrackBase::RESUMING) { in prepareTracks_l()
4022 track->mState = TrackBase::ACTIVE; in prepareTracks_l()
4027 processVolume_l(track, last); in prepareTracks_l()
4030 track->mRetryCount = kMaxTrackRetriesDirect; in prepareTracks_l()
4040 if (track->isStopping_1()) { in prepareTracks_l()
4041 track->mState = TrackBase::STOPPING_2; in prepareTracks_l()
4043 if ((track->sharedBuffer() != 0) || track->isStopped() || in prepareTracks_l()
4044 track->isStopping_2() || track->isPaused()) { in prepareTracks_l()
4056 track->presentationComplete(framesWritten, audioHALFrames)) { in prepareTracks_l()
4057 if (track->isStopping_2()) { in prepareTracks_l()
4058 track->mState = TrackBase::STOPPED; in prepareTracks_l()
4060 if (track->isStopped()) { in prepareTracks_l()
4061 if (track->mState == TrackBase::FLUSHED) { in prepareTracks_l()
4064 track->reset(); in prepareTracks_l()
4066 tracksToRemove->add(track); in prepareTracks_l()
4072 if (--(track->mRetryCount) <= 0) { in prepareTracks_l()
4073 ALOGV("BUFFER TIMEOUT: remove(%d) from active list", track->name()); in prepareTracks_l()
4074 tracksToRemove->add(track); in prepareTracks_l()
4391 Track* const track = t.get(); in prepareTracks_l() local
4392 audio_track_cblk_t* cblk = track->cblk(); in prepareTracks_l()
4398 bool last = l.get() == track; in prepareTracks_l()
4400 if (track->isInvalid()) { in prepareTracks_l()
4402 tracksToRemove->add(track); in prepareTracks_l()
4406 if (track->mState == TrackBase::IDLE) { in prepareTracks_l()
4411 if (track->isPausing()) { in prepareTracks_l()
4412 track->setPaused(); in prepareTracks_l()
4428 tracksToRemove->add(track); in prepareTracks_l()
4429 } else if (track->isFlushPending()) { in prepareTracks_l()
4430 track->flushAck(); in prepareTracks_l()
4434 } else if (track->isResumePending()){ in prepareTracks_l()
4435 track->resumeAck(); in prepareTracks_l()
4455 } else if (track->framesReady() && track->isReady() && in prepareTracks_l()
4456 !track->isPaused() && !track->isTerminated() && !track->isStopping_2()) { in prepareTracks_l()
4457 ALOGVV("OffloadThread: track %d s=%08x [OK]", track->name(), cblk->mServer); in prepareTracks_l()
4458 if (track->mFillingUpStatus == Track::FS_FILLED) { in prepareTracks_l()
4459 track->mFillingUpStatus = Track::FS_ACTIVE; in prepareTracks_l()
4467 if (track != previousTrack.get()) { in prepareTracks_l()
4483 if (previousTrack->sessionId() != track->sessionId()) { in prepareTracks_l()
4488 mPreviousTrack = track; in prepareTracks_l()
4490 track->mRetryCount = kMaxTrackRetriesOffload; in prepareTracks_l()
4495 ALOGVV("OffloadThread: track %d s=%08x [NOT READY]", track->name(), cblk->mServer); in prepareTracks_l()
4496 if (track->isStopping_1()) { in prepareTracks_l()
4504 track->mState = TrackBase::STOPPING_2; // so presentation completes after drain in prepareTracks_l()
4523 } else if (track->isStopping_2()) { in prepareTracks_l()
4526 track->mState = TrackBase::STOPPED; in prepareTracks_l()
4531 track->presentationComplete(framesWritten, audioHALFrames); in prepareTracks_l()
4532 track->reset(); in prepareTracks_l()
4533 tracksToRemove->add(track); in prepareTracks_l()
4538 if (--(track->mRetryCount) <= 0) { in prepareTracks_l()
4540 track->name()); in prepareTracks_l()
4541 tracksToRemove->add(track); in prepareTracks_l()
4551 processVolume_l(track, last); in prepareTracks_l()
5477 sp<RecordTrack> track = mTracks[i]; in threadLoop() local
5478 track->invalidate(); in threadLoop()
5543 sp<RecordTrack> track; in createRecordTrack_l() local
5618 track = new RecordTrack(this, client, sampleRate, in createRecordTrack_l()
5622 lStatus = track->initCheck(); in createRecordTrack_l()
5628 mTracks.add(track); in createRecordTrack_l()
5648 return track; in createRecordTrack_l()
5795 sp<RecordTrack> track = mTracks[i]; in setSyncEvent()
5796 if (eventSession == track->sessionId()) { in setSyncEvent()
5797 (void) track->setSyncEvent(event); in setSyncEvent()
5808 void AudioFlinger::RecordThread::destroyTrack_l(const sp<RecordTrack>& track) in destroyTrack_l() argument
5810 track->terminate(); in destroyTrack_l()
5811 track->mState = TrackBase::STOPPED; in destroyTrack_l()
5813 if (mActiveTracks.indexOf(track) < 0) { in destroyTrack_l()
5814 removeTrack_l(track); in destroyTrack_l()
5818 void AudioFlinger::RecordThread::removeTrack_l(const sp<RecordTrack>& track) in removeTrack_l() argument
5820 mTracks.remove(track); in removeTrack_l()
5822 if (track->isFastTrack()) { in removeTrack_l()
5864 sp<RecordTrack> track = mTracks[i]; in dumpTracks() local
5865 if (track != 0) { in dumpTracks()
5866 bool active = mActiveTracks.indexOf(track) >= 0; in dumpTracks()
5870 track->dump(buffer, SIZE, active); in dumpTracks()
5884 sp<RecordTrack> track = mActiveTracks[i]; in dumpTracks() local
5885 if (mTracks.indexOf(track) < 0) { in dumpTracks()
5886 track->dump(buffer, SIZE, true); in dumpTracks()
6023 sp<RecordTrack> track = mTracks[i]; in checkForNewParameter_l() local
6024 setEffectSuspended_l(FX_IID_AEC, suspend, track->sessionId()); in checkForNewParameter_l()
6025 setEffectSuspended_l(FX_IID_NS, suspend, track->sessionId()); in checkForNewParameter_l()
6175 sp<RecordThread::RecordTrack> track = mTracks[j]; in sessionIds() local
6176 int sessionId = track->sessionId(); in sessionIds()
6253 sp<RecordTrack> track = mTracks[i]; in createAudioPatch_l() local
6254 setEffectSuspended_l(FX_IID_AEC, suspend, track->sessionId()); in createAudioPatch_l()
6255 setEffectSuspended_l(FX_IID_NS, suspend, track->sessionId()); in createAudioPatch_l()