Codec specific metadata is sent only for first stream in gapless
playback. This causes incorrect configuration to be set for second
stream and distortions are observed due to framedrops in adsp.
Add support to send codec specific format during start of
next stream in gapless.
Add bit rate to wma codec data structure as it can vary between
streams in gapless.
Change-Id: I39f34ea1addff720612fe3e06257e7d75889e574
Signed-off-by: Chaithanya Krishna Bacharaju <chaithan@codeaurora.org>
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Conflicts:
sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c
Add delay_blk() to pcm, platform and DAI ops.
The pcm delay_blk() op collects the audio DSP path
delays from the low-level drivers and sets the
runtime->delay field to their aggregate.
Change-Id: Ib7e10f44ab8ccb46dc2f5825081d0afef662d827
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
This commit adds hwdep interface for codec calibration.
currently codec driver uses request_firmware to get calibration data
but as this firmware file is also written by userspace process after
bootup, it is not recommended to use request_firmware. ALSA core
provides mechanism to get hardware dependent data using hwdep nodes.
Codec will use aforementioned nodes to get calibration data from
userspace.
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
During soc_pcm_prepare, check for capture path for all
the codec_dais instead of the last codec_dai. This is
will help to set pcm start event for all the codec dais
that has capture_active set to high. Change checks for
all the codec_dais capture_active bit to set start stream
event.
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add an API to create a module under the given parent
directory and then register the info entry. This API
can be used to expose ID and version related
information.
Change-Id: I06f8bc1d8f649e6db37eb65303e948bc58eab7da
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Currenlty HW params fails to set 384KHz sample rate
due to unsupported sample rate. Change to add 384KHz
sample rate support to ALSA.
Change-Id: I381f7cdcc69e6cf9339cec53aab3fa295760c17c
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
Add soundwire bus support to regmap. This change enables
codec drivers using soundwire hardware interface to use
regmap interface for register read/write functionality.
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Currently, metadata such as min/max block size is sent only for first
stream in FLAC gapless playback. This causes incorrect configuration
and, subsequently, framedrops in decoding of second stream and onwards
By sending these additional flac metadata, dsp receives stream-wise
metadata and decodes without dropping
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Add support for compressed bitstream passthrough over HDMI
for DD/DDP contents. Use compressed driver to support
passthrough.
Change-Id: I01f9e4fa984a1f45d1f4de5250bed8f95d2a2dd0
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
With this patch soundwire drivers can use id_table and
MODULE_DEVICE_TABLE() method to bind against the devices just
like I2C or SPI drivers.
Change-Id: I4e8eee3cb9626a5dc4fbfa238b5d2a578355f2a3
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
- mixer_ctl_set() function is limiting the volume level
to particular range. This results in incorrect initial
volume setting for that device.
- In USB mixer while calculating the dBmin/dBmax values
resolution factor is hardcoded to 256 which results in
populating the wrong values for dBmin/dBmax.
- Fix is to use appropriate resolution factor while
calculating the dBmin/dBmax values.
CRs-Fixed: 515012
Change-Id: I502355af66f850bb65380c27333c3341fa43a947
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>
kzalloc() and usb_ifnum_to_if() both APIs can return NULL. Current
code is not checking return value and derefencing which may crash
device if it is set to NULL. Fix this by checking return value
against NULL and handling the same.
CRs-Fixed: 562273
Change-Id: I0d2c910f43321e94fc447b19ae3e3207727e24f3
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Having sound card offline condition checks inside
register read/write functions will also avoid Asoc
cache writes. However, it is needed to update the
Asoc cache whenever user-space sends disable sequence
while sound card is in offline state. Remove the offline
check condition from ASoC read/writes and let the codec
driver take care of not sending bus read/writes if sound
card is in offline state.
Change-Id: I960b85a277a28dd05eb919c1c6abf7aa32a45265
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Codec should be started before the CPU to ensure that there is no data
loss during playback.Current sequence enables the CPU first followed by
codec.This change updates the sequence prevent any playback data loss.
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
PAGE_SIZE buffer is not enough in all use cases.This
limits the amount of buffer that can be passed from
userspace. Not increasing this causes failure in pcm_native
when rules are checked against all hw_params passed
from userspace.
Change-Id: Iddc280f78d54a1959be8718055bdb5ef0270653c
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
Fixup callback is added for dai's which
do not follow the FE and BE convention
and is directly controlled by userspace
such as hostless dai's. This will restrict
the hw_params based on what is supported by
hardware rather than blindly setting what
is given by userspace.
Change-Id: I401c70ab5de1df10363ec808cb68f72d8d74af96
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
dapm_kcontrol_get_wlist() function needs to be called from
driver other than the soc-dapm.c file itself. Mark this
function as global function, so it can be accessed from
other drivers.
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Propagate the error code from the compress framework for the timestamp
query. This error code will be used by the client to handle the
error case scenarios gracefully.
CRs-Fixed: 683288
Change-Id: I68ad14d52327dd0156531fe8d17ac54ba110fdf6
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Clean up the format specifiers for compress offload drivers
and add compat ioctl support
Change-Id: I0829830336ec62c66658d6a5199d73b61249f791
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Since we dont have lock over the function, we need to acquire mutex
when checking and modifying states in drain and partial_drain handlers
Change-Id: I3f8af90a226b772492fb6e09c625ebedc8ebfeb5
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Eric Laurent <elaurent@google.com>
Git-commit: bab68b886fb87ee82a3e7d86d54f7eaa025950ef
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Revert some changes for compress offload path to avoid race
condition in drain and paartial-drain cases.
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Some simple ioctls like timsetamp query, capabities query can be done anytime
and should not be under the stream lock. Move these to
snd_compress_simple_iotcls() which is invoked without lock held.
While at it, improve readblity a bit by sprinkling some empty lines.
Change-Id: Icc8ffdadd565c635f6a95e7e5bdda76257f24ea3
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Eric Laurent <elaurent@google.com>
Git-commit: 6a44374b8b92e9946dc1e5c15c2a11003aa859b1
Git-repo: https://android.googlesource.com/kernel/msm
[dhakumar@codeaurora.org: resolved merge conflicts]
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
We are not currently freeing the compressed devices at module
unload time. This could be used to help, but more investigation
needs to be done to resolve this issue.
This patch is WIP
Change-Id: I6cf8bcc56e4d446d83e9a0e63b79db3da378a901
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Git-commit: b2ebfd20ecb255b8e575ea8b6fad8d1affc2ea77
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
snd_compr_tstamp is initialized using aggregate initialization
that does not zero out the padded bytes. Initialize timestamp
structure to zero using memset to avoid this.
CRs-Fixed: 568717
Change-Id: I7a7d188705161f06201f1a1f2945bb6acd633d5d
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
If a write done event is received when the compress driver
is in paused state, treat it as an underrun.
Change-Id: I56ca867983b9139c04d135276da7344ac912065e
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Eric Laurent <elaurent@google.com>
Git-commit: 6b9c3272087127fda41ed65ee7f8536ad9748383
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Compress driver might have to deal with arbitrary sized writes
in the middle of playback. To deal with it, accumulate fragment_size worth
data before sending to the DSP. Use the drain trigger to push any
pending buffer to the DSP.
Change-Id: I8d95a9945076142f16adb99a295f6a9e84039cbb
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Eric Laurent <elaurent@google.com>
Git-commit: 6ac9bb553c1285266b2ac28800abec240cd76e17
Git-repo: https://android.googlesource.com/kernel/msm
[dhakumar@codeaurora.org: resolved merge conflicts]
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Compress offload playback for AAC requires media format block to be
sent to the DSP before the bitstream can be decoded. Send this
as part of configuring the DSP
Change-Id: Ia22bc52aa0c136a1ee3f70a1e150458f8e4b6866
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Eric Laurent <elaurent@google.com>
Git-commit: ed16e26a99b2b7904d0badae4bd0d30953873b9e
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Add missing synchronization between handling of flush and
drain in the compressed audio driver.
Change-Id: I01b6d2c4fb372be483022d1c3430b9369dea34f7
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Change condition to skip request for session time from DSP
during compress offload.
Change-Id: I0192b1f4059f09a32b8848c40e91eecf3dadf966
Signed-off-by: Haynes Mathew George <hgeorge@codeaurora.org>
Signed-off-by: Eric Laurent <elaurent@google.com>
Git-commit: b31efc7e185f453da00cedbbad5b59c23560dcde
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Pointer member variables in snd_codec params break bit alignment and
causes data corruption. By changing these pointers to fixed size
array variables, the bit alignment is rectified. The size has been
set to max possible size. Also, remove params which are not required
anymore.
Change-Id: Ib87bbeb07b0df1ce8a81166b319976fe54c0f013
Signed-off-by: Amit Shekhar <ashekhar@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Kernel 3.10 has cpu dai widgets in the list of card
widgets in addition to platform and codec widgets.
This is causing a delay in device switch because
cpu dai widgets increase the number of widgets to be
processed for bias changes by a factor of five, however
they are not required to be processed.
Skip processing of cpu dai widgets to keep
the device switch latency at same level as in kernel 3.4.
CRs-fixed: 699168
Change-Id: I2d7d9e34dabf2cd25ec5fdd3e58be0fc657c0f6c
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
This gerrit reverts the gerrit with the commit number-
b8bab04829
Now that we don't use SNDRV_PCM_RATE_xxx bit fields for sample rate, we need to
change the description to an array for describing the sample rates supported by
the sink/source
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Increase the Input device SW ID from 15 to 32. This is needed
to accomodate more input devices.
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
There is use case that the HDMI input goes through MI2S
TX interface to ADSP. Add compressed TX support for
this use case.
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
WMA V9 and WMA Pro tunnel-mode supports are added to
compressed driver. It allows user-space application to
decode WMA V9 and WMA Pro audio stream through QDSP6.
Change-Id: I99407d00b618a627e6d762be9abea4abd2410b8b
Signed-off-by: Manish Dewangan <manish@codeaurora.org>
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Add timestamp field to compress structure which indicates when
audio sample has been captured or needs to be rendered.
Change-Id: Ie61170c6645c71207e7df1c7176e0750e47590f8
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Dolby surround1-DS1 module supports both Dolby Audio processing - post
processing and Dolby digital plus decoder in DSP. Add support for
AC3 and EC3 playback in tunnel mode so that DS1 is integrated and
functional end to end.
Change-Id: Iacb46cdfded16c9a5a9227a6ff4e072c61df2be8
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Set the output path of the decoder output of the compressed format
to input of the pseudo port.
Output of the pseudo port is connected to the input of
DTS encoder.
Output of the DTS encoder is connected to the selected
output ports SPDIF, HDMI.
Change-Id: I3945e53fdfd57de47fb2209ddc81ba4623999028
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
- Added DTS_LBR for Passthrough case in Compress Driver
- Added Graceful Error Handling for Unsupported Codec
IDs in case of open_write_compressed.
Change-Id: Ifbecb02832a2599be0e3c73cc69381f87969d78a
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Support the MP2 as a format for the tunnel mode.
MP2 format to be decoded in the DSP.
Change-Id: I0d268a6ddb57b1470ee2c43449ac31520176232f
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
In the use case of HDMI input PCM capture, timestamp received from
DSP is required in userspace to propogate it on the playback path.
Timestamp mode propagation is availble through the meta data mode
in compressed driver. Add support for PCM capture in compressed
driver to address the usecase
Change-Id: I1221b8e99628dadc136df681619ed960ff7c5c1a
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
There is a usecase where compressed data is sent over HDMI IN to
ADSP. The format of compressed is detected in ADSP and sent through
the meta data to compressed driver. Add support for meta data in
compressed TX for this use case.
Change-Id: Idbb18fe4a0ad828e9c2e9d7beec048b3cedf002d
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>