hal: use 0 as default return value for out_get_render_position

- Initialize default return value of out_get_render_position to
  0(NO_ERROR).
- Default value(NO_ERROR) will be used if timestamp query happens
  before compress driver is opened. Return 0(NO_ERROR) in this case
  to avoid playback failures.

Change-Id: I0f8b2e0f19cfe736a19934ddef18016599ec582c
CRs-Fixed: 756508
hal: Upstream updates for samplerate/bitwidth

 * Clean up sample rate choice code
 * Choose correct rates for specific devices when appropriate
 * Kill logspam

Change-Id: I39ea6801834fe8e3cb6b0a40ba6ff649c5ab1b1d
hal: Add support for listen playback concurrency

Add support for concurrency handling between number of
listen capture session and playback activity.

Change-Id: I4a0656f240c62f2cc6266a714a96fdcdc13ae9d8
post_proc: Fix bassboost/virtualizer not disabled on speaker

When output is unintended device, there's no need to query enable_flag
before setting effect to disabled state. There's possiblity that
enable_flag is 0 as initialized value, which hinder effects from being
disabled.

Change-Id: Ib90c0ad0982dc8274129bb1bed7861e11670fbdb
hal: Clean up compilation warnings

Change-Id: I3857f565dd7a2f3ce3a1cbb783eb3d67fb024e3e
hal: Invert standard build flags

 * Always include these unless explicitly negated

Change-Id: I3931ef089dddcd9ac9f61d8b7e870cf916a4e47d
hal: Kill useless logspam

Change-Id: I540e3e22670c192d440697c0ae284225427711e0
hal: Remove samplerate checks for speaker

 * This is causing mass chaos, and is not necessary with the floating
   point mixer.

Change-Id: I60285e8b44566b69deb5113772a982c875d4f727
hal: Be specific about supported offload formats

 * We need to look at the subformats here since certain combinations
   are not valid.
 * Fixes AAC offload with Tidal.

Change-Id: Ice41aeb7e011a4421e52b02a6e53b6bc36f0b9c6
hal: Fix progress bar issue during compress offload playback

During MP3 (with no gapless meta data) playback in 'repeat one song'
mode observed that from second iteration onwards the progress
bar continues to increase beyond the clip duration.
At the end of second iteration the drain command is not reaching the
driver as the compress_set_gapless_metadata() is not called.
Fix the issue by ensuring that it gets called for every iteration.

Change-Id: If71c145c5a02c99ff55f528522f1f36e20ec8871
audio: Avoid mute during AFE PROXY Usecase

Silence data is getting written from in_read when voice
call is muted with USB Headset connected. This resulting
in muting Rx path too along with Tx path in this
scenario. USB Voice call scenario, PROXY_IN device is
responsible for reading RX data. So not supposed to be
muted.

Fix is to avoid muting if the current use case is AFE_PROXY

CRs-Fixed: 763152

Change-Id: I1fbd5545f343cbaea865e941214be05791dec14e
hal: bug fixes for PCM offload

When pcm offload is done, override the buffer size
that was calculated and use the value from the system property
Make write call blocking if small buffers are used in offload
Update latency value for pcm offload with small buffer hint based
on period size and period count.

Change-Id: Ic74caa6bd172c8e4554384e9fa98a5137117f07c
audio: Reject incall record request when call is not active

- If application selects AUDIO_SOURCE_VOICE_CALL when voice call is
  not active, audio HAL is selecting afe-proxy use case which is
  wrong. afe-proxy usecase/device expected to be selected during
  USB Voice call scenario only

- Fix is to fail opening the input stream with
  AUDIO_DEVICE_IN_TELEPHONY_RX or AUDIO_DEVICE_IN_VOICE_CALL if
  the call is not active

Change-Id: Iae2d25d192b3b5011dd45816778ffc03d3049449
Correction of dolby format name from EAC3 to E_AC3

Change-Id: I0222fd5b3d78261215c3fa8f4abff990a130d0de
hal: fix null pointer de-reference

When speaker protection is turned on input stream can be
NULL. Add a check to fix de-referencing NULL pointer.

Change-Id: I75647d9360a559b5255c29d0baca264b1274eba2
hal: Check for multiple offload usecases

While checking if a usecase is compressed offload, consider
concurrent multiple offload usecases

Change-Id: If01424137d4d5640e97ead58f151300a168f0912