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

Commit 92820ed0 authored by Ashish Jain's avatar Ashish Jain Committed by Scott Mertz
Browse files

audiopolicy: fix playback of multichannel pcm clips via low latency output

-Mutichannel clips, which cannot be offloaded or played via
direct output, are played using a low latency output even
if they have stream type as AUDIO_STREAM_MUSIC
-Reverting this change Ibf295f506e6ec62ffbd79091361793c18213d494
done to support multiChannel playback over HDMI as
it is supported by default.

CYNGNOS-952
CRs-Fixed: 839323
Change-Id: Iba3aa0b64fffa741704c957e07bc81b44e8a0cfe
parent ded9d933
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -1638,11 +1638,6 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
        flags = AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
    }

    if ((format == AUDIO_FORMAT_PCM_16_BIT) &&(popcount(channelMask) > 2)) {
        ALOGV("owerwrite flag(%x) for PCM16 multi-channel(CM:%x) playback", flags ,channelMask);
        flags = AUDIO_OUTPUT_FLAG_DIRECT;
    }

    sp<IOProfile> profile;

    // skip direct output selection if the request can obviously be attached to a mixed output
@@ -1660,9 +1655,8 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
    // This may prevent offloading in rare situations where effects are left active by apps
    // in the background.

    if ((((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) ||
            !isNonOffloadableEffectEnabled()) &&
            flags & AUDIO_OUTPUT_FLAG_DIRECT) {
    if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) ||
            !isNonOffloadableEffectEnabled()) {
        profile = getProfileForDirectOutput(device,
                                           samplingRate,
                                           format,