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

Commit 19f67bed authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "aaudio: add support for FLOAT pcm"

parents 79ede93e 8eebebaa
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -80,14 +80,14 @@ aaudio_result_t AAudioServiceEndpointMMAP::open(const aaudio::AAudioStreamReques

    audio_format_t audioFormat = getFormat();

    // FLOAT is not directly supported by the HAL so ask for a 32-bit.
    if (audioFormat == AUDIO_FORMAT_PCM_FLOAT) {
        // TODO remove these logs when finished debugging.
        ALOGD("%s() change format from %d to 32_BIT", __func__, audioFormat);
        audioFormat = AUDIO_FORMAT_PCM_32_BIT;
    }
    result = openWithFormat(audioFormat);
    if (result == AAUDIO_OK) return result;

    if (result == AAUDIO_ERROR_UNAVAILABLE && audioFormat == AUDIO_FORMAT_PCM_FLOAT) {
        ALOGD("%s() FLOAT failed, perhaps due to format. Try again with 32_BIT", __func__);
        audioFormat = AUDIO_FORMAT_PCM_32_BIT;
        result = openWithFormat(audioFormat);
    }
    if (result == AAUDIO_OK) return result;

    if (result == AAUDIO_ERROR_UNAVAILABLE && audioFormat == AUDIO_FORMAT_PCM_32_BIT) {