audio_policy: force cancel unexecuted device routing command

-unexecuted device routing command can be handled for a none active
 output and cause wrong audio routing for the other active output
-cancel the pending device routing command if stream is voice call
 and new device is none

Change-Id: Ia5aeb935ccbdcb63fe8b226f911d252f78e2fa9b
CRs-Fixed: 678582
Revert "audio: primary desc check for sonification"

This reverts commit 785b693a0fa89aebbec4137fc9cc52b2b160174f

Change-Id: I70cb4e74eb47b6fd936f9ddd8afb602441a9ad7e
CRs-Fixed: 656945
policy_hal: Set the output devices in ascending order of outputs

 -volume related issues are seen with customer app while setting
  device forcefully
 -Set the output devices in ascending order of outputs to make
  the overridden setForceUse API's code inline with base function.

Change-Id: I375b557de105be295c7bc246fe3f8325f55ce859
alsa_sound: call voice volume api for direct output also

- Voip volume is not applied on direct output and as a result
  volume cannot be adjusted for some voicemail applications
  which opens direct output stream with mode set to IN_CALL.
- Voice volume is applied only for primary output and volume
  command is not sent to HAL for direct output.
- Call voice volume api for direct output as well from policy
  manager.

Change-Id: Iad6dc31ba628408958e4d693b99062f502210a56
CRs-Fixed: 676599
hal: fix mutex unlock issue

If a audio/voice usecase is active, hal should re-try the speaker
calibration.Speaker portection mutex was not being unlocked for this
usecase which causes ANR.Change unlocks the mutex which fixes the issue.

CRs-fixed: 671620
Change-Id: Ic29697e29e96dba784941f4e29664b8c10f51e84
mm-audio: aenc: timestamp fixes

Save timestamp of first ETB as anchor time and use it
as reference in calculating timestamp for all future FBDs

Change-Id: Id937ac169c878fccf7d6f8fa660cb9ec321d4afa
CRs-Fixed: 639731
mm-audio: Remove omx decoder components from mm-audio folder

Remove omx decoder component from hal/mm-audio as
decoder component are used from proprietary/mm-audio folder

Change-Id: Ia9d4842f6939108a652d64912e1dec45a987b1e9
audio: Starting proxy thread when there is an active stream

- Proxy thread is started from DoRouting only when previous
  and current devices are external devices. When CS call
  is ended while BT Headset is connected, we get a route
  call to ear piece intermittently and then for BT A2DP to
  resume the music playback. As previous device is not
  external device, Proxy thread is not started automatically
  in this scenario. This is blocking pcm_write call for
  touch tones as ear piece is disabled and data is not
  consumed by proxy device as well

- Fix is to start proxy thread after the route call when
  pcm_write for any stream is in progress

Change-Id: I378419977a2ac5af6cd86aa52bf0cc97a3abcee8
CRs-fixed: 661252
audio: Add support for offloading MPEG2 and WMA

Change-Id: I75afa455537cc8aaecd5d5a36ffda9e62785c723
audio: Always offload audio for AV

Change-Id: I88ba026c9733cdd7e31a5771f3d82bfc1cf37597
Revert "audio: Always offload audio for AV"

 * Framework offload path is too racy and the root issue this was
   addressing is resolved now.

This reverts commit 6f03c6068a26636f68038402a84d371f64d54ddf.

Change-Id: I35f9a5b2a613bdff056630dffeecd7117657cc85
hal: Add support for multiple instances of offload playback

Add support for multiple offload playback instances

Change-Id: I9d35b68fc8ca27c4eeb3976eb508b06c5ad3ca8f
hal: configure HDMI channels based on sink capability.

- configure output HDMI channel count based on sink
  capability when audio.use.hdmi.sink.cap is set to true

CRs-Fixed: 656308
Change-Id: I3dd3226054c68a69a2c29f8bb2f9c27e429ad2dc
hal: SSR support for compress offload

- add support for time stamp error propagation
  to frameworks on compress driver error

- close active compress session on SSR

Change-Id: I9cbd3a6c271097b81c9b79e71573fda8d78c7dbf
hal: SSR support for compress offload

- reject offload request based on sound
  card state

Change-Id: I38256ce6163f948a9e9c14cb895de3f71529a0e9
hal: Support for FLAC 24 bit format in offload path

- Add flac in supported codecs list
- Set FLAC codec specific parameters
- Set fragment size based on bit width and sampling rate
  for flac.
- Configure backend to 24/16 bit based on the current
  usecases running

Change-Id: If013078e277fd3053fba6489345803f8f58bd86d
Audio: Fix for sound card status overwrite issue

 - Sound card status is getting over written to OFFLINE
   by HAL internally on continuous SSR
 - Fix by returning different error code for snd card offline
   update in HAL internally instead of ENETRESET

Change-Id: I98a34d8b667dff045a1e99d18307376579ac4ebc
hal: add support for pcm_ioctl() api

- Tinyalsa doesn't expose an api to call
  ioctls exposed by the audio drivers.
- Add pcm_ioctl() api to support pcm ioctl.

Change-Id: I448252e8d3347257a73c56bc8ed341abc2dd2dab
policy: Add support for multiple instances of offload playback

Add support for multiple offload playback instances

Change-Id: Icab3c7d6e89121a7aa23744729a634d8e402fabf
hal: Add multiple offload support for msm8974

 * msm8974 can also benefit from multiple tunnel support, but
   is limited to four devices. This allows for reliable gapless
   playback and other use cases.

Change-Id: Ie0698cc0d600a23df0799482a79181f248a001e7