audio-caf: Import 7x30 audio

Change-Id: Iaa4912ca4dad659e679d982064d2ba23abb42e61
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
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
audio : Mute FM when ringtone is played from settings

- FM audio on speaker is getting mixed up with ringtone
  when it is played from settings.
- Fix is to mute FM audio by enabling the combo device for
  sonification strategy even if the speaker is force used
  for media.
  CRs-Fixed: 574271

Change-Id: Ic595f326d7409b4cb557f5f1edf8f3bf58ce60c8
alsa_sound: Raise priority of separate VOIP input

 * This needs to come first for devices that use this path, otherwise
   we fallthru to the standard voice call route.
 * Fixes Hangouts on JF.

Change-Id: I21fbdf520a5bb0e48b3c8988bc99c9cca0b64e85
audio :Close HotWord audio source if it is already opened

- HotWord GTS test tries to record using second instance
  of HotWord Audio Source while one is already active.
  AudioPolicyManagerALSA is not closing the previous audio
  input before starting the second input.
- AudioHardwareALSA::openInputStream rejects opening
  of the second instance of audio input.
- HotWordAudioSource GTS test case fails due to above
  reasons.
- Fix is to enable the code that closes the previous
  input before starting the second audio input.
- Remove the code in openInputStream that is restricting
  the second record client. This is not needed now as it
  is already done in startInput of AudioPolicyManagerALSA

Change-Id: I63cd5061e23bef6c1f7c52cadd65833778e34018
CRs-Fixed: 591788
 audio: Increase the period size for USB audio

 -During USB audio playback, breaks are heard .This is
  primarily due to overruns of USB buffer from the audio
  HAL.
 -By increasing the period size of USB buffer we are
  avoiding overruns .

  CRs-Fixed: 574897

Change-Id: I78fb1bd5d7201fe789a2fcc5090eb1555af408ea
audio: Add support for AUXPCM BT

Atheros BT chip uses AUXPCM instead of slimbus. Audio HAL has
to use different UCM files depending on whether it's
internal or external BT chip

Change-Id: If6580ea1608b9dc8bb24be58dd2c4d2bbc331f92
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
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
audio: Choose Speaker instead of USB Headset on force use

- getNewDevice() is selecting USB Dock Headset when user
  forces it to be speaker during VOIP/VOICE call
- Fix is to return speaker as output device in this case
CRs-Fixed: 571801

Change-Id: I81cbcef17ac6d07ac0a174e4ab35c8f5c6426257
audio: fix for unhandled NULL pointer in HAL

- Check if handle is NULL before calling pcm_close
- Check if usecase is NULL before string comparison
  operations
- Disable unnecessary debug logs in HAL

Change-Id: I569cbf510c820e1a155abf3efb4bbb525e68aafb
alsa_sound: Fix for unhandled NULL pointer

-Passing NULL pointer to pcm_read()/pcm_write()/
 pcm_prepare() would crash, since it doesnt perform
 a NULL check before using the pointer, resulting
 in random crash
-Fix is to check whether handle is NULL or not.

Change-Id: I7061d40bddcaaae2145f5fc0a0229abeebead878
CRs-fixed: 549257
mm-audio: Fix openmax encoder hang during flush

Flush issued by command thread should unblock the read/write calls
in openmax component.
There is race condition between input/output thread and command
thread in openmax component due to which read/write is not unblocked
which results in a hang.
This change makes command thread to issue multiple flush when it is
wait for ack to avoid a hang.

Change-Id: Ia4486f2e53f56a8413c2115b7f418b29b4bc54c5
CRs-fixed: 466764
msm8660: update ion includes

 This helps for devices that are using a newer kernel with all msm
 ion related stuff inside of msm_ion.h instead of ion.h. Seeing that
 most other qcom related hw repos use this include it only makes sense.

Change-Id: I98a091523060658b96ea7aa4a2247b222594841b
audio-caf: Don't build extensions that need QCOM proprietary source

Change-Id: Ifc588cbb9717890fe3f359bc207eb5f271603551