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

Change-Id: I49d9f4bc4471c4d6e369fa44a49fbe899c398e4e
CRs-fixed: 580226
policy_hal: Do not allow sonification for USB headset.

- Ringtone will be played on speaker when USB headset is connected.
- Sonification is not allowed for USB headset. The behavior is
  similar to HDMI.

CRs-Fixed: 588622
Change-Id: I5fba6ae0e42235f4144ccebac2a55fe1529b530a
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: I9010de8681977295ab3965c5cbf23ffbf9265888
hal: mpq:  configure HDMI channel number

Fixed the issue that HDMI channel number was not configured
from audio HAL

Change-Id: Ibd141befb677ef4a00c4c4a14f0d6e58c225acbd
hal: add support for all_call_states key

Add support for all_call_states which can be queried by
applications to know call states.

Change-Id: I5ba66186e9d9f6d5769a814f4c1e0627c6f6dd74
hal: fix set_parameter() returning -2 error

When setparameters() is called and if the known keys are not found,
the implementation returns -2 error.Fix this by setting error only
when keys are found and there is an error while executing corresponding
implemention.

CRs-fixed: 589280
Change-Id: If5544d6fdeac47ddfc1f7e8e18bfa81e2ef5cbc2
hal: HFP support for setting sampling rate

- Add support for setting sampling rate using setparameter. This
is to support 8000 or 16000 sampling rate set from BT

Change-Id: Ia6c7e530df0ba0226e492937e1c9acc70f6c6d13
hal: avoid audio rerouting to different device when hfp is active

 - when hfp is active we make sure we do not reroute anything
   new to different device with same backend.

CRs-Fixed: 592390
Change-Id: I75e69916a8fe7e711b326cf82b206e3e16508b60
hal: audio routing enable in hfp case

 - When hfp is enabled make sure to reroute during device
   switch

CRs-Fixed: 595541
Change-Id: I680b4198a2d3baf257ae4bcfaf0c955eb62df3d9
hal_mpq: Fix the underrun issue in the offload playback

The cmd_pending variable was not updated correctly leading to the
underrun

Change-Id: Ic5a779c2caf737da097ce9165242f1bdbfa737aa
hal_mpq: Add the SPDIF device entry

Add the SPDIF device entry.

Change-Id: I865c65a150e713586adebb1541055feacaadcdf0
hal: fix no audio when switching devices in voice concurrency

When voip usecase is active and voice call is recieved, voip
usecase will go to standby causing devices to be disabled
resulting no audio in voice call.

CRs-fixed: 589353, 592531
Change-Id: I6d5e2f9c5dd72438affd82799333d7227c72533f
hal: handle combo output devices for voice call

- Issues: camera shutter sound is not heard on
  speaker when wired headset is connected.
- Rootcause: combo output devices are not updated
  properly for voice call use cases.
- Fix: update combo devices before voice call use
  cases in platform_get_output_snd_device.

CRs-Fixed: 591822
Change-Id: Ic2e75a4ce25f77499c07b4a8a32af774cdea16c2
hal: fix no audio in qchat call with speaker as default device

HAL doesnt let voice calls start if the device is set to speaker
as voice calls generally start on devices other than speaker.
However QCHAT calls start by calling setForceUse and setting the
device to speaker.

Fix by updating a flag whenever device routing happens when
AUDIO_MODE_IN_CALL. Reset the flag when mode is AUDIO_MODE_NORMAL.

CRs-fixed: 596074
Change-Id: I546959d2b0123828562dba1f6439aa494a365c3f
hal: add support for voip_out_stream_count key in get_parameters

Add support for voip_out_stream_count in get_parameters which
will be queried by Audio Track to decide whether to open direct
output or not in case of VoIP.

Change-Id: Ic0d058dff32d9002cd452689636f342e748a7fe5
hal: Send device based parameters for DAP and DDP

Send device based parameters for DAP and DDP

Change-Id: I2cb977a573a3065f121d7aa096355ebda15f5948
hal: Fix compilation issue seen when a feature flag is defined

This change is needed to fix a compilation warning in Compress VoIP
code when the feature flag "AUDIO_FEATURE_DISABLED_MULTI_VOICE_SESSIONS"
is defined.

Change-Id: Ie19f542dc71705bc27a7278c83236904782f3a5e
CRs-Fixed: 590219
hal: Add XML parser for platform info

Add XML parser which parses the platform_info.xml
on the device. That xml contains ACDB ID information
and is populated from the device project folder to
the /etc folder on the device. It is used to overwrite
hardcoded ACDB ID's in platform.c.

Change-Id: I86419bf0f48bcf7f0125da58626adab1d23fa50a
hal: Update USB headset ACDB ID

USB headset ACDB ID is set to 0. Update
it to right value.

Change-Id: Ia634750d0d77078077a4e2758c01bb9a6ec39ea0
audio: mpq: enable volume control for offload playback

Enable set_compress_volume to apply volume on offload
playback sessions.

Change-Id: I89631dff192f02988b7613ae07b5b112e420c287