Lines Matching refs:chain

356         // move effect chain to this output thread if an effect on same session was waiting
1072 sp<EffectChain> chain = mEffectChains[i];
1073 if (chain != 0) {
1074 chain->dump(fd, args);
1192 sp<EffectChain> chain = getEffectChain_l(sessionId);
1193 if (chain != 0) {
1194 LOGV("createTrack_l() setting main buffer %p", chain->inBuffer());
1195 track->setMainBuffer(chain->inBuffer());
1196 chain->setStrategy(AudioSystem::getStrategyForStream((AudioSystem::stream_type)track->type()));
1315 sp<EffectChain> chain = getEffectChain_l(track->sessionId());
1316 if (chain != 0) {
1317 LOGV("addTrack_l() starting track on chain %p for session %d", chain.get(), track->sessionId());
1318 chain->startTrack();
1458 sp<EffectChain> chain;
1463 chain = mEffectChains[i];
1467 return chain;
1573 // prevent any changes in effect chain list and in each effect chain
1611 // enable changes in effect chain
1642 // enable changes in effect chain
1699 // Delegate master volume control to effect in output mix effect chain if needed
1700 sp<EffectChain> chain = getEffectChain_l(AudioSystem::SESSION_OUTPUT_MIX);
1701 if (chain != 0) {
1703 chain->setVolume_l(&v, &v);
1705 chain.clear();
1725 // track->mainBuffer() != mMixBuffer means there is an effect chain
1727 chain.clear();
1729 chain = getEffectChain_l(track->sessionId());
1730 // Delegate volume control to effect in track effect chain if needed
1731 if (chain != 0) {
1734 LOGW("prepareTracks_l(): track %08x attached to effect but no chain found on session %d",
1783 // Delegate volume control to effect in track effect chain if needed
1784 if (chain != 0 && chain->setVolume_l(&vl, &vr)) {
1790 // from effect chain to avoid volume spike
1876 chain = getEffectChain_l(track->sessionId());
1877 if (chain != 0) {
1878 LOGV("stopping track on chain %p for session Id: %d", chain.get(), track->sessionId());
1879 chain->stopTrack();
1890 // effect chain as in this case the mixer will not write to
2286 // Delegate volume control to effect in track effect chain if needed
2287 // only one effect chain can be present on DirectOutputThread, so if
2339 LOGV("stopping track on chain %p for session Id: %d", effectChains[0].get(),
2608 // prevent any changes in effect chain list and in each effect chain
2651 // enable changes in effect chain
2661 // enable changes in effect chain
4782 // first output. The effect chain will be moved to the correct output
4858 sp<EffectChain> chain = srcThread->getEffectChain_l(session);
4859 if (chain == 0) {
4860 LOGW("moveEffectChain_l() effect chain for session %d not on source thread %p",
4865 // remove chain first. This is useful only if reconfiguring effect chain on same output thread,
4866 // so that a new chain is created with correct parameters when first effect is added. This is
4867 // otherwise unecessary as removeEffect_l() will remove the chain when last effect is
4869 srcThread->removeEffectChain_l(chain);
4871 // transfer all effects one by one so that new effect chain is created on new thread with
4876 sp<EffectModule> effect = chain->getEffectFromId_l(0);
4883 dstChain = effect->chain().promote();
4885 LOGW("moveEffectChain_l() cannot get chain from effect %p", effect.get());
4899 effect = chain->getEffectFromId_l(0);
4920 sp<EffectChain> chain;
4954 // check for existing effect chain with the requested audio session
4955 chain = getEffectChain_l(sessionId);
4956 if (chain == 0) {
4957 // create a new chain for this session
4958 LOGV("createEffect_l() new effect chain for session %d", sessionId);
4959 chain = new EffectChain(this, sessionId);
4960 addEffectChain_l(chain);
4961 chain->setStrategy(getStrategyForSession_l(sessionId));
4964 effect = chain->getEffectFromDesc_l(desc);
4967 LOGV("createEffect_l() got effect %p on chain %p", effect == 0 ? 0 : effect.get(), chain.get());
4972 lStatus = AudioSystem::registerEffect(desc, mId, chain->strategy(), sessionId, id);
4977 // create a new effect module if none present in the chain
4978 effect = new EffectModule(this, chain, desc, id, sessionId);
4983 lStatus = chain->addEffect_l(effect);
5004 chain->removeEffect_l(effect);
5010 removeEffectChain_l(chain);
5025 // check for existing effect chain with the requested audio session
5027 sp<EffectChain> chain = getEffectChain_l(sessionId);
5030 if (chain == 0) {
5031 // create a new chain for this session
5032 LOGV("addEffect_l() new effect chain for session %d", sessionId);
5033 chain = new EffectChain(this, sessionId);
5034 addEffectChain_l(chain);
5035 chain->setStrategy(getStrategyForSession_l(sessionId));
5038 LOGV("addEffect_l() %p chain %p effect %p", this, chain.get(), effect.get());
5040 if (chain->getEffectFromId_l(effect->id()) != 0) {
5041 LOGW("addEffect_l() %p effect %s already present in chain %p",
5042 this, effect->desc().name, chain.get());
5046 status_t status = chain->addEffect_l(effect);
5049 removeEffectChain_l(chain);
5067 sp<EffectChain> chain = effect->chain().promote();
5068 if (chain != 0) {
5069 // remove effect chain if removing last effect
5070 if (chain->removeEffect_l(effect) == 0) {
5071 removeEffectChain_l(chain);
5074 LOGW("removeEffect_l() %p cannot promote chain for effect %p", this, effect.get());
5089 status_t AudioFlinger::PlaybackThread::addEffectChain_l(const sp<EffectChain>& chain)
5091 int session = chain->sessionId();
5095 LOGV("addEffectChain_l() %p on thread %p for session %d", chain.get(), this, session);
5097 // Only one effect chain can be present in direct output thread and it uses
5107 // Attach all tracks with same session ID to this chain.
5116 // indicate all active tracks in the chain
5122 chain->startTrack();
5127 chain->setInBuffer(buffer, ownsBuffer);
5128 chain->setOutBuffer(mMixBuffer);
5129 // Effect chain for session AudioSystem::SESSION_OUTPUT_STAGE is inserted at end of effect
5131 // Effect chain for session AudioSystem::SESSION_OUTPUT_MIX is inserted before
5136 // Effect chain for other sessions are inserted at beginning of effect
5144 mEffectChains.insertAt(chain, i);
5149 size_t AudioFlinger::PlaybackThread::removeEffectChain_l(const sp<EffectChain>& chain)
5151 int session = chain->sessionId();
5153 LOGV("removeEffectChain_l() %p from thread %p for session %d", chain.get(), this, session);
5156 if (chain == mEffectChains[i]) {
5158 // detach all tracks with same session ID from this chain
5193 sp<EffectChain> chain = getEffectChain_l(sessionId);
5194 if (chain != 0) {
5195 effect = chain->getEffectFromId_l(effectId);
5248 const wp<AudioFlinger::EffectChain>& chain,
5252 : mThread(wThread), mChain(chain), mId(id), mSessionId(sessionId), mEffectInterface(NULL),
5443 sp<EffectChain> chain = mChain.promote();
5444 if (chain != 0 && chain->activeTracks() != 0) {
5503 // last effect in the chain accumulates in output buffer: input buffer != output buffer
6218 // they are processed first and accumulated in chain input buffer
6229 // auxiliary effects output samples to chain input buffer for further processing
6294 // always read samples from chain input buffer
6297 // if last effect in the chain, output samples to chain
6298 // output buffer, otherwise to chain input buffer
6310 LOGV("addEffect_l() effect %p, added in chain %p at rank %d", effect.get(), this, idx_insert);
6335 LOGV("removeEffect_l() effect %p, removed from chain %p at rank %d", effect.get(), this, i);
6398 // then indicate volume to all other effects in chain.