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

Commit 6ba62d1b authored by kunleiz's avatar kunleiz
Browse files

hal: Set default backend sample rate for headset device

When music playback at 22.05Khz with headset, the afe
backend sample rate is set to 22.05khz as well. When
there is touch tone, it requires afe backend sample
rate to 48Khz. The rate change will cause music playback
disable and reroute to cause interruption during playback.

Fix it by setting backend sample rate to 48Khz if sample
rate less than 44.1Khz.

CRs-Fixed: 2258133
Change-Id: I711407537c0c41dbac99fea059710912ba6d1af3
parent 2ab55f3c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6154,6 +6154,11 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
            ALOGD("%s:becf: afe: napb not active - set non fractional rate",
                       __func__);
        }
        /*ensure AFE set to 48khz when sample rate less than 44.1khz*/
        if (sample_rate < OUTPUT_SAMPLING_RATE_44100) {
            sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
            ALOGD("%s:becf: afe: napb set sample rate to default Sample Rate(48k)",__func__);
        }
    }

    /*
+5 −0
Original line number Diff line number Diff line
@@ -6129,6 +6129,11 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev,
            ALOGD("%s:becf: afe: napb not active - set non fractional rate",
                       __func__);
        }
        /*ensure AFE set to 48khz when sample rate less than 44.1khz*/
        if (sample_rate < OUTPUT_SAMPLING_RATE_44100) {
            sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
            ALOGD("%s:becf: afe: napb set sample rate to default Sample Rate(48k)",__func__);
        }
    }

    /*