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

Commit 34574a0a authored by juyuchen's avatar juyuchen Committed by Gerrit - the friendly Code Review server
Browse files

audio hal: fix enabling snd device with same backend on the codec twice.



Enable hearing-aid-mic and handset-mic at the same time will cause codec crash
during voice call.

Route afe-proxy-record usecase to hearing-aid-mic device when it uses
handset-mic device.

Bug: 139555903
Test: MO and MT voice call with hearing aid.

Change-Id: I2d536ff1e75d7848208fa0f6a726715f522eeb6c
Signed-off-by: default avatarjuyuchen <juyuchen@google.com>
(cherry picked from commit af6a1d3e707f62462facedee54964df0a3911134)
Signed-off-by: default avatarAniket Kumar Lata <alata@codeaurora.org>
parent 4a6aff44
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1764,13 +1764,13 @@ static void check_usecases_capture_codec_backend(struct audio_device *adev,
        if (usecase->type != PCM_PLAYBACK &&
                usecase != uc_info &&
                (usecase->in_snd_device != snd_device || force_routing) &&
                ((uc_info->devices & backend_check_cond) &&
                (((uc_info->devices & backend_check_cond) &&
                 (((usecase->devices & ~AUDIO_DEVICE_BIT_IN) & AUDIO_DEVICE_IN_ALL_CODEC_BACKEND) ||
                  (usecase->type == VOIP_CALL))) &&
                  (usecase->type == VOIP_CALL))) ||
                ((uc_info->type == VOICE_CALL &&
                  usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL) ||
                 platform_check_backends_match(snd_device,\
                                              usecase->in_snd_device)) &&
                                              usecase->in_snd_device))) &&
                (usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) {
            ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
                  __func__, use_case_table[usecase->id],