Commit Graph

1534 Commits

Author SHA1 Message Date
Liam Girdwood c90055f2f5 header: rtos: use rtos specific version of string.h
No runtime semantic change. Use C library when RTOS uses
C library otherwise use own C library calls.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood 09c52810a7 header: rtos: use rtos specific version of bit.h
No runtime functional change. Code can now include <rtos/bit.h>

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood 1629a1f72c header: rtos: decouple headers into rtos specific directories.
No functional runtime change, but changes to rtos partitioning and the
layout of headers .

This patch creates RTOS specifc header paths and updates spinlock.h
and kernel.h to show the new usage. Other headers will incrementally follow.
It reuses the current zephyr topleve directory and creates a new
toplevel xtos directory for xtos specific files.

Due to the mixing of RTOS, driver and library headers at the top level include
directory it was necessary to create rtos specific header directories i.e.

src/include/rtos-xtos
src/include/rtos-zephyr

These RTOS include directories will eventually contain RTOS specific headers
whilst common logic and structures will be placed in non RTOS directories.

This will also mean

"#include <sof/spinlock.h>"

will become

"#include <rtos/spinlock.h>"

and will allow easier visualisation of where and why RTOS headers are being used.
This will help to eliminate cross usage of headers between RTOSes.

Subsequqnt patches will move more headers and rtos specific wrppaer
source files into rtos specific locations.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Ming Jen Tai 8496d585d1 Modify periods setting for RTNR capturing pipeline
With the  release of RTNR version 20220728, period for capturing pipeline requires at least 5ms.

Periods setting for 16KHz capturing pipeline is also removed since RTNR is currently running in 48KHz capturing pipeline only.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2022-08-31 11:26:18 +01:00
Kai Vehmanen 13ba5fe90c tools: add mtrace-reader.py
Tool to stream data from Linux SOF driver "mtrace" debugfs
interface to standard output. Plain "cat" is not sufficient
as each read() syscall returns log data with a 32bit binary
header, containing the payload length.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-31 10:33:46 +01:00
Liam Girdwood 7288d52ab6 testbench: cleanup the logging to use printf.
No point in doing a sprintf to a local buffer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-29 14:11:29 +01:00
Liam Girdwood 2865cc2bb2 testbench: cmake: parser does not use CONFIG_LIBRARY cmake variable
Not used by parser cmakefile so delete.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-29 14:11:29 +01:00
Liam Girdwood 67ae353bfb tplg_parser: support building as static or shared library.
Allow the tplg_parser to built as either static or shared library.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-29 14:11:29 +01:00
Liam Girdwood d9f9340e1a tplg_parser: split out testbench logic and partition features per file.
This is another tplg_parser and testbench update on the road to provide
further flexibility around supporting new modules and IPC versions.
There will more to follow.

Changes are mostly mechanical code movements i.e. moving testbench related code
to the testbench, splitting the files into per module/component files and
making some functions static and public.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-29 14:11:29 +01:00
Liam Girdwood 03b4f30129 testbench: include stdlib.h
Newer GCC version complain about free() not being defined.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-29 14:11:29 +01:00
Chao Song 7882b1a93d topology2: add pin binding classes for multiple I/O queue
An IPC4 widget may support multiple I/O queue. Queue ID is
required during widget binding in route setup.

This patch adds sink_pin_binging and src_pin_binding classes
for multiple I/O queue support.

For widget requires special pin(queue) binding, sink_pin_binding
or src_pin_binding should be defined in the widget object. So
that the kernel knows which pin to use during widget binding
by parsing topology.

Note that pin binding should be defined for all sink/source pins
or for none. Even if there is only one sink pin requires special
pin binding, pin binding should be defined for all sink pins, and
for pins that are not used, give the value "NotConnected". This rule
applies to source pins, too.

Example: smart_amp widget has two sink pins and one source pin,
and its feedback sink pin requires special pin binding, so we have to
define sink_pin_binding objects within smart_amp object like this:

Object.Base.sink_pin_binding.1 {
    # the main sink pin is connected to host for playback data
    sink_pin_binding_wname	"copier.host.1.1"
}
Object.Base.src_pin_binding.2 {
    # the feedback sink pin is connected to capture dai for codec feedback.
    sink_pin_binding_wname	"copier.SSP.2.1"
}

In this example, smart_amp is connected to host and DAI directly,
it is also possible to be connected to host and DAI indirectly (with
gain or other widget in the middle).

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-08-29 13:26:49 +01:00
Chao Song 721e58f3d2 topology2: add num_sink/source_pins tokens for widget
These two tokens will be used by the kernel to decide the
supported number of sink/source pins, thus to allocate
correct widget queue id in route setup.

These two tokens are mandatory for IPC4 widgets, because
the default value in Linux kernel is zero, which is invalid
for queue id allocation.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-08-29 13:26:49 +01:00
Marc Herbert 92d828bc37 sof-logger: make inotify optional
Restores ability to compile on Windows with MSYS.

Fixes commit dcf0577a77 ("logger: allow starting before the driver is
loaded")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-29 13:24:40 +01:00
Marc Herbert 277985e687 tools: delete obsolete tools/.gitignore
We moved to CMake and out-of-source builds years ago.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-29 13:24:40 +01:00
Seppo Ingalsuo 04aa27103e Math: FFT: Switch to script generated twiddle.h
This patch adds script tools/tune/fft/export_twiddle.m. Since
the data in original twiddle.h differs by one LSB in few
items the file is replaced with one generated with the script.

The identifier 32 is added to header name and variables names
as preparation to add 16 bit FFT version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-08-26 10:46:50 +01:00
Chunxu Li 8d9c5485c4 topology1: remove mt8186 unused topologies
Remove mt8186 unused topologies.

We use sof-mt8186 on our demo board, sof-mt8186-mt6366-rt1019-rt5682s
and sof-mt8186-mt6366-da7219-max98357 will no be used anymore.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-08-25 16:20:26 +03:00
Rander Wang d40fb8fc99 topology2: add stream token in topology2
Add stream d0i3 token

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-08-25 13:24:25 +01:00
Marc Herbert e1d6b9a08a topology2: build only when alsatplg is v1.2.7 or greater
Fixes: #5323

The v1.2.6 requirement was a lie the whole time because alsatplg v1.2.6
does not have any `-I` option. The truth was: un-released alsa-utils
from git was required. The check for v1.2.6 was an approximation good
enough for many users but not for everyone, see for instance #5323.

Now that alsa-utils v1.2.7 has been released we can stop lying:
 https://github.com/alsa-project/alsa-utils/commit/7d934f3142549

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-18 13:36:49 +01:00
Laurentiu Mihalcea 3590936101 topology1: Add new i.MX topology for PCM capture using compress API
We add a new i.MX8MP topology which will use the compress API for PCM
capture. This topology is mainly used for testing.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-17 15:01:59 +03:00
Laurentiu Mihalcea b99bf48195 topology1: Add new i.MX topology for PCM playback using compress API
We add a new i.MX8MP topology which will use the compress API for PCM
playback. This topology is mainly used for testing.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-17 15:01:59 +03:00
Laurentiu Mihalcea cb38eec76e topology1: Add new i.MX topology for PCM capture using compress API
We add a new i.MX8Q(M/XP) topology which will use the compress API for
PCM capture. This topology is mainly used for testing.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-17 15:01:59 +03:00
Laurentiu Mihalcea 476b31ecdb topology1: Add new i.MX topology for PCM playback using compress API
We add a new i.MX8Q(M/XP) topology which will use the compress API for
PCM playback. This topology is mainly used for testing.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-17 15:01:59 +03:00
Laurentiu Mihalcea def03928d5 topology1: pcm: Add new macro for compress capture
We want to be able to create topologies for the case of
compress capture. This change will enable us to do so.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-17 15:01:59 +03:00
Laurentiu Mihalcea 9d54236675 topology1: pcm: Introduce compress parameter for pcm_capture_add_common
This change will allow us to prepare for adding a new macro
for the case of compress capture.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2022-08-17 15:01:59 +03:00
barry.jan 8efd627964 topology: add Waves for sof-mt8186-mt6366-rt1019-rt5682s tplg
Signed-off-by: barry.jan <barry.jan@waves.com>
2022-08-16 21:53:12 +01:00
Kai Vehmanen 87425baf22 probe-app: add support for non-audio probe buffers
Identify non-audio probe streams and write them out with ".bin"
extension and without the RIFF WAVE header.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-16 15:35:03 +01:00
Kai Vehmanen bd9168f676 probe-app: support non-word aligned probe data streams
Modify code to correctly handle probe streams where sync word
can occur at any byte boundary, and where probe packet size may
not be aligned to 32bit word size.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-16 15:35:03 +01:00
Kai Vehmanen e2a5d925ba probe-app: bail out if opening file fails
Do not blindly call fwrite without checking whether file open
succeeded or not.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-16 15:35:03 +01:00
Kai Vehmanen 89039c6bff probe-app: fix handling of buffer-id of zero
Don't assume buffer-id of zero is an invalid value.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-16 15:35:03 +01:00
Daniel Baluta 8a1b051940 topology1: codec_adapter: Remove ca_config bytes
After commit:
5763c74bf4 ("codec_adapter: Remove setup config from module data")
we no longer setup config bytes in codec adapter control bytes.

So, we need to remove ca_config bytes and fix payload size. This
didn't introduce any bug because this is the default
CA_SETUP_CONTROLBYTES. Each topology uses a custom control bytes
which overrides this default values.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-15 12:53:29 +01:00
Seppo Ingalsuo a328223ba5 Topology1: Allow S24_4LE and S32_LE playback with PCM4
This patch allows to test SRC with all 16/24/32 bit formats
in UP-squared device. Without this patch only 16 bit is
supported.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-08-10 07:54:39 +01:00
Daniel Baluta 6231528924 topology: Fix setup control bytes comments
setup config data was removed with commit
5763c74bf4 ("codec_adapter: Remove setup config from module data")
update documentation to reflect this.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-05 19:22:37 +01:00
Pierre-Louis Bossart 190cfd79f7 topology1: add SSP1 for all ES8336, SSP5 for APL/GLK
We apparently missed quite a few platforms with SSP1, and SSP5 is also
needed for APL/GLK.

One day we'll have a better way to add topologies, but so far it's
brute-force combinatorial addition. Oh well.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-08-05 12:28:12 +01:00
Kai Vehmanen 8881a406af topology: add sof-rpl-nocodec.tplg
Add nocodec topology for Intel Raptor Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Kai Vehmanen f2bfa2824e topology: add sof-rpl-rt711 and sof-rpl-rt711-4ch topologies
Add new topologies for Intel Raptor Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Kai Vehmanen 09944bc058 topology: Add platform definition file for Intel Raptor Lake
Start with Alder Lake definitions.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Marc Herbert dcf0577a77 logger: allow starting before the driver is loaded
Don't fail immediately when the driver is not loaded. Use inotify
instead to wait for /sys/kernel/debug/sof/[e]trace to appear.

This makes it possible to start before the driver is loaded which
reduces considerably the chances of missing early logs.

Fixes a small part of https://github.com/thesofproject/linux/issues/3275

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-02 16:48:27 +01:00
Marc Herbert af6bd41a99 logger: open /sys/debug/fw_version _after_ /sys/debug/[e]trace
Open /sys/kernel/debug/sof/fw_version _after_
/sys/kernel/debug/sof/[e]trace because reading the former is optional
and the latter is not.

So when the driver is not loaded, we get the same (missing trace) error
trace message whether we use the -n option or not.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-02 16:48:27 +01:00
Seppo Ingalsuo b0336346f7 [SKIP CI] Tools: Tune: SRC: Add missing gain to generate scripts
Patch a0ff2bb277 added field .gain to configuration data for
src_generate() but the previous generator scripts were not
updated to set it. This patch fixes in them the error about
undefined gain by setting it to previous -1 dB default.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-08-01 11:11:56 +01:00
Seppo Ingalsuo 978827f7fc [SKIP CI] Tools: Tune: SRC: Add to coefficients data Doxygen cond comments
This patch updates the SRC tool to export same guidance for
Doxygen as added by a previous patch for coefficients
header files. The added comments to begin and end are:

/** \cond GENERATED_BY_TOOLS_TUNE_SRC */
/** \endcond */

The impacted headers remain identical so they don't need update.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-08-01 11:11:56 +01:00
Pierre-Louis Bossart d87adcd2dc topology1: CMakeLists: add missing APL/GLK support for ES8336 with DMIC.
For some reason we added DMIC-based topologies for all platforms
except GLK and APL.

This should be back-ported to 2.2 stable.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-19 09:40:28 +01:00
Ranjani Sridharan b80fc03c4c tplg_parser: Add support for parsing process components by UUID
Add support for loading the process components by UUID. This needs a
modification in the IPC3 helper to modify the ipc data pointer to
address followed by the UUID in the component extended data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-07-18 16:56:40 +01:00
Brent Lu 41e56b336d topology: sof-jsl-rt5682: enable mclk always-on feature
Enable the always-on feature for pop.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-07-18 14:20:09 +01:00
Brent Lu 8dfc008b8b intel: ssp: implement mclk always-on feature
In the earliest design, mclk is turned on in set_config() and never
turned off. The behavior is modified in this commit:

d5840a9200 ("ssp: move mclk request/release to pre_start and post_stop")

Now the mclk is enabled only during audio streaming so some codec may
pop. This commit adds the always-on behavior back as an new feature.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-07-18 14:20:09 +01:00
Fred Oh 23e81f7c20 topology2: cavs: add mixer-based hda pipelines to passthrough hdmi tplg for mtl
First two pipelines are mixer-based HDA playback and capture pipelines.
Tested with ALC256 HDA codec.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-07-15 09:08:12 +01:00
Fred Oh fcca1c3b7c topology2: cavs: re-order cavs hda toplogies
Re-ordering CNL TGL to MTL and DMIC 2ch to 4ch.
No functionality change.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-07-15 09:08:12 +01:00
Pierre-Louis Bossart 4be016befc topology1: sof-tgl-rt711-rt1308: use EXT_AMP_REF for rt1316
RT1316 is exposed by the machine driver as having an echo reference,
so the indices are different from the regular ones.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Pierre-Louis Bossart 04df9161cb topology1: sof-tgl-rt711-rt1308: make BT_OFFLOAD a CMakeFiles parameter
Somehow we assumed that all ADL platforms support BT_OFFLOAD. Wrong,
this is only valid for Chromebooks and needs to be set externally in
the CMakeFiles definitions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Pierre-Louis Bossart 7666716e12 topology1: CMakeLists: add topology for HP Omen 16
RT711 on link0 and RT1316 on link3.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Pierre-Louis Bossart e70fd0fbf7 topology1: sof-tgl-rt711-rt1308: make amplifier link configuration
HP Omen 16 devices have an amplifier on link3, add the required
configuration macro.

BugLink: https://github.com/thesofproject/linux/issues/3727
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00