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

Commit b9216d85 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Re-route TX/Input stream for compress voip"

parents 2fedf4a7 cdf67afe
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -3127,6 +3127,38 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
            enable_audio_route(adev, voip_in_usecase);
        }
    }
    if (voice_extn_compress_voip_is_active(adev)) {
        struct audio_usecase *voip_usecase = get_usecase_from_list(adev,
                                                 USECASE_COMPRESS_VOIP_CALL);
        /*
         * If only compress voip input is opened voip out will be primary out.
         * Need to consider re-routing to select correct i/p pair
         */
        if ((voip_usecase != NULL) &&
            (usecase->type == PCM_PLAYBACK) &&
            (usecase->stream.out == voip_usecase->stream.out)) {
            in_snd_device = platform_get_input_snd_device(adev->platform,
                                                         NULL,
                                                         &usecase->stream.out->device_list,
                                                         usecase->type);
            if (voip_usecase->in_snd_device != in_snd_device ) {
                ALOGD("%s:Re routing compress voip tx  snd device matching voip rx pair",
                __func__);
                disable_audio_route(adev, voip_usecase);
                disable_snd_device(adev, voip_usecase->in_snd_device);
                voip_usecase->in_snd_device = in_snd_device;
                voip_usecase->out_snd_device = usecase->out_snd_device;
                /* Route all TX  usecase to Compress voip BE */
                check_usecases_capture_codec_backend(adev, voip_usecase, in_snd_device);
                enable_snd_device(adev, in_snd_device);
                /* Send Voice related calibration for RX /TX  pair */
                status = platform_switch_voice_call_device_post(adev->platform,
                                                               out_snd_device,
                                                               in_snd_device);
                enable_audio_route(adev, voip_usecase);
            }
        }
    }


    audio_extn_qdsp_set_device(usecase);