audio: msm8660: Update references to AUDIO_FORMAT

* We should use AUDIO_FORMAT_XXXXX instead of AudioSystem::XXXXX
  definitions.

Change-Id: Idb56bc07f8950cb2f1280f4e0db87fd494782c34
audio: Fix mExtOutMutex related lock issue

-extoutThread was taken slightly longer than on MR1.
-On newer platform, It takes more time to write becausea2dp_write
is a blocking call and takes about 20 ms in every execution
-Because of this, the new stream that was coming in was not getting
the lock.
-To solve this, added a new lock that we acquire before write, and
this lock is taken only during A2DP disconnect since that is the only
case when we close the extoutput

Change-Id: I4ce0bcb17ba2e9fbd60aacd2315d92808509d150

Conflicts:

	legacy/alsa_sound/AudioHardwareALSA.cpp

Conflicts:
	legacy/alsa_sound/AudioHardwareALSA.cpp
audio: Fix for AV Sync related issues

-Fix buffer pointer mismatch in proxy
-There were glitches heard at times when listening
to music over Bluetooth
-The issue was due to slight scheduling delays. When proxy read
thread in the HAL wakes up, there might be more than one period
size worth of data in the proxy. This would result in the proxy
copying only one period but incrementing whatever is available and
subsequently leading to glitches.

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

-query BT hal for audio latency for a2dpstream
-Set proper latency when audio is played on BT devices
by querying BT hal. This is needed for av sync over BT devices

-Calculate proxy port latency
-The latency of proxy port should be considered during playback
on these devices.

-Flush Proxy data at high water mark
-Delays in the system setup causes Proxy buffers to become very close
to full and leading to choppy audio, afterwards.
-Flush the data in the proxy whenever a limit [water mark] is
reached. The water mark is set to 40000 frames. This can, also, be
changed by modifying AFE_PROXY_HIGH_WATER_MARK_FRAME_COUNT

Change-Id: I55ffb93b16618d3e63fb93c66483286db058740f

Conflicts:
	legacy/alsa_sound/AudioHardwareALSA.cpp
alsa_sound: Add wifi display to fixed volume devices

Wifi display should be treated as device with fixed volume like HDMI.
User should not be able to change the volume on device. Volume
change should be supported only on the end device.

CRs-Fixed: 480334
Change-Id: I328cc9817fb0735fbfd67f14534cfad127026a44
 voice path

  Earlier, setparameters() followed by setMode() is called
  from telephony to Audio HAL to setup voice path.
  Now, setParameters() API called by RIL instead of
  telephony.
  Make changes to handle the API sequence changes
  to setup voice path.

Change-Id: I12ed40662e06fb83f8b0e565d770fdcb77fdc853
Merge "audio: Fix mExtOutMutex related lock issue"