alsa_sound: Fix a memory leak

A pointer variable was not being freed up which is
causing memory leak.
This change is to fix the same.

Change-Id: I12728a4a75fb303d34d10657fe9cbc1b55c1687e
CRs-Fixed: 523572
audio: avoid muting already muted stream

-Issue: FM or music is getting mixed with ringtone over the
 speaker when BT or wired HS is connected. Because the stream will
 not get temporarily muted if its already muted.But during unmute,
 there is no condition to check whether stream is temporarily muted
 or not.This is leading to unmuting of non-muted stream
-Fix is added to avoid muting of stream if its already
 muted

CRs-Fixed: 574271
Change-Id: I6b4962f402b87781846e37aed1872a639d06f488
Merge "audio: avoid muting already muted stream"
alsa_sound: Fix to sound burst on switching from speaker to headset

- Sound burst observed on speaker to headset switch if call + pcm
  music playback is active

- On each keyRouting call from APM, HAL is routing new device to all
  open outputs.This result device switch stream mute(vol 0) is applied
  for PCM playback after device switch

- Call HAL routing to primary output first followed by fastoutput
  (if tunnel is not active) will resolve mismatch

Change-Id: I812cab1f57c6f4707adb626ca4581d7c82a18e55
Merge "alsa_sound: Fix a memory leak"
Revert "audio: Start proxy when external output is enabled"

This reverts commit 61450f47726440849a76eccbdbe6b607a6e48e77.
 -Playback thread for proxy is started twice.
  Once from write and next from setParameters. So, the
  active use-cases become 3(first being HiFi and next
  HiFi Low latency). So, after the ringtone(or music)
  is completed only only one of the usecase is removed from
  the active list and the playback thread is not stopped as
  the active usecase list is not empty.
 -Reverted the gerrit to not start the playback thread twice

 CRs-Fixed: 573521

Change-Id: I46d601a4b538434d74faecc54fb704eeae8eaedc
Merge "Revert "audio: Start proxy when external output is enabled""
Merge "alsa_sound: Fix to sound burst on switching from speaker to headset"
alsa_sound: select correct BT device pair for car-kit use case

- No audio during call when connected to Alpine NTG2.5 carkit
- BT-SCO Rx as the output device and Hanset Dual Mic as the
  input device is selected which is not a valid pair
- Select BT-SCO Tx as input when BT-SCO Rx is the output device

CRs-Fixed: 585953
Change-Id: I6a5220bf14fd2d7476196b9b1730c0646beec3a1
Merge "alsa_sound: select correct BT device pair for car-kit use case"
alsa_sound: select correct BT device pair for car-kit use case

- No audio during call when connected to Alpine NTG2.5 carkit
- BT-SCO Rx as the output device and Hanset Dual Mic as the
  input device is selected which is not a valid pair
- Select BT-SCO Tx as input when BT-SCO Rx is the output device

CRs-Fixed: 585953
Change-Id: I6a5220bf14fd2d7476196b9b1730c0646beec3a1
Merge branch 'kk_2.7_rb1.15' of git://codeaurora.org/platform/hardware/qcom/audio into cm-11.0
Merge AU_LINUX_ANDROID_KK_2.7_RB1.04.04.01.007.022 on remote branch

Change-Id: I9b348ebc2c784c4e298d2145092d17f6ae87f3f4
Merge "Merge AU_LINUX_ANDROID_KK_2.7_RB1.04.04.01.007.022 on remote branch"
legacy/msm8660: fix VoIP in call audio transmission

 Forward port fix from CM10.2

 - In VoIp call mute option is not working
 - Due to wrong device selection, PCM recording path is selected, instead
   of MVS Tx path, for VoIP tx.
 - Enable MVS Tx path for VoIP uplink.
 - Add verification for available input device
 - Updated audio policy to add IN_COMMUNICATION global config

Change-Id: Idf00768e56bd872a1cc82c6aa05448421dd3f246
Merge branch 'kk_2.7_rb1.17' of git://codeaurora.org/platform/hardware/qcom/audio into cm-11.0
Merge branch 'cm-11.0' of github.com:CyanogenMod/android_hardware_qcom_audio-caf into kk-devel-qcom