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

Commit 933a0079 authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

Merge "Adjust the conditions for creating a duplication output to play...

Merge "Adjust the conditions for creating a duplication output to play sonification via speaker and hdmi." am: c11f9d9c am: 233104cf am: 613c77c8

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2166983



Change-Id: Iaa24032b54405136777c42cf548a7bbbeafb8098
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ac9341fa 613c77c8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -7841,6 +7841,9 @@ sp<SwAudioOutputDescriptor> AudioPolicyManager::openOutputWithProfileAndDevice(

    addOutput(output, desc);

    sp<DeviceDescriptor> speaker = mAvailableOutputDevices.getDevice(
            AUDIO_DEVICE_OUT_SPEAKER, String8(""), AUDIO_FORMAT_DEFAULT);

    if (audio_is_remote_submix_device(deviceType) && address != "0") {
        sp<AudioPolicyMix> policyMix;
        if (mPolicyMixes.getAudioPolicyMix(deviceType, address, policyMix) == NO_ERROR) {
@@ -7851,13 +7854,13 @@ sp<SwAudioOutputDescriptor> AudioPolicyManager::openOutputWithProfileAndDevice(
                    address.string());
        }

    } else if (hasPrimaryOutput() && profile->getModule()
                != mHwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_PRIMARY)
    } else if (hasPrimaryOutput() && speaker != nullptr
            && mPrimaryOutput->supportsDevice(speaker) && !desc->supportsDevice(speaker)
            && ((desc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) == 0)) {
        // no duplicated output for:
        // - direct outputs
        // - outputs used by dynamic policy mixes
        // - outputs opened on the primary HW module
        // - outputs that supports SPEAKER while the primary output does not.
        audio_io_handle_t duplicatedOutput = AUDIO_IO_HANDLE_NONE;

        //TODO: configure audio effect output stage here