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
 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
hal: Remove extra checks for proprietary features

 * If headers available, build it.

Change-Id: I31481e3e810706b6050f409e38c11620532f158a
hal: Minor usb stability fix

- Adding buffer of one byte for the strstr usecase to make
  the passed string is NULL terminated.

Change-Id: Ief8531e149b05f4020cb1338110bbfad4a74f7d0
Crs-fixed: 607454
hal: Add suport for dedicated VoIP devices

 * Some devices out there have dedicated paths for VoIP, add support
   for these by setting the system property.

Change-Id: I59cd97e78427f811559081a04151c9a2eccf452f
hal: Port fixes and features to msm8960 variant

Change-Id: I5c7a9ea64f4d6fc9e00e784bb36e208d7310fb5c
hal: Add support for PCM in offload path

- Translate PCM Offload format to pcm codec id
- Set 16/24 sub format id in compress params format
- Calculate offload fragment size for pcm
- Move offload calculation functions to platform file
- Update audio policy manager isOffloadSupported
  for pcm offload profile. Use audio.offload.pcm.enable

Change-Id: I2064d646b66e8283fce2cc736e96fb93cba0a552
hal: Fix memory leak in HAL debug logs

String returned from str_parms_to_str for set/get parameter in
debug logs is not de-allocated. Fix is to make sure the memory
allocated for set parameter key value pair is de-allocated.

CRs-Fixed: 610079
Change-Id: I5027d8f1741c9e7223e7b4721f8d5473404998d3
hal: fix a bug introduced as part of changes done for fixing memroy leak

The return value of platform_get_parameters() is getting freed up
wrongly which is fixed now. This bug was introduced as part of the
gerrit-id 611791.

Change-Id: I61e4f5abc732fbe84702452e27cde7c1c36f77e6
hal: Update the correct channel count for dolby configuration

-Wfd supports both 5.1 and stereo. Based on the sink capabilities
 update the correct channel count for dolby configuration for wfd.

CRs-Fixed: 609429
Change-Id: I85b81ba7db7134a6781007393f0f3c2adb5ea138
hal: set Dolby DMID for low latency playback

- Remove additional check to set Dolby DMID
  for low latency playback. DMID should
  be set for all playback use cases.

Change-Id: Ia93e1b13cc61145148a1bf520a222f8e480b3e2b
CRs-Fixed: 620246
hal: Fix for down-mixing of multi-ch offload playback

- Check if multi-ch playback in offload path is active
 before re-configuring the HDMI channels

Change-Id: If3639ffbbbc56083f9d09257ea4fafdc2b204e76
CRs-Fixed: 622339
hal: Enhance compress offload logging

Add/Enable msg logging
-Salient funtion calls to tinycompress
-Salient funtion calls from frameworks
-Events sent to frameworks
-miscellaneous important events

Change-Id: I493d98d3f3c1216f7c6030a539e01d1f2dd8c202
post_proc: send ENABLE_FLAG directly to offload effect driver

Enable flag should be sent directly through offload effect driver to
adsp whenever bundle receives EFFECT_CMD_ENABLE. Otherwise enablement
will only take effect in adsp after subsequent parameters being set, and
that's not expected.

Change-Id: I5a8f936095b5667f0e04b9109b67eaa0faec3a69
mm-audio: Update bitrate based on profile and samplerate

As per AAC specification bitrate is a function of profile
and sample rate. Change ensures that bitrate will be programmed
as per the specification.

Change-Id: I188f7155c50c32b7c9945036c0ad0ef3f5ee164a
CRs-fixed: 606251
hal: Fix memory leak in listen module

String returned from str_parms_to_str for set/get parameter
key-value pair for listen module is not de-allocated. Fix is
to make sure the memory allocated for key value pair
is de-allocated.

CRs-Fixed: 610083
Change-Id: I290e61168b8fd1569a7b89e13257e142aa5aa1ac
hal: msm8960: Don't even try to calculate a compress-offload buffer

The platform doesn't support compress offload

Change-Id: I1132659f1cd1d4f7131c99a64ddd94e1eac8b506
hal: Fix error in log message

- Fix a compilation error in verbose log message

Change-Id: I2a977f1af7fd568372988f30c5b51b45619f65c3
hal: Add support for EC in regular audio recording

- Ensure EC reference is set when the source is MIC and fluence is
  enabled in the regular audio recording path.

Change-Id: I6648f41fcc578ded13e4fecdb7ef35bc6b0579d4
CRs-Fixed: 628085