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

Commit 44376cc0 authored by Narsinga Rao Chella's avatar Narsinga Rao Chella
Browse files

hal: fix voice call mute issue

The backend is always configured with default bit width and sample
rate for voice calls. The backend reconfiguration should not be done
when a new stream starts during voice call.

Change-Id: I9fda27c4fb1925b3ddeec929ad986886dc4d695e
CRs-fixed: 747001
parent be149396
Loading
Loading
Loading
Loading
+13 −17
Original line number Diff line number Diff line
@@ -2641,14 +2641,11 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev,

    // For voice calls use default configuration
    // force routing is not required here, caller will do it anyway
    if (adev->mode == AUDIO_MODE_IN_CALL ||
        adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
    if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
        ALOGW("%s:Use default bw and sr for voice/voip calls ",__func__);
        *new_bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
        *new_sample_rate =  CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
        backend_change = true;
    }

        bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
        sample_rate =  CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
    } else {
        /*
         * The backend should be configured at highest bit width and/or
         * sample rate amongst all playback usecases.
@@ -2658,7 +2655,6 @@ bool platform_check_codec_backend_cfg(struct audio_device* adev,
         *
         * Exception: 16 bit playbacks is allowed through 16 bit/48 khz backend only
         */
    if (!backend_change) {
        list_for_each(node, &adev->usecase_list) {
            struct audio_usecase *curr_usecase;
            curr_usecase = node_to_item(node, struct audio_usecase, list);