Commit Graph

1034 Commits

Author SHA1 Message Date
Ben Zhang 6dd44d5b4c comp: Add initial Google hotword detector
Add a new component that uses the Google hotword library
to do keyword detection. The language model needs to be
set using the byte control from userspace before running
the detector.

1. Put the hotword library at $SOF_REPO/third_party_libraries/
hotword_dsp_api.h
libhifi3_google_hotword_dsp_api.a (TGL)
libcometlake_google_hotword_dsp_api.a (CML)

2. Build SOF fw and tools with xcc

3. Set language model on DUT:
amixer -c 0 contents | grep Model
      numid=73,iface=MIXER,name='GHD9.0 Hotword Model'
./sof-ctl -n 73 -t 0 -b -r -s x_google/en_all.mmap

4. Open the WoV pcm device
arecord -Dhw:0,8 -M -N -r 16000 -c2 -f s16_le --buffer-size=67200 -vvv
/tmp/wov.wav

5. Say "OK Google" and verify wov.wav

Signed-off-by: Ben Zhang <benzh@chromium.org>
Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2021-06-11 13:53:12 +01:00
fy.tsuo a85e06a380 audio: igo_nr: added active channel selection
Use binary to configure active channel index.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-06-11 11:39:45 +01:00
Marc Herbert 73df64444b logger: prefix and pad "task add 0xbe05ba30 <bad uid ptr 0x00000000>"
Before:
 WARN task add 0xbe05ba30 <bad uid ptr 0>

After:
 WARN task add 0xbe05ba30 <bad uid ptr 0x00000000>

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-10 15:50:21 +01:00
Marc Herbert 448bbc61a7 logger: print INFO and DEBUG prefixes, not just ERROR and WARN
It's not long and more consistent.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-10 15:50:21 +01:00
Marc Herbert ab643b7655 logger: catch out of bounds e->params[i] access
... when there are too many % characters in format string. Spotted by
routine valgrind run.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-10 15:50:21 +01:00
Ranjani Sridharan 5b072d97d5 topology: sof-apl-nocodec: revert to static pipelines
Dynamic pipelines will fail with the sof-apl-nocodec topology
due to issues with the memory allocator. Revert back to
use static pipelines until we have a more flexible memory
allocatory available with Zephyr.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-10 12:11:57 +01:00
Keyon Jie 64c5f3a46b topology: sof-tgl-nocodec-ci: fix DMIC16KHz PCM
Correct the wrong PCM name and pipeline number.

Fixes: 7c62a65ac6 ("topology: sof-tgl-nocodec-ci: add dmic16k coverage")
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-06-09 23:00:13 +08:00
Brent Lu 5abd8a9ea5 topology: sof-glk-cs42l42: using 2.4MHz bclk
By changing bclk to 2.4MHz, we can use XTAL as clock source and reduce
power consumption.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2021-06-08 21:37:15 +01:00
Keyon Jie 7c62a65ac6 topology: sof-tgl-nocodec-ci: add dmic16k coverage
Add dmic16k to run on Core 0, this will help to cover DMIC dais on
multi-core scenario (dmic 48k on core 2, dmic 16k on core 0).

Also correct the comment w.r.t. DSP cores.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-06-08 16:37:24 +01:00
Viorel Suman 58b4aa472a topology: imx8: add kwd component with wm8960 codec
Add KWD topology for imx8: SAI1 and wm8960 codec
used for recording.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2021-06-03 13:49:58 +01:00
Curtis Malainey 89e7983498 probe: fix realloc mishandling
you need to use a temp var always with realloc, otherwise you through
away your pointer to your memory (which is still valid) in the event of
realloc failing.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-06-03 13:32:59 +01:00
Curtis Malainey ead5afa6c2 probe: refactor function to decrease indent
following commit fixes a bug but to do the fix we need to allow
ourselves more room to add ifs, so lets pull out this function

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-06-03 13:32:59 +01:00
Seppo Ingalsuo 8cec7d3ef1 Topology: Allow 8 - 192 kHz rates for Media Playback PCM
The pipeline was limited to 48 kHz min and max that is not
useful for running and testing SRC component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-06-03 13:21:35 +01:00
Liam Girdwood 60a6b1330e testbench: improve error messaging on file failures.
Tell the user the error.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-03 09:31:27 +01:00
Liam Girdwood da67183a6b testbench: fix the component type for file writer.
Incorrectly set as filereader. Fix it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-03 09:31:27 +01:00
Liam Girdwood 74e0872f08 testebench: no need for parenthesis around case values.
Remove and use correct style.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-03 09:31:27 +01:00
Liam Girdwood 6c290043f7 ipc: abstraction: Add initial IPC4 support.
This patch adds the initial IPC4 messaging structures as used by existing
host middle ware. These are mapped onto existing pipeline APIs to support
creation of certain pipeline elements using IPC4.

This patch only upstream the interfaces, the IPC handler is to follow.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-03 09:31:03 +01:00
Ranjani Sridharan 9742cf3ae6 topology: clean up graph list name for all pipelines
No functional change. Graph names are not used anywhere.
But matching the name with the pipeline name will help
make it easy to convert 1.0 topologies to the 2.0 syntax.
Also remove the -PIPELINE_ID suffix from all the name as the
P_GRAPH macro adds it already.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-06-01 11:05:23 +01:00
Libin Yang 5d9d2ddad8 topology: fix hdmi pcm id for cnl-rt5682-sdw2
HDMI PCM id should be 5, 6, 7 as described in the
sof-cnl-rt5682-sdw2.m4.

Let's use 5, 6, 7 as the HDMI PCM ID to match the UCM setting.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-05-27 10:54:02 +01:00
Marc Herbert d641558ef0 logger: print the value of a negative DELTA when there is one
Because why not.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-27 09:07:46 +01:00
Marc Herbert be7bed9ddf logger: don't "return" when failing in the main loop, break instead
Set the error code in "ret" and only exit the loop so we don't lose the
optional warnings at the end of the loop.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-27 09:07:46 +01:00
fy.tsuo 9ae018b9fa topology: max98373-rt5682: define dmic 48k core id
Define DMIC_PIPELINE_48k_CORE to assign dmic 48k pipeline core id.

For sof-tgl-max98373-rt5682 platform, it is necessary to offload

dmic 48k pipeline to core 1 of TGL because igo_nr takes high MCPS.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-26 20:24:06 +01:00
Ben Zhang 9d21f9ecf2 topology: Add a tgl-max98357a-rt5682 tplg with DMIC16k on PDM1
There are TGL devices using either PDM0 or PDM1 port for the DMIC16k
DAI for hotword detection. This patch adds the DMIC_DAI_LINK_16k_PDM
parameter and builds both versions.

Signed-off-by: Ben Zhang <benzh@chromium.org>
2021-05-26 08:08:49 -07:00
Marc Herbert fa5cc118b5 fuzzer: add deprecation README.md
As discussed in https://github.com/thesofproject/sof/pull/4132

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Marc Herbert e69e1c7eeb scripts/build-tools: some usage and other clarifications
Fixes #4141. I got tired of repeatedly having to read CMakeLists.txt
files.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Marc Herbert a5b3c8e36b logger: increase time_fmt[] size to avoid a gcc warning.
gcc does not know that we already filtered unreasonable precision
values.

Increase the size of the temporary string from 32 bytes to 64
bytes. We're running on the host, memory is cheap.

Fixes commit d6f6a456c1 ("logger: fix column and header alignments")
For some reason CMake uses -Werror=format-truncation only in Release
mode.

Avoids the following warning:

```
sof/tools/logger/convert.c: In function ‘fetch_entry’:
sof/tools/logger/convert.c:514:27: error: ‘%d’ directive output may be
  truncated writing between 1 and 10 bytes into a region of size
  between 0 and 18 [-Werror=format-truncation=]

  514 |      "%%s[%%%d.%df] (%%%d.%df)%%s ",
      |                           ^~

sof/tools/logger/convert.c:514:6: note: directive argument in the
       range [0, 2147483647]
  514 |      "%%s[%%%d.%df] (%%%d.%df)%%s ",
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from /usr/include/stdio.h:867,
                 from sof/tools/logger/convert.h:13,
                 from sof/tools/logger/convert.c:21:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10:

   note: ‘__builtin___snprintf_chk’ output between 21 and 59 bytes into
   a destination of size 32

   67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   68 |      __bos (__s), __fmt, __va_arg_pack ());
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Jaska Uimonen 636cbefc62 topology: add missing tokens in SSP_CONFIG_DATA
Add all same tokens to SSP_CONFIG_DATA that we have in
SSP_MULTI_CONFIG_DATA.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-05-24 22:02:49 +01:00
Jaska Uimonen 5cffff335d topology: remove obsolete s24_4le from COMP_SAMPLE_SIZE
Remove definition of s24_4le from COMP_SAMPLE_SIZE macro as it is not
used anywhere. Instead all pipelines are using s24le definition and the
COMP_SAMPLE_SIZE macro works only because it defaults to 4 bytes.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-05-24 17:07:14 +01:00
fy.tsuo c32a0e032f topology: igo_nr: move igo_nr to core 1.
igo_nr runs on core 1 to balance loading.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-21 11:06:47 +01:00
fy.tsuo 9266614004 audio: igo_nr: igo_nr support 48k
To roll back SSP clock setting to original one.

igo_nr now support 48k-in-48-out and the entire pipeline

DMIC_PIPELINE_48k is reverted back to 48k too.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-21 11:06:47 +01:00
Liam Girdwood 45918aa19b dai: abstract the DAI hardware configuration
Currently the DAI HW configuration is tightly bound to the IPC major
version and IPC structures. Provide a mechanism whereby different
IPC data structures can be passed for DAI configuration.

This change does the following changes.

1) Pass a common ipc_config_dai structure to all dai config call. This
allows retention of common logic that uses this common data.

2) Provide a IPC specific private data pointer to the dai config that
can be interpreted by the DAI as custom data. Today this is the
existing IPC, but it could also support an NHLT binary register blob in
the future.

3) Splits ipc specific code out of src/audio/dai.c and into
src/ipc/ipc3-dai.c.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-05-20 14:01:34 +01:00
Yong Zhi 68499a08ba topology: sof-tgl-rt711-rt1308: add BT offload for ADL
Add pipelines for Bluetooth offload support:

PCM14 <---> passthrough (pipe 13, 14) <---> SSP2 BT offload

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-19 15:22:35 +01:00
Chao Song f510435a25 topology: sof-tgl-nocodec-ci: run pipelines on different cores
This patch moves DMIC pipeline to run on DSP core 2,
and SSP1 pipelines to run on DSP core 3 for multi-core
verification.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Zhang Keqiao <keqiao.zhang@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-05-17 22:24:06 +08:00
Yong Zhi e9d2900b3b topology: adl-sdw-max98373-rt5682: Add BT offload support
Add BT offload support for ADL platform:

PCM14 <---> passthrought (pipe 14, 15) <---> SSP2 (BT offload)

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-05-17 09:15:38 +01:00
Vamshi Krishna e112e0bc0f topology: sof-tgl-sdw-max98373-rt5682: add support for ADL
For speakers SDW2 link is used.
For Headset SDW0 link is used.
add sof-adl-sdw-max98373-rt5682 topology

Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
2021-05-13 12:27:22 +01:00
Vamshi Krishna 7d44f31e7d topology: sof-tgl-sdw-max98373-rt5682: remove redundant topologies
removing 2-ch topology and renaming 4-ch topology.

Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
2021-05-13 12:27:22 +01:00
Ranjani Sridharan 426d7816e2 topology: nocodec: switch to dynamic pipelines
Switch the APL/CNL/ICL/JSL/TGL nocodec topologies to use dynamic
pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-05-13 11:58:06 +01:00
Ranjani Sridharan b371f93c51 topology: hda: re-enable dynamic pipelines
Re-enable dynamic pipelines for HDA topologies.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-05-13 11:58:06 +01:00
Pin-chih Lin 1f68cabafa topology: add drc-eq-volume-demux playback pipeline and default coefs
Adds pipe-drc-eq-volume-demux-playback.m4 for locating Multiband DRC and EQ
IIR on the path of the internal speaker.

This pipeline will be used by Eldrid first for Audio DRC/EQ offloading
purpose.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-05-12 13:44:28 +01:00
fy.tsuo 7fa9befd57 topology: sof-tgl-max98373-rt5682: added igonr.
Added sof-tgl-max98373-rt5682-igonr.tplg.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-12 13:01:15 +01:00
Pierre-Louis Bossart d430091259 topology: add missing configuration for byt-max99080
Somehow we only support this configuration for BYT, but there are
Baytrail devices using the same codec.

BugLink: https://github.com/thesofproject/sof/issues/4160
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-05-12 09:23:22 +01:00
Marc Herbert 96f6a7b385 logger: add error messages when failing in the middle of fetch_entry()
Failing _in the middle of one log entry_ should really not be treated as
a normal event. The purpose of a logging tool is to find issues, not
hide them.

Don't abort on EOF because of valid use cases like device suspend but
don't do it quietly.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-12 09:22:10 +01:00
Marc Herbert e6f0f8b60f logger: add or fix error handling in read_entry_from_ldc_file()
Add a few missing log_err().

Remove calls to ferror() because:
- its return value is a meaningless "non-zero" boolean,
- we don't really care whether the dictionary file is in an error state
  or not; an unexpected end of dictionary file is just as bad.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-12 09:22:10 +01:00
Marc Herbert fb02c56649 logger: don't sound like the DMA trace can wrap
In general the DMA trace runs until interrupted but there are cases
where it can exit "normally": when reading from a file or stdin, when
some error happens,....

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-12 09:22:10 +01:00
Marc Herbert 1e64b7e83c logger: fix relative timestamp when re-opening the trace after EOF
Need to reset the (now global) entry number.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-12 09:22:10 +01:00
Liam Girdwood 80666b7cc7 ipc: component: abstract the component creation API
Make sure component creation is not tightly coupled to a particular IPC
version. This is mostly a mechanical change of structures being passed
to the comp creation APIs away from IPC specific to general structures.

Highlevel changes

1) Pass a common component data object and a component
specific data object during create().

2) Mark the component IPC derived data as "ipc_config" within the
component device to help developers track the data source origin.

3) Pass component specific data during creation so that componets
can allocate and copy to thier private data.

4) Comp_dev no longer has component specific data appended to it.
Instead we can store all in the comp private data (and hence use the
compiler to access it rather than by developer access methods).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-05-10 15:36:07 +01:00
Keyon Jie 47d223c09f 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-05-08 22:43:58 +08:00
Ross Chisholm f706843697 topology: adding IIR component on max98373-rt5682 topology
Builds a configuration of the max98373-rt5682 topology with AMP_SSP=2
defined and includes the IIR component

Signed-off-by: Ross Chisholm <ross.chisholm@xperi.com>
2021-05-06 17:21:57 +01:00
Libin Yang 7851493534 topology: add sof-adl-rt711 topologies
Add sof-adl-rt711.tplg and sof-adl-rt711-4ch.tplg.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-05-06 16:59:52 +01:00
Libin Yang 37c485df36 topology: sof-tgl-rt711-rt1308: add EXT_AMP option
Some devices are using rt711 only, without amplifiers.
Add the "EXT_AMP" option in sof-tgl-rt711-rt1308.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-05-06 16:59:52 +01:00