Commit Graph

4852 Commits

Author SHA1 Message Date
Jaska Uimonen 5f6c678180 topology: add mux config to sof-apl-demux-pcm512x.m4
Add mux config to top level topology.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen 874393cbeb topology: add binary blob macro for muxdemux
Add macro for binary blob generation for muxdemux. With this macro the
stream routing matrix will be easier to visualize and manipulate.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Jaska Uimonen 82aab68b3e topology: add bit, byte and abi_version macros to utils
Bit and byte manipulation macros are needed for building binary blobs,
so add them. Add also macro to generate sof_abi_version.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-04-07 14:36:21 +01:00
Marcin Rajwa 94b235c164 topology: update min host buffer size for KWD
This updates the minimal host buffer size to the
minimum value which enables sefe draining for all
pcm parameters.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa 9eb5a8dc3e kpb: change order of members in comp_data struct
This patch changes the order of members in comp_data
struct to improve memory access for related data.
So now data that are commonly used together like *state*
and *state_log* are put next to each other so fewer cache
reads are needed.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa 1191b6ca40 kpb: move update of buffered data to higher layer
This patch moves the update of buffered data during
draining from buffering function to the caller
function.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa 44f1bc8428 kpb: change error message to warning
This patch changes the error message caused by
no bytes to be buffered from "error" to warning
as this is not crirical error.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa afe41bcd53 kpb: simplify calculation of buffered data
This patch reworks the calculation of buffered data.
NOTE! We only keep record of buffered data up to
the size of history buffer as there is no usecase
beyond that.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa ec2d1cd52d kpb: add condition for buffering
This patch adds the condition that if we are
in draining or init draining state and
pipeline_copy() appeared before we actually
started the draining, plus the amount of new data
can overwrite the data staged for draining then
we should postpone buffering procedure for next
period. At that time we assume draining task will have
already drained some samples therefore making a space
for new ones.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa 06874423ba kpb: calculate free space in history buffer
This additional variable says how much data can be
written to history buffer and won't cause overwrite
of data staged for draining. It is important to realize
the history buffer is circular and its data gets
overwrite all the time. So *free* in this case doesn't
mean "amount of bytes before buffer is full". History
buffer is *full* 99% of the time. However before the
draining starts we "freeze" history buffer data
so new samples can be written only if:

HISTORY_BUFFER_SIZE - HISTORY_DEPTH > 0

The result of above subtraction is what we call "free"

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa c886e0a1b3 kpb: add new struct history_data
This patch adds new struct called "history_data"
which contains all variables related to
history buffer namely, its size, amount of free and
available data as well as address of current write
buffer (history buffer is a collection of smaller
buffers)

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa 240b067d0d kpb: change the name of draining data structure
This patch changes the name of "dd" structure to
more meaningful "draining_data". Therefore code
is more readable.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Rajwa 8866f3b593 kpb: change history buffer struct name
This patch changes the name of the "hb" struct to
more meaningfull "history_buffer". Therefore
code is more readable.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-07 14:26:13 +01:00
Marcin Maka 5f24796630 comp: use comp_alloc in existing components
Replaces the common, required part of the initialization
copied by every implementation.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-07 13:51:04 +03:00
Marcin Maka e66b40a5b4 comp: provide comp_alloc for device alloc and init
This short helper not only groups and hides some infrastructure level
initialization steps but also guarantees that none of it is
missed in the component implementation.
It is easier to group the steps in internal function rather
then explain them and remember to add to every new component
(especially that initialized comp_dev members are used internally).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-07 13:51:04 +03:00
Sam Muhammed de085f22f5 sof: Avoid comparison with NULL
Use (!x) instead of comparison with NULL.

Signed-off-by: Sam Muhammed <jane.pnx9@gmail.com>
2020-04-07 12:07:59 +03:00
Daniel Baluta b4e8b1e471 drivers: imx: sdma: Reduce level of logging for sdma_start
This is not really an error.

Reported-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-06 09:51:44 +01:00
Daniel Baluta 880fca28f2 drivers: imx: sdma: Fix SDMA scripts load addresses
MCU2SHP means processor to peripheral that is memory to device.
SHP2MCU means peripheral to processor that is device to memory.

There was a confusion in the initial patch, fix this now to
have the correct load addresses.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-06 09:51:44 +01:00
Daniel Baluta f044f8c478 platform: imx8m: dma: Fix SDMA irqname
irq name must match cascaded controller name, otherwise
interrupt_get_irq will fail.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-06 09:51:44 +01:00
Daniel Baluta 0d9eefbda4 trace: Fix compilation error when CONFIG_TRACE not set
Introduce dummy trace functions for when CONFIG_TRACE
is not set to avoid undefined reference to function error.

src/ipc/handler.c.o: In function `ipc_glb_tplg_buffer_new':
src/ipc/handler.c:1094: undefined reference to `trace_on'

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-05 18:16:03 +03:00
Marc Herbert 757b13c123 CODEOWNERS: scripts/ += marc-hb
Adding myself per Liam's instruction in PR #2606

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-04-04 20:06:49 +01:00
Slawomir Blauciak bf9ce82b27 dai: provide additional description of dai private data
This provides basic guidelines to clear up how to allocate
and use DAI private data.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-04-03 21:12:10 +01:00
Slawomir Blauciak 5d0dadf7de alh: obtain hw params from ipc config
This allows the firmware to become aware of
the programmed format on ALH DAIs.

The change is backwards compatible,
in-case of ABI mismatch, the data will be filled with 0s,
which is consistent with previous values.

This change is required in the case of pipelines,
that contain components capable
of modifying the parameters of a stream, for example (de)mux.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-04-03 21:12:10 +01:00
Fred Oh 8d03efe701 topology: apl: share asymmetrical dmic pipe setting
apl dmic asymmetrical topologies are shared most of common codes. Share
one m4 macro for all.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-04-03 21:11:21 +01:00
Janusz Jankowski 99d03de968 cmake: add *_overridedefconfig targets
Add targets that are meant to be used after defconfig,
to apply configs from <arch>/configs/override on top of defconfigs.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-04-03 20:20:43 +01:00
Janusz Jankowski 22e4e7bff6 cmake: fix defconfigs dependency
CMake regeneration condition should depend on directory to automatically
update when new defconfigs are added.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-04-03 20:20:43 +01:00
Guennadi Liakhovetski 3094f51aa5 pipeline: support concurrent streaming and topology growth
With virtualised clients it can happen, that while one client is
performing audio streaming over a pipeline, another client is adding
components to a new pipeline, that later will be connected to the one
in use. This can happen, e.g. when streaming is taking place on the
host and a guest VM is booting. To support this we need to ignore
newly added but not yet finalised components while traversing
pipelines. Components are in this states after they have been
connected but before the respective pipeline has been finalised, i.e.
before SOF_IPC_TPLG_PIPE_COMPLETE has been issued for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-03 16:36:35 +01:00
Guennadi Liakhovetski 3ce32d3076 pipeline: (cosmetic) remove redundant code
Remove redundant initialisations and an empty "default" case.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-03 16:36:35 +01:00
Guennadi Liakhovetski f1cdf99379 pipeline: reduce stack usage in recursion
pipeline_for_each_comp() is called recursively, Reduce its stack
usage by reducing the number of parameters and using a structure
instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-04-03 16:36:35 +01:00
Karol Trzcinski b3c16790cd rimage: Remove ldc generation ability
SMEX is new tool designed to create ldc file content,
so this ability in rimage should be removed to avoid
duplication.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-03 16:27:04 +01:00
Karol Trzcinski f87c6e89f2 smex: logger: Logger should point to smex as ldc generator
rimage will not be responsible for ldc file creation so logger
should points valid tool.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-03 16:27:04 +01:00
Karol Trzcinski 7633c34224 smex: Add elf modules content validation
After find some error in source elf file, ldc file shouldn't
be generated

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-03 16:27:04 +01:00
Karol Trzcinski 36929ae1b7 smex: Create new tool to build ldc file
SMEX (*SOF Metadata EXtractor*) is a tool used to extract needed
information from SOF source code and output files and then save
them in convenient form like logs dictionary file (*ldc*).

After full integration of SMEX with SOF build system,
rImage with no sof specific ldc generator code can be moved
outside as a common external tool.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-03 16:27:04 +01:00
Marc Herbert 69d928829d CODEOWNERS: updates patterns, remove src/[include]/host/
... as reported by
https://github.com/zephyrproject-rtos/ci-tools/blob/cf55a47d52d/scripts/check_compliance.py
-m Codeowners

Thanks @jajanusz for the help.

For src/[include]/host, I tried some tig blame and git log to find
potential renames, but I gave up when I found that commits
e20217abc7 and f081a20de9 (for instance) added or moved some
patterns that already did not match anything at the time.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-04-03 11:02:58 +01:00
Lech Betlej ac197ec76e cavs: add configuration presets for Chrome based products
As the number of configuration options is increased there is a need
to clearly specify presets that reflect features options. Specifically
the change adds option to enable Low Power Sequencer (LPS) and
Low Power Ring oscillator together.

The approach is based on keeping generic configuration in configs directory
while the override directory contains only incremental delta information.
The compilation flow assumes using make overrideconfig command. In example:

make cannonlake_defconfig
cp ../src/arch/xtensa/configs/override/cannonlake_chrome.config
override.config
make overrideconfig
make bin

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2020-04-03 10:30:30 +01:00
Lech Betlej acebe4b8a9 cavs: set HP ring oscillator clock as a default
The change is provided to address issues reported by users who try
to execute workloads that exceed computing capacity provided by
LP RO clock.

On the other hand motivation to have a canary settings to check
FW pipelines utilization is diminished as infrastructure improvements
to measure compute utilization per component are introduced.

Signed-off-by: Lech Betlej <lech.betlej@linux.intel.com>
2020-04-03 10:30:30 +01:00
Pierre-Louis Bossart 8b7f1fafd2 topology: sof-apl-pcm512x: add codec master mode and 44.1kHz support
This patch provides an optional support for codec master mode and uses
a macro to change the frame sync as needed. The scheduling is also
changes to to DMA instead of TIMER.

The user is still required to manually copy the desired topology as
sof-tplg/sof-apl-pcm512x.tplg, but a manual configuration of the ACPI
initrd overlays and BIOS settings is required as well, so there's no
turn-key solution possible anyways.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2020-04-03 09:15:10 +01:00
Pan Xiuli 1ecf435d13 CI: travis: Add host-testbecnh
build test topology.
builg host-testbench
Test with host-testbench.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-03 09:13:03 +01:00
Pan Xiuli a2ac3c3197 sripts: update host-testbench to work with latest code
Enable 3 simple test with host-testbench:
volume, src and eqiir
Usage:
./scripts/build-tools.sh -t
./scripts/host-build-all.sh
./scripts/host-testbench.sh

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-03 09:13:03 +01:00
Janusz Jankowski d7ad0c134d tools: sof_ri_info: make executable
Script is meant to be used as standalone tool,
so it should have executable file attribute.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-04-02 20:51:37 +01:00
Slawomir Blauciak d00c8d599b kpb: perform additional pointer sanity checks
Issues detected by code scans.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-04-02 18:05:03 +02:00
Marcin Maka 8d9c762de2 agent: trace drift message as warning, not error
Non-critical drifts should be traced as warnings (WARN,
yellow color), not errors since the system is expected
to recover in this scenario.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-02 14:39:19 +01:00
Pan Xiuli 06401fe589 topology: add KWD comp into sof-tgl-max98373-rt5682
Add KWD pipelines with vol-kfpm pipe using intel-generic-dmic-kwd tmplate.
48K DMIC still uses PCM 99
Add 16K DMIC KWD on PCM 100

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-02 11:45:35 +02:00
Pan Xiuli 4d1cbd32c7 topology: add hda generic kwd pipeline
Add KWD pipeline with kfpm only for HDA generic topology.
DMIC 48K have PCM 6
DMIC 16K have PCM 7

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-02 11:45:35 +02:00
Pan Xiuli 8454f7a1b7 topology: intel: add generic dmic key word dection
Add generic dmic kwd template.
Need to define flowing variable to make it work:
CHANNELS: channel for the DMIC

KFBM_TYPE: kfpm or vol-kfpm

DMIC_PCM_48K_ID: PCM ID for 48K DMIC
DMIC_PIPELINE_48k_ID: pipeline ID for 48K DMIC
DMIC_DAI_LINK_48K_ID: dai link ID in machine dirver for
48K DMIC

DMIC_PCM_16k_ID: PCM ID for KWD 16K DMIC
DMIC_PIPELINE_16k_ID: pipeline ID for 16K DMIC
DMIC_PIPELINE_KWD_ID: pipeline ID for KWD
DMIC_DAI_LINK_16k_ID: dai link ID in machine driver
for 16K DMIC

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-02 11:45:35 +02:00
Pan Xiuli c5b4421c99 topology: add pipe-vol-kfbm-capture to have vol before kfbm
Add vol comp before kfbm comp in pipe-vol-kfbm-capture.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-02 11:45:35 +02:00
Pan Xiuli 6c83df8186 topology: fix ID typo in kfbm pipeline
The PCM ID should use PCM_ID instead for PIPELINE_ID

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-02 11:45:35 +02:00
Artur Kloniecki 40ee1a0e85 topology: buffer: Add flags field to struct sof_ipc_buffer.
2 flags have been added for use during buffer instantiation:
SOF_BUF_OVERRUN_PERMITTED and SOF_BUF_UNDERRUN_PERMITTED,
along with struct sof_ipc_buffer member fields flags and reserved.
Flags field is supposed to hold the above-mentioned flags to allow
some control over XRUN behaviour, i.e. prevent XRUN on buffers which
are allowed to under/overrun by design.
Also added reserved field to the structure in case it comes in handy
some time in the future.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-04-02 10:29:46 +01:00
Artur Kloniecki 23ae5d824a muxdemux: Rename unused API fields to '_deprecated'.
After the cleanup few elements of the API are no longer used/accessed.
This allows for ABI simplification in the future if we so decide.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-04-02 10:12:28 +01:00
Artur Kloniecki e20cd2811e muxdemux: Remove obsolete references to config->num_channels.
Few artifacts of the past were left after dependency removal. This patch
is there to address that.

Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
2020-04-02 10:12:28 +01:00