Home | History | Annotate | Download | only in audioflinger

Lines Matching defs:thread

561     // further sample rate checks are performed by createTrack_l() depending on the thread type
568 // further channel mask checks are performed by createTrack_l() depending on the thread type
575 // further format checks are performed by createTrack_l() depending on the thread type
590 PlaybackThread *thread = checkPlaybackThread_l(output);
591 if (thread == NULL) {
592 ALOGE("no playback thread found for output handle %d", output);
604 // output thread and move it here.
624 track = thread->createTrack_l(client, streamType, sampleRate, format,
629 // move effect chain to this output thread if an effect on same session was waiting
633 Mutex::Autolock _dl(thread->mLock);
635 moveEffectChain_l(lSessionId, effectThread, thread, true);
641 if (thread->isValidSyncEvent(mPendingSyncEvents[i])) {
679 PlaybackThread *thread = checkPlaybackThread_l(output);
680 if (thread == NULL) {
681 ALOGW("sampleRate() unknown thread %d", output);
684 return thread->sampleRate();
690 PlaybackThread *thread = checkPlaybackThread_l(output);
691 if (thread == NULL) {
692 ALOGW("format() unknown thread %d", output);
695 return thread->format();
701 PlaybackThread *thread = checkPlaybackThread_l(output);
702 if (thread == NULL) {
703 ALOGW("frameCount() unknown thread %d", output);
708 return thread->frameCount();
714 PlaybackThread *thread = checkPlaybackThread_l(output);
715 if (thread == NULL) {
716 ALOGW("latency(): no playback thread found for output handle %d", output);
719 return thread->latency();
749 // Now set the master volume in each playback thread. Playback threads
861 // Now set the master mute in each playback thread. Playback threads
907 PlaybackThread *thread = NULL;
909 thread = checkPlaybackThread_l(output);
910 if (thread == NULL) {
917 if (thread == NULL) {
922 thread->setStreamVolume(stream, value);
958 PlaybackThread *thread = checkPlaybackThread_l(output);
959 if (thread == NULL) {
962 volume = thread->streamVolume(stream);
1011 sp<RecordThread> thread = mRecordThreads.valueAt(i);
1012 audio_devices_t device = thread->inDevice();
1014 // collect all of the thread's session IDs
1015 KeyedVector<int, bool> ids = thread->sessionIds();
1019 thread->setEffectSuspended(FX_IID_AEC,
1022 thread->setEffectSuspended(FX_IID_NS,
1040 // hold a strong ref on thread in case closeOutput() or closeInput() is called
1041 // and the thread is exited once the lock is released
1042 sp<ThreadBase> thread;
1045 thread = checkPlaybackThread_l(ioHandle);
1046 if (thread == 0) {
1047 thread = checkRecordThread_l(ioHandle);
1048 } else if (thread == primaryPlaybackThread_l()) {
1060 if (thread != 0) {
1061 return thread->setParameters(keyValuePairs);
1262 sp<PlaybackThread> thread;
1266 ALOG_ASSERT(thread == 0);
1267 thread = mPlaybackThreads.valueAt(i);
1271 return thread;
1405 RecordThread *thread = checkRecordThread_l(input);
1406 if (thread == NULL) {
1412 if (deviceRequiresCaptureAudioOutputPermission(thread->inDevice())
1434 recordTrack = thread->createRecordTrack_l(client, sampleRate, format, channelMask,
1442 // session and move it to this thread.
1445 Mutex::Autolock _l(thread->mLock);
1446 thread->addEffectChain_l(chain);
1576 PlaybackThread *thread = primaryPlaybackThread_l();
1577 return thread != NULL ? thread->sampleRate() : 0;
1583 PlaybackThread *thread = primaryPlaybackThread_l();
1584 return thread != NULL ? thread->frameCountHAL() : 0;
1608 sp<PlaybackThread> thread = mPlaybackThreads.valueAt(i);
1609 if ((thread->hasAudioSession(sessionId) & ThreadBase::TRACK_SESSION) != 0) {
1610 // A session can only be on one thread, so exit after first match
1611 String8 reply = thread->getParameters(String8(AUDIO_PARAMETER_STREAM_HW_AV_SYNC));
1688 PlaybackThread *thread;
1690 thread = new OffloadThread(this, outputStream, *output, devices);
1691 ALOGV("openOutput_l() created offload output: ID %d thread %p", *output, thread);
1695 thread = new DirectOutputThread(this, outputStream, *output, devices);
1696 ALOGV("openOutput_l() created direct output: ID %d thread %p", *output, thread);
1698 thread = new MixerThread(this, outputStream, *output, devices);
1699 ALOGV("openOutput_l() created mixer output: ID %d thread %p", *output, thread);
1701 mPlaybackThreads.add(*output, thread);
1702 return thread;
1730 sp<PlaybackThread> thread = openOutput_l(module, output, config, *devices, address, flags);
1731 if (thread != 0) {
1732 *latencyMs = thread->latency();
1735 thread->audioConfigChanged(AudioSystem::OUTPUT_OPENED);
1740 mPrimaryHardwareDev = thread->getOutput()->audioHwDev;
1769 DuplicatingThread *thread = new DuplicatingThread(this, thread1, id);
1770 thread->addOutputTrack(thread2);
1771 mPlaybackThreads.add(id, thread);
1773 thread->audioConfigChanged(AudioSystem::OUTPUT_OPENED);
1784 // keep strong reference on the playback thread so that
1786 sp<PlaybackThread> thread;
1789 thread = checkPlaybackThread_l(output);
1790 if (thread == NULL) {
1796 if (thread->type() == ThreadBase::MIXER) {
1801 dupThread->removeOutputTrack((MixerThread *)thread.get());
1809 // save all effects to the default thread
1813 // audioflinger lock is held here so the acquisition order of thread locks does not
1816 Mutex::Autolock _sl(thread->mLock);
1817 Vector< sp<EffectChain> > effectChains = thread->getEffectChains_l();
1819 moveEffectChain_l(effectChains[i]->sessionId(), thread.get(), dstThread, true);
1825 thread->exit();
1826 // The thread entity (active unit of execution) is no longer running here,
1829 if (thread->type() != ThreadBase::DUPLICATING) {
1830 closeOutputFinish(thread);
1836 void AudioFlinger::closeOutputFinish(sp<PlaybackThread> thread)
1838 AudioStreamOut *out = thread->clearOutput();
1840 // from now on thread->mOutput is NULL
1845 void AudioFlinger::closeOutputInternal_l(sp<PlaybackThread> thread)
1847 mPlaybackThreads.removeItem(thread->mId);
1848 thread->exit();
1849 closeOutputFinish(thread);
1855 PlaybackThread *thread = checkPlaybackThread_l(output);
1857 if (thread == NULL) {
1862 thread->suspend();
1870 PlaybackThread *thread = checkPlaybackThread_l(output);
1872 if (thread == NULL) {
1878 thread->restore();
1897 sp<RecordThread> thread = openInput_l(module, input, config, *device, address, source, flags);
1899 if (thread != 0) {
1901 thread->audioConfigChanged(AudioSystem::INPUT_OPENED);
2008 // Start record thread
2011 sp<RecordThread> thread = new RecordThread(this,
2020 mRecordThreads.add(*input, thread);
2021 ALOGV("openInput_l() created record thread: ID %d thread %p", *input, thread.get());
2022 return thread;
2036 // keep strong reference on the record thread so that
2038 sp<RecordThread> thread;
2041 thread = checkRecordThread_l(input);
2042 if (thread == 0) {
2049 // on at least one effect. We must either move the chain to an existing thread with the
2050 // same session ID or put it aside in case a new record thread is opened for a
2054 Mutex::Autolock _sl(thread->mLock);
2055 Vector< sp<EffectChain> > effectChains = thread->getEffectChains_l();
2056 // Note: maximum one chain per record thread
2062 // first check if a record thread is already opened with a client on the same session.
2063 // This should only happen in case of overlap between one thread tear down and the
2068 if (t == thread) {
2073 ALOGV("closeInput() found thread %d for effect session %d",
2079 // put the chain aside if we could not find a record thread with the same session id.
2087 // FIXME: calling thread->exit() without mLock held should not be needed anymore now that
2089 closeInputFinish(thread);
2093 void AudioFlinger::closeInputFinish(sp<RecordThread> thread)
2095 thread->exit();
2096 AudioStreamIn *in = thread->clearInput();
2098 // from now on thread->mInput is NULL
2103 void AudioFlinger::closeInputInternal_l(sp<RecordThread> thread)
2105 mRecordThreads.removeItem(thread->mId);
2106 closeInputFinish(thread);
2115 PlaybackThread *thread = mPlaybackThreads.valueAt(i).get();
2116 thread->invalidateTracks(stream);
2256 PlaybackThread *thread = checkPlaybackThread_l(output);
2257 return thread != NULL && thread->type() != ThreadBase::DIRECT ? (MixerThread *) thread : NULL;
2274 PlaybackThread *thread = mPlaybackThreads.valueAt(i).get();
2275 AudioStreamOut *output = thread->getOutput();
2277 return thread;
2285 PlaybackThread *thread = primaryPlaybackThread_l();
2287 if (thread == NULL) {
2291 return thread->outDevice();
2482 // look for the thread where the specified audio session is present
2497 // If no output thread contains the requested session ID, default to
2499 // thread when a track with the same session ID is created
2505 ThreadBase *thread = checkRecordThread_l(io);
2506 if (thread == NULL) {
2507 thread = checkPlaybackThread_l(io);
2508 if (thread == NULL) {
2509 ALOGE("createEffect() unknown output thread");
2518 Mutex::Autolock _l(thread->mLock);
2519 thread->addEffectChain_l(chain);
2525 // create effect on selected output thread
2526 handle = thread->createEffect_l(client, effectClient, priority, sessionId,
2575 ALOGV("moveEffectChain_l() session %d from thread %p to thread %p",
2580 ALOGW("moveEffectChain_l() effect chain for session %d not on source thread %p",
2585 // Check whether the destination thread has a channel count of FCC_2, which is
2590 " destination thread %p channel count(%u) != %u",
2595 // remove chain first. This is useful only if reconfiguring effect chain on same output thread,
2601 // transfer all effects one by one so that new effect chain is created on new thread with