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

Commit 7a17d749 authored by Ashish Jain's avatar Ashish Jain
Browse files

hal: Ensure that native sample rate is configured on correct backend

-In case of concurrecny of native music playback with voice call
over Headphones,Non native backends can get configured to native
sample rate if mode is set to mode in call, but the call has
not yet started.
-Hence ensure that if the incoming backend is not a native backend
then it should not be configured with native sample rate.

Change-Id: Ic216758bbb73fe384656912132757ca8bf4d2efe
parent c8402246
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5326,7 +5326,9 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
                 ALOGD("%s:becf: afe: true napb active set rate to 44.1 khz",
                       __func__);
            }
        } else if (na_mode != NATIVE_AUDIO_MODE_MULTIPLE_44_1) {
        } else if (na_mode != NATIVE_AUDIO_MODE_MULTIPLE_44_1 ||
                   ((backend_idx != HEADPHONE_44_1_BACKEND) &&
                     (backend_idx != DSD_NATIVE_BACKEND))) {
            /*
             * Map native sampling rates to upper limit range
             * if multiple of native sampling rates are not supported.
+4 −1
Original line number Diff line number Diff line
@@ -5230,7 +5230,10 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
                 ALOGD("%s:becf: afe: true napb active set rate to 44.1 khz",
                       __func__);
            }
        } else if (na_mode != NATIVE_AUDIO_MODE_MULTIPLE_44_1) {

        } else if (na_mode != NATIVE_AUDIO_MODE_MULTIPLE_44_1 ||
                   ((backend_idx != HEADPHONE_44_1_BACKEND) &&
                     (backend_idx != DSD_NATIVE_BACKEND))) {
            /*
             * Map native sampling rates to upper limit range
             * if multiple of native sampling rates are not supported.