Commit Graph

7789 Commits

Author SHA1 Message Date
Andrey Borisovich eb4a9381d3 Added #ifndef guards in compiler_attributes
Building with GCC on Windows using MSYS caused errors related to
macros redefinition in compile_attributes.h due to GCC using its
standard headers. Added #ifndef guards.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-16 12:02:40 +00:00
Andrey Borisovich 2c1f089d39 Added standard headers include path for MSYS
Windows users building with MSYS2 need to provide additional include
path to the POSIX standard headers to build sof-logger with GCC.
Added this include directory when environmental variable
MSYS_INSTALL_DIR is set.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-16 12:02:40 +00:00
Andrey Borisovich f11e275aab Fixed warning W-char-subscripts in sof logger
Newer gcc compilers 9.1+ issue a W-char-subscripts warning when argument
type passed to isspace is not explicitly int. Added cast to int.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-16 12:02:40 +00:00
Pierre-Louis Bossart 04a0d3c1b5 topology1: sof-cml-es8336: use correct 24MHz MCLK
Rookie mistake, the clock can't possibly be 19.2 MHz

Reported-by: Nikolai Kostrigin <nickel@altlinux.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-02-16 12:01:30 +00:00
Ranjani Sridharan 24d1b1a012 topology2: cavs: hda: remove unwanted topologies
We only want the mixin/mixout based HDA and passthrough HDMI topologies.
Delete everything else.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-16 11:59:00 +00:00
Ranjani Sridharan 3d9b6ffd29 topology2: cavs: remove deep buffer pipeline
Remove deep buffer pipeline until the driver code to ready to handle it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-16 11:59:00 +00:00
Ranjani Sridharan 6001e44241 topology1: remove redundant kcontrol for codec adapter pipelines
The codec adapter component only uses a single config now. So remove the
runtime config kcontrol as the same kcontrol can be used for runtime
config as well.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-16 12:28:08 +02:00
Adrian Warecki 838c7328f8 asrc: Fixed sink rate selection
Don't change sink rate if value from IPC is 0 (auto detect)

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-02-15 14:59:48 +00:00
Ranjani Sridharan 8c0b05d579 topology2: cavs: all pipelines should be dynamic by default
Set all pipelines to be dynamic by default.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-15 10:58:34 +00:00
Tomasz Leman 819c023d23 ipc4: fix pipeline reset
During pipeline reset all components remains in previous state. This
cause issue at pipeline deletion. This patch allowed to propagate state
transition to all pipeline components.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-02-14 12:05:04 +00:00
Tomasz Leman 4ec8d8b6f5 ipc4: helper: unbinding modules from the same pipeline
When both module instances are parts of the same pipeline Unbind IPC
would be ignored by FW since FW does not support changing internal
topology of pipeline during run-time. The only way to change pipeline
topology is to delete the whole pipeline and create it in modified form.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-02-14 12:05:04 +00:00
Ranjani Sridharan c84d64b524 topology2: CMakeLists: clarify the pipelines for mixin-mixout tplg
Only the HDA pipelines use mixin/mixout based pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Ranjani Sridharan c94ae772a0 topology2: cavs: split the passthrough pipeline into host and DAI parts
We cannot have one single pipeline going from the host copier to the DAI
copier. So split the passthrough pipeline into host and DAI pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Ranjani Sridharan 788e0534d6 topology2: mixin/mixout pipelines: Add gain before and after mixers
Add gain widgets before and after the mixers in all the
mixin/mixout-based pipelines. Change the cavs-mixin-mixout-hda.conf
topology to add the mixer names for all gain widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
Ranjani Sridharan 3120b7c4c9 topology2: gain: remove default audio formats
Remove the default audio formats from the gain class definition.
They should be added depending on the number of formats based on the
pipeline. Fix the gain-playback and gain-capture pipelines to add the
audio formats for the gain widgets.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-14 11:12:44 +00:00
balapati b8954754f0 amd: renoir: clk: Fix ACP clock to default clock
Fix ACP clocks to default clock during boot up time.

Signed-off-by: balapati <balakishore.pati@amd.com>
2022-02-11 16:11:00 +00:00
Adrian Bonislawski 735d44368f probe: update dma copy method to dma_copy_to_host()
dma_copy_to_host_nowait() no longer exists and needs to be updated

Fixes commit 443b21de4b ("dma-trace: Fix potential race issue by using
blocking DMA copy")

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-02-11 12:17:36 +00:00
Seppo Ingalsuo 2b6001e065 Audio: EQFIR: Optimize source and sink buffers use in generic C version
This patch replaces the audio stream read/write frag based
access to source and sink by block processing based on
audio_stream_bytes_without_wrap() bytes count.

In a test with forced generic C for xtensa build processing load in
original was 324 MCPS, in optimized 309 MCPS, saving is 15 MCPS. The
load is nearly same for all formats s16/s24/s32. The base load was
very high in test due to a very long used FIR filter. The MCPS saving
should be the same for all stereo 48k streams.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-11 11:52:51 +00:00
Guennadi Liakhovetski d0057a7def Revert "zephyr: add a generic Zephyr platform"
This reverts commits e0ff1b16d8,
339e5ac217 and
09c69b7607. A different approach will
be used for making SOF a platform-agnostic Zephyr application.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-02-11 11:18:54 +00:00
Chao Song bf191f6b67 audio: force pcm_converter_generic for IPC4 with zephyr
The copier component depends on special pcm conversion
code, which is only implemented in the generic pcm
converter. If we build SOF with IPC4 support with XCC,
the HIFI3 pcm converter is selected automatically, and
causes the issue of
    undefined reference to `pcm_func_vc_count'
    undefined reference to `pcm_func_vc_map'.

This patch forces the use of generic pcm converter
if build SOF with IPC4 and Zephyr.

This patch should be reverted once the HIFI3 pcm converter
counterpart is implemented.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-02-11 11:02:19 +00:00
Chao Song 487363fb1b zephyr: add copier and base_fw components
The two components copier and base_fw are
essential to IPC4 support on SOF on Zephyr.

This patch integrates the build of the two
components to SOF build with zephyr RTOS.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-02-11 11:02:19 +00:00
Seppo Ingalsuo cf43cb1604 Tools: Topology: Add long FIR EQ topology for sof-hda-generic
The topology is useful for testing long binary control IPC and to
test equalization of headset and speaker in sof-hda-generic devices.
It adds a flat IIR and a generic FIR that creates a mild loudness
effect.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-11 10:41:55 +00:00
Seppo Ingalsuo e9048e4b7d Tools: Topology: Fix erratic FIR example response
The previous patch increased the FIR length but it also triggered
a numerical issue in FIR design with long minimum phase filters. The
filter became essentially a band-stop filter and causes difficulties
in test of EQ component. Also the equalizer sounds subjectively
bad. The fix is to change the design to linear phase that always
converges.

Fixes: 0d296ce7d1

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-11 10:41:55 +00:00
Shriram Shastry 10b4c56ed9 math: Add logarithm base E and base 10
fixpoint math log() and log10() function.  logarithm of a
number is the power or exponent by which another value
must be raised to produce an equivalent value of the given number
fix point  log10(x) is a derivative of log2(x)/log2(10)
and loge(x) is log2(x)/log2(e)

Signed-off-by: Shriram Shastry <malladi.sastry@intel.com>
2022-02-10 16:42:00 -08:00
Lionel Koenig 28de049330 topology1: Fix issue in google-rtc-audio-processing pipeline
This fixes a mistmatch in the PCM capabilities for the Google
RTC audio processing pipeline.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-02-10 16:37:13 -08:00
Jyri Sarha 443b21de4b dma-trace: Fix potential race issue by using blocking DMA copy
It is possible that that in trace_work() sof_ipc_dma_trace_posn ipc
message reaches host side sof driver before the dma_copy_to_host_nowait()
is finished. Change the dma_copy_to_host_nowait() implementation to
dma_copy_to_host() by adding DMA_COPY_BLOCKING flag to dma_copy()
command.

The flag is already there on the !defined(CONFIG_DMA_GW) version of
the function and the old name of the function was a bit misleading.

This commit changes also probe.c probe_task() so that it also uses the
new blocking DMA copy. I could not see any justification to use nowait
version there either.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-02-10 11:57:27 +00:00
Jyri Sarha 5afc494671 drivers: Intel: hda-dma: DMA buffer address should be correctly aligned
Add check for DMA buffer address alignment to hda_dma_set_config().
Wrongly aligned DMA buffer does not work correctly.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-02-10 11:57:27 +00:00
Jyri Sarha c11562b00a dma-trace: Align DMA buffer correctly to fix dma tracing issues
Force DMA buffer to be correctly aligned. If the buffer is only
64-byte aligned, when using hda-dma, then the last 64-bytes of the DMA
buffer is not transferred correctly to host side.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-02-10 11:57:27 +00:00
Ranjani Sridharan 9983ab67a9 topology2: cavs-gain: Add PGA to control names
This is needed for sof-test to identify the controls.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-09 21:50:11 +00:00
Adrian Bonislawski 33ec780df2 ipc4: add updwmix module support
Up Down Mixer module
Conversions supported:
Up/Downmixing for stereo output:
	1, 2, 2.1, 3.0, 3.1, Quatro, 4.0, 5.0, 5.1, 7.1 -> 2
Upmixing for multichannel output:
	1, 2 -> 5.1
	2 -> 7.1
Downmixing for mono output:
	4.0, Quatro, 3.1,
	2 -> 1
At initial release only hifi3 version is supported.

Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-02-09 14:35:18 +00:00
Seppo Ingalsuo e5d95d1dd3 Tools: Topology: Change playback volume ramp to 20 us
The topologies sof-hda-generic were earlier fixed to use short
20 ms ramp because of nearly inaudible UI blip tones with 250 us
ramp. Some changes to topologies build m4 macros have brought
back the long ramp.

This patch fixes the playback ramps to use 20 ms long transitions.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 10:19:48 +00:00
Seppo Ingalsuo b3b937eb3d Tools: Topology: Make PGA token objects unique
This patch avoids the issue that topology .conf file after m4
processing can contain multiple same name objects playback_pga_conf
for volume component tokens with possibly different settings. Alsatplg
does not error from such input and it's not defined which impacs
topology binary.

The new naming is pga_conf_X and and_pga_tokens_X where X is the
pipeline number.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 10:19:48 +00:00
Yong Zhi 7fdd59844d topology2: cavs-nocodec: remove dai_index for copier widget
When generating the tplg, copier inherits its dai_index
from the parent DAI object, since there is no need to overwrite
dai_index with different value, let's remove them from top level conf.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-02-09 10:01:19 +00:00
Seppo Ingalsuo e6f677959b Tools: Test: Audio: Fix typos in tools/test/audio/*
This patch fixes the typos in audio test Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Seppo Ingalsuo ae4c30207e Tools: Tune: Fix typos tools/tune/*
This patch fixes the typos in the setup tools Matlab code.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Seppo Ingalsuo b38b746607 Audio: Fix spelling typos in src/audio/*
This patch addresses the typos in audio processing components.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-09 09:52:17 +00:00
Kai Vehmanen e20384eb6a testbench: add option to override CPU core mapping
Add option to override how a core id, specified in SOF topology, is
mapped to host core. This allows to map a multithreaded pipeline
execution to specific range of host CPUs.

Implement the option via environment variable "SOF_HOST_CORE0", which is
understood by the CONFIG_LIBRARY implementation of ll-scheduler.

Document the usage to testbench help. mapping of DSP core ids specified
SOF_HOST_CORE

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-09 09:44:34 +00:00
Guennadi Liakhovetski a61ff1fe63 buffer: use a mutex for locking under Zephyr
Buffers are never handled from atomic context. Use the _thread
variant of the coherent API for them to use a mutex under Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-02-08 13:46:45 +00:00
Guennadi Liakhovetski a3d9b029be kpb: use a mutex under Zephyr
KPB is using a lock to protect its buffers. That lock is taken in two
contexts: in the KPB draining task and in the pipeline task, that it
notifying KPB to drain buffers. Under Zephyr both these contexts
are running in thread context. This allows us to use a mutex under
Zephyr for this lock.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-02-08 13:46:45 +00:00
Guennadi Liakhovetski 81883871b6 coherent: add locking variants for thread context
When used from thread context the coherent API can use mutexes for
locking to avoid unnecessarily disabling interrupts.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-02-08 13:46:45 +00:00
Seppo Ingalsuo 84c9033fea Tools: Test: Audio: Add sound direction test for TDFB
This patch adds Matlab script tdfb_direction_test.m. The test
simulates acoustical microphone array capture with 360 degrees
rotated noise source. The test topologies build adds an array
identifier to component name in topology file name. That
allows the scripts to simulate with several arrays. Now a
basic 2 mic array (no array suffix, just tdfb), 4 mic line,
and 8 mic circular are tested. Test pass/fail is so far only
visual check from plot.

The existing tdfb_test.c is extended to perform test with the
three test array configurations.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-02-08 12:34:32 +00:00
Brent Lu cb755f879d comp: re-link buffers in make_shared
After moving component to a new memory location, not only source and
sink lists need to re-link but also the buffers which already been
connected to this component.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-02-08 10:48:53 +00:00
Liam Girdwood 9ad987e7fd testbench: return error up the stack.
Dont exit() but return the error up the stack for proper handling.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 0cec50a976 testbench: further refactor of per pipeline data
The testbench currently has a global structure that contains
per topology and per pipeline data. Refactor to move data to the
most appropriate structure for use.

This is not the final fix, further refactoring is needed.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood ac12b4a748 testbench: print a meaningful error if scheduling comp is not found
Let the user know if the scheduling component is missing and handle it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 6f43299f3b testbench: take the global data off the stack.
Testbench prm is global data used by many thread. Take it off the stack.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood 480d1ad168 testbench: improve error messages in topology load
Give users more information when failures occur.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
Liam Girdwood c3adfcecc7 testbench: add support for mixer
Add mixer support to the testbench

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-02-08 10:43:18 +00:00
balapati 47ef306bf7 amd: renoir: Add lock for synchronization b/w host and DSP
Add hardware semaphore lock before accessing trigger
bits to achieve proper synchronization between host and
DSP during IPC communication.

Note: Same hardware lock is implemented in amd host driver.
Signed-off-by: balapati <balakishore.pati@amd.com>
2022-02-08 09:28:18 +00:00
Ranjani Sridharan 1303c1a233 topology2: cavs-gain-hda: Add 32-bit support
Add 32-bit support in PCM capabilities.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-02-08 09:26:38 +00:00