Currently lsm client driver doesn't reset app type configs at
the end of a session, which causes the previous lsm session's
acdb_dev_id to be cached and reused in the new lsm sessions.
Fix this by resetting app type configs at msm_lsm_close to set
acdb_dev_id to 0.
Change-Id: I2c51201291beb1d4baa4d57c0d5c1ef9777a85ed
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
Exposure of driver bind/unbind to userspace via sysfs may
lead to unexpected behavior.
Hide bind and unbind by driver attribute.
Change-Id: I20d6ee653bcc16af15d6368664aaf240c6645cd0
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
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>
Initialize started flag in open instead of prepare since reset
happens in close. This will also help stop already active LSM
sessions even if prepare was called in between.
Change-Id: Iad47f9459ceddefd582840313901d95d338e1147
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
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>
Buffering is not stopped during lsm close due to
which lab buffers can be queued during teardown of
session. This leads to read being issued even after session
close. Stop lab during close to avoid this. Use correct
return value to indicate errors during lsm start and stop.
Change-Id: I52fa33cebaa3ee6ae60eb2a60bb1e833f2a9d0d6
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
Error logging from set session data is not reflecting actual reason of failure.
Update error logging for this failure with correct info.
Change-Id: I5009a8b17128f0093e16f75c0e212a9bfb1f1a2e
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
snd_soc_platform_driver is removed in kernel-4.19.
Update snd_soc_platform_driver to snd_soc_component_driver.
Change-Id: I434b6fd173d1f4365a610d9164342d5d04d6c5bc
Signed-off-by: Meng Wang <mengw@codeaurora.org>
chmap in msm_lsm_check_and_set_lab_controls, data in
wcd9xxx_i2c_write_device and irq_level in wcd9xxx_irq_init
are Variable Length Array (VLA). VLAs are considered unfit
when it comes to security, performance, code quality and so
on. Hence, allocate the memory dynamically.
Change-Id: I52f33e61f857a00774eb26dc1d6372f2ed3d425c
Signed-off-by: Meng Wang <mengw@codeaurora.org>
Switch audio drivers to SPDX identifier on msm-4.19.
Change-Id: Ic3f0230a516db251b8d81e8a7e73dbc04d66fe1b
Signed-off-by: Meng Wang <mengw@codeaurora.org>
ADSP, userspace and LSM client driver, all these three layer are maintaining
independent buffers and rewrite them irrespective of the buffer being read
successfully by their client or not.
Before switching to real-time capture, history buffers cached can be returned
with minimal delay and may lead to overrun in a module if buffering in the
module is not sufficient to store all those data generated almost instantaneously.
LSM driver having buffer size smaller than history buffer duration is hitting
this issue and resulting in buffer overrun for even a small delay from userspace
in start of capture processing thread.
Prevent this issue by synchronising read and write in LSM driver to make
sure the driver waits for read from userspace before writing the same buffer again.
Change-Id: I2710b484a7ef03e8314c7ba05bf729893aecb890
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
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>
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>
With pre-processing applied, it is possible that the processed
number of channels could be different than the number of channels
that voice wakeup can run with. In such cases, the channel mixer
should be setup to downmix the channel. For voice wakeup to detect
keywords properly, preprocessed channels cannot be mixed hence
the channel mixer is always setup with unity co-efficients or 0
to either select or drop the channel. In this case the channel mixer
acts more like an channel selector.
Change-Id: I79b578b56ad5484e27f433404a5371540618a2ae
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
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>
Add __user attribute for msm_lsm_ioctl's input parameter
"*arg" to explicitly identify it as user space pointer.
Change-Id: I33e8a23cdef9eee9a55b77bb017716ccf2ba5f81
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
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>
IOCTL command "SNDRV_LSM_EVENT_STATUS_V3_32" in msm_lsm_ioctl_compat
has an incorrect error handling logic which can cause mutex deadlock.
Change this logic to avoid potential mutex deadlock.
Change-Id: I19b3509b5d40cff555536e4615132ea8c477d451
Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
snd_pcm_ops copy interface used by msm platform drivers is replaced
with copy_user in msm-4.14. Unit of two input variables is changed
from frame count to byte.
Update all the related msm platform drivers to adapt to this change.
Change-Id: Icecd0454c7a80e5ee90407c64aaf1ca76d2d9815
Signed-off-by: Meng Wang <mwang@codeaurora.org>
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>
Switch to DLKM for all audio kernel modules.
Change-Id: I6a96023a21f655f873531af9ace81f2b01eb0f58
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Propagate the changes based on latest snapshot
for audio kernel source tree at below cutoff of
kernel msm-4.9 -
(aed56b2df75 - "drm/msm/sde: update te vsync enable sequence change")
Change-Id: I7ed5102146986b81e5cb9ca55432360b3549b60c
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>