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

Commit 4f578a29 authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: reduce aaudio.min_sleep_usec default

This can reduce latency for moderate workloads.

Bug: 220364385
Test: synthmark -tl -n1 -N75 -a2
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: Iff76a0a6175e7b048b65eee19f2cb2677d035e0e
parent 9ac4cb4f
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -560,9 +560,10 @@ int32_t AAudioProperty_getWakeupDelayMicros() {
}
}


int32_t AAudioProperty_getMinimumSleepMicros() {
int32_t AAudioProperty_getMinimumSleepMicros() {
    const int32_t minMicros = 20; // arbitrary
    const int32_t minMicros = 1; // arbitrary
    const int32_t defaultMicros = 200; // arbitrary
    // Higher values can increase latency for moderate workloads.
    const int32_t maxMicros = 2000; // arbitrary
    const int32_t defaultMicros = 1; // arbitrary
    const int32_t maxMicros = 200; // arbitrary
    int32_t prop = property_get_int32(AAUDIO_PROP_MINIMUM_SLEEP_USEC, defaultMicros);
    int32_t prop = property_get_int32(AAUDIO_PROP_MINIMUM_SLEEP_USEC, defaultMicros);
    if (prop < minMicros) {
    if (prop < minMicros) {
        ALOGW("AAudioProperty_getMinimumSleepMicros: clipped %d to %d", prop, minMicros);
        ALOGW("AAudioProperty_getMinimumSleepMicros: clipped %d to %d", prop, minMicros);