Payload size is not checked before payload access. Check it
to avoid out-of-boundary memory access.
Change-Id: Iaa39ee4ea5489bb5579e7b7d5dfada12d88c5809
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
Validate buffer index obtained from ADSP token before using it.
CRs-Fixed: 2372302
Change-Id: I5c3b1634bd08b516844638dd67f726a882edfc17
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Channel_mapping array size varies for different commands.
Add check for num_channels before calling q6asm_map_channels.
Change-Id: Iccbcfe82f716fc0ffe0a26b1779dcaa1c3cb805b
Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
APPS crashes randomly due to invalid memory allocation
in q6asm_audio_client_buf_free_contiguous.
Added check to return error if memory allocation size is 0.
Change-Id: I40f49aa147d513b29b56224a5ee77ccbb2dcc110
CRs-Fixed: 2285272
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
The ADSP asm session ids are managed by the kernel driver. It's all right
for native use cases. But for virtualization use cases, there's no way to
synchronize the session ids' status among virtual machines. Playing back
in one virtual machine is probably failed, because the session id may had
been occupied by a use case in another virtual machine.
The patch allowed audio capture stream and loopback stream to try all
available session ids in case of session id conflict error, to support
concurrent playback from multiple virtual machines.
Change-Id: I01b4da65f3e5716dd14c20c614b53f3c45dd9ea3
Signed-off-by: Erin Yan <xinyey@codeaurora.org>
During unmap of rtac block in ASM, mem_map_handle
address is set to zero instead of the value. Set the
map handle value to zero to avoid issue in freeing the
ion memory.
CRs-Fixed: 2254339
Change-Id: I6584be029d4c8dde235e722149c758df0db9916e
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
The ADSP asm session ids are managed by the kernel driver. It's all right
for native use cases. But for virtualization use cases, there's no way to
synchronize the session ids' status among virtual machines. Playing back
in one virtual machine is probably failed, because the session id may had
been occupied by a use case in another virtual machine.
The patch allowed audio playback stream to try all available session ids
in case of session id conflict error, to support concurrent playback from
multiple virtual machines.
Change-Id: If98d05898cec3f05d80c750ec8a014add3b1f34c
Signed-off-by: Han Lu <hanlu@codeaurora.org>
Expected buffer size to read is 2 bytes.
Corrected the size check to return error
when count is not 2.
Change-Id: I43b572d191f6f98a8a790b5ae77b43fabcd7329a
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
HLOS update ASM driver to support 32 channels playback
and capture since ADSP firmware has already support on this.
With this each MultiMedia Frontend would be able to support
32 channels playback and capture.
Signed-off-by: Cong Tang <congt@codeaurora.org>
Change-Id: Ie2ada37e612d0096cb623777f43aa9c05989058d
Check for debugfs ops buf size passed before reading
to eliminate the possibility of reading out of bounds.
Change-Id: I28fd60ce93256b6b0bad62b449092a891cc15463
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Add check for integer overflow of user
supplied data for ADSP stream command.
CRs-Fixed: 2173850
Change-Id: Ic70093e890b7a6dd07529d77d10fff003282a8ea
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
ac could get freed during the execution of q6asm_callback.
And kernel panic happens. Add spinlock to protect ac to avoid
kernel panic.
Change-Id: Ie49c8a3979231552ba7d5f207aab0d95ffdc2a72
Signed-off-by: Meng Wang <mwang@codeaurora.org>
Add support to set and get audio effects module params with
Instance ID support. Maintain support for non
Instance ID set and get param structures as well.
Use common pack and set param functions to set and
get parameters to DSP instead of handling them at an
individual module level.
CRs-Fixed: 2151551
Change-Id: I62342d434fc5bd58c06d22913683d7d0fd602da9
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Add support to set and get ASM module params with
Instance ID support. Maintain support for non
Instance ID set and get param structures as well.
Use common pack and set param functions to set and
get parameters to DSP instead of handling them at an
individual module level.
CRs_Fixed: 2151551
Change-Id: I48a0f0f856d8b8b59b7e7361fae63283e0f87948
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Add support to set and get rtac params with
Instance ID support. Maintain support for non
Instance ID set and get param structures as well.
Use common pack and set param functions to set and
get parameters to DSP instead of handling them at an
individual module level.
CRs-Fixed: 2151551
Change-Id: Ic07cb109b9e469dccf510f89ba9917e8c9eccbd8
Signed-off-by: Siena Richard <sienar@codeaurora.org>
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
Max ASM session upperbound condition is corrected to support
8 interactive plus a primary streams playback.
Change-Id: I5ec29c70941f52af020a64cc58bf10be52354f1b
Signed-off-by: Varun Balaraj <varunb@codeaurora.org>
Fix access of a dangling pointer by assigning it to NULL.
CRs-Fixed: 2096407
Change-Id: I22c1d55ea611ac59cdca51924787f6831bad8c2b
Signed-off-by: Aditya Bavanari <abavanar@codeaurora.org>
RTIC(runtime check) event ack command can execute asynchronously
along with other ASM commands. Using common cmd_state variable
to wake up the thread results synchronization issues. So use
no-wait command for RTIC event ack command.
Change-Id: Ie55ac6d50f83112e72de65c68340f7f7ba0923da
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Currently ion fd is used to extract ion handle to free ion client.
ION FD is not valid if user-space application is crashed so ion handle
is returned to the client during msm_audio_ion_phys_assign() API which
is used to destroy ion client in msm_audio_ion_phys_free() API.
Change-Id: Idcc4ca838741aac26662a679117af9d9c935e630
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Fix pan control gain param to accommodate Q28 format.
Convert 32bit gain to be inlined with 16bit mixer coefficients
of ADSP.
Change-Id: I85ebd11c49b4af982f34091937acabb9e6580e8f
Signed-off-by: Varun Balaraj <varunb@codeaurora.org>
Get the physical address of memory from ion FD and
assign it to ADSP for secure playback scenario.
Change-Id: I51019f5da6fb5fedefc81504b192f985b851ab12
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Continuous latency for pcm offload is incorrect as buffer offset
is not getting considered while pattern matching.
Fix this by considering buffer offset while calculating
continuous latency.
CRs-Fixed: 2059729
Change-Id: I943da364f99a4152119d34a98b343e6e1cbad5b8
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Add support for set params on ASM/ADM for MFC and
Volume modules. Make PSPD mitrix set param api generic.
Change-Id: I75a5b9e3fd2316b75be41439848f89190944bc36
Signed-off-by: Varun Balaraj <varunb@codeaurora.org>
SMMU sid is set to 0 in q6asm_set_shared_circ_buff and
q6asm_set_shared_pos_buff in 32 bit arch. Fix it to
send proper SID to ADSP when sharing buffer.
Change-Id: I00cc0f881acd7a4a52292e65360ea7b03f2f0212
Signed-off-by: Rohit Kumar <rohitkr@codeaurora.org>
Add DSP transcode loopback. Userspace can use this driver
to support TX to RX audio HW DSP loopback.
CRs-Fixed: 2049714
Change-Id: Ie83f5ca2c626c8fffbec4624f3e35c6c179d4c8c
Signed-off-by: Siddartha Shaik <sshaik@codeaurora.org>
In transcode loopback session open, ALSA to ASM format conversion is
incorrect. Update the format based on ASM defined formats.
CRs-Fixed: 2049714
Change-Id: Ie5ddb6a58a30b0d6b78bfc68cbbbcd3d92f28fb1
Signed-off-by: Siddartha Shaik <sshaik@codeaurora.org>
Transcode loopback api can be used by client to configure
compress loopback.
CRs-fixed: 2049714
Change-Id: I7286fbdfa89375d517f3dad7d04e1d2a360d6f7e
Signed-off-by: Siddartha Shaik <sshaik@codeaurora.org>
Add support for IEC61937 which is an audio packaging
standard used for compressed HDMI pass-through. Any
audio format can be sent through HDMI pass-through
formatted as IEC61937.
Change-Id: I09821add306e2aeae6530cecbac189471a55e589
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
APR deregister is to be called for two ports from both
q6asm_callback(during RESET) and q6asm_audio_client_free.
In race condition between the two, APR deregister is called
only for one port. The mismatch in apr register-deregister
count causes apr not to reset service after ssr, causing
APR communication failure.
Change-Id: Ibd0528215bf2fb986eda03ae0d683b2af31358fe
Signed-off-by: Ramprasad Katkam <katkam@codeaurora.org>
Add TrueHD format selection to ASM compressed
open and remove it from non-compressed open.
Change-Id: I94b61958e71d3a0d3aec2aa0206cf35698399d34
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
Add support to handle new ADSP ASM stream event APIs for
different applications.
Change-Id: Id1e7b9b2841449ceb70099722d834b51c198f04e
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Implement FIFO queue for multiple callback events. Events are
cleaned at stream close.
Change-Id: Id738326a20613d2f939e45204b2d46448a5b4759
Signed-off-by: Xiaojun Sang <xsang@codeaurora.org>
ASM driver changes to apply DSP clock recovery.
Clients can issue clock recovery command with a positive value
to advance the clock or a negative value to delay the clock.
CRs-Fixed: 2036899
Change-Id: If2f10368afafe203ebdea219edcc2227cd381801
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Eagle driver is not in use any more.
Remove the code and associated calls
to it.
CRs-Fixed: 1103106
Change-Id: Ice5333861beda9538f0783b70b3267523d16fd2b
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Add TrueHD audio format for compressed HDMI pass-through
Change-Id: Id8a0b8c3a01c881ae284f13c2c0a36959c2413ac
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
When ADSP subsystem restart is triggered, apr_reset is called
from the ASM callback function, which internally calls
apr_deregister. At the same time, user space will clean up
all existing audio sessions when ADSP SSR happens. To avoid
any race condition, make sure only the ASM callback function
is allowed to handle the APR deregistration process, while the
other (session close) skips the step.
CRs-fixed: 2022490
Change-Id: I0c395c19d177e66a03fbb4cee3dd4b34f84e2d10
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>