Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 913862ea authored by Glenn Kasten's avatar Glenn Kasten Committed by Android Git Automerger
Browse files

am 9017e5e0: Increase normal mixer\'s pipe to fast mixer

* commit '9017e5e0':
  Increase normal mixer's pipe to fast mixer
parents 6051af9e 9017e5e0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2203,9 +2203,10 @@ AudioFlinger::MixerThread::MixerThread(const sp<AudioFlinger>& audioFlinger, Aud

        // create a MonoPipe to connect our submix to FastMixer
        NBAIO_Format format = mOutputSink->format();
        // frame count will be rounded up to a power of 2, so this formula should work well
        MonoPipe *monoPipe = new MonoPipe((mNormalFrameCount * 3) / 2, format,
                true /*writeCanBlock*/);
        // This pipe depth compensates for scheduling latency of the normal mixer thread.
        // When it wakes up after a maximum latency, it runs a few cycles quickly before
        // finally blocking.  Note the pipe implementation rounds up the request to a power of 2.
        MonoPipe *monoPipe = new MonoPipe(mNormalFrameCount * 4, format, true /*writeCanBlock*/);
        const NBAIO_Format offers[1] = {format};
        size_t numCounterOffers = 0;
        ssize_t index = monoPipe->negotiate(offers, 1, NULL, numCounterOffers);