hal: Squashed collection of fixes

 * Remove unnecessary ifdefs for PCM offload
 * Remove unnecessary property for 24-bit support (use audio policy)
 * Clean up warnings

 * Also includes these patches from Google:

audio: fix set_parameters return value.

xxx_set_parameters functions were returning the status
returned by str_parms_create_str() which is incorrect.
These functions should return 0 when no error occurs.

Change-Id: Ib4a7ac427e49f5500c99902f86d2d69d5843eda0

Scan and verify audio device parameters on open

Scanning is default disabled at this time.
Verbose logs will display device params found.

Change-Id: Id188d096ec68d2058c66ae3a51fe57d9645d03ef
Signed-off-by: Andy Hung <hunga@google.com>

audio: deprecate audio_stream_frame_size()

Bug: 15000850.
Change-Id: I1bbe614c241befa24513a2b583594680e32fd954
hal: Invert standard build flags

 * Always include these unless explicitly negated

Change-Id: I3931ef089dddcd9ac9f61d8b7e870cf916a4e47d
hal: add all compressed formats for app type selection

Support all compressed formats as mentioned in
audio_policy.conf for app type selection in compress_offload
section of audio_output_policy.conf.

CRs-fixed: 767955
Change-Id: Ifea1643429f1f9f5fdb587d4dfc4303e9af9ff40
hal: Support config selection for playback on speaker

Support bit width selection for playback on speakers based on
platform info.

Change-Id: I8dd2cc7049186e7468615a43db550d7d580a81d1
hal: Fix issues with app type config during device verification

 * Don't try to send the app type config during verification as the
   streams aren't set up yet and will crash due to null pointers.

Change-Id: Ic4cdd5374b46b3e3c2042b158820af5ec020e754
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: 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
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
hal: Fix glitch in audio playback during device switch

Currently the deep buffer path uses 4 * 20msec buffer.
During device switch the AudioPolicyManager delays routing
command by 2 * output latency (80msec) to ensure that all
the data written to driver/DSP is played out on current
device itself.
The stream side buffering in the DSP in legacy PCM mode is
95msec and hence the depth of pipeline is 80 + 95 = 175msec
which exceeds the device switch delay 160msec (2 * 80). So
the tail (data written to driver before headset plugin) is
heard on headset and perceived as glitch.
Ensure that the buffering in the kernel is greater than or
equal to the buffering in the DSP to fix the issue.

Change-Id: I01a3862d63ce4c258056620693dee08761c7e83f
CRs-Fixed: 771446
hal: Port fixes and features to msm8916 HAL

 * Offload enhancements, 24-bit, etc

Change-Id: I728154c2c01650ea88b994b0ad73711694c64070
hal: add support for low-latency capture

 Enable low latency use-case for Bear family

CRs-Fixed: 752390

Change-Id: I7cac5a0166ee9e19ab8753f567bde712ca36ebb3
hal : Overwrite the APP type for PCM RX and TX path

 -For all the rx/tx sessions hal sends the default app type 'general playback'
  with acdb cal data if output policy conf file is not added.So it sets the SA+
  topo id for POPP.
 -With output policy conf file it would create the
  multiple instance of COPP for different output with different app type,
  which is not recommended for resource constrained target.So we can not
  add the output policy conf file with different app types to avoid SA+.
 -Overwrite the app type for PCM Rx and Tx path to avoid setting SA+ for POPP.

Change-Id: I1a3e0cbb01360e4d2e7b0ba0ecf8a1bee7fecda7
hal : Fix for SA+ app type selection for PCM Capture usecase

- SA+ topology is selected for for incall recording use case.

- HAL selects default app type for incall recording use case,
  which results SA plus topology selection

- Add support for app type selection based on use case type
  instead of use case id

Change-Id: I0ce017ea4dca04eb25055e669e72bda0c281b22c