audio: hal: Fix to use correct EC_REF_RX

In 8610, we need to use I2S_RX as ec_ref_rx
parameter and for SLIM based targets use
SLIM_RX.

CRs-Fixed: 575647
Change-Id: Ia220498f302a58dc3dbd42b1874fa01f081ce3dd
hal: Detect sound card dynamically

- HAL always assumed SOUND_CARD/MIXER_CARD
  number to be zero. This could cause HAL
  not to load when some other card is
  detected earlier to HAL.
- Fix by removing these Macro(s) and reading
  correct sound card number runtime while loading
- Corrected its use cases across HAL replacing it
  with appropriate platform API

CRs-fixed: 580226

Change-Id: I4512e4a2f7f81d8415c3ba8ec393c96867e6d69a
hal: Fix for adev_open causing hang

- Mutex acquired in the begining of
  the synchronised block but is not
  unlocked when platform_init fails.

- Fix by adding the mutex unlock code.

Change-Id: I02b7f7cac0185dd40ec9f03e443e4de98b18c105
CRs-fixed: 590216
hal: Add audio support for 8092

- Add support for OMX audio encoder components for mpq8092.

Change-Id: I7a652581fd48fc22c025193d2c825b6e747edcfe
hal: pass set parameters call to listen hal

Pass set parameters call to listen hal. Currently it used
to handle SSR in listen hal.

Change-Id: Ia8df94ca87916afff45fe4e3fd569f6268bc3560
hal: Avoid duplicate primary outputs

open_output_stream API expects the default usecase to
be returned if other usecases are unavailable or unusable.
However, the output returned in this default case must be
the default primary if it exists.

Change-Id: Ie5cc53f077358d7039d62b09b29edb58c213bc08
audio: Re-arrange member var initializations

Rearrange initializations of some stream_out member
variables to prevent possible uninitialized use.

CRs-Fixed: 587676
Change-Id: I7018f38f29a19b130185b285f4acf22219e4228c
policy_hal: remove unused function isVirtualInputDevice

- isVirtualInputDevice is a static member function and
  its implementation should be modified in base class only.
- Remove isVirtualInputDevice in policy_hal and modify
  APM_AUDIO_IN_DEVICE_VIRTUAL_ALL in base class to support
  FM recording over A2DP headset.

Change-Id: Ib0527cfdff170367491feb62b117815558e139e1
CRs-Fixed: 581377
mpq8092: Porting audio HAL changes

Porting audio HAL changes

Change-Id: I85e739ed231ee09ebf150da2ea3fd4f5d4aa3a24
audio: Add support for 8974 Voice2

Add the Voice2 pcm ID to enable DSDS on 8974.

CRs-fixed: 587066
Change-Id: Ifd134313a49af601f4e0f1d66ad0b4ff8596609d
audio: mpq: Add WMA, PCM and MP2 format for tunnel decode

Add WMA, PCM and MP2 as supported format for tunnel decode

Change-Id: I874305c17c1ac31ab89412bd5f05503b7844deea
hal: Add property to configure the compress offload fragment size.

Add property - audio.offload.buffer.size.kbytes to configure offload
fragment size. The maximum value for fragment size is 256k. Default
value is 32k. The minimum value is 8k.

Change-Id: I9b440a420270b27f5fdba9f82de6944da0afb9d2
hal: Fix slowtalk key value type

Slowtalk key value is defined as string in upper layer but
HAL expects key value as type 'int' which causes type mismatch.
change slowtalk key value as string.

Change-Id: I66499436d1d09528e4f4b3079c39c9c1a0777385
hal: fix for surround sound recording

- Use proper period_size(512) and period_count(8)
  for 4ch pcm recording.
- Fix read logic in ssr_read to capture 4k data
  for each read
- Miscellaneous code clean up for variables, APIS,
  and debug dumps.

Change-Id: I01c0e99a717a3536bd7d19c2f46ed10be77661e4
Crs-Fixed: 589342
hal: Fix voice call with QUAD MIC

voice call using quad mic doesn't work.
Fix this by update quad mic acdb entry in the table.

Change-Id: I744ac2fe26e39e24f0b0c8f0eed337c86cd7bd6c
hal: Add support for Volume Boost

Add support in AHAL for Volume Boost. A parameter is received
from the UI and the volume boost feature set ID is sent to the
calibration driver to send the volume boosted calibration.

Change-Id: Iafb099b2750deaf58dc5f073f31a23abb9bfe950
hal: remove assertion for unsupported sound card

- Remove CHECK(0) for unsupported sound card to
  avoid boot up failure with USB headsets.

Change-Id: Ib41c48e2b50de042fe94a4c1db0890a39b6a03e2
CRs-Fixed: 580226
policy_hal: Fix to route the call to proper device

When voice/volte call is setup over USB headset, the call is
still on USB headset even after turning on speaker.

Don't set the device to USB headset when speaker is forced
by Telephony during call.

Change-Id: If6a95895a33423ff5150862a823fc669fd44e59a
CRs-Fixed: 588884
hal: Disable gapless offload playback by default.

-Set the property-audio.offload.gapless.enabled to true to enable
 gapless playback by default.
-Set mixer control to the driver to decide if gapless playback needs
 to be used or not
-If gapless playback is not enabled then partial drain from HAL is
 treated as full drain.

Change-Id: Id7f4967fe528bab9097c3f609058276ec02174e1
hal: set gapless metadata for compress  offload playback

-If any of the  metadata parameters are set from the framework.
 set the gapless metadata to one.

CRs-Fixed: 588353
Change-Id: I66a79d3f64515d108585527496a754c06a441560