Commit Graph

968 Commits

Author SHA1 Message Date
Curtis Malainey 30719babb4 testbench: print error on failure to prepare
We are capturing the error, we should log it, thank cppcheck for the
find.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-22 11:30:38 +01:00
Curtis Malainey 0f0dd1d7ab testbench: remove unused sets
looks like a bug to checkpatch.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-22 11:30:38 +01:00
Curtis Malainey f227ae7af2 tplg_parser: fix exit path
goto after return is incorrect since it generates unreachable code.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-22 11:30:38 +01:00
Curtis Malainey 30f7931c4e tplg_parser: don't use void * in pointer math
Void * math is technically undefined, so for portability sake lets not
use it.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-22 11:30:38 +01:00
Curtis Malainey 5436fec004 tplg_parser: don't use unsigned types with signed math
cppcheck is (legitmately) upset that we are doing signed math size_t

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-22 11:30:38 +01:00
Curtis Malainey f2bd45bac8 tplg_parser: don't assign unused values
minor style violation

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-04-22 11:30:38 +01:00
Yong Zhi 05eb73e4cb topology: sof-tgl-max98373-rt5682: add Bluetooth audio offload support
Add passthrough pipelines to support Bluetooth sample rates
on SSP port2.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-04-21 22:32:09 +01:00
Yong Zhi 5fc21b6fb7 topology: intel: add generic Bluetooth audio offload pipeline
Make BT offload m4 generic for platforms that supports it.
User needs to provide id number for pipe/link/pcm and hw config.

I2S config for BT SCO:
16 bit samples, 1 slot TDM, no padding
19.2Mhz MCLK, 256/128kHz BCLK, 16/8kHz fsync
Frame-sync length 1 cycle ("DSP_A" mode)
Codec clk in primary mode

For BT A2DP:
16 bit samples, DSP_A protocol
2 slot TDM, no padding
38.4Mhz MCLK, 1.536Mhz BCLK, 48kHz fsync
Codec clk in secondary mode

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-04-21 22:32:09 +01:00
Yong Zhi e81c25eab7 topology: Add CHANNELS_MIN macro for passthrough pipeline
Add macro to restrict channel number of PCM capabilities, this will
allow channels_min to be configurable. The default behavior is
not changed with this patch.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-04-21 22:32:09 +01:00
Ross Chisholm c08f030d53 topology: fixing comments in jsl-rt1015 topology
Corrected comments relating to s32le (was s24le)

Signed-off-by: Ross Chisholm <ross.chisholm@xperi.com>
2021-04-20 19:28:03 +01:00
Ross Chisholm 71814655e6 topology: adding optional support for IIR component on jsl-rt015 topology
Allows the IIR component to be added to the jsl-rt015 topology allowing
tuning

Signed-off-by: Ross Chisholm <ross.chisholm@xperi.com>
2021-04-20 19:28:03 +01:00
Marc Herbert dc0ab8a449 logger: fix precision bug introduced by new -e option
Add missing "break" so the -e option stops spilling on the -f precision
option. Fixes commit 53ce8b9d9f ("logger: new relative timestamps
option, relative to first entry seen"). Since that commit the -e option
was wrongly assigned to the precision too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-19 15:43:06 +01:00
Liam Girdwood 1931168185 pipeline: decouple IPC major from pipeline_new().
Decouple the IPC ABI major version from pipeline creation. This moves
struct sof_ipc_pipe_new from the pipeline and replaces it with it's
members (saving 8 bytes as no header is needed).

Add new feature specific pipeline APIs to configure pipeline at creation.

Additionally align testbench and UTs to API change.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-19 14:29:37 +01:00
Kai Vehmanen be065e55a8 topology: ssp: fix a bug in passing SSP_MULTI_CONFIG_DATA args
The m4 ifelse parameters using defn() are not working as expected.
If more than 3 parameters are passed to SSP_MULTI_CONFIG_DATA(),
the values are not correctly passed.

Fix this by removing defn() and correctly quoting the whole
ifelse section.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-04-16 16:12:43 +01:00
Kai Vehmanen 49547404e9 topology: ssp: fix a bug in passing SSP_CONFIG_DATA args
The m4 ifelse check on macro parameters is not working as expected.
If optional parameters are not passed, an empty string is written
to output conf file, instead of the "0" string specified in
the ifelse statement.

This has not caused functional errors as the empty string has
been interpreted as zero. Fix the logic despite this so that this
is not copied to other macros.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-04-16 16:06:40 +01:00
Liam Girdwood 6678b4022f testbench: align IPC structures on 4 bytes.
IPC is aligned on at least 4 bytes, removes compiler warning about packed
data being aligned on 1 bytes.

In file included from /home/lrg/work/sof/sof/tools/testbench/file.c:23:
/home/lrg/work/sof/sof/tools/testbench/include/testbench/file.h:59:1: error: alignment 1 of ‘struct sof_ipc_comp_file’ is less than 4 [-Werror=packed-not-aligned]
   59 | } __attribute__((packed));
      | ^

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-14 10:51:13 +01:00
Keyon Jie cd2444adbf topology: sof-tgl-nocodec-ci: change to run smart_amp on core 1
Change to run smart_amp pipelines on DSP core 1, this will help reduce
the core 0 usage and add multi-core to the CI coverage.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-13 21:16:56 +01:00
Liam Girdwood c80270e7e4 ipc: structures should all be aligned on 4 bytes
Give the compiler a chance to further optimise IPC data access since it's
all on a 4 byte alignment.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-13 15:32:26 +01:00
Pierre-Louis Bossart fbdc330263 topology: add ADL SoundWire topologies
This is based on early hardware information and subject to change.

The ADL topologies use the link information to avoid confusions on
configurations. The kernel tables will use the same conventions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 8af787ae2b topology: add adl.m4
copy/pasted from tgl.m4, will need to differentiate later

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 8673f92feb topology: align SoundWire topologies with the use of macros
No need for a dedicated topology just to deal with swapped links

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 2ce64f914f topology: soundwire: use macros for dailink names
use eval w/ macros instead of hard-coded values

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 7070c1b2d6 topology: soundwire: add macros for link numbers
remove hard-coded link numbers and make them configurable, this will
allow for reuse of the same topology when the devices are swapped

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 2d66939c37 topology: soundwire: add 'NOJACK' option
Some devices are starting to remove the 3.5mm jack, we need a topology
for these cases.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Pierre-Louis Bossart 375481c442 topology: soundwire: remove hard-coded hex values
replaces with regular base10 indices that are easier to correlate with
kernel/DAPM logs

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-04-13 10:43:03 +01:00
Liam Girdwood e79d5d1f8e fuzzer: fix build as with header order and ARRAY_SIZE redefinition
ARRAY_SIZE was being redefined, simplest option is to remove, but I think
this code has to additionally be compiled with external Fuzzer. Fix build.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 15:57:23 -07:00
Liam Girdwood 517ad95d51 ipc: split ipc headers per function.
Split IPC APIs out by feature so that the IPC layer to help future
IPC infrastructure changes support more than one IPC ABI MAJOR version.

No code changes here, only code partitioning and Doxygen comments.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 19:30:11 +01:00
Liam Girdwood 0f2c9d1230 cleanup: remove double blanks lines.
Several files had multiple blank lines even before the removal of
platform_shared_commit(). Fix them with "cat -s"

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-12 16:58:51 +01:00
Iuliana Prodan d660742d41 topology: imx8: add src component with cs42888 codec
This topology works on i.MX8QM and i.MX8QXP with cs42888 codec.
It adds the Sample Rate Converter component for both playback
and capture.

The SRC topology can be used for test bench and real device usage.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan ec2fcf3e34 topology: imx8: add src component with wm8960 codec
This topology works on i.MX8QM and i.MX8QXP with wm8960 codec.
It adds the Sample Rate Converter component for both playback
and capture.

The SRC topology can be used for test bench and real device usage.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan 6a59154bf2 topology: imx8m: add src component with wm8960 codec
This topology works on i.MX8MP with wm8960 codec.
It adds the Sample Rate Converter component for both playback
and capture.

The SRC topology can be used for test bench and real device usage.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Iuliana Prodan 3472ae1d6e tools: update SRC tool for 96 kHz mode, for tiny profile
This patch adds 96 kHz into SRC generator script for tiny
profile.

I've added 96 kHz in src_tiny_int16.m and follow the steps
from https://thesofproject.github.io/latest/algos/src/sample_rate_conversion.html
to generate the coefficients.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-04-09 13:54:34 +01:00
Keyon Jie 2db847b7b2 tools: test: mix_sweep: correct the start index
The i0 is already the start index, so no need the '+1' for i1
calculation, correct it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-09 13:27:45 +08:00
Keyon Jie be6777006e Tools: Test: thdnf_test_input: correct the noct calculation
To make sure we are using max 1 octave step, we need to use noct+1 to
get noct sections from logspace.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-04-09 13:27:45 +08:00
Oleksandr Strelchenko 72121fb06c topology: Add topology for Waves codec
Add pipe for Waves codec playback
Add pipe for Waves codec demux playback
Modify sof-tgl-max98357a-rt5682 topology so Waves codec can be added
to playback and headphones in case 'WAVES' is defined

Signed-off-by: Oleksandr Strelchenko <oleksandr.strelchenko@waves.com>
2021-04-08 15:39:21 +01:00
Ranjani Sridharan 2c69afc5fd topology: Switch HDA topologies to use dynamic pipelines
Let's start testing dynamic pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-04-06 14:30:55 +01:00
Ranjani Sridharan 8fcacc9fc7 topology: tokens: fix dynamic_pipeline token name
Should be called SOF_TKN_SCHED_DYNAMIC_PIPELINE instead
of SOF_TKN_SCHED_DYNAMIC.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-04-06 14:30:55 +01:00
Ross Chisholm cab7328725 topology: adding support for IIR component
This patch adds IIR support in the tgl-max98373-rt5682 topology to allow
the frequency response of the headset output to be tuned.

Signed-off-by: Ross Chisholm <ross.chisholm@xperi.com>
2021-04-06 14:28:30 +01:00
Daniel Baluta 8530a95224 topology: codec_adapter: Prepare switching to shimmed CA interface
Each codec family is now having its own UUID. We keep the old
codec_adapter UUID to be used with Cadence family codecs.

All other codec families (e.g passthrough, waves) needs to use new
uuids.

The topology files will just need to define CA_UID macro.

e.g for waves codec, topology file should contain:

DECLARE_SOF_RT_UUID("Waves codec", waves_codec_uuid, 0xd944281a, 0xafe9,
		0x4695, 0xa0, 0x43, 0xd7, 0xf6, 0x2b, 0x89, 0x53, 0x8e);

define(`CA_UUID', cadence_codec_uuid)

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-04-06 14:24:03 +01:00
Mac Chiang 208af04724 Topology: Add support for MAX98390 echo reference capture
codec chip playback loopback to capture stream.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2021-04-02 13:39:14 +01:00
Marc Herbert 53ce8b9d9f logger: new relative timestamps option, relative to first entry seen
Add a new sof-logger -e 0/1 relative timestamps option where the
TIMESTAMP column is relative to the first entry seen.

Removes many digits and makes the TIMESTAMP column much more readable in
short logs.

Also stop showing "NaN" as the first DELTA like something went
wrong. Show zero instead.

The new option is off by default when using -r(aw) and on otherwise.

The first entry is kept always absolute.

Before:

         TIMESTAMP              DELTA C# COMPONENT     LOCATION                      CONTENT
[6653843012.343750] (             NaN) c0 dma-trace    src/trace/dma-trace.c:339     ERROR FW ...
[6653843111.510417] (       99.166664) c0 ll-schedule  ./schedule/ll_schedule.c:229  perf ll_work
[6653843309.010417] (      197.500000) c0 ll-schedule  ./schedule/ll_schedule.c:399  task add
[6653843314.166667] (        5.156250) c0 ll-schedule  ./schedule/ll_schedule.c:403  task params
[6653843322.031250] (        7.864583) c0 ll-schedule  ./schedule/ll_schedule.c:309  new added
[6653843327.031250] (        5.000000) c0 ll-schedule  ./schedule/ll_schedule.c:312  num_tasks 2
[6653844109.531250] (      782.500000) c0 sa                    src/lib/agent.c:65   perf sys_load
[6653844155.156250] (       45.625000) c0 ll-schedule  ./schedule/ll_schedule.c:229  perf ll_work
[6653844384.218750] (      229.062500) c0 component       src/audio/component.c:130  comp new host

After:

         TIMESTAMP              DELTA C# COMPONENT     LOCATION                      CONTENT
[686125142.395834] (        0.000000) c0 dma-trace    src/trace/dma-trace.c:339     ERROR FW ...
[       94.270833] (       94.270836) c0 ll-schedule   ./schedule/ll_schedule.c:229  perf ll_work
[      296.770833] (      202.500000) c0 ll-schedule   ./schedule/ll_schedule.c:399  task add
[      301.979167] (        5.208333) c0 ll-schedule   ./schedule/ll_schedule.c:403  task params
[      309.843750] (        7.864583) c0 ll-schedule   ./schedule/ll_schedule.c:309  new added
[      314.843750] (        5.000000) c0 ll-schedule   ./schedule/ll_schedule.c:312  num_tasks 2
[     1092.395833] (      777.552063) c0 sa                     src/lib/agent.c:65   perf sys_load
[     1137.968750] (       45.572918) c0 ll-schedule   ./schedule/ll_schedule.c:229  perf ll_work
[     1850.208333] (      712.239563) c0 component        src/audio/component.c:130  comp new host

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-02 13:35:48 +01:00
Marc Herbert 2e6cafa02f logger: use strerror()
Useful error messages when forgetting to use "sudo" or to change
permissions in udev.

Some places were printing the errno decimal. Others no specific error
at all.

Sample outputs:

error: Unable to open version file /sys/kernel/debug/sof/fw_version: \
                                                       Permission denied

error: Unable to open version file /sys/kernel/debug/sof/fw_version: \
                                               No such file or directory

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-01 22:04:45 +01:00
Marc Herbert 7c08aabbe7 topology/cmake: add missing .m4 dependency, fixes incremental build
There was no [MAIN_]DEPENDS on the .m4 source file, so changes were not
triggering any rebuild.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-26 14:51:33 +00:00
Keyon Jie aee22b07c1 topology: pipe-codec-adapter-playback: fix the blob size
The size of the fallback CA_SETUP_CONTROLBYTES is 20 (0x14), not 0x20,
here correct it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-03-26 10:25:53 +08:00
Cristina Feies (ilie) 9c499bc1d6 topology: imx8m: add kwd component with wm8960 codec
Adapt the apl KWD topology to imx8m by switching to
SCHEDULE_TIME_DOMAIN_DMA on capture pipeline and
creating a no LP capture file for KFBM component.

Signed-off-by: Cristina Feies (ilie) <cristina.ilie@nxp.com>
2021-03-16 13:47:12 +02:00
Seppo Ingalsuo b17280cc0e Topology: Change minimum bus clock to 2.4 MHz for 48 kHz DMIC DAI
The driver configures a lowest feasible bus clock to save power.
Since the 48 kHz and 16 kHz DMIC DAI can now be instantiated in the
runtime there is possibility that the min. 500 kHz clock allowed could
be too low for a new 48 kHz capture when existing 16 kHz capture is
running.

The topologies those define a 48 kHz DMIC DAI need to increase the min.
clock to a sufficient rate. This patch changes every 500 kHz value to
2.4 MHz. This change does not change the external microphone clock in
any platform. The lower than 2.4 MHz clock rates never happened in
previous version to due to the 48 kHz DAI request in these topologies.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-03-08 12:14:26 +00:00
Jaska Uimonen 91a08aa9cc topology: enable setting multiple configs for dai
In some cases we need to change dai configuration in firmware. ASoC
supports already setting multiple hw_configs, but sof M4 scripts lack
the mechanism to do this. Thus enable defining multiple config items in
the dai. Enable now support only for SSP by defining new
SSP_MULTI_CONFIG macros that should not clash with the single dai config.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-03-08 12:11:53 +00:00
Seppo Ingalsuo 5b9a82deff Topology: Add simple topologies (no KWD) for CML RT1011 RT5682
This patch is based on sof-cml-rt1011-rt5682.m4 but omits the
hard coded keyword pipeline and replaces it with a generic
16 kHz capture pipeline. The use of intel-generic-dmic.m4 to
set up the capture pipeline simplifies the topology a lot. This
change makes the topology for CML I2S quite similar to sof-hda-generic
to add audio processing.

All endpoint processing can be defined from top level CMakeLists.txt
with macros HSMICPROC, HSEARPROC, SPKPROC, DMICPROC, DMIC16KPROC.

A sample topology with equalizers in headset and speaker paths is
added.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-03-08 12:07:56 +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
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