Commit Graph

6292 Commits

Author SHA1 Message Date
Marc Herbert f57de5957c cmake: print some error messages when XTENSA_TOOLS_ROOT is wrong
Notably: xt-xcc --show-config failed with: No such file or directory

... when the directory exists but is wrong.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-08 12:05:08 +00:00
Adrian Bonislawski 592e79403e clk: do not release clock only for LPRO->HPRO transition
This will allow to switch to HPRO much faster when needed in s0

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2021-03-08 08:47:07 +01:00
Marc Herbert f59bb62e31 .github: add shallow checkpatch to Github Actions
Let's try to run checkpatch in an open-source and fast way while
leveraging Github's very good user interface.

Run checkpatch both with and without --strict; this has been a source of
confusion in the past, see
https://github.com/thesofproject/linux/pull/1988

Note this attempt does not rely on git merge-bases which has been found
to be not compatible with shallow cloning:
https://github.com/thesofproject/linux/issues/2556

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-05 11:44:34 +00:00
Marc Herbert 907f8691c2 installer: TOOLCHAIN default value depends on XTENSA_TOOLS_ROOT
XTENSA_TOOLS_ROOT is required by xtensa-build-all.sh anyway, so don't
force the user to say twice that they want xcc.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-05 11:42:36 +00:00
Marc Herbert 6468490d8d xtensa-build-all.sh: show supported XtensaTools installation in usage
Add this to the -h usage message:

This script supports XtensaTools but only when installed in a specific
directory structure, example:

myXtensa/
└── install/
    ├── builds/
    │   ├── RD-2012.5-linux/
    │   │   └── Intel_HiFiEP/
    │   └── RG-2017.8-linux/
    │       ├── LX4_langwell_audio_17_8/
    │       └── X4H3I16w2D48w3a_2017_8/
    └── tools/
        ├── RD-2012.5-linux/
        │   └── XtensaTools/
        └── RG-2017.8-linux/
            └── XtensaTools/

$ XTENSA_TOOLS_ROOT=/path/to/myXtensa ./scripts/xtensa-build-all.sh ...

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-05 11:41:35 +00:00
Marc Herbert 5b34b81cb1 xtensa-buid-all.sh: prepends $OVERRIDE_CONFIG with $SOF_TOP
commit e31afb3651 ("xtensa-build-all.sh: make it runnable from
anywhere") missed this.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-05 11:37:11 +00:00
Ranjani Sridharan 160886bc6f topology: add new token for dynamic pipelines
Add a new token in scheduler tokens to flag a pipeline
as dynamic. Modify the DAI_ADD ans PIPLINE_PCM_ADD macros
to indicate if the pipeline should be dynamic or now. It is
also possible to make all pipelines in a topology dynamic
by defining the macro DYNAMIC during build.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-03-05 11:26:43 +00:00
Marc Herbert 25fc45143b installer: disable incremental builds with XCC due to $XTENSA_SYSTEM
In the future we should probably extract the array of XTENSA_SYSTEM
values out of xtensa-build-all.sh

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-04 22:07:48 +00:00
Seppo Ingalsuo 6807ebce29 Topology: Add missing include() to pipe-eq-iir-volume-capture-16khz.m4
This patch adds the include of mixercontrol.m4. The topologies build
fails if none of the earlier parsed pipelines contains the same
include.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-03-04 22:01:03 +00:00
Seppo Ingalsuo b872c170a3 Topology: Fix re-define of DMICPROC in sof-hda-generic.m4
The mistake in the topology macro causes overwrite DMICPROC with
volume if HSPROC is not defined. This patch fixes the macro line
to handle properly HSPROC.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-03-04 22:01:03 +00:00
Paul Olaru 26223f0213 kconfig: imx: Disable HIFI3 optimized conversion
With this kconfig option set to y SOF does not build on i.MX platforms,
so we disable this optimized conversion.

The warning below is treated as an error.

sof/src/audio/pcm_converter/pcm_converter_hifi3.c: In function ‘pcm_convert_f_to_s16_lin’:
sof/src/audio/pcm_converter/pcm_converter_hifi3.c:681: warning: implicit declaration of function ‘XT_ROUND_S’

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2021-03-04 20:34:17 +02:00
Paul Olaru cc5e1d0468 scripts: xtensa-build-all: imx: Fixup Xtensa compiler
There is no such compiler as RF-2017.8 that is in use. The correct
compiler is RG-2017.8 for all i.MX platforms.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2021-03-04 19:04:05 +02:00
Daniel Baluta 2b10b49a8e codec_adapter: cadence: Fix API func search
Existing code returns every time the API function at index 0, which works
now because we support only a single API function. But, this will break
when patches adding multiple Cadence codec types will be merged.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-03-04 15:36:17 +02:00
Jaska Uimonen 7712d96a18 host: fix buffer size alignment
In buffer_size calculation period_bytes should be aligned with dma
before multiplying with period_count. This is an issue for example when
period_bytes could be smaller than the dma alignment size like with 8khz
16 bit mono stream.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-03-03 22:42:02 +00:00
Marc Herbert 288e228c67 cmake: generate the complete .config at configuration time.
Add cmake -DINIT_CONFIG= option that can point at any initial file.

"make clean" does not delete .config any more.

Note reconfiguration does NOT causes recompilation because -imacros
hides the generated .h from CMake's dependency scan. This is not a
regression, that problems exists since -imacros was introduced. At least
it's now possible to "make clean" and rebuild without losing the .config
file.

Fix for #3617

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-03 22:33:53 +00:00
Marc Herbert 453c686fd1 installer/README.md: no need to build manually anymore
Doc update missing from the most recent pull request.

Also warn against `make -jN stage rsync`

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-03 22:28:37 +00:00
Ranjani Sridharan 6d67a9dce9 ipc: fix logic for buffer free
A buffer should be prevented from being freed only
if both the sink and the source widgets are active.
In the case of dynamic pipeline loading, a buffer
belonging to a pipeline will need to freed when that
pipeline is no longer active but the other end of the
buffer might still be active. So, change the logic
to check if both the sink and source widget states
are invalid to prevent the buffer from being freed.
Also make sure that the buffer is disconnected from the
active comp before it is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-03-03 22:27:23 +00:00
Oleksandr Strelchenko f7d0d89f9e fix norm_int32 implementation
New implementation does not rely on left shift of signed value and
has no code duplication. Output is the same as original.
found by cppcheck

Signed-off-by: Oleksandr Strelchenko <oleksandr.strelchenko@waves.com>
2021-03-02 13:09:46 -08:00
Keyon Jie ebe28dd06b cavs: clk: do TGL specific HW recommended flow unconditionally
We need to follow TGL specific HW recommended flow to get/put
PM_RUNTIME_DSP, even for not release_unused clocks requirement.

This will address the PM_GATE IPC failure issue:
https://github.com/thesofproject/sof/issues/3823

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-03-02 10:30:03 +08:00
Pin-chih Lin bdb9af48d8 sof: drc: sat_int32 after left-shift to avoid overflow
Q_SHIFT_LEFT doesn't check overflow itself. We should do saturation
after left shifts to avoid erroreous value after left shifts.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-03-01 10:28:32 -08:00
Daniel Baluta f20b3ee1ef codec_adapter: Bail out only on fatal errors
When setting parameters some API calls might not be fatal, so there
is no need to fail the apply config phase in this case.

For example, in case of Cadence MP3 codec the only supported PCM
output word size is 16 and 24. Trying to set a PCM word size of 32
will result in a non-fatal error and the word size would be adjusted to
24.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-03-01 11:42:26 +02:00
Daniel Baluta a0ed3e4ba9 tools: topology: Fix runtime controlbytes name
This was a copy paste error in the initial commit.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-03-01 11:13:43 +02:00
Keyon Jie 109148d9c7 Kconfig: update the description of SYSTICK_PERIOD
The SYSTICK_PERIOD is used for system agent only now, remove the
schedule part from the description.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Keyon Jie 53b2d08c6f ll_schedule: reschedule logic refining
Reschedule once interrupt is handled by all cores(clients) according to
the earlist task of the list, and enable interrupt on cores that have
tasks to run.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Keyon Jie caf3e19a28 ll_schedule: _tasks_run() refining
At interrupt handling & tasks_run(): run each pending task of the core,
e.g. for period tasks:
previously: update task->start based on last_tick(asynchronized), if the
last_tick was delayed, the delay will be accumulated to the subsequent
periods!
new: update task->start based on last task->start, to try to make the
task's running follow the pipeline requirement as more as possible.

Add lock/unlock for domain accessing and updating while keep task can
run simultaneously on multiple cores.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Keyon Jie 9b5ef7703c ll_schedule: refine the _domain_set/clear() logic
Refine and simplify the domain_set/clear() part:

1. Use UINT64_MAX to denote that the domain is not set.

2. For _domain_set(), set only when needed. e.g. the first task over all
cores being added, or a task asking for earlier timer being added.

The _domain_set() logic is refined as below:
a. For first task, set domain according to the required start, else
b. for one shot task, set domain if it is earlier, else
c. for earlier periodic task, try to make it cadence-aligned with the
existed task, else
d. for later periodic task, simply cover it by the coming interrupt.

3. For _domain_clear() logic, simplify to call it when the last client is
freed.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Keyon Jie 5104f5e02d timer_domain: refine the timer_domain_set() logic
Do timer_domain refining as below:

Use unified LL_TIMER_SET_OVERHEAD_TICKS=1000 which denote the max
overhead that the timer_domain_set() will take, and remove the
definition from each platforms.

Don't add any overhead if no needed(e.g. if the start > current +
overhead). This will help to schedule the task ASAP, and make the
catching up (of the previous delay) possible.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Keyon Jie 1f7a2805de ll_schedule: rename last_tick to next_tick
rename the last_tick to next_tick, which means the one already set
to the timer, for more easy to understand.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Keyon Jie ab89e26c2b Revert "timer_domain: set last_tick to ticks_req in order to avoid drift"
This reverts commit 9a08028a76.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-02-26 16:47:25 +00:00
Oleksandr Strelchenko 236c519253 audio: codec_adapter: Waves custom codec
added codec_adapter API implementation for Waves MaxxEffect API

Signed-off-by: Oleksandr Strelchenko <oleksandr.strelchenko@waves.com>
2021-02-26 16:41:42 +00:00
Iuliana Prodan f40222a1ea drivers: imx: esai: use rate from topology
So far we only used topologies with rate set
to 48 000Hz. This might change in the future.
So use rate from parameters passed from kernel.

While here, align sof_ipc_dai_esai_params struct
with the one from kernel.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-02-26 16:23:43 +00:00
Marc Herbert eb4373cb61 .github: new installer.yml
Builds everything, stage and check the output of the "tree" command

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Marc Herbert 5dea5aead9 installer: add checktree target
Simple check of the "tree" output

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Marc Herbert 479809663e installer: (re)build firmware, topologies and user space tools
One-touch "make -C installer rsync" combines fast incremental build,
staging and deploy in one command.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Marc Herbert f9545c8f59 installer: new BUILD_TOOLS directory
The tools build is independent from the firmware build. The next step is
to invoke it from here if needed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Marc Herbert ffaeaaafdd build-tools.sh: build in any directory
Take $BUILD_TOOLS_DIR from the environment if present.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Marc Herbert e31afb3651 xtensa-build-all.sh: make it runnable from anywhere
Fix $pwd confusion and remove bogus ../local/bin PATH that does not
exist.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Seppo Ingalsuo 8bb8787cd3 Topology: Get PGA_NAME from pipeline caller macro
This patch fixes the error that happens with the hard-coded PGA
names Dmic0 and Dmic1 in pipelines pipe-eq-iir-volume-capture.m4
and pipe-eq-iir-volume-capture-16khz.m4. Pipelines for beamformer
TDFB have the same hard-coded PGA names and are fixed too.

If impacted pipelines are used for any other purpose than DMIC endpoints
the topology graph gets messed up. With this change the caller macro,
e.g. intel-generic-dmic.m4 needs to set the PGA_NAME macro when the
respective pipeline is instantiated. If it is not set the default
name via N_PGA() macro is used.

The macro intel-generic-dmic-kwd.m4 is updated to set the Dmic0
PGA name as well as the earlier missed PIPELINE_FILTER1 and
PIPELINE_FILTER2 definitions for passing filter coefficients.

Fixes: #3378

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-02-26 15:17:36 +00:00
Daniel Baluta bd604d06e3 xtensa-build-all.sh: Bump IMX xtensa toolchain version
Lets use the same version of Xtensa toolchain as Intel in order
to avoid compilation problems.

It is difficult to support multiple toolchain versions because specific
headers needs to be updated, so lets have the same version supported
between IMX and Intel.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-02-26 16:14:28 +02:00
Curtis Malainey be31139532 codec_adapter: fix documentation for apply config
Comment is incorrect. There are multiple cases when a config is pushed
by userspace that will result in no callback.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 14:09:00 +00:00
Curtis Malainey efd55bbd06 codec_adapter: delete empty header
if its unused, then its uneeded

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 14:09:00 +00:00
Seppo Ingalsuo 079f916c6a Topology: Move some topologies to development and dsp_enhancement
The main topology directory contains a number of topologies those
are not used directly by Linux kernel machine drivers. Also there
are variant topologies built those are modified versions of the
main topology. The topologies for testing and devolopment are moved to
directory development. The topologies those may be used by end users
to enhance the audios are moved or built to dsp_enhancements directory.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-02-26 14:07:38 +00:00
Curtis Malainey 7e6bdb6963 math: clarify order of operations with ternary
minor cppcheck style violation

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 12:25:15 +00:00
Curtis Malainey 5116f070c2 math: don't use implicit types in fixed point math
Cppcheck is complaining that we are running a 32bit int off the end.
This shouldn't happen here in any arch. Looking at the math and
comments, it looks like idx should be a 64 type or cast to a larger
container before the bit shift. Therefore I am enforcing a strict type
on it.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 12:25:15 +00:00
Curtis Malainey 6d9ce240e2 trace: suppress cppcheck comparison error
Cppcheck check doesn't understand the relationship between trace section
start and end so it is giving a false positive because it thinks they
are two separate objects, not two pointers to the same region.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 12:25:15 +00:00
Curtis Malainey 98167ceac7 trace: remove unused code based on build
The current version of the code effectively relies on the compiler to
optimize out the loop, this both trusts the compiler, annoys
cppcheck which also not being entirely clear to the reader. Solution is
to use the compile switch to remove all relevant code.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 12:25:15 +00:00
Curtis Malainey cbf03f28be codec_adapter: don't error on free(NULL)
libc doesn't return a type, so it just no-ops silently on null, lets to
the same having this error makes walk back patterns more annoying

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-02-26 12:15:55 +00:00
Pin-chih Lin 3bc52f8a48 sof: drc: replace int type by int32_t
In order to make the algorithm portable to non-xtensa arch.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-02-22 19:55:41 +00:00
Pin-chih Lin fd10a0728c sof: drc: refine function comments
Refined some function comments to prevent confusion of usage.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-02-22 19:55:41 +00:00
Pin-chih Lin 5f2de711a0 sof: drc: fix drc_pow_fixed function
The proposed calculation doesn't take negative or zero input-x into
consideration, and we also don't need such use cases. Just return 0
for those input-x.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-02-22 19:55:41 +00:00