Commit Graph

1170 Commits

Author SHA1 Message Date
Marc Herbert 31b3a39202 sof_ri_info: print error messages on stderr
stderr is often highlighted with a different color.
This also makes the usual >/dev/null redirection possible.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 2dbec9f2b2 sof_ri_info: show file offsets for most components + some lengths
File offsets were critical in finding the serious begin_off bug fixed in
the same series. The information is already there so just show it.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 06187791d7 sof_ri_info: fix adsp_mft_cse_entry.entry_file_offset
Fixes the adsp_mft_cse_entry Component added by
commit 8885b465df ("tools: sof-ri-info: move parsing adsp mft outside
cse mft").

`adsp_mft_cse_entry.entry_file_offset` did not account for the extended
manifest.

Also fix the large `reader.ext_mft_length + entry_offset`
copy/paste/diverge

That variable did not seem to be used anywhere yet but it's wrong value
was confusing and time-consuming when debugging.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert c66e26a9cf sof_ri_info: fix wrong begin_off in parse_mft_extension()
This broke parsing any extension past the first one.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Ming Jen Tai bf1e3b7f5b Support both 48kHz and 16kHz recording
Add 48kHz recording support to RTNR
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-10-19 13:40:12 +01:00
Brent Lu b50afe03cd topology: sof-tgl-max98357a-rt5682: add support for max98360a
Add support for max98360a running on ADL boards. We choose SSP1 for
speaker amplifier for BT offload compatibility. Also increase the
sample depth to 32 bits for more dynamic range and avoid using m/n
counter.

We add the flag SSP_CC_BCLK_ES to SSP0 for the compatibility with
CS42L42 in the future.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2021-10-13 14:54:22 +01:00
Ajit Kumar Pandey d4254be1ad topology: topology1: Add initial topology for AMD Renoir
Add m4 and headers to support basic topology with passthrough
pipeline for ACPSP and DMIC use cases support on renoir platform.

Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-10-07 15:06:55 +01:00
Kai Vehmanen 40484a87f2 topology1: correct misleading comments for priority/core
Comments for calls to PIPELINE_PCM_ADD and DAI_ADD describe parameters
in the same order they are passed to the macros. The only exception is
order of "priority" and "core", and this can be very misleading. In
most cases the actual current values for the two parameters are 0,
making it even easier to make a mistake when modifying them.

Fix the order in the comments to match the actual order in which the
parameters should be passed to PIPELINE_PCM_ADD and DAI_ADD.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-10-05 15:11:22 +01:00
Kai Vehmanen 9dfd2bd493 topology: intel: use 38.4Mhz MCLK for all Bluetooth use-cases
Updated guidance for BT hardware is to use 38.4Mhz MCLK for both
SCO and A2DP mode. This applies for all Intel platforms supporting
Bluetooth offload.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-10-05 15:05:25 +01:00
Daniel Baluta 771db86de2 topology1: codec_adapter: Add 'codec_adapter' pipeline configuration
This adds 'codec_adapter' pipeline configuration  allowing this
pipeline to be part of a more complex topology.

Important configuration here is the 'scheduler' widget. Without this,
'codec_adapter' would work in a more complex topology. This is because
each individual pipeline needs to have a 'scheduling' component.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-09-30 15:45:50 +01:00
Pierre-Louis Bossart 425743e772 topology1: add missing Dell SKU 0A45 topology
Same as before but with newer SDCA codecs.

Matching kernel PR: https://github.com/thesofproject/linux/pull/3162

BugLink: https://github.com/thesofproject/linux/issues/3161
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-09-29 10:58:21 +01:00
Seppo Ingalsuo b3c9ec46d9 Tools: Test: Audio: Run testbench tests with valgrind
The run with valgrind will error if memory leaks are detected.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-27 12:28:37 +01:00
Ming Jen Tai e4e23d47ec Integrate RTNR into sof-adl-max98357a-rt5682
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-09-23 13:50:35 +01:00
Seppo Ingalsuo f47b823cfe Tools: Testbench: File write DAI needs data structures of DAI
Previously the file component stored component data to device
private data similarly as processing components. However the
pipeline treats file as DAI. Without this patch the missing driver
and DAI operation get_init_delay_ms() causes a segfault in pipeline
parameters walk. It is sufficient for the walk to pass to have just
rzalloc() cleared pointers in driver structure.

The file component data is now placed into DAI private data.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-15 14:41:47 +01:00
Libin Yang 714518f5e9 topology1: fix a typo of a tplg name in CMakefile
sof-adl-rt1316-l2-mono-rt714-link0 should be
sof-adl-rt1316-l2-mono-rt714-l0

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-09-15 14:28:34 +01:00
Zhang Keqiao f6bc279da6 topology1: add a test topology sof-adl-nocodec-ci build support
We plan to test the CI test topology on ADL-P nocodec device, so
add the topology build support in cmake list.

Signed-off-by: Zhang Keqiao <keqiao.zhang@intel.com>
2021-09-13 15:44:52 +01:00
Curtis Malainey a0acad3414 CMake: require version 3.13
Without CMP0079 we cannot conditionally include libraries against SOF in
sub directories without seriously restructuring the project. This is
because the old policy requires the link target must be created in the
same folder. This does not work well from a configuration standpoint for
3P audio libraries trying to keep their config in src/audio/*. Rather
than enable the policy, lets simply upgrade since 3.13 is widely
available.

With this upgrade we can also remove the two version dependent checks at
the top of our scripts.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-10 17:19:29 +01:00
Pierre-Louis Bossart 8fc5247289 topology: move IMX and MTK topologies out of Intel list
Not sure why they were intertwined, let's separate them out to avoid
git conflicts with integration.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-09-08 20:19:41 +01:00
Pierre-Louis Bossart 24ad7ea0fa topology: sof-glk-es8336: initial support
This topology is used on GLK and TGL. variations include:
- DMIC supported on TGL and not on GLK
- TGL uses SSP0 instead of SSP2

APL support was added only based on user reports. This assumes the
same topology as GLK but was not tested.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-09-08 20:19:41 +01:00
Allen-KH Cheng 7eda2d509e topology1: add sof-mt8195-mt6359-rt1019-rt5682 topology
Add sof-mt8195-mt6359-rt1019-rt5682 topology

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-07 13:33:01 +01:00
Allen-KH Cheng 3342311c8e topology1: add afe config
Add afe config for mt8195

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-07 13:33:01 +01:00
Allen-KH Cheng 5ae624cf4e topology1: add afe tokens
Add afe tokens for mt8195

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-07 13:33:01 +01:00
Allen-KH Cheng e9ae9e07ca topology1: add afe.m4
Add afe.m4 for afe related define

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-07 13:33:01 +01:00
Allen-KH Cheng 16975ced60 topology1: add sof-mt8195-mt6359-rt1019-rt5682.m4
Add sof-mt8195-mt6359-rt1019-rt5682.m4 for mt8195

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-07 13:33:01 +01:00
Allen-KH Cheng afc39d10a5 topology1: add mt8195.m4
Add mt8195 pipelines and components

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-07 13:33:01 +01:00
Guennadi Liakhovetski f5760a648d pipeline: trigger START from the task context
When the firmware receives a START or RELEASE IPC message, it
immediately triggers all involved components, which starts DMA.
Then it schedules the pipeline task, but since the scheduler can be
already running at that time, the task might be scheduled when DMA
data isn't available yet or has already overflowed. To fix this
change the control flow to also trigger all components from the task
during its first run. Actual data processing then begins with the
next period. Note, that this is currently only possible with
pipelines, using timer-based scheduling. Pipelines, using DMA
interrupts for scheduling are unaffected.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-08-31 21:14:37 +01:00
Guennadi Liakhovetski 1103860a8d pipeline: add two new trigger commands and a new state
We need to split the START trigger command into two commands because
some components have a long delay inside their START handling. This
patch introduces two new trigger commands: PRE_START and
PRE_RELEASE and a new state PRE_ACTIVE to prepare for that split.
For simmetry POST_STOP and POST_PAUSE are also added, however they
aren't used yet.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-08-31 21:14:37 +01:00
ShriramShastry 3d674bca57 TDFB Improve directivity index and WNG
Added singular value decomposition algorithm
	for diagonal matrix calculation. Added filters for side
	lobe artifacts.

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2021-08-30 11:00:52 +01:00
Seppo Ingalsuo 23c7e4739c Topology: Add development example of demux and EQ band-split pipeline
This patch adds topologies sof-apl-nocodec-demux-eq-2ch4ch.tplg and
sof-apl-nocodec-demux-eq-4ch4ch.tplg. Playback of 2ch creates 4ch
output in format L_lo, L_hi, R_lo, and R_hi. An example band-split
at 2 kHz is configured for EQ processing. The low band contains
an additional 80 Hz high-pass.

The pipeline was tested in UP2 device. The nocodec topology enables
an useful SPP loopback mode. The capture PCM is connected to DAI
loopback so this pipeline can be tested with simultaneous 2ch aplay
and 4ch arecord.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-08-26 09:57:35 +01:00
Rander Wang 0fefcc8bdf topology2: ipc4: add mixin & mixout support
Also add a simple pipeline used by windows. A normal
playback pipeline is : copier -> mixin -> mixout -> gain -> copier

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-26 09:49:43 +01:00
Jaska Uimonen 73803adec9 topology2: add dmic to nocodec topology
Add dmic definition to nocodec topology.

Suggested-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-08-25 15:39:43 +01:00
Jaska Uimonen c4880ff50a topology2: add dmic and pdm classes
Add classes for dmic and pdm config.

Suggested-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-08-25 15:39:43 +01:00
Pin-chih Lin 541e070eec multiband_drc: Add switch control for enabling DRC
Add mixer type control switch for enabling/disabling DRC.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2021-08-24 17:46:09 +01:00
Ming Jen Tai d3381eaa13 Integrate RTNR into sof-tgl-max98357a-rt5682.m4
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-08-24 17:41:38 +01:00
Marc Herbert 1d8f68140e tools: remove spurious dependency on rimage
This reverts May 2020 commit a2de860f42 ("cmake: fix tools build
with submodules") that added a dependency on rimage for the entire
`tools/` subdirectory, probably because `smex/ldc.h` included
`rimage/fw.h` (removed in previous commit).

Looking at the code review I can see no apparent attempt to understand
anything, not even a quote of a build error message.

This will hopefully unblock
https://github.com/zephyrproject-rtos/zephyr/pull/37250

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-08-24 13:22:47 +03:00
Yong Zhi 0570315cd9 topology: pipe-volume-demux-playback: fix pipeline comments
Update the comments to match the P_GRAPH definition.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-08-23 13:25:37 +01:00
Fred Oh ce97fc7128 topology1: sof-tgl-sdw-max98373-rt5682: use a mockup of the smart amp
Remove 3rd party library dependency.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-08-18 13:10:45 +01:00
Ming Jen Tai bbc5209c4f Support RTNR on Tigerlake platform
This PR adds RTNR Noise Reduction/Suppression(NR/NS) component by
Realtek Semiconductor Corp. This feature links to proprietary libraries.
Please contact antz0525@realtek.com for any question about the library.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-08-17 16:18:21 +01:00
Yong Zhi 93e572050c topology1: tgl-max98357a-rt5682 fix ENDPOINT_NAME macro side effect
Without enclosing ENDPOINT_NAME with `', the generated tplg has
pcm id 0 named to "Headphones" instead of "Speakers".

$ ./tplgtool.py ~/work/sof/tools/build_tools/topology/sof-tgl-max98357a-rt5682.tplg
pcm=Headphones;id=0;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=Headset;id=1;type=both;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI1;id=2;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI2;id=3;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI3;id=4;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=HDMI4;id=5;type=playback;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=EchoRef;id=6;type=capture;fmt=S16_LE;rate_min=48000;rate_max=48000;ch_min=2;ch_max=2;
pcm=DMIC;id=99;type=capture;fmt=S32_LE;rate_min=48000;rate_max=48000;ch_min=4;ch_max=4;
pcm=DMIC16kHz;id=100;type=capture;fmt=S16_LE;rate_min=16000;rate_max=16000;ch_min=2;ch_max=2;

$ grep Headphones topology/sof-tgl-max98357a-rt5682.conf -n -B5

7071-# PCM Low Latency, id 0
7072:SectionPCM."Headphones" {
7073-
7074-	# used for binding to the PCM
7075-	id "0"
7076-
7077:	dai."Headphones 0" {
7078-		id "0"
7079-	}

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-08-16 09:05:01 +01:00
Vamshi Krishna Gopal 6713cace35 topology: sof-tgl-max9357a-rt5682: add support for ADL
For speakers SSP2 link is used.
For Headset SSP0 link is used.
Adding required macros to select SSP and Platform.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
2021-08-13 17:45:41 +01:00
Oleh Titov 691c4e0587 topology: Add Waves codec to JSL topology
Modify sof-jsl-rt5682 topology so Waves codec can be added
to playback in case 'WAVES' is defined.
Small refactoring

Signed-off-by: Oleh Titov <Otitov@waves.com>
2021-08-12 14:51:38 +01:00
Kai Vehmanen c8b759a806 topology1: fix error in LOCAL_CHANNELS_MIN definition
The patch to fix CHANNELS_MIN side effects had a bug in which caused
LOCAL_CHANNELS_MIN to slip into conf output. Example from
sof-adl-sdw-max98373-rt5682:

---cut--
SectionPCMCapabilities."Passthrough Capture 14" {
»       formats "S16_LE"
»       rate_min "8000"
»       rate_max "16000"
»       channels_min "LOCAL_CHANNELS_MIN"
--cut--

Fixes: 659266685b ("topology: remove side effects from macro definitions")
BugLink: https://github.com/thesofproject/sof/issues/4621
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-12 10:40:57 +03:00
Iuliana Prodan bee27fe258 topology1: i.MX: Add topology with DRC component
Dynamic range compression (DRC) or simply compression is an
audio signal processing operation that reduces the volume of
loud sounds or amplifies quiet sounds, thus reducing or
compressing an audio signal's dynamic range.

This enables the DRC component for i.MX8QM/i.MX8QXP/i.MX8MP
with wm8960 codec.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-11 13:47:54 +03:00
Bud Liviu-Alexandru 659266685b topology: remove side effects from macro definitions
This commit fixes the issue mentioned in #4583.

A temporary definition is introduced that takes it's value from
"CHANNELS_MIN" if it is already defined, otherwise it is set to
a default value. This temporary is used instead of "CHANNELS_MIN"
for the rest of the file. This avoids having the macro defined in
files where it shouldn't be.

In order to be completely sure it avoids side effects this temporary
is undefined after it is no longer needed.

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-08-09 21:28:40 +01:00
Ranjani Sridharan 5a42c023d2 topology1: make all cavs nocodec topologies dynamic
All cAVS platforms can use dynamic pipelines with nocodec topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-08-05 22:45:35 +01:00
Daniel Baluta 0d14a64ea6 topology1: i.MX: Add topology to demonstrate EQ FIR component
This enables EQ component using FIR filter for i.MX8QM/i.MX8QXP/i.MX8MP.

Usage:

   $  amixer -Dhw:1 controls | grep EQ
    numid=44,iface=MIXER,name='EQFIR1.0 eqfir_coef_1'

  $ ./sof-ctl -Dhw:1 -n 44 -s sof/tools/ctl/eq_fir_loudness.txt

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-08-03 13:34:11 +01:00
Daniel Baluta ffe4d594ae topology1: pipe-eq-fir-volume: Fix ControlBytes section name
ControlBytes section name is given by DEF_EQFIR_COEF macro.
Otherwise, using pipe-eq-fir-volume-playback.m4 in a topology results in
a compilation error.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-08-03 13:34:11 +01:00
Daniel Baluta c26dfff3bf topology1: imx8ulp: Set min_channels to 1
On i.MX8ULP SAI5 is connected to BT interface that only supports 1
channel.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-08-03 11:44:19 +03:00
Daniel Baluta e2fc7082e1 topology1: Add CHANNELS_MIN macro for playback pipeline
Add macro to allow configuration of min channels in PCM_CAPABILITIES.
The default behavior is not changed.

So far min channels was hardcoded to 2 for pipe-volume-playback but we
need mono for i.MX8ULP configuration.

Notice that we need to use the local macro TCHANNELS_MIN because we
don't want to modify the value of CHANNELS_MIN macro outside
of sof/pipe-volume-playback.m4 file.

Doing so will cause unpredictable behavior for next pipeline
definitions.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-08-02 22:08:07 +01:00
Zhang Peng ac3c5eb76f topology: Add sof-imx8ulp-btsco.m4 for imx8ulp
IMX8ULP pipeline is HOST-->VOLUME-->DAI(sai)-->CODEC(bluetooth).

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-08-02 21:42:31 +01:00