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

Commit cd64e0ed authored by Sumit Bhattacharya's avatar Sumit Bhattacharya
Browse files

AudioFlinger: Get shared heap size from property

For consecutive 24bit, 192kHz, 7.1 content 4MB heap is not enough.
So exposing a propery ro.af.client_heap_size_kbyte to set platform
specific shared client heap size.

Change-Id: I2fb257c5fecc0245aa3a07998c2bfd6864a7d64f
parent ee38fad5
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1355,12 +1355,16 @@ AudioFlinger::Client::Client(const sp<AudioFlinger>& audioFlinger, pid_t pid)
        mPid(pid),
        mTimedTrackCount(0)
{
    size_t heapSize = kClientSharedHeapSizeBytes;
    size_t heapSize = property_get_int32("ro.af.client_heap_size_kbyte", 0);
    heapSize *= 1024;
    if (!heapSize) {
        heapSize = kClientSharedHeapSizeBytes;
        // Increase heap size on non low ram devices to limit risk of reconnection failure for
        // invalidated tracks
        if (!audioFlinger->isLowRamDevice()) {
            heapSize *= kClientSharedHeapSizeMultiplier;
        }
    }
    mMemoryDealer = new MemoryDealer(heapSize, "AudioFlinger::Client");
}