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

Commit 4e868717 authored by Dhanalakshmi Siddani's avatar Dhanalakshmi Siddani Committed by Linux Build Service Account
Browse files

Audio: Fix for pop noise when switching FM playback from mute to unmute

 - While unmuting FM stream AudioService applies default device volume
   followed by device specific volume, which is appearing as pop noise
   when device specific volume  is less than default device volume.
 - Fix is to apply only device specific volume when FM is active

Change-Id: I10855f0a2ccf53f0d98dfea80caffa232462adb8
parent bbfde399
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2110,7 +2110,14 @@ status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
    for (size_t i = 0; i < mOutputs.size(); i++) {
        audio_devices_t curDevice =
                getDeviceForVolume(mOutputs.valueAt(i)->device());
#ifdef AUDIO_EXTN_FM_ENABLED
        audio_devices_t availableOutputDeviceTypes = mAvailableOutputDevices.types();
        if (((device == AUDIO_DEVICE_OUT_DEFAULT) &&
              ((availableOutputDeviceTypes & AUDIO_DEVICE_OUT_FM) != AUDIO_DEVICE_OUT_FM)) ||
              (device == curDevice)) {
#else
        if ((device == AUDIO_DEVICE_OUT_DEFAULT) || (device == curDevice)) {
#endif
            status_t volStatus = checkAndSetVolume(stream, index, mOutputs.keyAt(i), curDevice);
            if (volStatus != NO_ERROR) {
                status = volStatus;