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

Commit cfa4fbd6 authored by Zhou Song's avatar Zhou Song Committed by Gerrit - the friendly Code Review server
Browse files

hal: fix glitch heard when FM playback started

When FM started by "handle_fm", then a routing request followed,
for platforms with wsa speaker enabled, this will lead FM stopped
immediately just started and then started again. So some glitches
can be heard.

Revert this as wsa speaker can be enabled successfully now without
stop fm first then start it again

Change-Id: I1ec64d469314670c0906f89ef763e9b8f7a56982
CRs-Fixed: 891536
parent ab8f3289
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -243,22 +243,9 @@ void audio_extn_fm_set_parameters(struct audio_device *adev,
        if (ret >= 0) {
            val = atoi(value);
            if(val > 0)
                /*
                 * Only when wsa does present and is in analog mode,
                 * fm will stop/start here.
                 * To-do: when the kernel codec type query change
                 * is ready, enum of wsa mode should be checked here.
                 * Currently, platform_get_wsa_mode will directly return
                 * 1 when wsa is in analog mode.
                 */
                if (platform_get_wsa_mode(adev) == 1) {
                    fm_stop(adev);
                    fm_start(adev);
                } else {
                select_devices(adev, USECASE_AUDIO_PLAYBACK_FM);
        }
    }
    }
    if (fmmod.restart_fm && (fmmod.scard_state == SND_CARD_STATE_ONLINE)) {
        ALOGD("sound card is ONLINE, restart FM");
        fmmod.restart_fm = 0;