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

Commit b91f7d2d authored by Robert Wu's avatar Robert Wu
Browse files

Remove aaudio sample_rate_conversion flag

This flag was added in Android V and we can remove it now.

Bug: 378766408
Test: presubmit
Flag: EXEMPT bugfix
Change-Id: Ib07574aa2cde7b6d5079c13b500470e8e78c757f
parent 82d42141
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@
#include "fifo/FifoBuffer.h"
#include "utility/AudioClock.h"
#include <media/AidlConversion.h>
#include <com_android_media_aaudio.h>

#include "AudioStreamInternal.h"

@@ -197,15 +196,6 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) {
        setSampleRate(configurationOutput.getSampleRate());
    }

    if (!com::android::media::aaudio::sample_rate_conversion()) {
        if (getSampleRate() != getDeviceSampleRate()) {
            ALOGD("%s - skipping sample rate converter. SR = %d, Device SR = %d", __func__,
                    getSampleRate(), getDeviceSampleRate());
            result = AAUDIO_ERROR_INVALID_RATE;
            goto error;
        }
    }

    // Save device format so we can do format conversion and volume scaling together.
    setDeviceFormat(configurationOutput.getFormat());
    setDeviceSamplesPerFrame(configurationOutput.getSamplesPerFrame());
+3 −9
Original line number Diff line number Diff line
@@ -150,15 +150,9 @@ aaudio_result_t AAudioServiceEndpointMMAP::open(const aaudio::AAudioStreamReques

        // Try other formats if the config from APM is the same as our current config.
        // Some HALs may report its format support incorrectly.
        if (previousConfig.format == config.format) {
            if (previousConfig.sample_rate == config.sample_rate) {
        if ((previousConfig.format == config.format) &&
                (previousConfig.sample_rate == config.sample_rate)) {
            config.format = getNextFormatToTry(config.format);
            } else if (!com::android::media::aaudio::sample_rate_conversion()) {
                ALOGI("%s() - AAudio SRC feature not enabled, different rates! %d != %d",
                      __func__, previousConfig.sample_rate, config.sample_rate);
                result = AAUDIO_ERROR_INVALID_RATE;
                break;
            }
        }

        ALOGD("%s() %#x %d failed, perhaps due to format or sample rate. Try again with %#x %d",