Loading services/audioflinger/Threads.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -3944,7 +3944,9 @@ void PlaybackThread::detachAuxEffect_l(int effectId) bool PlaybackThread::threadLoop() NO_THREAD_SAFETY_ANALYSIS // manual locking of AudioFlinger { if (mType == SPATIALIZER) { // Check the flag and not the mixer type to also boost the duplicating thread priority // when one of the outputs is a spatializer thread. if (mOutput != nullptr && ((mOutput->flags & AUDIO_OUTPUT_FLAG_SPATIALIZER) != 0)) { const pid_t tid = getTid(); if (tid == -1) { // odd: we are here, we must be a running thread. ALOGW("%s: Cannot update Spatializer mixer thread priority, no tid", __func__); Loading Loading @@ -7895,11 +7897,11 @@ void DuplicatingThread::removeOutputTrack(IAfPlaybackThread* thread) void DuplicatingThread::updateWaitTime_l() { // Initialize mWaitTimeMs according to the mixer buffer size. mWaitTimeMs = mNormalFrameCount * 2 * 1000 / mSampleRate; mWaitTimeMs = mNormalFrameCount * 1000 / mSampleRate; for (const auto& track : mOutputTracks) { const auto strong = track->thread().promote(); if (strong != 0) { uint32_t waitTimeMs = (strong->frameCount() * 2 * 1000) / strong->sampleRate(); uint32_t waitTimeMs = (strong->frameCount() * 1000) / strong->sampleRate(); if (waitTimeMs < mWaitTimeMs) { mWaitTimeMs = waitTimeMs; } Loading services/audioflinger/Tracks.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2341,7 +2341,8 @@ OutputTrack::OutputTrack( sampleRate, format, channelMask, frameCount, nullptr /* buffer */, (size_t)0 /* bufferSize */, nullptr /* sharedBuffer */, AUDIO_SESSION_NONE, getpid(), attributionSource, AUDIO_OUTPUT_FLAG_NONE, TYPE_OUTPUT), TYPE_OUTPUT, AUDIO_PORT_HANDLE_NONE, /*frameCountToBeReady*/ playbackThread->frameCount()), mActive(false), mSourceThread(sourceThread) { if (mCblk != NULL) { Loading Loading
services/audioflinger/Threads.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -3944,7 +3944,9 @@ void PlaybackThread::detachAuxEffect_l(int effectId) bool PlaybackThread::threadLoop() NO_THREAD_SAFETY_ANALYSIS // manual locking of AudioFlinger { if (mType == SPATIALIZER) { // Check the flag and not the mixer type to also boost the duplicating thread priority // when one of the outputs is a spatializer thread. if (mOutput != nullptr && ((mOutput->flags & AUDIO_OUTPUT_FLAG_SPATIALIZER) != 0)) { const pid_t tid = getTid(); if (tid == -1) { // odd: we are here, we must be a running thread. ALOGW("%s: Cannot update Spatializer mixer thread priority, no tid", __func__); Loading Loading @@ -7895,11 +7897,11 @@ void DuplicatingThread::removeOutputTrack(IAfPlaybackThread* thread) void DuplicatingThread::updateWaitTime_l() { // Initialize mWaitTimeMs according to the mixer buffer size. mWaitTimeMs = mNormalFrameCount * 2 * 1000 / mSampleRate; mWaitTimeMs = mNormalFrameCount * 1000 / mSampleRate; for (const auto& track : mOutputTracks) { const auto strong = track->thread().promote(); if (strong != 0) { uint32_t waitTimeMs = (strong->frameCount() * 2 * 1000) / strong->sampleRate(); uint32_t waitTimeMs = (strong->frameCount() * 1000) / strong->sampleRate(); if (waitTimeMs < mWaitTimeMs) { mWaitTimeMs = waitTimeMs; } Loading
services/audioflinger/Tracks.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -2341,7 +2341,8 @@ OutputTrack::OutputTrack( sampleRate, format, channelMask, frameCount, nullptr /* buffer */, (size_t)0 /* bufferSize */, nullptr /* sharedBuffer */, AUDIO_SESSION_NONE, getpid(), attributionSource, AUDIO_OUTPUT_FLAG_NONE, TYPE_OUTPUT), TYPE_OUTPUT, AUDIO_PORT_HANDLE_NONE, /*frameCountToBeReady*/ playbackThread->frameCount()), mActive(false), mSourceThread(sourceThread) { if (mCblk != NULL) { Loading