Commit Graph

4471 Commits

Author SHA1 Message Date
Daniel Baluta 865f964b28 generic: dummy-dma: Remove commented code
This is a relict of an older implementation, remove it
to make code easier to read.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-23 21:13:28 +00:00
Daniel Baluta c35e1aa674 host: Fix compilation error with verbose traces enabled
src/audio/host.c: In function 'host_dma_cb':
src/audio/host.c:210:46: error: initialization of
'unsigned int' from 'const struct comp_driver *' makes integer from
pointer without a cast [-Werror=int-conversion]
  comp_cl_dbg(&comp_host, "host_dma_cb() %p", &comp_host);

This happens because our tracing system is limited to integer types
for parameters.

Fixes: a87b908505 ("trace: component: use err,info,dbg macros")
Suggested-by: Paul Olaru <paul.olaru@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-20 21:55:21 +00:00
Daniel Baluta 22de787f1f scripts: update sof_builder docker with imx8m support
Add imx8m cross compiler in sof_builder docker build file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-20 21:45:59 +00:00
Paul Olaru 135cace39a platform: imx: Add Kconfig option for i.MX EDMA driver
Not all i.MX platforms have EDMA for DMA controller. So make it a
Kconfig option.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2020-02-20 11:38:28 +00:00
Marcin Maka 247af133b8 comp: init back ptr to driver early in new
Back pointer must be initialized before any instance
level logging is performed by the new() operation since
the instance identification requires access to the uuid
that will be implemented on the component driver level.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 20:51:58 +00:00
Marcin Maka b1dd2a289d kpb: fix trace call
Missed drv pointer as the first parameter

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 20:51:58 +00:00
Marcin Maka 11de89f0f9 asrc: fix trace call
Missed drv pointer as the first parameter

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 20:51:58 +00:00
Mohana Datta Yelugoti 85a7e1883f include: ipc: control: Remove trailing whitespace
This patch fixes "ERROR: trailing whitespace" generated
by checkpatch.pl by removing trailing whitespace in the
file.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-02-19 21:18:03 +02:00
Mohana Datta Yelugoti bcf46c804d audio: eq_iir: Add missing blank line after declaration
This makes code easier to read and fixes checkpatch.pl
warning: "WARNING: Missing a blank line after
declarations".

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-02-19 21:18:03 +02:00
Mohana Datta Yelugoti 1e47e35e12 audio: eq_fir: Add missing blank line after declaration
This makes code easier to read and fixes checkpatch.pl
warning: "WARNING: Missing a blank line after
declarations"

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-02-19 21:18:03 +02:00
Mohana Datta Yelugoti 4e320b4c88 drivers: dw: dma: Add missing blank line after declaration
This makes code easier to read and fixes checkpatch.pl
warning: "WARNING: Missing a blank line after declarations".

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-02-19 21:18:03 +02:00
Marcin Maka 210f907ba2 comp: improve access to component properties
Static inline getters provides better control of use
component properties as L- and R-values.

They also make changes to the common component data defs
easier and transparent for clients (no code changes, just
recompilation required).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 14:22:11 +00:00
Marcin Maka 03aad19848 comp: remove unused macro from component.h
Incomplete and unused.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 14:22:11 +00:00
Marcin Maka df657886ac comp: move comp config ipc data size to common handler
This is unnecessary code duplication in each component
implementation.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 14:22:11 +00:00
Marcin Maka 8a7c0bac51 ipc: insert macro parameters around parentheses
To avoid side effects by operator precedence. It is even
recommended by checkpatch for dereferenced parameters but
not checked for referenced ones.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 14:22:11 +00:00
Marcin Maka cba8f59f03 comp: add comp config getter for ipc new component data
It enables common ipc config size verification to be performed at
the higher common level.

This getter (and its other existing form) should be reimplemented
when a new component base data structure, that includes both comp
and config is introduced and used in all components since this
would enforce the data layout in component data structure definitions.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 14:22:11 +00:00
Marcin Maka b29989b193 comp: remove incomplete duplicated memcpy of common data
Initialization data coming from ipc message is always copied by specific
component implementations since the component implementation is the only
one who knows the total size to be copied (comp + common config + specific
config).

This second copy operation not only overrides same data but is also
incomplete because ignores component specific configuration part and
what is more important (as the former may be optional) also ignores
another common part of data sof_ipc_comp_config.

This is a good example that implicit assumption of data layout, not
enforced by data structure definitions may cause issues.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-19 14:22:11 +00:00
Adrian Bonislawski 1b2a6ef02e probe-app: initial code
Probes will extract data for several probe points in one stream
 with extra headers. This app will read the resulting file,
 strip the headers and create wave files for each extracted buffer.

 Usage to parse data and create wave files: ./sof-probes -p data.bin

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-02-19 12:28:59 +00:00
Marcin Rajwa 53d35e4912 ut: add missing source file to build of KPB
This patch adds missing spinlock.c file to the build of
KPB component.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-02-17 20:25:38 +01:00
Bartosz Kokoszko de73e60a8c pipeline: improve parameter propagation within pipeline
Add additional recursive graph walk (in pipeline_comp_hw_params())
from DAI endpoint to other endpoints in order to set hardware DAI
parameters which were set during dai_set_config(). There is new
get_hw_params function in dai_driver ops in order to fetch hardware
dai parameters. Components could overwrite stream parameters due to
their processing capabilities.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko bdc95775af component: add generic comp_verify_params() function
Implements comp_verify_params() function, which can be used in order
to set and update some of sink (playback) or source (capture) buffer
parameters with pcm parameters. There is a possibility to specify
which of parameters won't be overwritten (e.g. SRC component should
not overwrite rate parameter, because it is able to change it).
Commit also adds macros to buffer.h, which can be used in order
to specify which parameter of source/sink buffer should not be
updated.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko 81c62cfbd4 buffer: add hw_params_configured flag to comp_buffer structure
Add hw_params_configured flag to comp_buffer structure. It indicates
whether hardware stream parameters were set.

This commit also implements buffer_set_params(),
buffer_reset_params() and audio_stream_set_params(). They can
be utilized in order to simply setting buffer parameters.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko 51e793ea0a comp: implement component_set_period_frames() function
This patch implements generic component_set_period_frames() function.
It can be utilized in order to set "frames" parameter in
comp_dev structure.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko 5e3edf8cd1 dai: changes whitespace alignment in dai ops
This commit changes white space alignment in dai
audio component.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko 55866f28ac comp: dai: implement dai_get_hw_params() function
Implement dai_get_hw_params() function for DAI
component in order to fetch hardware stream
parameters.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko 8453c0026a pipeline: add buf pointer in func arg in pipeline_for_each_comp()
Add calling buffer pointer in func argument in pipeline_for_each_comp()
function. It can be used for easy identification of buffer preceding
current component and allows to perform specific operations on that
buffer.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko 4f701966d6 component: add dai_get_hw_params() function to component ops
Add dai_get_hw_params() function to component ops (mandatory
 only for dai components) in order to fetch hardware dai stream
 parameters.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko cf820a7445 driver: dai: implement get_hw_params() for specific dai's
Implements get_hw_params() function for specific DAI's (SSP, HDA,
ALH etc.) in order to fetch hardware stream parameters (set in
ipc_dai_config()). In case the specific DAI is able to support
different formats (e.g. HDA - it is configured via dma_set_config()
in dai_params()) params are set to 0 to indicate that they can vary.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Bartosz Kokoszko b0ad9578a7 driver: dai: add get_hw_params() function to dai ops
Add generic get_hw_params() function in order to fetch
hardware dai parameters set during ipc_dai_config()
incovation.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-02-17 16:21:57 +00:00
Tomasz Lauda b206b7a8d6 ASRC: Fix stream parameters passing in params()
This patch updates the stream sample rate propagation to happen
via source or sink buffer. The params struct can no more be used
for that. Without this change the DAI component reports xrun and
the stream fails.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-16 22:26:55 +02:00
Marcin Maka 01a589581a hda: trace: switch to new trace macros
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka 8d72f5445e alh: trace: switch to new trace macros
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka 5f6e635c5e ssp: trace: switch to new trace macros
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka 59333211fd trace: dai: remove old trace macros
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka 317178f7ab dmic: trace: switch to new trace macros
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka 636bb32216 trace: dai: add err,info,dbg macros
New class and instance macro set for dai tracing defined.
Uses compact and well known suffixes: err,info,dbg.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka a87b908505 trace: component: use err,info,dbg macros
Both class and instance macro set switched to err,info,dbg
version.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka b93a879663 trace: pipeline: use err,info,dbg macros
Both class and instance macro set switched to err,info,dbg
version.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka 7b9f2d76c9 trace: add base macros for err,info,dbg levels
New macros use well known (also by checkpatch) trace
level names and map them to underlying trace_ implementation.

They can be used to define comp_err(), pipe_err(), etc.
derivatives with properly defined get_id_m(), get_subid_m().

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Marcin Maka b1fce53d72 trace: host: fix inconsistent trace deps
Depending on the header files include order some files
may not compile.

Note: trace header deps need a closer look and cleanup.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-02-14 16:37:46 +01:00
Tomasz Lauda 99df3ae2bf task: increase default stack size
Increases default stack size of EDF tasks.
It looks like some of the IPCs can exceed 2048 bytes of stack
and cause random data corruption. For sure it has been observed
when executing DAI config for DMIC.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-14 15:07:14 +00:00
Rander Wang e9fd746d70 Revert "topology: sof-icl-rt711-rt1308-rt715: refine dai index setting"
This reverts commit b90f4dd044.
The device id of rt715 and HDMI will be dynamic with this PR. This is
not friendly to UCM design. Let's deal with the id hole in machine
driver.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-02-14 14:28:14 +00:00
Amery Song 1fd1464b9d Topology: fix wrongly configured pipeline for sof-cml-rt5682-kwd.m4
Pipeline PCM0P and PCM0C in sof-cml-rt5682-kwd.m4 is wrongly
configured. This patch fix this error by removing redundent
'SSP' argument.

Signed-off-by: Amery Song <chao.song@intel.com>
2020-02-14 14:24:38 +00:00
Iulian Olaru e62ffe3f89 Math/trig: Adds spaces around arithmetic operator
This patch adds spaces around arithmetic operator to make code
easier to read and silence checkpatch script.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-02-14 11:06:26 +00:00
Marcin Rajwa 36d4c9f8f6 kpb: add new state
This adds new state KPB_STATE_INIT_DRAINING into
KPB internal states. This way we can see failed
init draining in logs. This new state is also
needed to change KPBs regular behavior in a
situation where we have initied draining task,
therefore calculated read position but the task
doesn't start before next pipeline_copy happens.
In this case, having this new state we can
recognize it and update read position
accordingly to new data.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-02-13 21:46:13 +00:00
Marcin Rajwa 5c1e8480d2 kpb: add wrong state log into kpb_buffer_data
This patch add a log message indicating wrong
state of KPB during buffering.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-02-13 21:46:13 +00:00
Iulian Olaru 4d17d0dee4 gdb: adds spaces around arithmetic operators
This patch adds spaces around arithmetic operators to make the code
easier to read and to silence checkpatch script.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-02-13 17:33:24 +02:00
Seppo Ingalsuo 7e88cc01f4 ASRC: Remove duplicate timestamp request
This patch removes the unnecessary duplicated function call by mistake.
The proper request is done a few lines above the deleted line.
Fortunately this did not cause any issues.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-02-12 16:53:24 +02:00
Iulian Olaru 0f43fcbbbf audio: Remove excess blank lines
This patch removes excess blank lines from "pipeline.c" and "switch.c"
to make the code easier to read and to silence checkpatch.pl script.

Signed-off-by: Iulian Olaru <iulianolaru249@yahoo.com>
2020-02-12 16:46:01 +02:00
Tomasz Lauda dd968a62ec ll_schedule: fix very rare race condition
Fixes very rare race condition, where one of the cores
finishes its tasks much earlier and is cancelled right away.
num_clients is already set to zero, so there's no need
to subtract.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-02-12 11:17:32 +00:00