libalsa-intf: Add mono headset support

- Some customers use mono device such as mono headset or mono
  speaker in their platform
- Add the mono headset acdb define

CRs-Fixed: 443365
Change-Id: I1ceba40e6329749bf73c366d8c4cbb76b7ca2830
alsa_sound: Support for applying independent channel volume control

Issue: The current volume sent to DSP is averaged between left and
right channels. As a result with volume level as zero on one
channel and non zero on the other channel results to playback on
both channels
Fix: send left and right volumes to DSP

Change-Id: If0608adb5ca40730fb1a00cf5a08635a6eb48860
CRs-Fixed: 449284
libalsa-intf: Fix build warning from ALOGE

Fix build warning due to wrong use of ALOGE
messaging.

Change-Id: I6686b55037ec0c5551b14b66a26e6643fa01516b
CRs-Fixed: 454730
alsa-sound: Avoid use of extra bytes to signal seek processed

- A few bytes were reserved in the buffer written by the AudioSessionOut
  client to indicate a seek has been processed and there
  is no need to skip it.
- We won't need this method anymore and its expected the client
  take care of this.

Change-Id: Idfdeb3d41320e3e332424c13638c66ed200c0fee
alsa_sound:Resample proxy ouput for other than 48KHz samplerate

-Issue:If USB samplerate is other than 48kHz then there
 is an issue of lower pitch observed. This is because proxy
 output is at 48kHz and there is a mismatch of sample rates.
- Fixed by using resampler from 48kHz to requested samplerate

Change-Id: Ia46b09f4856532ef4ca943f864769e5bcbcb8742

Conflicts:
	alsa_sound/Android.mk
Merge "alsa-sound: Avoid use of extra bytes to signal seek processed"
alsa_sound:Fix for Audio leak in LPA while in voice call

Issue: When stereo headset inserted and voice call is in BT,
LPA/Tunnel playback route to headset for a second before it
routes to BT.
RootCause: LPA/Tunnel player starts session with the device
that has been selected from media strategy.
Fix: Follow Phone strategy for Music also if in voice call.

Change-Id: If30ed07b50c1201ec055b8c939605f2cd3b4d69d
CRs-Fixed: 450628
alsa_sound: Fix to prevent additioal doRouting call

- During an MO VoLTE call if BT is connected then
  no sound was heard on either side.
- When the Call state was updated for VoLTE,
  doRouting was called, which tried to set BT with
  A2DP profile as the device if BT was connected.
- Added a check to call doRouting only when an
  ACTIVE or HELD call's state is being changed.

Change-Id: I8422c024e52abd99836cadd15a2d5df9d36f2eea
CRs-fixed: 446294
Merge "alsa_sound: Fix to prevent additioal doRouting call"
alsa_sound: Fix to prevent additioal doRouting call

- During an MO VoLTE call if BT is connected then
  no sound was heard on either side.
- When the Call state was updated for VoLTE,
  doRouting was called, which tried to set BT with
  A2DP profile as the device if BT was connected.
- Added a check to call doRouting only when an
  ACTIVE or HELD call's state is being changed.

Change-Id: I8422c024e52abd99836cadd15a2d5df9d36f2eea
CRs-fixed: 446294
Merge "alsa_sound: Fix to prevent additioal doRouting call"
alsa_sound: Add support for VoLTE over USB headset

-Currently VoLTE calls are not routed to USB HEADSET
-Start USB audio thread when VoLTE call is active

Change-Id: I87615f5e0b6373e8364db99430fe887f4a3f23ee
audio: fix input buffersize for AMR/EVRC formats

- Compute input buffer size for AMRNB/AMRWB/EVRC/
  EVRCB/EVRCWB audio formats based on sample rate,
  and channel count
- Use default input buffersize for invald audio
  formats

Change-Id: I36fa35a2d128fd05d2a956357b89c1e3acba48d3
Merge "libalsa-intf: Add mono headset support"
alsa_sound: Initialize the mPfdProxy in constructor

The uninitialised variable of the proxy parameter PfdProxy in the
ALSADevice constructor is initialized to avoid unnecessary call to
sys_close::lib_close without the proxy session enabled.

Change-Id: I8ef6cdae95a4f6ecee5c68f3e5ab8c85f5fb04c0
CRs-Fixed: 428656
(cherry picked from commit 6d812e2cba18aba1c40159b5e5194d225534235a)
alsa-sound: EOS notification if drain ioctl is interrupted

If the drain ioctl returns -EWOULDBLOCK, post an EOS ack only if
the client has signaled EOS

Change-Id: I9a9bd1b3702f62451032e4b1a4c2113501f42b44
Merge "alsa_sound:Fix for Audio leak in LPA while in voice call"
Merge "alsa_sound:Resample proxy ouput for other than 48KHz samplerate"
Merge "libalsa-intf: Fix build warning from ALOGE"
Merge "alsa_sound: Initialize the mPfdProxy in constructor"