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

Commit 93bb77da authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Workaround AudioRecord bug for large buffer sizes

Bug: 9556436
Change-Id: I92d1238b623d2cfd648e0a684d0e710fb0bd8b43
parent 0d09a9be
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -482,7 +482,8 @@ void ServerProxy::releaseBuffer(Buffer* buffer)
    } else if (minimum > half) {
        minimum = half;
    }
    if (!mDeferWake && mAvailToClient + stepCount >= minimum) {
    // FIXME AudioRecord wakeup needs to be optimized; it currently wakes up client every time
    if (!mIsOut || (!mDeferWake && mAvailToClient + stepCount >= minimum)) {
        ALOGV("mAvailToClient=%u stepCount=%u minimum=%u", mAvailToClient, stepCount, minimum);
        int32_t old = android_atomic_or(CBLK_FUTEX_WAKE, &cblk->mFutex);
        if (!(old & CBLK_FUTEX_WAKE)) {