Commit Graph

159 Commits

Author SHA1 Message Date
Aditya Bavanari
3c259b5e62 dsp: Add size check for afe set and get functions
In afe_get_cal_sp_th_vi_param and afe_set_cal_sp_th_vi_cfg
functions, data size check is not present which might lead to
out of bounds access. Add size checks to fix the same.

Change-Id: I99eca6065e6f5a050527f1bfce2bfcba28123b53
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-06-26 11:01:38 +05:30
qctecmdr
cbadda916f Merge "dsp: add senary MI2S and TDM port IDs" 2019-05-21 20:36:44 -07:00
Ramprasad Katkam
14efed6eb7 asoc: Ratelimit error logs
Ratelimit error logs to avoid excessive logging during
ssr/pdr.

Change-Id: Icdc9823cef5b070ed70cdd002bb3cd00d482a869
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
2019-05-14 17:42:22 +08:00
qctecmdr
d12578a0ab Merge "asoc: send VAD enable or disable" 2019-05-07 22:35:09 -07:00
Karthikeyan Mani
3bbd2ee907 dsp: add senary MI2S and TDM port IDs
Add MI2S/TDM AFE senary port IDs for Kona target.

Change-Id: I8dafa4516c31040aad0bca30cfdc9acbdf460bf1
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-05-06 11:19:29 -07:00
qctecmdr
1ae80f7aa4 Merge "dsp: Fix payload mismatch issue in AFE clock setting" 2019-04-30 10:57:39 -07:00
qctecmdr
c38cf58d38 Merge "asoc: dsp: add support for aptx adaptive speech" 2019-04-25 06:48:14 -07:00
Aditya Bavanari
23513e0973 dsp: Fix payload mismatch issue in AFE clock setting
IID support is set from user space during boot up
which can come in parallel with AFE set clock requests
due to which param payload is set in difference with
the actual set param command as per instance id support.

Change-Id: I07e45fda0943cac814f25c16da930dfae5d209a6
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-04-25 09:36:36 +08:00
qctecmdr
7bf19b93d3 Merge "dsp: update error handling for Doa Tracking Monitor" 2019-04-23 20:41:27 -07:00
Zhou Song
caa541d688 asoc: dsp: add support for aptx adaptive speech
Add support for speech codec which is similar to a2dp aptx adaptive.

Change-Id: Ibfbcf086f009fdb561e26aaf92cefc92f1bd16ca
Signed-off-by: Zhou Song <zhous@codeaurora.org>
2019-04-22 14:43:00 +08:00
Mangesh Kunchamwar
27baab0fb9 asoc: send VAD enable or disable
Updates to send VAD enable or disable to AFE port.
Send VAD and island configuration based on the ports
on which these features are supported in Vipertooth
machine.

Change-Id: Ib3e6d46fed3bf9e822f350c9ec0dc629cd82547e
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2019-04-15 02:51:36 -07:00
Cong Tang
b84eea3768 audio-driver: support tdm multi lane for sa8155
Support group tdm multi lane configuration for TDM interface.
With valid lane mask tdm interface support delivery audio channels
through different data lines.

Change-Id: I63e8ba1106b89c6bcaca0a8359a1def696c334ad
Signed-off-by: Cong Tang <congt@codeaurora.org>
2019-04-15 02:42:21 -07:00
Surendar Karka
7bc942b640 dsp: update error handling for Doa Tracking Monitor
AFE callback payload response for param id FFV_DOA_TRACKING_MONITOR
is not handled properly. This is resulting in 2sec
of wait event timeout delay. Updating the state event and
status event based on the payload response. This decreases
hal load time by 2sec.

Change-Id: If960ee14e264b3fe444463b47878d29aaee5e63f
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2019-04-15 02:30:15 -07:00
Karthikeyan Mani
3325ee5475 dsp: afe: check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-04-10 16:52:45 -07:00
Karthikeyan Mani
5670cbd6e3 dsp: afe: get apr handle before sending apr pkt
Make sure to get apr handle before sending a packet
so that it does not end up with no handle to send
the apr packet.

Change-Id: Iaaebee3ddc6c83896e4cb9dc8149d310fc7d67f1
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2019-03-25 17:45:17 -07:00
Laxminath Kasam
36384ecca2 dsp: get excursion logging at afe close for wsa and log data
Trigger xt logging getparam at every playback close
and store data. When app queries sys/class node, return
stored values and reset to 0 for some params as per
app requirement.

Change-Id: Ice1a3e9a7e03062390f1c36184a971635e55d450
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-03-20 00:07:28 -07:00
Aditya Bavanari
740b4839cb dsp: afe: Implement get param for excursion logging parameters
Implement get param for AFE_PARAM_ID_SP_RX_TMAX_XMAX_LOGGING
in order to get excursion params from DSP.

Change-Id: I5129938c51c6f6ede9d4703d13be60d04d26f5e3
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2019-03-15 15:56:01 +08:00
Laxminath Kasam
2e13d95506 dsp: q6afe: Add v-validation support for speaker
With speaker protection in v-validation mode, speaker
samples can be tested in early factory mode. Add
support for v-validation feature from driver.

Change-Id: I92493d6d2784cf4dd58021746bffe01180f89d23
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-03-13 19:53:30 -07:00
Mangesh Kunchamwar
cdd68dbe72 msm: vote for LPASS core while access LPASS registers
When ADSP is in power collapse or island state, it would fail
to access LPASS codec register.Vote for LPASS core to avoid
LPASS power collapse with pmruntime approach while accessing
LPASS registers & TLMM.

Change-Id: I74d037e499fb6f1245b9a1bd1b0a77200608c27b
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2019-03-06 08:50:31 +08:00
Linux Build Service Account
16470427d0 Merge "asoc: Add support for Aptx Adaptive decoder" 2019-02-27 01:15:33 -08:00
Linux Build Service Account
b24eed47e3 Merge "audio-kernel: dsp: Add needed exports" 2019-02-27 01:15:32 -08:00
Xiaojun Sang
cf353edbf2 dsp: validate token before usage as array index
Token from DSP  might be invalid for array index. Validate the token
before being used as array index.

Change-Id: I9f47e1328d75d9f9acf7e85ddb452019b6eced0a
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2019-02-21 16:44:51 +08:00
Chaithanya Krishna Bacharaju
4a466532e4 dsp: Add support for Aptx Adaptive decoder
Add support for Aptx Adaptive decoder. Introduce flag
to indicate ABR feedback decoder configuration to
differentiate from regular decoder configuration.

Change-Id: I272e0a9572a56e878f7ad1385514b3be7010145a
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
2019-02-20 19:05:55 +08:00
Josh Kirsch
2253309313 audio-kernel: dsp: Add needed exports
Add needed exports in q6afe. These are
needed for sdxprairie drivers where LPASS
provides the clock.

Change-Id: Icd8256153523c8827ffd65eda1152ef9ad355119
Signed-off-by: Josh Kirsch <jkirsch@codeaurora.org>
2019-02-20 19:02:33 +08:00
Meng Wang
688a867091 asoc: Update file header to GPL-2.0-only
Update file header to GPL-2.0-only.

Change-Id: If16bf92f951c6d7521f56a3e9b91da2ca2ccf6f8
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-01-29 13:43:33 +08:00
Linux Build Service Account
1ec5816c0b Merge "dsp: Add frame size control parameter for AAC encoder" 2019-01-08 05:32:06 -08:00
Linux Build Service Account
f6416bbf7a Merge "dsp: afe: add support for VA macro codec DMA interface" 2019-01-08 05:32:05 -08:00
Xiaoyu Ye
8341eefc48 dsp: afe: add support for VA macro codec DMA interface
VA macro on Kona has three TX codec DMA interface. The
current AFE driver only supports two codec DMA interface.
Add support to enable the third one in AFE driver.

Change-Id: Ie0f6241ef37bc03ad9adb1c4fe82f82468caec25
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-01-03 14:57:47 -08:00
Aniket Kumar Lata
be83735305 dsp: Add frame size control parameter for AAC encoder
BT sink devices have a limitation on the packet sizes
they can receive and handle from BT sources. AAC encoder
can produce output frames which can vary in size based on
content being encoded. If frame size exceeds MTU size of
BT sink device, it will lead to incorrect decoding of
frames in BT sink.
Add a frame configuration parameter (MTU/Peak bitrate)
for AAC encoder to solve this problem.

Change-Id: Ia7795049e982400b0b3657b0b3a8990fc6920e38
Signed-off-by: Aniket Kumar Lata <alata@codeaurora.org>
2019-01-02 17:28:08 +08:00
Laxminath Kasam
c910c02395 dsp: return ENETRESET error if apr is down
In SSR/PDR, return ENETRESET errno to
propagate this failure to userspace. After
audio HAL receives ENETRESET, it stops retry
for pcm_open continuously. Rate limit the logs
when apr send packet fails during PDR/SSR
usecases to avoid watchdog timeouts.

Change-Id: I03a80aef6ffedb4f15f953fff5213d6a3c9efc4b
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2019-01-02 15:44:42 +08:00
Linux Build Service Account
ed9a9cce4a Merge "dsp: afe: Cleanup task_struct related implementation" 2018-12-12 08:52:06 -08:00
Linux Build Service Account
d3a0e9fcca Merge "dsp: q6afe: return error on no configuration data" 2018-12-12 08:52:02 -08:00
Linux Build Service Account
af3c54713f Merge "ASoC: Add TWS+ mono mode support" 2018-12-12 08:52:01 -08:00
Linux Build Service Account
bed688a58c Merge "asoc: add support to get Direction of Arrival target scores" 2018-12-12 08:51:56 -08:00
Karthikeyan Mani
0253cb9698 dsp: q6afe: return error on no configuration data
Move the return value to within the error check
condition to avoid returning error for valid
scenarios too.

Change-Id: I718786d9eb3c779a85da3a4cb3929806692f5424
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
2018-12-11 00:09:46 -08:00
Chaithanya Krishna Bacharaju
8c6a184189 dsp: add support to get Direction of Arrival target scores
Add support to get DOA tracking monitor data.
This is required to support SVA LED display feature with
FFECNS/FFNS enabled.

Change-Id: I7e39c2f3998fcc3f9ed0767c0090f862e1ba7539
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
2018-12-11 00:02:27 -08:00
Surendar Karka
d47fda4407 asoc: add support for afe_loopback_tx BE dai
Add dai driver and routing driver changes for
afe loopback BE. This BE is used to capture
EC reference data.

Change-Id: Ia57f335bde5f8a47de0030fbf1cdb784c8821e17
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2018-12-10 23:58:04 -08:00
Aditya Bavanari
91674b50e6 dsp: afe: Cleanup task_struct related implementation
Cleanup task_struct related implementation in
AFE driver as it is not used anymore and
causes invalid pointer access in stability tests.

Change-Id: I97ad810f9389338af85c7cea3213432917a21106
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-12-10 23:45:11 -08:00
Manisha Agarwal
d99fac0210 ASoC: Add TWS+ mono mode support
Add support to enable mono mode when one TWS+ earbud is
connected. Change the encoder config when device switches from two
earbuds to single earbud.

CRs-Fixed: 2341876
Change-Id: I880aa6a2767d88e99be2d80afff0e5fbec94b8a4
Signed-off-by: Manisha Agarwal <maniagar@codeaurora.org>
2018-12-10 23:36:26 -08:00
Meng Wang
61af6849e9 ASoC: switch audio drivers to SPDX identifier
Switch audio drivers to SPDX identifier on msm-4.19.

Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2018-12-07 15:47:32 +08:00
Florian Pfister
f4fd5f33d1 dsp: add SBC support for BT sink mode
Update SBC sample frequency and number of channels
from IPC library to set AFE port accordingly.

Change-Id: Ibca385b0fc0ba4c3122053559b1116bd4c31336d
Signed-off-by: Florian Pfister <fpfister@codeaurora.org>
2018-11-15 01:32:22 -08:00
Linux Build Service Account
ab1a6c2a63 Merge "dsp: afe: change lock sequence to avoid deadlock" 2018-11-05 21:39:03 -08:00
Linux Build Service Account
563b443fcd Merge "dsp: increase afe apr_send_pkt timeout to 2 seconds" 2018-11-04 19:08:04 -08:00
Vidyakumar Athota
aade87e1f2 dsp: increase afe apr_send_pkt timeout to 2 seconds
Some USB headsets take more than 1 second to respond
for afe port start command so increase the timeout value
to support playback on slow responsive USB headsets.

Change-Id: I76c43bafe3c9e1e2d8a4a23059053db6bfc0188b
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
2018-11-01 11:09:57 -07:00
Florian Pfister
f1b8d5bdea dsp: add BT sink support in AFE driver
Add different media format support in AFE decoder.

Change-Id: Icdc3884882c34236f5ab02355dfbabdd2a1becd2
Signed-off-by: Florian Pfister <fpfister@codeaurora.org>
Signed-off-by: Surendar Karka <skarka@codeaurora.org>
2018-10-31 23:14:03 -07:00
Xiaojun Sang
41de9e1640 dsp: afe: change lock sequence to avoid deadlock
Lock sequence for afe_alloc_cal does not comply with others. To
avoid deadlock, move afe_cmd_lock to the top caller in AFE.

Change-Id: I4ce03034c642c8b5e7e9e5e2ff4c73644980484b
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
2018-10-31 03:08:26 -07:00
Linux Build Service Account
53b13dd5a6 Merge "dsp: Fix port media type sample rate for APTX AD" 2018-10-23 01:32:47 -07:00
Linux Build Service Account
fee3694cd7 Merge "dsp: enable VAD support on TDM interface" 2018-10-16 20:46:43 -07:00
Aniket Kumar Lata
1c9ae8ff76 dsp: Fix port media type sample rate for APTX AD
Send sample rate for port media type from APTX AD
config before AFE port start.

Change-Id: I3410428661ad4162539f437bb391c33a60ea1852
Signed-off-by: Aniket Kumar Lata <alata@codeaurora.org>
2018-10-15 10:56:21 -07:00
Mangesh Kunchamwar
bc81e3af17 dsp: enable VAD support on TDM interface
Send VAD configuration during TDM port start.

Change-Id: I30b45b066b2ca5fdf49cd74d87d95f75566661c9
Signed-off-by: Mangesh Kunchamwar <mangeshk@codeaurora.org>
2018-10-12 09:33:03 +05:30