Loading services/audioflinger/Threads.cpp +35 −11 Original line number Diff line number Diff line Loading @@ -5276,7 +5276,10 @@ MixerThread::MixerThread(const sp<IAfThreadCallback>& afThreadCallback, AudioStr mFastMixerNBLogWriter = afThreadCallback->newWriter_l(kFastMixerLogSize, "FastMixer"); state->mNBLogWriter = mFastMixerNBLogWriter.get(); sq->end(); { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_PUSHED); } NBLog::thread_info_t info; info.id = mId; Loading Loading @@ -5335,8 +5338,11 @@ MixerThread::~MixerThread() } state->mCommand = FastMixerState::EXIT; sq->end(); { audio_utils::mutex::scoped_join_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_PUSHED); mFastMixer->join(); } // Though the fast mixer thread has exited, it's state queue is still valid. // We'll use that extract the final state which contains one remaining fast track // corresponding to our sub-mix. Loading Loading @@ -5416,7 +5422,10 @@ ssize_t MixerThread::threadLoop_write() FastThreadDumpState::kSamplingNforLowRamDevice : FastThreadDumpState::kSamplingN); #endif sq->end(); { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_PUSHED); } if (kUseFastMixer == FastMixer_Dynamic) { mNormalSink = mPipeSink; } Loading Loading @@ -5449,7 +5458,10 @@ void MixerThread::threadLoop_standby() mFastMixerFutex = 0; sq->end(); // BLOCK_UNTIL_PUSHED would be insufficient, as we need it to stop doing I/O now { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_ACKED); } if (kUseFastMixer == FastMixer_Dynamic) { mNormalSink = mOutputSink; } Loading Loading @@ -6345,8 +6357,11 @@ PlaybackThread::mixer_state MixerThread::prepareTracks_l( // // This occurs with BT suspend when we idle the FastMixer with // active tracks, which may be added or removed. { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(coldIdle ? FastMixerStateQueue::BLOCK_NEVER : block); } } #ifdef AUDIO_WATCHDOG if (pauseAudioWatchdog && mAudioWatchdog != 0) { mAudioWatchdog->pause(); Loading Loading @@ -8318,8 +8333,10 @@ RecordThread::RecordThread(const sp<IAfThreadCallback>& afThreadCallback, afThreadCallback->newWriter_l(kFastCaptureLogSize, "FastCapture"); state->mNBLogWriter = mFastCaptureNBLogWriter.get(); sq->end(); { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastCapture->getTid()); sq->push(FastCaptureStateQueue::BLOCK_UNTIL_PUSHED); } // start the fast capture mFastCapture->run("FastCapture", ANDROID_PRIORITY_URGENT_AUDIO); pid_t tid = mFastCapture->getTid(); Loading Loading @@ -8353,8 +8370,11 @@ RecordThread::~RecordThread() } state->mCommand = FastCaptureState::EXIT; sq->end(); { audio_utils::mutex::scoped_join_wait_check queueWaitCheck(mFastCapture->getTid()); sq->push(FastCaptureStateQueue::BLOCK_UNTIL_PUSHED); mFastCapture->join(); } mFastCapture.clear(); } mAfThreadCallback->unregisterWriter(mFastCaptureNBLogWriter); Loading Loading @@ -8987,7 +9007,11 @@ void RecordThread::inputStandBy() mFastCaptureFutex = 0; sq->end(); // BLOCK_UNTIL_PUSHED would be insufficient, as we need it to stop doing I/O now { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastCapture->getTid()); sq->push(FastCaptureStateQueue::BLOCK_UNTIL_ACKED); } #if 0 if (kUseFastCapture == FastCapture_Dynamic) { // FIXME Loading Loading
services/audioflinger/Threads.cpp +35 −11 Original line number Diff line number Diff line Loading @@ -5276,7 +5276,10 @@ MixerThread::MixerThread(const sp<IAfThreadCallback>& afThreadCallback, AudioStr mFastMixerNBLogWriter = afThreadCallback->newWriter_l(kFastMixerLogSize, "FastMixer"); state->mNBLogWriter = mFastMixerNBLogWriter.get(); sq->end(); { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_PUSHED); } NBLog::thread_info_t info; info.id = mId; Loading Loading @@ -5335,8 +5338,11 @@ MixerThread::~MixerThread() } state->mCommand = FastMixerState::EXIT; sq->end(); { audio_utils::mutex::scoped_join_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_PUSHED); mFastMixer->join(); } // Though the fast mixer thread has exited, it's state queue is still valid. // We'll use that extract the final state which contains one remaining fast track // corresponding to our sub-mix. Loading Loading @@ -5416,7 +5422,10 @@ ssize_t MixerThread::threadLoop_write() FastThreadDumpState::kSamplingNforLowRamDevice : FastThreadDumpState::kSamplingN); #endif sq->end(); { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_PUSHED); } if (kUseFastMixer == FastMixer_Dynamic) { mNormalSink = mPipeSink; } Loading Loading @@ -5449,7 +5458,10 @@ void MixerThread::threadLoop_standby() mFastMixerFutex = 0; sq->end(); // BLOCK_UNTIL_PUSHED would be insufficient, as we need it to stop doing I/O now { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(FastMixerStateQueue::BLOCK_UNTIL_ACKED); } if (kUseFastMixer == FastMixer_Dynamic) { mNormalSink = mOutputSink; } Loading Loading @@ -6345,8 +6357,11 @@ PlaybackThread::mixer_state MixerThread::prepareTracks_l( // // This occurs with BT suspend when we idle the FastMixer with // active tracks, which may be added or removed. { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastMixer->getTid()); sq->push(coldIdle ? FastMixerStateQueue::BLOCK_NEVER : block); } } #ifdef AUDIO_WATCHDOG if (pauseAudioWatchdog && mAudioWatchdog != 0) { mAudioWatchdog->pause(); Loading Loading @@ -8318,8 +8333,10 @@ RecordThread::RecordThread(const sp<IAfThreadCallback>& afThreadCallback, afThreadCallback->newWriter_l(kFastCaptureLogSize, "FastCapture"); state->mNBLogWriter = mFastCaptureNBLogWriter.get(); sq->end(); { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastCapture->getTid()); sq->push(FastCaptureStateQueue::BLOCK_UNTIL_PUSHED); } // start the fast capture mFastCapture->run("FastCapture", ANDROID_PRIORITY_URGENT_AUDIO); pid_t tid = mFastCapture->getTid(); Loading Loading @@ -8353,8 +8370,11 @@ RecordThread::~RecordThread() } state->mCommand = FastCaptureState::EXIT; sq->end(); { audio_utils::mutex::scoped_join_wait_check queueWaitCheck(mFastCapture->getTid()); sq->push(FastCaptureStateQueue::BLOCK_UNTIL_PUSHED); mFastCapture->join(); } mFastCapture.clear(); } mAfThreadCallback->unregisterWriter(mFastCaptureNBLogWriter); Loading Loading @@ -8987,7 +9007,11 @@ void RecordThread::inputStandBy() mFastCaptureFutex = 0; sq->end(); // BLOCK_UNTIL_PUSHED would be insufficient, as we need it to stop doing I/O now { audio_utils::mutex::scoped_queue_wait_check queueWaitCheck(mFastCapture->getTid()); sq->push(FastCaptureStateQueue::BLOCK_UNTIL_ACKED); } #if 0 if (kUseFastCapture == FastCapture_Dynamic) { // FIXME Loading