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

Commit c3fe8f75 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Ensure during voice call backend in sample rate is fixed at 48kHz"

parents 99cce0c1 a72c94a9
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -5184,6 +5184,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
    unsigned int sample_rate;
    unsigned int channels;
    bool passthrough_enabled = false;
    bool voice_call_active = false;
    int backend_idx = DEFAULT_CODEC_BACKEND;
    struct platform_data *my_data = (struct platform_data *)adev->platform;
    int na_mode = platform_get_native_support();
@@ -5216,6 +5217,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
        bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
        sample_rate =  CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
        channels = CODEC_BACKEND_DEFAULT_CHANNELS;
        voice_call_active = true;
    } else {
        /*
         * The backend should be configured at highest bit width and/or
@@ -5255,7 +5257,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
    }

    /* Native playback is preferred for Headphone/HS device over 192Khz */
    if (codec_device_supports_native_playback(usecase->devices)) {
    if (!voice_call_active && codec_device_supports_native_playback(usecase->devices)) {
        if (audio_is_true_native_stream_active(adev)) {
            if (check_hdset_combo_device(snd_device)) {
                /*
@@ -5266,8 +5268,8 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
                 */
                    sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
                    bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
                    ALOGD("%s:becf: afe: port has to run at 48k for a combo device",
                          __func__);
                    ALOGD("%s:becf: afe: port to run at 48k if combo device or in voice call"
                           , __func__);
            } else {
             /*
              * in single BE mode, if native audio playback
+5 −3
Original line number Diff line number Diff line
@@ -5067,6 +5067,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
    unsigned int sample_rate;
    unsigned int channels;
    bool passthrough_enabled = false;
    bool voice_call_active = false;
    int backend_idx = DEFAULT_CODEC_BACKEND;
    struct platform_data *my_data = (struct platform_data *)adev->platform;
    int na_mode = platform_get_native_support();
@@ -5100,6 +5101,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
        bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
        sample_rate =  CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
        channels = CODEC_BACKEND_DEFAULT_CHANNELS;
        voice_call_active = true;
    } else {
        /*
         * The backend should be configured at highest bit width and/or
@@ -5139,7 +5141,7 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
    }

    /* Native playback is preferred for Headphone/HS device over 192Khz */
    if (codec_device_supports_native_playback(usecase->devices)) {
    if (!voice_call_active && codec_device_supports_native_playback(usecase->devices)) {
        if (audio_is_true_native_stream_active(adev)) {
            if (check_hdset_combo_device(snd_device)) {
                /*
@@ -5150,8 +5152,8 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
                 */
                    sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
                    bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
                    ALOGD("%s:becf: afe: port has to run at 48k for a combo device",
                          __func__);
                    ALOGD("%s:becf: afe: port to run at 48k if combo device or in voice call"
                           , __func__);
            } else {
             /*
              * in single BE mode, if native audio playback