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

Commit 4643173a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: fix the input device selection for headphones"

parents 987af8e8 97db8706
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1659,7 +1659,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
                goto exit;
            }
        }
        if (out_device & AUDIO_DEVICE_OUT_EARPIECE) {
        if (out_device & AUDIO_DEVICE_OUT_EARPIECE ||
            out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
            if (out_device & AUDIO_DEVICE_OUT_EARPIECE &&
                audio_extn_should_use_handset_anc(channel_count)) {
                snd_device = SND_DEVICE_IN_AANC_HANDSET_MIC;
@@ -1688,8 +1689,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
                else
                    snd_device = SND_DEVICE_IN_BT_SCO_MIC;
            }
        } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER ||
                   out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
        } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) {
            if (my_data->fluence_type != FLUENCE_NONE &&
                my_data->fluence_in_voice_call &&
                my_data->fluence_in_spkr_mode) {
@@ -1855,12 +1855,13 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
            snd_device = SND_DEVICE_IN_HANDSET_MIC;
        } else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) {
            snd_device = SND_DEVICE_IN_HEADSET_MIC;
        } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER ||
                   out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
        } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) {
            if (channel_count == 2)
                snd_device = SND_DEVICE_IN_SPEAKER_STEREO_DMIC;
            else
                snd_device = SND_DEVICE_IN_SPEAKER_MIC;
        } else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) {
            snd_device = SND_DEVICE_IN_HANDSET_MIC;
        } else if (out_device & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) {
            if (adev->bt_wb_speech_enabled) {
                if (adev->bluetooth_nrec)