ASoC: qdsp6: Add support for gapless audio playback

Update ASM driver to support for gapless audio playback in
tunnel mode.

Change-Id: Id1f25afef25b3636fb50dc08b5feb803150d1b59
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>

Conflicts:
	include/sound/q6asm-v2.h
	sound/soc/msm/qdsp6v2/q6asm.c
ASoC: msm: Add support for gapless audio playback

Update compress driver to enable gapless mode in DSP to
achieve gapless audio playback in compress offload mode.

Change-Id: I212178025996f28ff5a3ddc361ceb7bd70b5d192
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
ASoC: qdsp6: Add support for custom topology

Update ASM driver to send commands to DSP to enable
custom topology for enabling audio post processing
effects in POPP.

Change-Id: Ic222b5045820ebabb79148c8e51f5fd90fcd1410
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
ASoC: qdsp6: Add support for audio post processing effects

Add interface to support configuring equlaizer, bass boost,
virtualizer and reverb effects in DSP for tunnel mode of
playback.

Change-Id: Ie1512e340315302691327b6379a0935170dc57a7
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
ASoC: msm: Add support to enable audio post processing in DSP

Add interface to support configuring equlaizer, bass boost,
virtualizer and reverb effects in DSP for tunnel mode of
playback.

Change-Id: I5ed578df1e1cb860734d2205c0895e82cfbdfbfc
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
ASoC: msm: Enable initial/trailing silence removal

For gapless audio playback, the DSP HW decoder needs to
remove the initial and trailing samples from the decoder
output according to meta data present in the stream. This
change is to enable the silence removal by sending the
meta data down to DSP.

Signed-off-by: Ravi Kumar Alamanda <ralama@codeaurora.org>
sound: Copy audio_effects.h for userspace
ASoC: msm: Handle RESET_EVENTS in compress driver

Listen for RESET_EVENTS message in the q6asm callback and move
compress driver to an error state. All ops except free() are rejected
in this state.

Change-Id: Id12dba9e3a40b01f02e516857cb32af8f9e4cb60
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
ALSA: pcm: check for integer overflow during multiplication

Channel info data structure is parsed from userspace and if
user does not set the no. of channels correctly, it could lead
to security vulnerability if we don't check for overflow when the
no. of channels is multiplied with pcm bit width. Add a condition
to check for overflow during multiplication.

CRs-fixed: 537818
Change-Id: Ib9631b6e45d77b39be2c27343d4aee3e9244d8cc
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
ASoC: msm: Add few more Dolby endpoint dependent paramters

While turning Dolby effecrs on and off from its UI app, volume of
levels vary and difference is observed. Dolby requires few more
paramters to be sent based on endpoints for proper tuning.

CRs-Fixed: 503579
Change-Id: Ibae16d417d4df53eb2bf27475ed24fa409af3861
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
ASoC: msm: update endpoint based DAP table for REMOTE_SUBMIX

Update endpoint parameters table for REMOTE_SUBMIX and FM
endpoints used for Miracast devices in DAP driver.

Change-Id: I9bda1d884f93c131149b3cae0f22a0113020d6e7
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
ASoC :msm: Increase Proxy buffering

-Proxy buffering can overflow if BT playback setup takes a lot of time
-Fix this by increasing the proxy buffer size so that we will end
 up buffering the additional data that can come in during this time

Change-Id: I3b9acc848e0922bb26c87845fc6164f4266fbfa9
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
ASoC: msm: qdsp6: add support to query RMS during recording

Recorder app requires RMS value of the recording when using
tunnel mode AMR-WB encoding. Add mixer control so app can query
the RMS value from DSP

Change-Id: I84127ad35b916d257b0edee260141c34b92742f2
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
ASoC: msm: q6: check upper bounds when copy ac3 params

Although AC3 maximum param size is fixed, better check upper bounds
when copy user data. It might cause overflow, possibly cause memory
corruption.

Change-Id: I2f7cec8edd9e013de1433ea06480b963ec307196
Signed-off-by: Fred Oh <fred@codeaurora.org>
ASoC: msm: q6: update render flag to NON_DMA for handling underrun

In scenarios where the driver is in underrun state, restart
mechanism triggers when the render flag is in NON_DMA mode. The
compressed driver which is opened in mmap mode runs into underrun
scenarios when the valid buffer length is smaller than the
buffering in the DSP. Update render flag accordingly so that the
restart is trigger when driver is in underrun state.

CRs-Fixed: 487732
Change-Id: Ia4ee5dcf1d079ebef69e9ee627591bc039934add
Signed-off-by: Jitendra Singh Naruka <jnaruk@codeaurora.org>
ASoc: msm: Add check for compressed capture format

- Only AMRWB format is supported in compress capture
  path, use default codec.id(SND_AUDIOCODEC_AMRWB) if
  request codec id is invalid.
- Use fixed band mode and dtx mode since these are the
  only supported parameters for AMRWB format

Change-Id: I45a48952a5833c3e85588b515d38d311064cd7fb
Signed-off-by: Mingming Yin <mingming@codeaurora.org>
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>

Conflicts:
	sound/soc/msm/qdsp6v2/Makefile
	sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c
ASoC: msm: qdsp6v2: Add timestamp in voip frame header

Uplink timestamp needs to propagate to userspace for AV sync.
timestamp field is added in voip frame header to
capture the timestamp from LPASS for each uplink packet.

Change-Id: Id701df56e5a3d36bf83771ba9731c61a03dae3ba
Signed-off-by: Helen Zeng <xiaoyunz@codeaurora.org>
ASoC: msm: qdsp6v2: Add support for EVRCNW format

Add changes to support VoIP call with EVRCNW audio format.

Change-Id: Iaaedbc6434cee4a59bf22c265bfe463df55a19fd
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
ASoC: msm: qdsp6v2: Add support to configure min and max rates

Add support to configure min and max frame rates for EVRC/EVRCB/
EVRCWB/EVRCNW codecs. This change is needed to support variable
length frames for VoIP calls.

Change-Id: Id17dd645b17b1b8c1dc21afcf20dbc7e2c9c0d30
Signed-off-by: Narsinga Rao Chella <nrchella@codeaurora.org>
ASoC: msm: qdsp6v2: Copy frame data based on frame length

Copying data based on count will result in copying
uninitialized data to userspace which can potentially
disclose sensitive data. Fix by copying data based on
frame instead.

Change-Id: I39e264b1ffc7a6b79b01c14cd0b5bb00c67307c6
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>