Loading services/audioflinger/FastCapture.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,9 @@ void FastCapture::onStateChange() // FIXME new may block for unbounded time at internal mutex of the heap // implementation; it would be better to have normal capture thread allocate for // us to avoid blocking here and to prevent possible priority inversion (void)posix_memalign(&mReadBuffer, 32, frameCount * Format_frameSize(mFormat)); size_t bufferSize = frameCount * Format_frameSize(mFormat); (void)posix_memalign(&mReadBuffer, 32, bufferSize); memset(mReadBuffer, 0, bufferSize); // if posix_memalign fails, will segv here. mPeriodNs = (frameCount * 1000000000LL) / mSampleRate; // 1.00 mUnderrunNs = (frameCount * 1750000000LL) / mSampleRate; // 1.75 mOverrunNs = (frameCount * 500000000LL) / mSampleRate; // 0.50 Loading services/audioflinger/Threads.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -6932,6 +6932,7 @@ void AudioFlinger::RecordThread::readInputParameters_l() mRsmpInFrames = mFrameCount * 7; mRsmpInFramesP2 = roundup(mRsmpInFrames); free(mRsmpInBuffer); mRsmpInBuffer = NULL; // TODO optimize audio capture buffer sizes ... // Here we calculate the size of the sliding buffer used as a source Loading @@ -6941,7 +6942,9 @@ void AudioFlinger::RecordThread::readInputParameters_l() // The current value is higher than necessary. However it should not add to latency. // Over-allocate beyond mRsmpInFramesP2 to permit a HAL read past end of buffer (void)posix_memalign(&mRsmpInBuffer, 32, (mRsmpInFramesP2 + mFrameCount - 1) * mFrameSize); size_t bufferSize = (mRsmpInFramesP2 + mFrameCount - 1) * mFrameSize; (void)posix_memalign(&mRsmpInBuffer, 32, bufferSize); memset(mRsmpInBuffer, 0, bufferSize); // if posix_memalign fails, will segv here. // AudioRecord mSampleRate and mChannelCount are constant due to AudioRecord API constraints. // But if thread's mSampleRate or mChannelCount changes, how will that affect active tracks? Loading Loading
services/audioflinger/FastCapture.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,9 @@ void FastCapture::onStateChange() // FIXME new may block for unbounded time at internal mutex of the heap // implementation; it would be better to have normal capture thread allocate for // us to avoid blocking here and to prevent possible priority inversion (void)posix_memalign(&mReadBuffer, 32, frameCount * Format_frameSize(mFormat)); size_t bufferSize = frameCount * Format_frameSize(mFormat); (void)posix_memalign(&mReadBuffer, 32, bufferSize); memset(mReadBuffer, 0, bufferSize); // if posix_memalign fails, will segv here. mPeriodNs = (frameCount * 1000000000LL) / mSampleRate; // 1.00 mUnderrunNs = (frameCount * 1750000000LL) / mSampleRate; // 1.75 mOverrunNs = (frameCount * 500000000LL) / mSampleRate; // 0.50 Loading
services/audioflinger/Threads.cpp +4 −1 Original line number Diff line number Diff line Loading @@ -6932,6 +6932,7 @@ void AudioFlinger::RecordThread::readInputParameters_l() mRsmpInFrames = mFrameCount * 7; mRsmpInFramesP2 = roundup(mRsmpInFrames); free(mRsmpInBuffer); mRsmpInBuffer = NULL; // TODO optimize audio capture buffer sizes ... // Here we calculate the size of the sliding buffer used as a source Loading @@ -6941,7 +6942,9 @@ void AudioFlinger::RecordThread::readInputParameters_l() // The current value is higher than necessary. However it should not add to latency. // Over-allocate beyond mRsmpInFramesP2 to permit a HAL read past end of buffer (void)posix_memalign(&mRsmpInBuffer, 32, (mRsmpInFramesP2 + mFrameCount - 1) * mFrameSize); size_t bufferSize = (mRsmpInFramesP2 + mFrameCount - 1) * mFrameSize; (void)posix_memalign(&mRsmpInBuffer, 32, bufferSize); memset(mRsmpInBuffer, 0, bufferSize); // if posix_memalign fails, will segv here. // AudioRecord mSampleRate and mChannelCount are constant due to AudioRecord API constraints. // But if thread's mSampleRate or mChannelCount changes, how will that affect active tracks? Loading