Gráfico de commits

33 Commits

Autor SHA1 Mensagem Data
Xiaoyu Ye
18ab344528 lsm: add support for SVA multi sound model
Add support in audio drivers to support multiple sound models
to be registered individually to the same module within a single
instance in ADSP.

Change-Id: I7d1abb206c7505ed10f0384b8286d5000416e1be
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2020-06-03 19:52:11 -07:00
Vignesh Kulothungan
e0bdd11269 ASoC: update headers for upstream compliance
Update uapi header reference path to include
path prefix "audio/"

Change-Id: Ic7b1d22910b07be3ffe8d9f02514ed89facea974
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2020-05-06 11:26:15 -07:00
qctecmdr
5cf3663e4e Merge "dsp: Add spinlock to protect audio client" 2020-04-29 22:27:55 -07:00
Prasad Kumpatla
ed1116f0a6 dsp: Add spinlock to protect audio client
Add spinlock in callback func to avoid race condition
between session_free and q6lsm_callback.

Change-Id: Ic008bf17693a2c2217c8933c2e52a7965c249bda
Signed-off-by: Prasad Kumpatla <nkumpat@codeaurora.org>
2020-04-22 22:46:11 -07:00
Aditya Bavanari
bb77ffe0fe dsp: lsm: Change wake up latency for LAB module
In order to reduce the LPI memory consumption,
reduce the apps wake up latency from 250msec
to 40msec in LAB module config.

Change-Id: I5451e2b43b81ce7c6f8840f774b74e3cffc0a032
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2020-04-19 08:11:25 -07:00
Xiaoyu Ye
b58c0716e4 dsp: lsm: remove the size checking for sound model
Currently q6lsm driver only allows buffer to be allocated for
SVA sound model with size larger than 512 byte in function
q6lsm_snd_model_buf_alloc.This causes issue when a valid SVA
sound model is smaller than 512 byte. Since there is no
restriction in ADSP for sound model size, remove this size
checking to allow sound models with smaller size.

Change-Id: I716dc8c0e1a4e3189cd334ef692ff07f3e4635db
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-11-25 11:38:14 -08:00
qctecmdr
111c029686 Merge "dsp: lsm: move lsm_common deregister out of mutex_lock" 2019-10-23 05:00:17 -07:00
Meng Wang
a801ad8fd7 dsp: lsm: move lsm_common deregister out of mutex_lock
When dispatch_event in apr and q6lsm_client_free in q6lsm
are running concurrently, there may be deadlock between
session_lock in lsm and svc->m_lock in apr for lsm_common.
Move lsm_common mmap apr deregister out of mutex_lock to
avoid deadlock.

Change-Id: I7c96ba12834bd4a7c8e5ca1b78d798578678b251
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-10-14 20:22:41 -07:00
Xiaoyu Ye
56c0d0927d dsp: lsm: don't print physical address of invalid lsm client pointer
Function q6lsm_get_session_id_from_lsm_client will print out the
physical address of a lsm client pointer in error message when it
fails to find the matching lsm client. This is not needed because
the address information is redundant and might cause potential
issue when a lsm client is already invalid.

Change-Id: If8c38b566c839c4b45d98e79802d0fd6efb5bdb9
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-10-09 21:57:42 -07:00
qctecmdr
d598f6e9ad Merge "dsp: lsm: add apr NULL check in apr deregister" 2019-09-14 20:55:34 -07:00
qctecmdr
6f39bea44a Merge "dsp: lsm: check for mem_map_handle" 2019-09-12 03:57:02 -07:00
Meng Wang
c893cd2e0d dsp: lsm: add apr NULL check in apr deregister
During SSR, q6lsm_mmapcallback could happen before
q6lsm_mmap_apr_dereg. q6lsm_common.apr and
q6lsm_common.apr_users are cleared in q6lsm_mmapcallback.
Add apr NULL check in q6lsm_mmap_apr_dereg before accessing
q6lsm_common.apr_users.

Change-Id: Ia0ff57b3fff0a0e4f26b836a8a15324406af1a14
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-09-09 09:27:45 +08:00
Meng Wang
fae3404de2 dsp: lsm: check for mem_map_handle
Sometimes adsp may fail to allocate memory for SVA calibration
data and add check if mem_map_handle is assigned with valid
non-zero handle to avoid panic.

Change-Id: Icad722edc52906e63d581aafa02b42b8518ebca6
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-09-04 08:13:18 +08:00
Meng Wang
818d4e9b7f dsp: lsm: adjust mutex_lock to avoid deadlock
When dispatch_event in apr and q6lsm_client_free in q6lsm
are running concurrently, there may be deadlock between
session_lock in lsm and svc->m_lock in apr. Adjust session_lock
in q6lsm_client_free to avoid deadlock.

Change-Id: I26eb788d4c17af78272dd1f717717e865dfbd0ac
Signed-off-by: Meng Wang <mengw@codeaurora.org>
2019-08-30 15:44:49 +08:00
Xiaoyu Ye
845b66f42a asoc: msm-lsm-client: add support for shared buffer DAM module
A new module called DAM is introduced to achieve common shared
memory for SVA use cases in LPI. Add new mixer control interface
to provide support for STHAL to configure the data that LSM gets
from AFE to be either processed or unprocessed.

Change-Id: I8556413257c6a2aee4739bcd89ffd130805af0c5
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2019-05-10 09:42:27 -07:00
qctecmdr
a077609404 Merge "lsm: check payload size validity before using it as array index" 2019-04-16 07:59:20 -07:00
pavanc
8a81c4a868 dsp: lsm: Initialize lock and condition before apr_register
While allocating lsm client, lock and conditions are initialized
after registering session with APR. There is a possibility of
accessing uninitialized condition from q6lsm_callback when SSR
is triggerred after the port specific apr is registered.

Initialized lock, condition and state before registering session
with APR to avoid invalid access.

CRs-Fixed: 2230065
Change-Id: I48b6eb7670863c45b0539155592ea0b0a3c1bffc
Signed-off-by: pavanc <pavanc@codeaurora.org>
2019-04-15 02:53:09 -07:00
Kunlei Zhang
16e535969b lsm: check payload size validity before using it as array index
Payload size validity is not checked before using it in array index.
Check payload size to avoid out-of-boundary memory.

Change-Id: Ic0b06bb331fc1753ff7543bb218ab12d6a4a3ca8
Signed-off-by: Kunlei Zhang <kunleiz@codeaurora.org>
2019-04-14 20:21:24 -07: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
Vignesh Kulothungan
0fcf2af3df asoc: dsp: ipc: Reduce wait timeout to 1 second
Reduce the amount of time driver waits to get a response from ADSP.
Current wait time in some cases is 5 secconds, which might cause
user space crashes in Android P. So reducing the timeout to
1 second.

CRs-Fixed: 2318751
Change-Id: I6b6789aa5b408659dd57f8f6b017df52d14b28aa
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2019-01-02 16:04:27 +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
Laxminath Kasam
9c09cbdbb5 dsp: q6lsm: Avoid null pointer access in SSR
Synchronize both contexts of SSR and SVA close
to avoid access of client handle after free.
Check whether the client is valid or not when
retrieved from private data in q6lsm_callback along
with NULL check to avoid invalidated pointer access.

Change-Id: I51c13cd79fd947c624bf0cade4c93a3fdf07353e
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
2018-09-17 14:33:57 +05:30
Dhananjay Kumar
66ae4136f5 lsm: miscellaneous fixes for multi-stage adsp VA
Fix compilation warnings from multi-stage VA code changes.
Correct sound model param size value to avoid failure from
second stage sound model registration.

Change-Id: I7f589f0ddece167233b61236b3e5b6585927f62d
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
2018-07-07 01:36:05 +05:30
Dhananjay Kumar
ce6ec5fcf2 lsm: add support for ADSP multi stage VA
Enhance APIs to get instance id and stage info from userspace,
required for multi-stage Voice Activation in ADSP.

Change-Id: Ie39a3d002a56fb8df0c241089a50d55ef700a538
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
2018-06-27 23:39:17 +05:30
Bhalchandra Gajare
6ee5b50fd4 msm-lsm-client: decouple input and output hardware parameters
With multichannel voice activation support in LSM, it could be possible
that the input media format/hw_params to LSM would be different than
the output media format/hw_params. This change decouples the input
and output hw_params for LSM. The output hw_params are obtained through
ALSA pcm_hw_params operation, whereas the input hw_params are obtained
though the LSM_SET_INPUT_HW_PARAMS ioctl to LSM.

At the same time, the below parameter IDs are added to send the channel
information to LSM service:
	- LSM_PARAM_ID_MEDIA_FMT_V2
	- LSM_PARAM_ID_LAB_OUTPUT_CHANNEL_CONFIG

Change-Id: Ie53a087b0ec54e83c4eba93a0828f9bdd6cc147d
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2018-06-19 15:10:18 -07:00
Xiaoyu Ye
f0ec686d3b asoc: msm-lsm-client: add support for ADSP Generic Detection Event
ADSP detection engine module can raise Generic Detection Event to
provide variable payload data based on the information requested by
userspace. Adding new API/interface to provide support for Generic
Detection Event in LSM drivers.

Change-Id: Id5541f959ecdcf862dcfa1de1c1a1b3a796f260c
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2018-05-22 23:36:37 -07:00
Meng Wang
249b1f9bf1 ASoC: fix compilation warnings after enabling LLVM
After enabling compilation with LLVM for audio drivers,
some assignment warnings are reported. Add this change
to resolve the compilation warnings.

Change-Id: I571b2e210053bc0b80d65cd272ce1751e0ed10fb
Signed-off-by: Meng Wang <mwang@codeaurora.org>
2018-03-30 09:32:16 +08:00
Vignesh Kulothungan
a65e3010a2 ASoC: dsp: Update LSM driver to support Instance ID
Add support to set and get LSM module params with
Instance ID support. Maintain support for non
Instance ID set and get param structures as well.

CRs-Fixed: 2151551
Change-Id: Id9aa5ee89bab1a4e15ff1f7868bceb42d6c25d19
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
2018-03-03 15:14:56 -08:00
Banajit Goswami
08bb73698a dsp: update MSM Audio ION wrappers to align with upstream
Between Linux-4.9 and Linux-4.14, upstream has updated the
ION APIs significantly to make ION ready to bring out of
staging folder. This has changed the way ION and dma_buf
APIs used to work together for allocating, mapping and
deallocating ION buffers.
Update MSM Audio ION wrapper functions used by audio drivers
to reflect these ION API changes as per upstream ION.

Change-Id: I63097e147a397aa3a538f69ac88b6fb10871c3dc
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
2018-02-04 03:41:06 -08:00
Asish Bhattacharya
5faacb3a7e ASoC: allow drivers to compile both static and dynamic
Based on where the code is synced the driver should allow
both static and dynamic linked compilation.
Also remove __exit for modules loaded from another common
init/exit functions.

Change-Id: Ib58f152002aba3af4446f9bbd9b82c279212bd0a
Signed-off-by: Asish Bhattacharya <asishb@codeaurora.org>
2017-12-07 19:57:27 +05:30
Laxminath Kasam
8b1366a648 Audio: DLKM support for all audio modules
Switch to DLKM for all audio kernel modules.

Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-11-02 13:42:09 +05:30
Xiaoyu Ye
fb90eb6176 dsp: fix reset logic during ADSP SSR for lsm
During ADSP SSR, unless all APR clients are de-registered, Glink
channel will not be closed, which will cause Glink channel to remain
in stale/unusable state after ADSP SSR. Fix this by adding APR reset
logic in LSM driver.

Change-Id: Idec26836cfa4ecbacc557996339facd84ac19668
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
2017-10-15 18:04:50 -07:00
Laxminath Kasam
605b42f92c audio-lnx: Rename folders to new flat structure.
Kernel audio drivers can be categorised into below folders.
asoc - ALSA based drivers,
asoc/codecs - codec drivers,
ipc - APR IPC communication drivers,
dsp - DSP low level drivers/Audio ION/ADSP Loader,
dsp/codecs - Native encoders and decoders,
soc - SoC based drivers(pinctrl/regmap/soundwire)

Restructure drivers to above folder format.
Include directories also follow above format.

Change-Id: I8fa0857baaacd47db126fb5c1f1f5ed7e886dbc0
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2017-08-18 16:56:12 -06:00