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

Commit f344068f authored by vivek mehta's avatar vivek mehta Committed by Eric Laurent
Browse files

hal: enable device for AEC + NS in VR single mic usecase

- add new device SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS for
  VR in single mic usecase

Bug: 27906575

Change-Id: I6dde54e4a0809217d985b588b69ee9058401866d
parent 0db4da6d
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ static const char * const device_table[SND_DEVICE_MAX] = {
    [SND_DEVICE_IN_VOICE_REC_MIC] = "voice-rec-mic",
    [SND_DEVICE_IN_VOICE_REC_MIC_NS] = "voice-rec-mic",
    [SND_DEVICE_IN_VOICE_REC_MIC_AEC] = "voice-rec-mic",
    [SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS] = "voice-rec-mic",
    [SND_DEVICE_IN_VOICE_REC_DMIC_STEREO] = "voice-rec-dmic-ef",
    [SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = "voice-rec-dmic-ef-fluence",
    [SND_DEVICE_IN_VOICE_REC_HEADSET_MIC] = "headset-mic",
@@ -354,6 +355,7 @@ static int acdb_device_table[SND_DEVICE_MAX] = {
    [SND_DEVICE_IN_VOICE_REC_MIC] = ACDB_ID_VOICE_REC_MIC,
    [SND_DEVICE_IN_VOICE_REC_MIC_NS] = 113,
    [SND_DEVICE_IN_VOICE_REC_MIC_AEC] = 112,
    [SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS] = 114,
    [SND_DEVICE_IN_VOICE_REC_DMIC_STEREO] = 35,
    [SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE] = 43,
    [SND_DEVICE_IN_VOICE_REC_HEADSET_MIC] = ACDB_ID_HEADSET_MIC_AEC,
@@ -456,6 +458,7 @@ static const struct name_to_index snd_device_name_index[SND_DEVICE_MAX] = {
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_MIC)},
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_MIC_NS)},
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_MIC_AEC)},
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS)},
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_DMIC_STEREO)},
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE)},
    {TO_NAME_INDEX(SND_DEVICE_IN_VOICE_REC_HEADSET_MIC)},
@@ -2101,14 +2104,19 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d
                snd_device = SND_DEVICE_IN_QUAD_MIC;
            }
            if (snd_device == SND_DEVICE_NONE) {
                if (adev->active_input->enable_ns)
                    snd_device = SND_DEVICE_IN_VOICE_REC_MIC_NS;
                else if (adev->active_input->enable_aec) {
                if (adev->active_input->enable_aec) {
                    if (adev->active_input->enable_ns) {
                        snd_device = SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS;
                    } else {
                        snd_device = SND_DEVICE_IN_VOICE_REC_MIC_AEC;
                    }
                    platform_set_echo_reference(adev, true, out_device);
               } else
                } else if (adev->active_input->enable_ns) {
                    snd_device = SND_DEVICE_IN_VOICE_REC_MIC_NS;
                } else {
                    snd_device = SND_DEVICE_IN_VOICE_REC_MIC;
                }
            }
        } else if (in_device & AUDIO_DEVICE_IN_WIRED_HEADSET) {
            snd_device = SND_DEVICE_IN_VOICE_REC_HEADSET_MIC;
        }
+1 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ enum {
    SND_DEVICE_IN_VOICE_REC_MIC,
    SND_DEVICE_IN_VOICE_REC_MIC_NS,
    SND_DEVICE_IN_VOICE_REC_MIC_AEC,
    SND_DEVICE_IN_VOICE_REC_MIC_AEC_NS,
    SND_DEVICE_IN_VOICE_REC_DMIC_STEREO,
    SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
    SND_DEVICE_IN_VOICE_REC_HEADSET_MIC,