Merge "alsa_sound: primary desc check for sonification"
diff --git a/alsa_sound/AudioPolicyManagerALSA.cpp b/alsa_sound/AudioPolicyManagerALSA.cpp
index 78cc5ef..e9f6e37 100644
--- a/alsa_sound/AudioPolicyManagerALSA.cpp
+++ b/alsa_sound/AudioPolicyManagerALSA.cpp
@@ -1910,7 +1910,7 @@
             fmVolume = computeVolume(stream, index, output, device);
             if (fmVolume >= 0) {
                 if(output == mPrimaryOutput)
-                    mpClientInterface->setFmVolume(fmVolume, delayMs);
+                    mpClientInterface->setFmVolume(fmVolume, delayMs*2);
                 else if(mHasA2dp && output == getA2dpOutput())
                     mpClientInterface->setStreamVolume((AudioSystem::stream_type)stream, volume, output, delayMs);
             }
diff --git a/libalsa-intf/alsa_ucm.c b/libalsa-intf/alsa_ucm.c
index 7783fcc..bcd0b1b 100644
--- a/libalsa-intf/alsa_ucm.c
+++ b/libalsa-intf/alsa_ucm.c
@@ -725,6 +725,7 @@
         strlen(SND_USE_CASE_VERB_IP_VOICECALL)))) {
         voice_acdb = 1;
     }
+//The ident_value should store latest/current modifier
     if (voice_acdb != 1) {
         list_size =
         snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head);
@@ -742,9 +743,6 @@
                     strlen(SND_USE_CASE_MOD_PLAY_VOIP)))) {
                     voice_acdb = 1;
                     strlcpy(current_mod, ident_value, MAX_STR_LEN);
-                    free(ident_value);
-                    ident_value = NULL;
-                    break;
                 }
                 free(ident_value);
                 ident_value = NULL;
@@ -805,9 +803,8 @@
                     && tx_id == DEVICE_HANDSET_TX_FV5_ACDB_ID) {
                     tx_id = DEVICE_SPEAKER_TX_FV5_ACDB_ID;
                 }
-
-                if ((rx_id != uc_mgr->current_rx_device) ||
-                    (tx_id != uc_mgr->current_tx_device)) {
+/* Despite no change in rx and tx devices, calibration data can be required to be sent.
+This happens when the modifier changes*/
                     uc_mgr->current_rx_device = rx_id;
                     uc_mgr->current_tx_device = tx_id;
                     ALOGD("Voice acdb: rx id %d tx id %d verb:%s modifier:%s",
@@ -822,12 +819,7 @@
                           (!uc_mgr->isFusion3Platform))
                            acdb_loader_send_voice_cal(uc_mgr->current_rx_device,
                                                     uc_mgr->current_tx_device);
-                } else {
-                    ALOGV("Voice acdb: Required acdb already pushed \
-                         rx id %d tx id %d", uc_mgr->current_rx_device,
-                         uc_mgr->current_tx_device);
-                }
-            }
+             }
             free(ident_value);
             ident_value = NULL;
         }