Commit Graph

4983 Commits

Author SHA1 Message Date
Karol Trzcinski ab0c9e046d DMA: Fix fw panic after release on SdW platforms
Bug was caused because sdw controller is stopped first,
then DSP is stopped, so DW FIFO will never be consumed,
so timeout occurs, and watch dog will reset hardware.
Moreover polling for FIFO empty in duch a place should have positive
result only when pause take shorten than 1ms what is not
reasonable value.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 09:42:42 +01:00
Karol Trzcinski 75984ef562 cc_version: Improve string length check
In old method, when input string is to long by one char, then
complation pass what doesn't happen in new method.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 09:41:37 +01:00
Seppo Ingalsuo eab189fe69 ASRC: Fix memory allocation fail handling in prepare()
This patch fixes a minor issue when handling the fail to allocate a
samples buffer. The goto err_free_buf jumps to code "rfree(cd->buf);"
that would attempt free null pointer that is confusing and just
overhead. Only the successive operations of comp_set_state() and
returning -ENOMEM are needed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-21 09:39:22 +01:00
Keyon Jie 504ec438a9 topology: add sample platform .m4 file for smart amplifier usage
Add an example platform usage for smart amplifier feature, where it will
use nocodec SSP LBM(Looback Mode) for data verification.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 341286796e topology: add smart amplifier unified implementation
This is the unified implementation for smart amplifier feature,
including both playback and capture pipelines.

The upper layer platform topology should include this unified
implementation and define specific macros to use it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 864e7e8221 topology: add smart amplifier playback pipeline
Add the playback pipeline for smart amplifier use case, it will be used
with the reference capture pipeline together in the upper layer .m4
file.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 02fb00d628 topology: add amplifier reference capture pipeline
This is for smart amplifier use case only, to get the amplifier
reference samples captured to the host user space.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 3564b7dcdb topology: m4: add smart_amp component for smart amplifier usage
Add the initial version of smart_amp component for smart amplifier
widget, which will be use in the smart amplifier use case.

Todo: add blob kcontrol for it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 6569b345f5 Topology: utils: add Decimal to Hexadecimal converting macro
Add macro DEC2HEX marcro to convert 2-digit decimal number to
hexadecimal one that prefixed with '0x'.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Keyon Jie 79f97a6a0c Topology: utils: add macros to get format values
Add macros to get format values from strings.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-04-19 20:21:54 +01:00
Bard Liao aeaddf3af8 Topology: Add HDA config
We need to config HDA rate and channels.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2020-04-17 10:27:03 +01:00
Guennadi Liakhovetski 2bc79bfb74 ll-schedule: fix scheduling start on slave cores
When a task is first scheduled on a slave core the ll-scheduler fails
to enable the newly added slave core and the task misses its first
scheduling turn, it's started only after a re-scheduling takes place.
This leads to intermittent xrun events when starting tasks on slave
cores. Fix the condition to schedule slave cores immediately.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-17 10:06:13 +01:00
Pierre-Louis Bossart 0de9dfeeee topology: sof-apl-wm8804: add capture support
Add duplex capture - tested w/ HifiBerry Digi+

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-04-17 09:59:58 +01:00
Tomasz Lauda c57fe274fc component: fix comp_make_shared
Fixes comp_make_shared function by flushing data from cache
before accessing it using shared interface. Also additional
invalidation is no longer needed. It should be handled
automatically by platform_shared_get.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-17 09:21:52 +01:00
Tomasz Lauda 0cb5f35097 list: fix check in list_relink
Fixes check for empty list in list_relink.
list_is_empty(old_list) could be used, but it loads old_list
back into cache, which can lead to unpredictable data flush.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-17 09:21:52 +01:00
Karol Trzcinski b35af528b5 logger: per_cnt: Explicit cast arguments to uint32_t
Logger doesn't have possibility to directly send 64b arguments
to host, so this arguments should be explicit cast to shorten
data type.
Moreover after putting 64b value to va_arg list in function call
and reading it as 32b will lead to arguments misalignment with
formatting string.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-17 08:28:58 +01:00
Deepak R Varma 5f53bbe92d audio: mixer: re-indent multi-line function arguments
Reformat function arguments to align with the parenthesis as per coding
style guidelines. Change improves code readability. Problem
reported by checkpatch script.

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
2020-04-17 09:17:24 +03:00
Liam Girdwood e6e314eaf7 gitignore: zephyr: update gitignore for zephyr files.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Liam Girdwood de41202f8f zephyr: build: Add initial build support for SOF application.
Builds an initial Zephyr SOF audio module. This will be the starting
point for the porting work.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Liam Girdwood 36114685aa scripts: cmake: set command dir for git commands
The git commands to get version strings need to run in the SOF source
directory. This is not automatically set when building for Zephyr so
fix it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Liam Girdwood ff3ea5f1c1 zephyr: macros: manage macro redefinition between SOF and Zephyr
Some common macros are defined both in SOF and Zephyr. Temporarily undef
local copies if they are already defined in Zephyr. This will be removed
once Zephyr integration is complete as Zephyr copies will be used
directly.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Liam Girdwood 304c4b065f zephyr: lib: Zephjyr has it's own memcpy and memset
Use Zephyr memset and memcpy when using Zephyr as RTOS.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Liam Girdwood 7d1c8106d4 zephyr: cc: use C99 for headers that may be included into Zephyr
Zephyr is built using C99 configuration so we need to make sure that
headers that may be used by files being built into Zephyr also use C99.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Liam Girdwood 03bbec652b init: removed unused header
sof/drivers/interrupt.h not used so remove.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Bartosz Kokoszko 26733a3cf4 apl: change dmic format to s32_le in sof-glk-da7219.tplg
In order to allow record s16_le/s24_le/s32_le format this
commit changes DAI component's and DMIC's format to s32_le
on PCM99.
In case recording s16_le/s24_le DAI component makes pcm
conversion from s16_le/s24_le to s32_le.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-04-16 15:52:25 +01:00
Slawomir Blauciak e388ab5651 alh: fix incorrect trace message
The old trace message contained an SSP-specific string,
which is not correct for ALH.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-04-16 15:47:29 +01:00
Slawomir Blauciak d3ec9b5d21 hda: retrieve hda hardware params from ipc
This is an analogous change to what's been done for ALH DAIs.
Similarly, HDA is set up on the host side.

As a result, the firmware normally has no knowledge
of the hardware configuration, which leads to failures
in components, that may modify stream parameters, such as
(de)mux or asrc.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-04-16 15:47:29 +01:00
Yong Zhi 7aeb252264 WIP: topology: sof-jsl-da7219: Add KWD support
Add KWD pipelines with vol-kfpm pipe using intel-generic-dmic-kwd template.

DMIC01 on PCM 5 is renamed to DMIC48kHz, 16K DMIC KWD added on PCM 6.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-04-16 12:01:07 +01:00
Marc Herbert bf6d97c76a doxygen: subgroup dma_copy() to solve conflict with struct dma_copy {}
Name clash reported by sphinx/breathe:
 sof-docs/api/dma-drivers-api.rst:6: WARNING: Duplicate declaration, dma_copy

Before this commit:

- all "dma_copy" links in doxygen pointed to the struct, never to the
  function,
- there was no "dma_copy" link of any kind in sphinx.

With this commit:

- most "dma_copy" links in doxygen are disambiguited and fixed, see
  html/dma_8h_source.html for instance,
- there are dma_copy links to the struct in sphinx.

Once this is a merged, a commit in sof-docs will add the new subgroup
and re-add the function to sof-docs/api/dma-drivers-api.rst

Fixes: fa8abe145c ("core: dma: Add DMA copy API.")

Reference:
  http://www.doxygen.nl/manual/grouping.html

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-04-16 11:58:21 +01:00
Seppo Ingalsuo 80f6e0698f Tools: Test: Add objective quality tests for processing components
This patch adds an Octave test script process_test.m to audio processing
components like FIR and IIR EQ.

Parts of src_test.m are moved to common functions to ease printing of
test results matrix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Seppo Ingalsuo 594e031b6e Tools: Tune: Improve EQ blob decode scripts
This patch adds user friendly function eq_blob_plot(file) to
plot the IIR or FIR equalizer response that will be applied for
each channel.

The IIR and FIR decoders are modified to better support the higher
level script.

The copyright texts in impacted scripts are are updated to short
BSD-3-Clause style.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Seppo Ingalsuo 365ffbd02f Tools: Tune: Suppress sof-ctl text output when getting ABI header
This patch reduces amount of printed text to screen when Matlab/Octave
EQ tool needs configuration blob header information. The output is
redicted to /dev/null.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-16 11:48:22 +01:00
Mac Chiang 21b64c051f topology: add cml support with da7219 and max98357a
Reuse sof-glk-da7219-kwd by included cml.m4
for sof-cml-da7219-max98357a topology with KWD pipeline enabling

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2020-04-16 11:47:02 +01:00
Marcin Maka 32c9743fce buffer: trace: align id format in new
Format of id logged in comp_new aligned with other log entries.
Size logged to keep it visible while ipc trace moved to dbg level.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka 6ad4cf54df comp: trace: align id format in new
Format of id logged in comp_new aligned with other log entries.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka 91773bee34 pipeline: trace: log more parameters by basic operations
Aligns syntax of basic op traces with component traces
and logs more parameters in new.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka 46cd879989 ipc: trace: move verbose msgs to dbg level
All those messages are duplicated by target handler traces
which are sufficent on info level for verifying which
events/operations occurred.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka e444cf205b ipc: do not use incomplete msg data copies
Creating an incomplete copy of data in case where static size
is almost always smaller than actual size raises unnecessary
alarms and signals ABI uncompatibilities while everything is ok.

Using this incomplete copy locally for anything but tracing
some common parameters might be confusing while this copy
is useless for further processing by the actual target.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka 4cd1fa2033 ipc: comp_value: fix amount of data copied back
The size stored from incoming data header was used to
specify amount of data copied back to the mailbox.
While the header is copied from _data and contains
potentially modified size. In that case the header
and the buffer content would be inconsistent (basic
tests did not show any inconsistent reply fortunately).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka c5148e8966 ipc: trace: log message size at appropriate level
rx_size > tx->size where static size defined by FW is able
to accommodate the message is something usual and should not
add noise to INFO level.

tx->size > rx_size is something potentially dangerous since
the copy does not contain full data provided by the sender.
It should be logged at WARN level and addressed (cases where
partial copy is useful for anything are rather exceptional
and at this point it is not clear whether the original data
should be preserved and used or could be discarded as in case
where full data is safely copied).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Marcin Maka 2bed67e4be ipc: trace: define macro for warning level
Some IPC traces could be moved to warning level to pay
attention to them.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-16 10:17:32 +03:00
Mohana Datta Yelugoti 0fdfaed6f4 include: common: surround macro argument with parentheses
This commit fixes the warning generated by clang-tidy due to
bugprone macro parentheses. It is recommended to surround macro
arguments in the replacement list with parentheses. This ensures
that the argument value is calculated properly.

Name of the warning generated: bugprone-macro-parentheses

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-04-16 10:11:15 +03:00
Daniel Baluta d8899386b6 drivers: imx: sdma: Better isolate channel0
Channel 0 is special. It is used to run other channels. It allows
copying data and instruction to and from SDMA RAM.

For channel 0 there will no be DMA API calls. E.g sdma_start,
sdma_stop etc.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-15 22:37:24 +01:00
Daniel Baluta c377744cae drivers: imx: sdma: Set priority for channel 0
Channel 0 shouldn't be touched by DMA API functions.
Thus its priority needs to be set in sdma_init_c0.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-15 22:37:24 +01:00
Daniel Baluta 5b39ee1d3f drivers: imx: sdma: Introduce sdma_enable_channel
sdma_start shouldn't be used to enable channel 0. We will reserve
dma_ops to only work on data channels.

For now introduce sdma_enable_channel that will take care of
starting a channel.

Replace internal usage of sdma_start from sdma_run_c0 with
sdma_enable_channel.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-15 22:37:24 +01:00
Daniel Baluta 0a4a94f35c drivers: imx: sdma: Use shorter name for descriptor
s/descriptor/desc because makes lines shorter thus the code
cleaner and easier to read.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-15 22:37:24 +01:00
Daniel Baluta c0db6cae86 drivers: imx: sdma: Fix SDMA scripts offsets
These numbers are used for i.MX8MP and are in agrement
with Linux sdma driver.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-15 22:37:24 +01:00
Deepak R Varma 8df84ab56d audio: remove extra blank lines
Remove extra blank lines before and after curly braces. Problem
reported by checkpatch script.

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
2020-04-16 00:35:14 +03:00
Marcin Maka 7702288fd5 eq_fir: remove params handler, the default one is good enough
The code removed just called the default common handler,
which is now done by the infrastructure.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-15 14:55:54 +02:00
Marcin Maka bb95c04e7d volume: remove params handler, the default one is good enough
The code removed just called the default common handler,
which is now done by the infrastructure.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-15 14:55:54 +02:00