init audio
Fix headset call & Add missing define

Change-Id: I14574e56faf86b68782aa9023ac6e44e8009a716
Remove Audience A2220

Change-Id: Icc8eec491aea0d8847ea3e1163b3bd34dd7272a6
alsa_sound:Remove  Support ES325 2Mic and Samsung CSD client

Change-Id: I9ba77eea0ddbc32748bb96a06f1c25f6d93a84de
alsa_sound: Remove HTC CSD CLIENT board flag for special cases (BT)

Change-Id: Ided4b6cdc2c24d4ced27069a0610e6e5d946b5f2
move old audio-HAL code under legacy

Change-Id: Ic1ecb706202c82f8054c7b1df380473050078d89
bring back audiod

Change-Id: I3beb1901571eb280f62c80d14bf381346d481d23
    add new audio HAL (disabled) from Google

    -- build when BOARD_USES_LEGACY_ALSA_AUDIO is not defined
    -- under hal/
    -- uses audio_route library

Change-Id: I27499eacc8956cd9a5c1cda80468c7abed81cc75
移除重复定义

Change-Id: I3b7da5d415a814b36f61435c48554a115548398c
alsa_sound: Synchronization fix - standby and flush

-Standby was not waiting for DRAIN to finish before
calling standby on alsaHandle. Volume was also
not check AlsaHandle before calling it
-Fix this by adding lock and checking status of lock
CRs-Fixed: 493580

Change-Id: I318f5f120f4e02135e00962b670120f6000d49ef
Proper cleanup of Tunnel and LPA during Error

 - Cleanup of tunnel and lpa during error

Change-Id: I8792c224e55ec96102a00bd38ed4d8de85fd7e4e
Avoiding adding delay for LPA and Tunnel Device Setparameter

 - When switching between device the delay was causing output to route
   to wrong device during concurrancy.
 - This delay is not required for LPA and Tunnel mode.
 - Hence we send setparameter to Device without delay.

CRs-Fixed: 480244

Change-Id: Ia21322cb004791a8e7ba7c750628ac882f7c8372
alsa_sound: Update the usecase before enabling device

When speaker device is selected, route function enables
the TX processing path for speaker protection.
Change fixes issue where opendevice and route function try to
enable verbs for ucm usecase set function.As per UCM specification
only one verb should be active any time.

Change-Id: I9619ece0be9e1e2823321d341363470b1812d8eb
alsa_sound: Increase delay in tempmute for BT,USB,WFD devices

-WFD to BT switch while playing media causing  audio loss/noise on BT

-Before BT routing, stream is unmuted because of less latency time

-Increased temp mute time to ensure unmute after device switch

CRs-Fixed: 493835

Change-Id: I337088814258fcce060f1b139773bb63b6f21635
alsa_sound: Query BT/USB streams for audio latency

The latency of BT/USB devices should be considered during playback
on these devices. This is needed for audio and video to be in sync
when video clip is played.

CRs-Fixed: 499841
Change-Id: I5468f08b931d7a502e46399f602345590f1526dc
alsa_sound: Calculate proxy port latency

The latency of proxy port should be considered during playback
on these devices. This is needed for audio and video to be in sync
when video clip is played.

CRs-Fixed: 499841
Change-Id: Ifca7b2d20081cd8c4544d65f423243f015e8e253

Conflicts:
	legacy/alsa_sound/AudioHardwareALSA.h
alsa_sound: Fix buffer pointer mismatch in proxy

-There were glitches heard at times when listening
to music over Bluetooth
-The issue was that due to slight scheduling delays
when the proxy read thread in the HAL wakes up
there could be more than one period size worth
of data in the proxy. This would result
in the proxy copying out only one period
but incrementing the buffer by whatever thats
available. This resulted in a glitch
-To fix this, we have to make sure that the
pointer is incremented only by the amount of data
thats actually read from the proxy

Change-Id: I42e689ccfad2548d1bbbbc13995fb3b649593bbd
alsa_sound: Flush Proxy data at high water mark

-There are instances when delays in the system setup
causes buffering to fill up in Proxy. This results
in Proxy buffers being very close to full leading
to choppy audio
-To fix this we need to flush the data in the proxy
whenever the high water mark is reached. The water
mark is set to 40000 frames for now. This can be
changed by changing the
AFE_PROXY_HIGH_WATER_MARK_FRAME_COUNT

Change-Id: Ie727ac07c4865c8e84f1dfda752bc4b17b84a926
alsa_sound: Increase extOutThread priority to URGENT_AUDIO

Increase extOutThread priority to URGENT_AUDIO to avoid
delays in proxy port read.

CRs-Fixed: 499841
Change-Id: I734237807ce4f489a49d8e051ff370cafcbfb300
alsa_sound:Removed AWB from tunneled-input-formats

-AMRWB recording is failing because tunnelled mode is
 getting enabled in Sound Recorder use case
-Fix is to remove AWB parameter from tunneled-input-
 formats as it is not supported on A Family devices

Change-Id: I0cfc9b62639dfd179bc13af0988776a6c89999da
CRs-fixed: 521809