Loading services/audioflinger/FastCapture.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,7 @@ void FastCapture::onStateChange() unsigned channelCount = Format_channelCount(format); unsigned channelCount = Format_channelCount(format); // FIXME frameSize // FIXME frameSize readBuffer = new short[frameCount * channelCount]; readBuffer = new short[frameCount * channelCount]; memset(readBuffer, 0, frameCount * channelCount * sizeof(readBuffer[0])); periodNs = (frameCount * 1000000000LL) / sampleRate; // 1.00 periodNs = (frameCount * 1000000000LL) / sampleRate; // 1.00 underrunNs = (frameCount * 1750000000LL) / sampleRate; // 1.75 underrunNs = (frameCount * 1750000000LL) / sampleRate; // 1.75 overrunNs = (frameCount * 500000000LL) / sampleRate; // 0.50 overrunNs = (frameCount * 500000000LL) / sampleRate; // 0.50 Loading services/audioflinger/Threads.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -6136,7 +6136,9 @@ void AudioFlinger::RecordThread::readInputParameters_l() // The current value is higher than necessary. However it should not add to latency. // 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 // Over-allocate beyond mRsmpInFramesP2 to permit a HAL read past end of buffer mRsmpInBuffer = new int16_t[(mRsmpInFramesP2 + mFrameCount - 1) * mChannelCount]; size_t bufferSizeInShorts = (mRsmpInFramesP2 + mFrameCount - 1) * mChannelCount; mRsmpInBuffer = new int16_t[bufferSizeInShorts]; memset(mRsmpInBuffer, 0, bufferSizeInShorts * sizeof(mRsmpInBuffer[0])); // AudioRecord mSampleRate and mChannelCount are constant due to AudioRecord API constraints. // 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? // But if thread's mSampleRate or mChannelCount changes, how will that affect active tracks? Loading Loading
services/audioflinger/FastCapture.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -134,6 +134,7 @@ void FastCapture::onStateChange() unsigned channelCount = Format_channelCount(format); unsigned channelCount = Format_channelCount(format); // FIXME frameSize // FIXME frameSize readBuffer = new short[frameCount * channelCount]; readBuffer = new short[frameCount * channelCount]; memset(readBuffer, 0, frameCount * channelCount * sizeof(readBuffer[0])); periodNs = (frameCount * 1000000000LL) / sampleRate; // 1.00 periodNs = (frameCount * 1000000000LL) / sampleRate; // 1.00 underrunNs = (frameCount * 1750000000LL) / sampleRate; // 1.75 underrunNs = (frameCount * 1750000000LL) / sampleRate; // 1.75 overrunNs = (frameCount * 500000000LL) / sampleRate; // 0.50 overrunNs = (frameCount * 500000000LL) / sampleRate; // 0.50 Loading
services/audioflinger/Threads.cpp +3 −1 Original line number Original line Diff line number Diff line Loading @@ -6136,7 +6136,9 @@ void AudioFlinger::RecordThread::readInputParameters_l() // The current value is higher than necessary. However it should not add to latency. // 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 // Over-allocate beyond mRsmpInFramesP2 to permit a HAL read past end of buffer mRsmpInBuffer = new int16_t[(mRsmpInFramesP2 + mFrameCount - 1) * mChannelCount]; size_t bufferSizeInShorts = (mRsmpInFramesP2 + mFrameCount - 1) * mChannelCount; mRsmpInBuffer = new int16_t[bufferSizeInShorts]; memset(mRsmpInBuffer, 0, bufferSizeInShorts * sizeof(mRsmpInBuffer[0])); // AudioRecord mSampleRate and mChannelCount are constant due to AudioRecord API constraints. // 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? // But if thread's mSampleRate or mChannelCount changes, how will that affect active tracks? Loading