Commit Graph

3556 Commits

Author SHA1 Message Date
Seppo Ingalsuo 81f8de93c5 Tools: Test: Updates for testbench to match other changes in SOF
This patch updates the locations of "make install" libraries default
install locations into shell script to run SRC test cases. The script
also now prints the used LD_LIBRARY path to ease setting up code
debugging.

The segfault of testbench executable is fixed by returning a valid
pointer reference instead of a NULL from test dummy function
arch_schedulers_get().  The rest of testbench version of schedule.c
was also updated to be like the current real version module.

Finally in the testbench.c main the file names string pointers are
initilizated to null as well as the word length parameter to avoid
a segfault if executable is started without command line arguments
to see the usage help text.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-18 20:50:50 +02:00
Seppo Ingalsuo 573e0b17b3 Tools: Audio quality test for ssh accessible device
This patch adds a shell script sof_test_perf.sh that measures
gain, frequency response, and total harmonic distortion plus
noise for a remote device.

Matlab or Octave is needed. The shell script launches by default
Octave to process the signal generation and test results analysis
scripts.

The remote device must be set to be accessible by ssh without
passwords. An external high quality USB sound card is recommended
as analog interface to connect to test device's analog interface.

The configuration file sof_test_perf_config.m must be edited for
the remote device's user account, audio device, audio format, and
capture sound card audio device, and audio format.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-17 15:40:29 +01:00
Bartosz Kokoszko 03d68261cf alloc: fix first free update in alloc_cont_blocks()
In alloc_cont_blocks() function after allocation we should
check whether new first_free block has been already used.
If it was used, we should find first not used block.

fixes #1714

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
2019-09-17 09:22:42 +02:00
Jaska Uimonen 0d74d3a563 src: do not treat 0 size input data as error
Currently SRC returns error when 0 size input or output data is detected
and pipeline interpretes this as fatal xrun error. This could happen
for example when host dma has no time to fill in first iteration of
samples. So instead of error, return PPL_STATUS_PATH_STOP as SRC in the
middle of the pipeline should handle also occasional 0 size data.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2019-09-17 09:22:19 +02:00
Tomasz Lauda 0ba3fec518 topology: byt: fix media pipeline period for nocodec
Fixes media pipeline period for nocodec byt and cht topologies.
Now codec and nocodec topologies are aligned in regards to pipe
configurations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-16 16:14:59 +02:00
Tomasz Lauda 5bb4ce172c topology: remove accidentally added topologies
Removes topologies, which have been removed and accidentally
added again to the repository.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-16 16:14:59 +02:00
Marcin Maka 2339a62762 arch: xtensa: remove include constraint from wait.h
This header may be included by a platform specific, intermediate
wait() layer inserted between the lib and the architecture code.
Therefore the including unit should not be limited to lib only.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-09-16 12:59:34 +02:00
Marcin Maka ced0ea054c arch: xtensa: remove dependency on platform headers
Integration specific tweaks for xtensa architecture should
use Kconfig options selected for required platforms, not the
platform headers.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-09-16 12:59:34 +02:00
Marcin Maka 0f00c11531 cavs: pm: fix include of version header
Should include cavs/version to compile on < 1.8, not
the global version.h one.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-09-16 12:59:34 +02:00
Tomasz Lauda 2bd725df02 trace: move platform_trace_point to dedicated headers
Moves platform_trace_point macro from platform/platform.h
to platform/trace/trace.h. This way we don't need to
include platform header from generic sof/trace/trace.h.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-14 23:53:02 +02:00
Marcin Maka 94733aa588 task: remove edf specific elements from context switching layer
The context switching layer is a common mechanism for all
pre-emptive schedulers and should not depend on data types
defined for any specific one.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-09-13 14:35:18 +03:00
Tomasz Lauda e01c696337 common: add missing include
Adds missing include of stddef.h, which defines offsetof
macro.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-13 11:57:37 +02:00
Seppo Ingalsuo 92ec08dad5 Tools: Tune: Fix file paths for example FIR script
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-13 10:25:58 +01:00
Seppo Ingalsuo fa2f3a51ad Tools: Tune: Get SOF ABI header for EQs with sof-ctl
This patch avoids the need to main SOF ABI version information in
Matlab/Octave file eq_get_abi.m for equalizer tools. The ABI
header is fetched via new "-p" command line option for sof-ctl.

The BSD 3 clause copyright text is also updated to new short style.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-13 10:25:58 +01:00
Seppo Ingalsuo d013fbc6d7 Tools: Add current sof_abi_hdr struct print capability to sof-ctl
This patch adds command line option "-g" to generate and with help
of options "-o <file>" to store the current ABI version header data
into file. Use "-b" to change the default CSV format to binary.

It is used by external tools to create configuration data blobs for
SOF audio processing components.

The parameter for size is the configuration data payload size with
the size of sof_abi_hdr struct excluded. It does not impact the
the length of printed header. It just places the length into the
correct location in the header.

This patch also fixes the permissions of file output. The mode
need to be provided for open() to avoid having no access to
created file and allow overwrite of existing file.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-13 10:25:58 +01:00
Curtis Malainey 23d9c78a5c scripts: allocate tty on docker
Bash and menuconfig cannot run without this flag. Docker-run just hangs
without it

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-09-12 19:52:34 +01:00
Tomasz Lauda 8c61213c37 schedule: support dynamic scheduler creation
Refactors schedule code in order to allow dynamic scheduler
creation. We don't want to add every new scheduler to the static
array of scheduler_ops and also we don't want to have every
scheduler created on every platform. Maybe some of the platforms
won't need some of the future scheduler types.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-11 16:24:00 +02:00
Pan Xiuli b899489e49 topology: fix wrongly used SCHEDULE_DEADLINE
SCHEDULE_DEADLINE is replaced with SCHEDULE_PERIOD, but there is one
missed in DAI_ADD for W_PIPELINE.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-09-11 14:48:46 +02:00
Tomasz Lauda 09a44ab7c9 kpb: add missing flag to task init
Adds missing flag during draining task initialization.
It's needed at the moment, so the EDF scheduler can ignore
deadline for this task. Scheduling flags will be soon
refactored.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-10 23:08:12 +02:00
Marcin Rajwa 0242a5c0f8 pipeline: don't disable IRQs on prepare()
This patch removes the IRQ disable during
pipeline_prepare() as there is no potential
race condition. Also, the disable of IRQs
result in long delays in queued interrupts.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-09-10 16:24:42 +02:00
Marcin Rajwa 43b1cc428b pipeline: don't disable IRQs on params()
This patch removes the IRQ disable during
pipeline_params() as there is no potential
race condition. Also, The disable of IRQs
result in long delays in queued interrupts.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-09-10 16:24:42 +02:00
Jerome Laclavere 114692728a host: remove empty new line
Make code easier to read. Found using checkpatch.

Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
2019-09-10 13:00:31 +03:00
Guennadi Liakhovetski 596f761bf0 ipc: propagate an error from ipc_stream_pcm_params()
Instead of always returning -EINVAL propagate the error code from
ipc_stream_pcm_params() that actually caused the failure.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski bd9bd37f3f pipeline: remove redundant variable initialisations
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski fef188562a audio: host: remove superfluous variables
Two variables in host_new() contain constant values and only obscure
the code. Remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski 7d7fa49ea0 schedule: remove redundant initialisations
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski d9895174eb ll-schedule: remove "inline" and redundant initialisations
There is usually no need in explicit "inline" qualifiers in C, in
most cases the compiler does a good job deciding which functions to
inline. Also remove a redundant variable and simplify a function.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski 413c69acc8 notify: remove meaningless action
notify->list is a list head, no need to do a list-remove on it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski a57b951f2c notifier: remove superfluous initialisation
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski 32fa6fd387 ipc: remove redundant initialisation
rzalloc() allocates 0-initialised RAM, there's no need to initialise
it to 0 immediately after allocation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski 2198f59a91 ll_schedule: replace macros with safe versions
Current implementations of ll_sch_set_pdata() and ll_sch_get_pdata()
are unsafe, replace them with safe versions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Guennadi Liakhovetski d516a66c08 xtensa: remove superfluous initialisation of static data
Static data is always zeroed in C, no need for an explicit
initialisation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2019-09-09 12:52:03 +02:00
Seppo Ingalsuo 92b23fa856 Tools: EQ: Don't force upper case EQ response name
The existing IIR response names are not all upper case. This patch
removes the conversion to upper case to be able to automatically
generate the topology m4 syntax example equalizers.

Without this patch run of example_iir_eq.m script causes successive
topologies build to fail.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2019-09-08 13:19:48 +01:00
Tomasz Lauda 20acc16791 edf_schedule: implement the new version of EDF scheduler
This patch implements the new version of EDF scheduler.
This is the first basic implementation, which can be easily extended
in the future.

Previous implementation had two major flaws:
- Tasks could only be preempted based on the interrupt level on which
they have been scheduled, so it was limited based on the hardware.
- This led to the system not fully utilized, so we could never achieve
full EDF functionality.

The new implementation uses only one software interrupt and allows for
dynamic context switching between different tasks based on the deadline.
Also for some cases priority is taken into consideration e.g. for idle
and almost idle tasks, which don't have deadline at all and should be
executed only if the system is free. All other normal tasks should have
the same priority. Task chosen to be run is executed on passive level,
so automatically can be preempted by every interrupt. Every task has
its own private stack on which current context is saved and restored
if needed. Note that main firmware loop is task scheduled with
idle priority, so it will be executed only after every other task
is completed.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Tomasz Lauda fe9f9a1f36 apl: increase HP Buffer Heap and Runtime Sys Heap sizes
Increases HP Buffer Heap and Runtime System Heap sizes in order to
fit all the pipeline buffers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Tomasz Lauda d1ede217e8 test: alloc: remove tests which don't test anything
Removes two tests which don't really test anything
and are based on magic numbers. Changing memory map
can easily break them.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Tomasz Lauda 1c93a4c15f schedule: pass sof context during scheduler init
Passes sof context structure to the schedulers during
scheduler initialization. It will be required by the new
EDF scheduler.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Tomasz Lauda 7d7f2ae051 arch: xtensa: add dedicated stacks for interrupt handlers
Defines and adds dedicated stacks for interrupt handlers
to core data. They are required to implement the execution
context switching, which is useful for any preemptive scheduler.
EDF is the first scheduler for which they will be used.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Tomasz Lauda 92c921c898 ipc: return valid error in ipc_dma_trace_config
Fixes the bug, where any error in ipc_dma_trace_config handling
was always returned as -EINVAL.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 10:57:32 +02:00
Paul Olaru 5b038fac04 drivers: imx: esai: Fix incorrect size in memory map
Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-09-06 09:49:43 +03:00
Pierre-Louis Bossart ba32f4ad0b topology: SoundWire topologies for CML and ICL
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Pierre-Louis Bossart 590b55d8b3 config: make ALH part of default config for ICL and CNL
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Slawomir Blauciak c66b87283e dai: ALH hardware params
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
2019-09-05 15:49:46 +02:00
Slawomir Blauciak b71c043c5d dai: alh fifo params for ICL and CNL
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Slawomir Blauciak cca029c6f6 dai: allow for runtime fifo params via DAI ops
This change introduces new DAI driver ops: get_handshake and get_fifo.
They shall be used to obtain DMA handshake and FIFO address information.

The motivation for this is the required by ALH ability
to retrieve this information during runtime,
based on parameters passed to us by the kernel/driver.

The DAIs no longer have to have hardcoded platform data (fifo/handshake),
the computation of those now may happen directly
in the DAI driver implementation.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Slawomir Blauciak e859a51edb platform: set alh configuration ownership to host
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Slawomir Blauciak c8bda49042 dai: add alh to dai list and initialize it
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-09-05 15:49:46 +02:00
Slawomir Blauciak 79e7a3d206 dai: rename soundwire to alh
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-09-05 15:49:46 +02:00
Marcin Rajwa cd3de64cc6 kpb: fix premature state change in buffering function
This patch fixes state change in buffering function before
the check of state from previous stage. This issue resulted
in missing samples from stream during draining.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-09-05 13:08:18 +02:00
Marcin Rajwa 4146968e10 kpb: log error and stop pipeline copy if no bytes to copy
This patch checks if "copy_bytes" which is the minimum
of sink->free and source->avail is != 0. If so we go
further with copy and internal buffering.
If no we log error message and return from
copy function.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2019-09-05 13:08:18 +02:00