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

Commit f3a8d32f authored by Eric Laurent's avatar Eric Laurent
Browse files

Change audio routing policy for HDMI

HDMI device should have a higher priority than analog dock audio but a lower priority
than wired headsets.
Also modified AudioService so that HDMI is mapped to DEVICE_OUT_AUX_DIGITAL device and not
DEVICE_OUT_DGTL_DOCK_HEADSET as before to enable discrimination between SPDIF going to
digital dock and SPIDF going to HDMI.

Change-Id: I887d0c73479784dd2edaf41ce1a7d8d0bdcbb4bd
parent d27f1e69
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1641,19 +1641,19 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy,
        // FALL THROUGH

    case STRATEGY_MEDIA: {
        uint32_t device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL;
        if (device2 == 0) {
            device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE;
        }
        uint32_t device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE;
        if (device2 == 0) {
            device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET;
        }
        if (device2 == 0) {
            device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET;
            device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL;
        }
        if (device2 == 0) {
            device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET;
        }
        if (device2 == 0) {
            device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET;
        }
#ifdef WITH_A2DP
        if (mA2dpOutput != 0) {
            if (strategy == STRATEGY_SONIFICATION && !a2dpUsedForSonification()) {