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

Commit 04643599 authored by Ravi Kumar Alamanda's avatar Ravi Kumar Alamanda Committed by Jean-Michel Trivi
Browse files

hal: Fix EC not working with some VoIP app

Echo reference must be before starting input stream. But in
some cases, input stream is started first and then the output
stream. As the primary output is not started, echo reference is
set based on AUDIO_DEVICE_NONE.

Fix by using primary output's device even if it is in standby.

Bug: 23720819
Change-Id: I1cf2b93ea52219489964e09ee671ef008e81255c
parent 533bb726
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -649,12 +649,13 @@ int select_devices(struct audio_device *adev,
            out_snd_device = SND_DEVICE_NONE;
            if (in_snd_device == SND_DEVICE_NONE) {
                audio_devices_t out_device = AUDIO_DEVICE_NONE;
                if (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION &&
                        adev->primary_output && !adev->primary_output->standby) {
                    out_device = adev->primary_output->devices;
                if (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
                    platform_set_echo_reference(adev, false, AUDIO_DEVICE_NONE);
                } else if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {
                    if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {
                        out_device = AUDIO_DEVICE_OUT_TELEPHONY_TX;
                    } else if (adev->primary_output) {
                        out_device = adev->primary_output->devices;
                    }
                }
                in_snd_device = platform_get_input_snd_device(adev->platform, out_device);
            }