Lines Matching refs:chain

864         sp<EffectChain> chain = mEffectChains[i];
865 if (chain != 0) {
866 chain->dump(fd, args);
1000 sp<EffectChain> chain = getEffectChain_l(sessionId);
1001 if (chain != 0) {
1003 chain->setEffectSuspended_l(type, suspend);
1005 chain->setEffectSuspendedAll_l(suspend);
1012 void AudioFlinger::ThreadBase::checkSuspendOnAddEffectChain_l(const sp<EffectChain>& chain)
1014 ssize_t index = mSuspendedSessions.indexOfKey(chain->sessionId());
1026 chain->setEffectSuspendedAll_l(true);
1030 chain->setEffectSuspended_l(&desc->mType, true);
1120 sp<EffectChain> chain = getEffectChain_l(sessionId);
1121 if (chain != 0) {
1122 chain->checkSuspendOnEffectEnabled(effect, enabled);
1283 sp<EffectChain> chain;
1305 // check for existing effect chain with the requested audio session
1306 chain = getEffectChain_l(sessionId);
1307 if (chain == 0) {
1308 // create a new chain for this session
1309 ALOGV("createEffect_l() new effect chain for session %d", sessionId);
1310 chain = new EffectChain(this, sessionId);
1311 addEffectChain_l(chain);
1312 chain->setStrategy(getStrategyForSession_l(sessionId));
1315 effect = chain->getEffectFromDesc_l(desc);
1318 ALOGV("createEffect_l() got effect %p on chain %p", effect.get(), chain.get());
1324 desc, mId, chain->strategy(), sessionId, effectId);
1329 // create a new effect module if none present in the chain
1330 lStatus = chain->createEffect_l(effect, this, desc, effectId, sessionId, pinned);
1356 chain->removeEffect_l(effect);
1362 removeEffectChain_l(chain);
1408 sp<EffectChain> chain = getEffectChain_l(sessionId);
1409 return chain != 0 ? chain->getEffectFromId_l(effectId) : 0;
1416 // check for existing effect chain with the requested audio session
1418 sp<EffectChain> chain = getEffectChain_l(sessionId);
1425 if (chain == 0) {
1426 // create a new chain for this session
1427 ALOGV("addEffect_l() new effect chain for session %d", sessionId);
1428 chain = new EffectChain(this, sessionId);
1429 addEffectChain_l(chain);
1430 chain->setStrategy(getStrategyForSession_l(sessionId));
1433 ALOGV("addEffect_l() %p chain %p effect %p", this, chain.get(), effect.get());
1435 if (chain->getEffectFromId_l(effect->id()) != 0) {
1436 ALOGW("addEffect_l() %p effect %s already present in chain %p",
1437 this, effect->desc().name, chain.get());
1443 status_t status = chain->addEffect_l(effect);
1446 removeEffectChain_l(chain);
1467 sp<EffectChain> chain = effect->chain().promote();
1468 if (chain != 0) {
1469 // remove effect chain if removing last effect
1470 if (chain->removeEffect_l(effect, release) == 0) {
1471 removeEffectChain_l(chain);
1474 ALOGW("removeEffect_l() %p cannot promote chain for effect %p", this, effect.get());
1939 sp<EffectChain> chain = getEffectChain_l(session);
1940 if (chain.get() != nullptr) {
1942 chain->checkOutputFlagCompatibility(flags);
2153 sp<EffectChain> chain = getEffectChain_l(sessionId);
2154 if (chain != 0) {
2155 ALOGV("createTrack_l() setting main buffer %p", chain->inBuffer());
2156 track->setMainBuffer(chain->inBuffer());
2157 chain->setStrategy(AudioSystem::getStrategyForStream(track->streamType()));
2158 chain->incTrackCnt();
2341 sp<EffectChain> chain = getEffectChain_l(track->sessionId());
2342 if (chain != 0) {
2343 ALOGV("addTrack_l() starting track on chain %p for session %d", chain.get(),
2345 chain->incActiveTrackCnt();
2387 sp<EffectChain> chain = getEffectChain_l(track->sessionId());
2388 if (chain != 0) {
2389 chain->decTrackCnt();
2908 // TODO: should we decActiveTrackCnt() of the cleared track effect chain?
2971 status_t AudioFlinger::PlaybackThread::addEffectChain_l(const sp<EffectChain>& chain)
2973 audio_session_t session = chain->sessionId();
2982 ALOGV("addEffectChain_l() %p on thread %p for session %d", chain.get(), this, session);
2984 // Only one effect chain can be present in direct output thread and it uses
3001 // Attach all tracks with same session ID to this chain.
3008 chain->incTrackCnt();
3012 // indicate all active tracks in the chain
3016 chain->incActiveTrackCnt();
3020 chain->setThread(this);
3021 chain->setInBuffer(halInBuffer);
3022 chain->setOutBuffer(halOutBuffer);
3023 // Effect chain for session AUDIO_SESSION_OUTPUT_STAGE is inserted at end of effect
3025 // Effect chain for session AUDIO_SESSION_OUTPUT_MIX is inserted before
3030 // Effect chain for other sessions are inserted at beginning of effect
3043 mEffectChains.insertAt(chain, i);
3044 checkSuspendOnAddEffectChain_l(chain);
3049 size_t AudioFlinger::PlaybackThread::removeEffectChain_l(const sp<EffectChain>& chain)
3051 audio_session_t session = chain->sessionId();
3053 ALOGV("removeEffectChain_l() %p from thread %p for session %d", chain.get(), this, session);
3056 if (chain == mEffectChains[i]) {
3058 // detach all active tracks from the chain
3061 ALOGV("removeEffectChain_l(): stopping track on chain %p for session Id: %d",
3062 chain.get(), session);
3063 chain->decActiveTrackCnt();
3067 // detach all tracks with same session ID from this chain
3072 chain->decTrackCnt();
3351 // prevent any changes in effect chain list and in each effect chain
3440 // enable changes in effect chain
3609 sp<EffectChain> chain = getEffectChain_l(track->sessionId());
3610 if (chain != 0) {
3611 ALOGV("stopping track on chain %p for session Id: %d", chain.get(),
3613 chain->decActiveTrackCnt();
4244 // Delegate master volume control to effect in output mix effect chain if needed
4245 sp<EffectChain> chain = getEffectChain_l(AUDIO_SESSION_OUTPUT_MIX);
4246 if (chain != 0) {
4248 chain->setVolume_l(&v, &v);
4250 chain.clear();
4510 // there is an effect chain connected to the track
4511 chain.clear();
4517 chain = getEffectChain_l(track->sessionId());
4518 // Delegate volume control to effect in track effect chain if needed
4519 if (chain != 0) {
4522 ALOGW("prepareTracks_l(): track %d attached to effect but no chain found on "
4579 // then derive vl and vr as U8.24 versions for the effect chain
4596 // Delegate volume control to effect in track effect chain if needed
4597 if (chain != 0 && chain->setVolume_l(&vl, &vr)) {
4606 // from effect chain to avoid volume spike
4675 * Tracks with effects go into their own effects chain buffer
4731 // clear effect chain input buffer if an active track underruns to avoid sending
4733 chain = getEffectChain_l(track->sessionId());
4734 if (chain != 0) {
4735 chain->clearInputBuffer();
4846 // passing a non-clean buffer to the effect chain
4850 // effect chain as in this case the mixer will not write to the sink or mix buffer
5149 // Delegate volume control to effect in track effect chain if needed
5150 // only one effect chain can be present on DirectOutputThread, so if
5288 // clear effect chain input buffer if the last active track started underruns
6558 // thread mutex is not locked, but effect chain is locked
6839 // enable changes in effect chain
6982 sp<EffectChain> chain = getEffectChain_l(sessionId);
6983 if (chain != 0) {
6985 chain->checkInputFlagCompatibility(flags);
7750 status_t AudioFlinger::RecordThread::addEffectChain_l(const sp<EffectChain>& chain)
7752 // only one chain per input thread
7754 ALOGW("addEffectChain_l() already one chain %p on thread %p", chain.get(), this);
7757 ALOGV("addEffectChain_l() %p on thread %p", chain.get(), this);
7758 chain->setThread(this);
7759 chain->setInBuffer(NULL);
7760 chain->setOutBuffer(NULL);
7762 checkSuspendOnAddEffectChain_l(chain);
7766 chain->syncHalEffectsState();
7768 mEffectChains.add(chain);
7773 size_t AudioFlinger::RecordThread::removeEffectChain_l(const sp<EffectChain>& chain)
7775 ALOGV("removeEffectChain_l() %p from thread %p", chain.get(), this);
7777 "removeEffectChain_l() %p invalid chain size %zu on thread %p",
7778 chain.get(), mEffectChains.size(), this);
8115 sp<EffectChain> chain = getEffectChain_l(mSessionId);
8116 if (chain != 0) {
8117 chain->setStrategy(AudioSystem::getStrategyForStream(streamType()));
8118 chain->incTrackCnt();
8119 chain->incActiveTrackCnt();
8168 sp<EffectChain> chain = getEffectChain_l(track->sessionId());
8169 if (chain != 0) {
8170 chain->decActiveTrackCnt();
8171 chain->decTrackCnt();
8257 // enable changes in effect chain
8471 status_t AudioFlinger::MmapThread::addEffectChain_l(const sp<EffectChain>& chain)
8473 audio_session_t session = chain->sessionId();
8475 ALOGV("addEffectChain_l() %p on thread %p for session %d", chain.get(), this, session);
8476 // Attach all tracks with same session ID to this chain.
8477 // indicate all active tracks in the chain
8480 chain->incTrackCnt();
8481 chain->incActiveTrackCnt();
8485 chain->setThread(this);
8486 chain->setInBuffer(nullptr);
8487 chain->setOutBuffer(nullptr);
8488 chain->syncHalEffectsState();
8490 mEffectChains.add(chain);
8491 checkSuspendOnAddEffectChain_l(chain);
8495 size_t AudioFlinger::MmapThread::removeEffectChain_l(const sp<EffectChain>& chain)
8497 audio_session_t session = chain->sessionId();
8499 ALOGV("removeEffectChain_l() %p from thread %p for session %d", chain.get(), this, session);
8502 if (chain == mEffectChains[i]) {
8504 // detach all active tracks from the chain
8505 // detach all tracks with same session ID from this chain
8508 chain->decActiveTrackCnt();
8509 chain->decTrackCnt();
8769 // Delegate volume control to effect in track effect chain if needed
8770 // only one effect chain can be present on DirectOutputThread, so if