Commit Graph

3424 Commits

Author SHA1 Message Date
Seppo Ingalsuo 4870332719 Topology: Updates for single EQ pipeline definitions
This patch provides needed maintenance. The pipelines
missed the volume ramp tokens and caused topology build fail for
topologies those would use the pipeline macros
pipe-eq-fir-volume-playback.m4 and pipe-eq-iir-volume-playback.m4.

The embedded filter coefficients in these pipelines were replaced
by included default FIR and IIR filter coefficients to fix ABI
incompatibility in the configuration blobs and ease future
maintenance of these pipelines.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-07-12 09:24:51 +02:00
Keyon Jie 09b416bb5a topology: sof-cml-rt5682-max98357a: switch to use kwd pipelines
Switch to use sof-cml-rt5682-kwd.m4 which can support Keyword Detect
feature.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-11 15:32:01 +02:00
Keyon Jie b56fcbc44a topology: sof-cml-rt5682-max98357a: change BE id to align with machine
driver

The BE id for amplifier pipeline should be changed to 6 to align with
machine driver (The commit ASoC: Intel: sof-rt5682: correct naming for
dmic16k).

Cc: Sathya Prakash M R <sathya.prakash.m.r@intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-11 15:32:01 +02:00
Keyon Jie d1ae32a322 topology: sof-cml-rt5682: refining for dmic16k pipeline
Add volume component, change to use 16KHz sample rate, and modify the
PCM ID from 5 to 8, as it is in lower priority comparing with pipelines
like amplifier.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-11 15:32:01 +02:00
Tomasz Lauda 4cbfd88731 platform: cpu: extract core defines to separate headers
Extracts DSP core defines to the separate platform headers.
It was partially done before for cAVS platforms.
It's a step forward towards full header cleanup.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-10 07:58:44 +02:00
Seppo Ingalsuo 34d0db94be Cmocka: Volume: Increase test coverage for S24_LE output format
This patch adds check for sample to not exceed S24_LE range that
could happen in int32_t type storage. The existing check for
abs(delta) > 1 does not cover such case if e.g. the reference
volume code would output e.g. INT24_MAX and the FW component
INT24_MAX + 1.

Similar check is added for every reference volume function that
outputs S24_LE format.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-07-09 15:15:15 +02:00
Janusz Jankowski 27cdfbdb40 m4: support for ssp bclk_delay token
BCLK delay is optional last value (after quirks),
in SSP_CONFIG_DATA.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-05 11:55:51 +02:00
Janusz Jankowski 098636c098 ssp: bclk delay parameter
Some codecs require BCLK to be on for some time,
before sending any data. It can be achieved with delay between
enabling BCLK and DMA that should be given in topology.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-05 11:55:51 +02:00
Keyon Jie 7e0d2661c7 pipeline: disable FW xrun recovery at the moment to rescue logs
Xrun recover failure will flush all over the memory window that we can't
get the log of the first error, let's disable it before the flag is
moved to kconfig and fw_ready IPC, to rescue logs and debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-05 11:37:44 +02:00
Keyon Jie 40c2b9e80c dw-dma: add more logs when get avail/free data fail
We should not get 0 size from dw_dma_avail_data_size() and
dw_dma_avail_data_size(), if that happened, something might be wrong,
e.g. the dma channel is not enabled, here logging out the channel
enabling status for debugging.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-05 11:37:44 +02:00
Keyon Jie fcd727678e detect-test: refine the detect function
We should use the absolute value for the activation comparing, and no
need to take extra handling to those samples with low enough level.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-04 07:43:34 +01:00
Keyon Jie d2e5c6a78a sof-ctl: split and move ctl_setup out of main()
Move ctl_elem pointers and buffer initialization out of main(), and
replace calling alloca APIs with malloc ones to make they are shareable
between different functions.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie d5f359c0f4 sof-ctl: add '-t' to support specifying the component type
Firmware may use different component specified type in abi header, to
support more than one kcontrols for the same component, here add '-t' to
support specifying this component specified type in the abi header.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie a29032420b sof-ctl: add labels to handle failure paths
Add labels in main() to handle kinds of failure cases, with the code
cleanup together.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie e86ba1dcbf sof-ctl: add '-o' support to dump ctl data to a specified file
Here add '-o' to support output control data to the specified file, in
binary format.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie cc717a539e sof-ctl: add separated function for control set/get
Add a separated function ctl_set_get() for tlv set/get, and call it from
main().

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 5de89ad8c1 sof-ctl: add functions for buffer allocate and free
Split buffer allocating and freeing part from main(), add separated
functions and call them from main().

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie f3bc979112 sof-ctl: add macros for buffer offsets
Add macros for offsets in the ctl_data buffer, and switch to use them.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie fe28746bba sof-ctl: add '-r' to support raw data mode
Using '-r' with '-s' means no abi header for the input file, and asks
for not dumping abi header when using '-r' without '-s'.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 0c2f1a6cdc sof-ctl: add header_init() for abi header initialization
This will be needed for raw data(without abi header) input file.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 89b4df8c6c sof-ctl: add support to dump kcontrol in binary mode
When specified with '-b', let's dump out kcontrol value in 16bit hex
format.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 32b1021080 sof-ctl: add '-b' mode to support binary format input file
Adding support to binary input file, using '-b' to indicate that.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 98794eef79 sof-ctl: add function to get file size
This will be used on large input file scenario, we need to allocate
buffer according to the input file size.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 985f49a786 sof-ctl: create functions for data dumping
We might dump kcontrol values in different format, create data_dump()
and csv_data_dump() for that.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 49c0f91a75 sof-ctl: allocate ctl_data struct and switch to use it
Allocate ctl_data struct, initialize it and switch to use it to replace
the local variables.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie efcda78053 sof-ctl: add ctl_data struct for params sharing between functions
Add a globle struct which will store params and be shared among
functions in the later commits, to make the code more readable.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie e5096aeb85 sof-ctl: fix a print out format
Adding '\n' after "hdr: type" output to make the header dumping more
easier to be read.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 15:29:59 +01:00
Keyon Jie 2762ada65e topology: cml-rt5682-kwd: change to use S24_LE format for CML
As dmic only support 16 bit or 32 bit, we configure dmic dai to be
s32_le, and pipelines to be s24_le.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 14:10:00 +02:00
Keyon Jie 6a9fc3c56e topology: kwd: add volume component after dmic
We need volume component after dmic for either volume change or format
converting, here add volume component between dmic and kpb.

And after this, our kwd can support all s16_le, s24_4le, and s32_le PCM
capabilities.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 14:10:00 +02:00
Jaska Uimonen 528c72baef host: resize host buffer for dma alignment
Depending on the topology, buffer size might not be multiple of dma
transfer size. So, round host buffer size up to nearest dma transfer
size multiple and possibly resize the host buffer.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-07-03 13:55:30 +02:00
Jaska Uimonen 7a857acdd7 buffer: add resize to buffer_set_size function
Add resize function to buffer_set_size. This is useful, because we might
have situations where external parameter like stream sample rate or dma
transfer size is not compatible with buffer size from topology. So this
allows to change the buffer bigger and also to free memory if less space
is needed.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-07-03 13:55:30 +02:00
Janusz Jankowski 084e7d6e79 test: add realloc stubs
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-03 13:55:30 +02:00
Jaska Uimonen 54c4076ee4 testbench: add realloc for host testbench
Add rbrealloc and rrealloc for host testbench.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-07-03 13:55:30 +02:00
Janusz Jankowski bac917330e ssp: add M/N divider
M/N divider is needed for getting BCLK rates,
that are not dividers of MCLK.
In such a case, FW will try to find set of M, N and SCR values
needed to achieve target BCLK.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-03 13:07:46 +02:00
Janusz Jankowski 5a92c4f370 ssp: SCR comment
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-07-03 13:07:46 +02:00
ArturX Kloniecki e52ed8d208 Mux: implement comp_reset function.
Mux component was lacking reset function implementation. This is to
address this issue.

Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
2019-07-03 12:40:21 +02:00
Keyon Jie 1e295a5d6a detect-test: initial default size buffer for model data
We need initial a default buffer for model data at component new()
stage, and make sure we have non-0 size of this buffer otherwise, the
get_data cmd will fail.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-07-03 10:21:17 +02:00
Tomasz Lauda 357e47c49c buffer: improve traces
Improves traces for comp_update_buffer_produce
and comp_update_buffer_consume functions. Now
we will be able to easy identify failing components.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-02 18:17:30 +02:00
Tomasz Lauda b4fc677c70 dw-dma: change behavior for preload
Changes behavior for DMA_COPY_PRELOAD flag.
DW-DMA should just start transfer the same way
as for DMA_COPY_ONE_SHOT. It fixes playback
for platforms using DW-DMA for host transfers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-02 15:15:27 +02:00
Tomasz Lauda 19efb46109 dw-dma: change release handling for non HW_LLI
Changes DW-DMA release handling for configurations
not using hardware linked list support. We should
not make any additional copies in such case.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-07-02 11:15:50 +02:00
Keyon Jie 2b0935798d detect-test: refine model data management
Add struct model_data to manage model related stuff.

For set_model, re-allocate buffer at the 1st IPC, calculate crc after the
last IPC is handled.

For get_model, output the crc value at the 1st IPC.

Todo: add crc32 value to the struct sof_ipc_ctrl_data may be the next
step, it will require ABI change.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-29 17:08:58 +01:00
Keyon Jie 25a4c5b0db detect-test: allocate model data memory at set_model stage
We are aligned to use separate IPC for set_config and set_model, so
don't allocate model buffer at set_config stage, but do that in the
first IPC for model blob config IPC sequences.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-06-29 17:08:58 +01:00
Tomasz Lauda 440cd55f60 pipeline: change preload conditions
Changes pipeline's preload conditions to take into
consideration the situation, where we don't always
want to do playback preload, because the sink part
of pipeline is already running e.g. mixer topology.
However the host component still needs to perform
preload on its own, so for now we make the decision
based on stream's direction.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-29 16:44:04 +01:00
Tomasz Lauda 4c59ef3b87 handler: set host copy to one shot
Sets host copy mode to one shot for platforms
with CONFIG_HOST_PTABLE set. Note: this setting
shouldn't be dependent on CONFIG_HOST_PTABLE,
but rather should be set in platform specific code.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Tomasz Lauda 4151d902b7 host: ignore host_trigger() for one shot copy mode
Ignores host_trigger(), when host component is
configured in one shot copy mode. In such mode
the DMA is started every time in copy and stopped
automatically.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Tomasz Lauda eefe72c925 component: add new COMP_COPY_ONE_SHOT type
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Tomasz Lauda 912158e1f4 component: make copy type extendable
Changes component's copy attribute from bool to
enum, which makes it extendable. Now we can add
additional copy types and implement each component's
functionality based on selected type.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-06-28 16:37:31 +02:00
Bartosz Kokoszko 12a563fce0 host: correct typo in host.c file
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-28 21:16:33 +07:00
Bartosz Kokoszko c9ffb30c12 dma-trace: make dma-trace using dma_get_attribute()
I've removed PLAFORM_HDA_BURST_SIZE define since it is the
same as HDA_DMA_COPY_ALIGNMENT. In trace functions we
can retrieve alignment by using dma_get_attribute()
dma function.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-28 21:16:33 +07:00
Bartosz Kokoszko fbc6277d9b hda-dma: move HDA_ALIGNMENT defines to hda-dma.c
HDA_DMA_ALIGNMENT and HDA_COPY_ALIGNMENT are not platform
specific. I've moved them from specific platform.h files to
hda-dma.c.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-06-28 21:16:33 +07:00