Commit Graph

5144 Commits

Author SHA1 Message Date
Shreeya Patel 729ab7e5f6 scripts: qemu-check.sh: Use getopts
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.

The script uses no options as of now, so current implementation just
exits if any option is provided.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:59:27 +01:00
Shreeya Patel 4f288b2c4d scripts: qemu-check.sh: Make PLATFORMS a proper array
"PLATFORMS" variable was used as an array while it is actually a string
used incorrectly making it work accidentally.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:59:27 +01:00
Shreeya Patel 38af37a843 .travis.yml: Fix incorrect usage of -j option
xtensa-build-all.sh expects number of cores to be used when -j option is
specified. By default, it uses all the cores available which is what we
want, hence, omitting the option altogether.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 6925c940ba scripts: xtensa-build-all.sh: Derive $ROOT from $HOST
Derive $ROOT from $HOST instead of explicit assignments.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 941dfcccb0 scripts: xtensa-build-all.sh: Use switch case
Use switch case for testing strings instead of if statements for each
case.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel d0cd2e0eac scripts: xtensa-build-all.sh: Ignore set -e the right way
Currently, "set -e" is being ignored for type command using redirections
and "A && true". "A && true" is a no-op and a peculiar case where
"set -e" ignores the exit code of A.

Exit code of the "type" command is used in an if statement which is
exactly what the function of "if" command is. Also, "set -e" ignores
exit codes of commands used in if statements.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 50d8646a64 scripts: xtensa-build-all.sh: Exit if unknown platform specified
Exits if an unknown platform is specified. Currently, there are no
warnings or errors.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel b0690f121b scripts: xtensa-build-all.sh: Use getopts
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 39d508b199 scripts: xtensa-build-all.sh: Make PLATFORMS a proper array
`PLATFORMS` variable was used as an array while it is actually a string
used incorrectly making it work accidentally.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Deepak R Varma 7801540dba sof: audio: free memory before returning in error
Memory allocated for new KPB component should be released before
returning NULL in when one of sampling width or number of channels or
sampling frequency are set to unexpected values.

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
2020-04-21 11:19:38 +01:00
Pan Xiuli 7d9ea989d7 topology: fix conflict PIPE_VOLUME_PLAYBACK defination
in bxt.m4 and sof-hda-generic.m4, they both define the
PIPE_VOLUME_PLAYBACK, this will cause wrong tplg result.

Refine the them in sof-hda-generic.m4 to PIPE_HEADSET_PLAYBACK
to fix the issue.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-21 10:58:42 +01:00
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