Commit Graph

5495 Commits

Author SHA1 Message Date
Karol Trzcinski f4bb9fe079 ipc: Extract pipeline id dereference from ipc_comp_dev structure
Mechanism of comparison pipe_id from ipc_comp_dev will be used in
trace filtering, so this part should be moved to separate function
and allow code reusability.
Moreover function usage is compact and descriptive method to define
what given block of code should do, so after such a refactor code
readability is improved.
Include from pipeline.h is removed to omit circular reference.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:43:54 +01:00
Karol Trzcinski cb10221109 logger: Rename float_precision to time_precision
New name better describes variable functionality.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:30:26 +01:00
Karol Trzcinski d97e9291e1 logger: Add possibility to hide timestamps
After removing timestamps it is possible to compare output logs
with tools like diff or similar. Moreover then output logs are
in more compact form.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:30:26 +01:00
Karol Trzcinski 4e867bcad4 dai: Rephrase misleading log from dai_config()
Structure X.Y is as usual used to describe pipeline and component
id, so usage of them in different context may be misleading.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:28:49 +01:00
Karol Trzcinski 99d7152a11 dai: Log number of frames in copy function
It easier to compare number of copied frames between dai and
process components than copied bytes.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-24 09:28:49 +01:00
Karol Trzcinski f69240a279 pipe: Trace with pipe component instead of class less method
Whenever it is possible, trace function with reference to pipe
component should be used instead of class less method. It allows
to print pipeline id in output logs and filter logs by this value.
In pipeline_new() moved trace context and ipc_pipe copy, to allow
tracing with context in earlier stages of this function.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-23 12:17:08 +01:00
Pan Xiuli 19c3ff9924 topology: fix wrong parameter for HDMI in sof-jsl-da7219
Remove the wrong one more 0 in the DAI config for HDMI.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-06-23 12:13:49 +01:00
Jaska Uimonen d76622a967 topology: fix dmic names (again)
We broke the upstream UCM configs by introducing pipeline id's to dmic
names. This differentiation is mandatory for reasons in alsaconf parsing
and ASoC layer combining the control names to pga's. However, the
differentiator can't be pipeline id as it can change depending on the
topology. So let Dmic0 have the old "Capture Volume" control name and
prefix Dmic1 control name with "2nd". This should not break the UCM's as
Dmic1 is not currently referenced.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-06-23 12:05:05 +01:00
Marc Herbert 81a416b75c .travis.yml: build ROM for "buildonly" platforms too
No obvious reason not to build ROM for "buildonly" platforms too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-23 12:03:15 +01:00
Adrian Bonislawski f4f7263b09 debug: disable stack rewind in exception
this will restore functional backtrace for exception dump because stack rewind
is not implemented correctly

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-23 12:58:47 +02:00
Adrian Bonislawski 5441b13cdc ipc: component free fix
This will allow to free component properly and stop using
already freed memory which can result in dsp panic if configured
with CONFIG_DEBUG_BLOCK_FREE

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-22 14:10:43 +01:00
Karol Trzcinski 806b7c3713 demux: Fix buffer lock in copy function
Sink buffer should be locked and invalidated (inside lock function)
before reading, to acheve consistent data between multiple cores.
Otherwise readed data may be outdated.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-22 13:10:32 +01:00
Marc Herbert ee8a0d8840 CMakeLists.txt: change generated config.h default to autoconfig.h
Change generated config.h default name to autoconfig.h to catch any
remaining #include config.h left in any other PR, branch or any other
concurrent work in progress unknown to this.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:01:26 +01:00
Marc Herbert 1002899b95 Use '-imacros config.h' instead of explicit #include <config.h>
Using -imacros on the compiler command line instead of explicitly
including config.h is not just less tedious in the future:
- it also makes sure configuration always comes first and is never
  accidentally missed by an earlier #include
- it makes sure all translation units get the (same) configuration
- it lets parent projects like Zephyr override the config.h name

To test this I ran ./scripts/xtensa-build-all.sh -a -r, compared
binaries before and after this change and found no output difference.

Full disclosure: this required a few unrelated tricks not submitted here
like a .tarball-version file, commenting out __DATE__ and __TIME__ in a
few places, running strip-determinism on the .a files because our
crosstool-ng reference is not cutting-edge, etc.

As Tigerlake is not built by default it required a couple more hacks to
compile.

Blank lines are left instead of the former #include lines so even debug
objects are the same.

Only defconfigs were tested. On the other hand, this commit was _not_
performed by a script but by changing the name of the generated file and
clicking on and fixing every build failure. This proves that every
removed #include was actually required by one or more tested defconfigs
and that the added -imacros flag does affect the compilation of all the
modified files.

There is no #include config.h left: they were all in use in at least
one _defconfig.

I think comparing all binaries produced by ./scripts/xtensa-build-all.sh
-r -a provides extensive enough coverage but note this was tested only
with the crosstool-ng toolchain described in the SOF documentation.

The obsolete[*] xt-xcc front-end is gcc-based and the newer xt-clang
front-end is (surprise) clang-based. clang (copies many gcc options and)
does support -imacros so I don't expect any issue with either xt-xcc or
xt-clang. In the worst case, I do not expect any compiler front end to
_silently_ discard any unknown command line flag nor to ignore a missing
or misnamed config.h file.

[*] https://github.com/zephyrproject-rtos/zephyr/issues/3165

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:01:26 +01:00
Marc Herbert d7d86cb609 CMakeLists.txt: make CONFIG_H_PATH a build parameter
No functional change for now.

This is needed because SOF is a CMake sub/"external" project when
building some host tools. We want to switch all projects to "-imacros
config.h" but subprojects cannot inform parents where their files are
located. So make parents able to dictate where config.h is instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:01:26 +01:00
Marc Herbert 4a87d8c967 xtensa-build-all.sh: add tgl with xtensa-cnl-elf. No rimage yet.
Copy the icl and cnl configurations.

This build with the gcc toolchain has NOT been tested on tgl. The
purpose is purely to add the gcc build to CI, avoid future gcc bitrot
and catch more warnings and bugs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:00:56 +01:00
Marc Herbert 6833c5d542 xtensa//cpu.c: give void _WindowOverflow4 a type, fixes -Werror
Fixes this -Werror on tgl platform:

.../xtensa/lib/cpu.c:65:38: error: taking address of expression of
  type 'void' [-Werror]
    void *dyn_vec_start_addr = (void *)(&_WindowOverflow4);

While "void foo;" is syntactically correct, doing anything with it is
illegal in standard C.  Only the tgl platform was affected because it's
the only one with CONFIG_NO_SLAVE_CORE_ROM right now.

Any C type works, I tried a few and when compiling with xtensa-cnl-elf
they all produce the exact same -g0 binaries than the original without
-Werror. I find that the uint8_t[] type doesn't make _WindowOverflow4
look too different from what it is: assembly code.

This is the only change required to compile with the xtensa-cnl-elf
crosstool-ng toolchain documented in the getting started guide.

Note the build with this xtensa-cnl-elf gcc toolchain has NOT been
tested!  The purpose of this commit is purely to add the gcc build to
CI, avoid future gcc bitrot and catch more warnings and bugs.

Fixes  #2516 / commit be083cf350 ("cpu: unpack dynamic vectors")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:00:56 +01:00
Janusz Jankowski 3d8a0ac809 chrome: config: enable LPRO for TGL
Set LPRO as default clock for power optimizations.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-06-18 16:47:20 +02:00
Karol Trzcinski 99f7ad112a ipc: pipe: Fix pipe id value in log message
`pipe` should refer to `pipeline_id`, using `comp_id` is misleading.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-18 12:11:13 +02:00
Adrian Bonislawski b6485b2fa4 arch: shared_vecbase cache fix
This will fix cache handling for shared_vecbase and allow to
boot slave cores in a proper way.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-18 12:09:25 +02:00
Bartosz Kokoszko f06da576cf smart_amp: add smart amplifier test component
Smart amplifier should be used in following topology:

                 +------------------------------------------+
     +------+    | +---+  +-------------+  +---+  +-------+ |
     | Host |----->|Buf|->|  Smart Amp  |->|Buf|->|SSP Dai|-----------+
     +------+    | +---+  +-------------+  +---+  +-------+ |         |
                 +-----------------^------------------------+         |
                                   |                                  |
                                 +---+                                |
				 |Buf|                                |
                                 +---+                                |
                                   ^                                  |
                 +-----------------|--------------------------+       |
     +------+    | +---+  +--------|------+  +---+  +-------+ |       |
     | Host |<-----|Buf|<-|     Demux     |<-|Buf|<-|SSP Dai|<--------+
     +------+    | +---+  +---------------+  +---+  +-------+ |
                 +--------------------------------------------+

Smart amplifier test component does not implement any specific processing
algorithm at the moment. I can pass chosen channels from source (buffer
between Host and Smart amplifier) or feedback (buffer between Smart
amplifier and Demux component) buffers. Those channels are selected by
sending proper config to this component. Smart amplifier can be
configured via SOF_SMART_AMP_CONFIG or SOF_SMART_AMP_MODEL data
(similarly as it happens in detector case).

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-17 11:33:23 +02:00
Bartosz Kokoszko 4d9244f080 detector: replace private data model functions with generic ones
This commit replaces private detector component functions with
generic ones in order to remove code duplication.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-17 11:33:23 +02:00
Bartosz Kokoszko a2d1e1efdc component: add set of helper functions for large config configuration
This commit rewrites functions responsible for large config configuration
from detect_test component and puts them in component.c file as
generic ones - as a result they can be used by other components.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-17 11:33:23 +02:00
Bartosz Kokoszko 4f1090d083 mux: select demux proc function based on source buffer
Demux should select proc func based on source buffer,
because sink can be not set yet (e.g. this can be observed
in Smart Amplifier topology scenario where we have
buffer between playback and capture pipeline).

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2020-06-16 15:01:16 +02:00
Janusz Jankowski 5257bd2dab cavs: timer: set logical_irq for arch timers
All timers should have logical_irq properly set up.
In case of arch timers logical_irq is equal to irq.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-06-16 10:19:37 +02:00
Marc Herbert e76ccbad59 scripts/xtensa-build-all.sh: clarify help of -c option
"Configure defconfig" misses the most important, interactive difference.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-16 09:04:05 +01:00
Marc Herbert 2afbbd0ef1 cmake/git-submodules: don't throw away work in progress at build time
- Add a simple test in cmake to download submodules only when rimage is
  missing. This stops randomly changing the source code from one build
  to the next and overwriting any submodule work in progress.

- Remove the GIT_SUBMODULE option which is now useless because rimage is
  not optional for sof

- Add a --merge option for safety. It makes zero difference right now
  but could save work in progress if we ever add more
  submodules (hopefully not) and someone struggles with submodules and
  ends up in a partially initialized state.

Git submodules are rarely ever the answer; these few changes make them a
bit more usable.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-15 21:23:30 +01:00
Karol Trzcinski a10b0ad27e ext_man: Port SOF_IPC_EXT_WINDOW to extended manifest
This information known at build time does not need to be
provided in a mailbox.
There was need to remove variable array from sof_ipc_window,
what give possibility to embed this struct inside another one,
but leads to ABI minor change.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-12 11:16:56 +01:00
Karol Trzcinski 8f318536ef ext_man: Add variables porting macro
Such a macro can be used to port .fw_ready structures to .fw_metadata
section with proper header.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-12 11:16:56 +01:00
Uday M Bhat 4d005a0554 topology: Add jsl+ MX98360a amp with ALC5682 Headset codec
Topology is modified to include another JSL+ product variant with
MX98360a AMP + ALC5682 Headset codec. Created a platform specific
for RT1015, included this and already existing MX98360a in
sof-jsl-rt5682.m4

Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
2020-06-12 11:00:28 +01:00
Daniel Baluta a8ec8bf8c6 .travis.yml: add IRC notifications
SOF has #sof dedicated channel on irc.freenode.net server.
This will enable travis ci to send notifications to the IRC
channel each time a build is finished (either successful or not).

We will see how this works and refine it later if it is too spammy.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-11 18:57:42 +01:00
Seppo Ingalsuo 700ca2ae9a Audio: Fix error trace for build specific limitation for FIR EQ
This patch fixes from errors trace a message where the length
parameter is always shown as zero:

ERROR Filter length 0 exceeds limitation for build.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-10 21:31:52 +01:00
Karol Trzcinski 34507f4f94 trace: Improve sof/trace/trace.h code formatting
Align escape characters in macros, use tabs instead of spaces
(when possible), use single tab indentation in tracec context
declaration.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 21:30:50 +01:00
Karol Trzcinski 0de401f074 trace: Remove unused structures
Unused parts of code only makes maintanace harder.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 21:30:50 +01:00
Karol Trzcinski bb7ba30f45 trace: Keep only single _DECLARE_LOG_ENTRY definition
This definition is unusefull in LIBRARY build.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 21:30:50 +01:00
Karol Trzcinski 256d02adc3 trace: Move _log_message definition to same place for FW and library
The same function implementation should be kept in same place or in
separate implementation files, to easily get which one is used under
what condition.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 21:30:50 +01:00
Karol Trzcinski cd4b08a48e trace: Add condition name near #endif and #else
It's quite easy to get lost when long, multi level #if/#endif are
used, pointing corresponding condition name near #else and #endif
helps to keep context during reading.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 21:30:50 +01:00
Yong Zhi 52c1174c18 topology: Add jsl+ tplg for RT1015 amp and ALC5682 Headset codec
The topology is cloned from sof-tgl-max98357a-rt5682.m4 with
changes on ssp config, iDisp and DMIC pipeline pcm number etc.

The dai_index matches the order defined in sof-rt5682.c machine driver.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2020-06-10 12:03:33 +01:00
Seppo Ingalsuo f269d0c732 Topology: Add ASRC capture pipe for WM8804 SPDIF input
This patch adds capture PCM with ASRC for capturing from SPDIF
input of WM8804 codec. This topology is used mainly for testing
of a bi-directional ASRC connected slave-DAI.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-10 12:01:02 +01:00
Seppo Ingalsuo 17f281de97 Audio: Improve volume gain ramp length accuracy
This patch replaces the fixed step increment/decrement linear ramp
update with a time since transition start calculated direct line point
value. It does not suffer from accumulated rounding errors.

The new ramp_coef[] vector (that replaced ramp_increment[]) defines
per channel the slope coefficient as Q16.16 units per millisecond. The
slope points calculation needs a new counter variable that counts
frames since ramp start. Also the volumes vector at time of ramp start
need to be stored. The old fixed increment calculation related macros
are removed.

The zero crossings timed volume mode suffered from fixed step the most
since depending on signal the fixed step could update the value too
much or too little.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-06-10 11:53:30 +01:00
Karol Trzcinski c419fadc3e trace: Filter messages in runtime
Ability to change log level per UUID component improve user
experience during debugging firmware. Threshold trace level
defined in log message with value from trace context, where
trece context is related with component instance (local or
global instance).

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 11:51:41 +01:00
Karol Trzcinski 568ed165a7 pcm_converter: Fix first output sample pointer calculation
Output sample size is unrelated wit input one. To calculate
write pointer address, correct value should be use.
Without this path, output data will be placed in wrong memory
area, what results in corrupted output stream when output offset
differ from zero.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-10 11:49:33 +01:00
Adrian Bonislawski bfcdee6c90 tgl: align to hardware recommended flow for clock change
This patch will update our clock change procedure to align
with hardware recommended flow for TGL platforms

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-10 11:46:48 +01:00
Adrian Bonislawski 6b8e67c41b cpu: use simple counter to validate core power down
This will prevent core power down if it is not allowed
and still in use

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-10 11:46:48 +01:00
Marc Herbert 7f0a59be29 README.md: fix Travis badge not to show the random PR of the moment
As discussed in PR #2964, the Travis badge shows the status of the
master branch but it links to the random PR of the moment. Fix that link
to point to the more useful "branches" page which has the master branch
at the top.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-10 10:56:24 +01:00
Tomasz Lauda 3a72e9e5d6 kconfig: remove cAVS menu
Removes cAVS menu and moves all platform specific things
to platform menu.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-10 10:40:02 +01:00
Mohana Datta Yelugoti b504367189 ipc: use macro instead of a magic number for timeout period
Currently, in the ipc_schedule_process function, when we call
schedule_task to schedule an ipc task, we use magic number to
indicate the time kernel waits before calling timeout on an
IPC. This makes it difficult to search for the timeout period
using grep and other utilities. Replacing it with a macro makes
it easier to search and change only at one place.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-06-09 20:25:26 +03:00
Marc Herbert 428804e1cb scripts/qemu-check.sh: add set -e
qemu always times out and fails, ignore that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00
Marc Herbert 454b2b1f43 scripts/qemu-check.sh: add find_qemu_extensa()
qemu-check.sh can now be invoked from more places: not just the qemu
directory but also from sof/ and from their parent.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00
Marc Herbert de8b043371 scripts/qemu-check.sh: unhardcode ../sof.git/
Find it with dirname "$0" instead. Can also be overridden with
SOF_BUILDS from now on.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00