Commit Graph

8061 Commits

Author SHA1 Message Date
Rander Wang b154132b46 ipc4: check pipeline priority for error report
Fix capture issue on windows and linux. In original code
if the source is in another pipeline line and is inactive
, ENODATA is returned. If current pipeline has higher
priority than the source pipeline, then the source pipeline
may be not started, so we return error only when source
pipeline has higher priority.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-19 16:43:45 +01:00
Sathyanarayana Nujella b67c2bf0d9 alloc: Making heap trace dump more readable
This Patch to help easily understand available heap from the trace dump.

Current dump:
src/lib/alloc.c:567  heap: 0xbe206000 size 12288 blocks 3 caps 0x65
src/lib/alloc.c:569   used 448 free 11840
src/lib/alloc.c:577   block 0 base 0xbe206000 size 64
src/lib/alloc.c:580    count 64 free 57

Dump with this patch:
src/lib/alloc.c:567  INFO  heap: 0xbe206000 size 12288 blocks 3 caps 0x65
src/lib/alloc.c:569  INFO   (In Bytes) used 0 free 12288
src/lib/alloc.c:576  INFO  64 Bytes blocks ID:0 base 0xbe206000
src/lib/alloc.c:580  INFO    Number of Blocks: total 64 used 0 free 64

Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Jairaj Arava <jairaj.arava@intel.com>
2022-04-19 16:40:29 +01:00
Ranjani Sridharan 2efc3ea41c topology2: dmic-generic: add support for 4ch capture
Add support for 4ch DMIC capture and modify the nocodec topology to use
it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-19 11:50:55 +01:00
Ranjani Sridharan 5d75b0f309 topology2: cavs: passthrough: Add 4ch audio formats
Add the audio formats for 4ch in passthrough-be and passthrough-capture
pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-19 11:50:55 +01:00
Tomasz Leman 9b3715fc16 ipc4: setdx: skip sending ipc response
When SetDx message shut down primary core, response to this IPC will be
send during power down procedure. It's done to minimize the chances of
the host shutting down power before the core is ready.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-04-19 11:00:12 +01:00
Marc Herbert 475e09f17d xtensa-build-zephyr.py: default to subprocess.run(check=True)
The default value is wrong, change it. See pylint warning W1510

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-19 10:52:20 +01:00
Marc Herbert 35e588080d xtensa-build-zephyr.py: add #pylint:disable=W0312,C0103,C0116
This reduces the number of warnings from about 600 to a more manageable
350.

Disable W0312 because the entire file uses tabs.
Disable C0103 because we have higher priority than naming conventions.
Disable C0116 because the script is small enough, shouldn't require
              pydoc everywhere.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-19 10:52:20 +01:00
Curtis Malainey 9cf8e0c777 m4: add RO bytecontrol
Sometimes we want to load a binary block of data without letting
userspace interact with the underlying control. An RO control will do
this exactly by loading the data and providing no write access.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-04-18 16:39:43 +01:00
Guennadi Liakhovetski 2238f3da32 tgl: fix single-core building
All TGL-based ADSPs are multicore, but it should also be possible to
build SOF with CONFIG_CORE_COUNT=1.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-04-18 16:25:48 +01:00
Rafal Redzimski 5191c0ad26 ipc4: dma-trace: trigger log transport only when half of buffer is full
The log buffer status notifications are triggered too frequently on
small buffer chunks causing an unnecessary overhead on dma transfer.
In order to make the dma transport more effective this change
triggers the ipc4 dma transport only when half of the available buffer
is filled with log entries. The ipc3 transport is always triggered.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-04-15 11:14:50 +01:00
Rafal Redzimski dad8a0c399 ipc4: dma-trace: use the already initialized ipc msg size instead of sizeof
Use the size which is already initialized in posn.rhdr.hdr instead of
using sizeof(posn) which is incompatible with ipc4.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-04-15 11:14:50 +01:00
Rafal Redzimski cb5886acc4 ipc4: dma-trace: fix the ipc4 log buffer status notification
Initialize the header and size of the ipc4 log buffer status
notification to correct values.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-04-15 11:14:50 +01:00
Rafal Redzimski 1918d789bd ipc4: add macro for building notification header
Add a macro for building ipc4 notification header based on
specific notification type.

Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
2022-04-15 11:14:50 +01:00
Rander Wang 87caf973eb ipc4: src: set param before param validation
In ipc4 path there is no ipc param message from host and
each module needs to build param from module config.

It does not affect ipc3 since the function does nothing
in ipc3 path.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-14 21:57:35 +01:00
Rander Wang ed0eda61d4 ipc4: src: remove frame setting with incorrect value
CPC is for pipeline schedule not for dev->frames and its
value is more than 1000 which is not fir for frames.
Dev->frame is assigned in src_verify_params and we don't
need to set it here.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-14 21:57:35 +01:00
Rander Wang 1710e92f96 ipc4: pipeline: stop preparing component in another pipeline
Currently we stop preparing when a component in another
pipeline only for some conditions. In ipc4 passthrough pipeline
host & dai are in different pipelines, these conditions can't
cover it. Actually we should only prepare component in its
parent pipeline, not in other pipeline.

This patch make sure that component is prepared in its own pipeline.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-14 21:54:37 +01:00
Rander Wang 9259bac343 ipc4: use correct function to free buffer
Buffer_release is used for cache operation, not
for buffer free

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-14 12:21:41 +01:00
Rander Wang 3723493901 ipc4: free buffer when pipeline is free
When two modules in different pipeline are unbind, the buffer used
by them is free. The buffer is not free if they are in the same
pipeline. So we need to free buffer when pipeline is free

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-14 12:21:41 +01:00
Kai Vehmanen 5ec02e3294 mixer: add logic to maintain data flow when sources are paused
In a topology where mixer is connected to multiple source pipelines, the
mixer<->DAI downstream pipeline for playback is kept running when
sources are put to PAUSED state.

This design means that mixer_copy() needs to continue to produce output
samples as the DAI is kept running as well. There is existing code to
generate silence when all sources are PAUSED.

A problem remains in the sequence when sources are RELEASED. On the
first iteration after RELEASE, the source state can be changed (so mixer
sees non-zero num_mix_sources). But the sources may not have any data
available on the first cycle. This can lead to XRUNs observed at the DAI
as the mixer is not continuously producing data in ACTIVE state.

Address this issue by adding a "sources_inactive" state to mixer. When
all sources are inactive, mixer enters this state. When sources are
resumed, mixer will note this state, and continue to generate silence
(on its output) until at least one source starts generating audio data.
This ensures continuous audio output to the mixer downstream pipeline.

The change is not sufficient on its own, but is part of the fixes
to address: https://github.com/thesofproject/sof/issues/5469

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-04-13 16:52:39 +01:00
Ederson de Souza 9e18603636 zephyr: Use type compatible with Zephyr linker declarations
`_end` and `_heap_sentry` linker symbols are used to infer heap size. In
Zephyr, `_end` is referenced as `char []` while in SOF as `uint8_t`.
This may "conflicting types", should those declarations be built
together.

This patch changes the Zephyr wrapper to also use `char []`, thus
avoiding this issue.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-04-13 16:45:34 +01:00
Adrian Warecki 19c479e11e copier: copier_params: Check the bsource_list size before reference to the first element.
The copier component receiving data from the host has an empty
bsource_list. The copier_params function references the first item in the
list without checking its size. In some cases, this leads to memory
corruption.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-04-13 16:41:59 +01:00
Guennadi Liakhovetski 529d0cbfc6 waves: fix building with gcc
gcc implements COMPILER_FALLTHROUGH with an __attribute__ so there
must be a semicolon after it. Also remove unused variables.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-04-13 12:37:24 +01:00
Guennadi Liakhovetski 0bf3d3aa10 waves: fix a typo
This fixes an "undefined variable" compilation failure.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-04-13 12:37:24 +01:00
Daniel Baluta f32a05698e codec_adapter: cadence: Only apply config is codec is prepared
Obviously this is a bug, but it works now because parameters are known
before prepare is done.

We will be introducing dynamic codec id set at prepare time, so there
will be a problem if apply config is called before codec is prepared.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-13 14:36:39 +03:00
Daniel Baluta aab5d9b0a1 codec_adapter: cadence: Move cadence_resolve_api
Move cadence_codec_resolve_api to cadence_codec_post_init function.
We need this because later the entire cadence_codec_post_init function
will be called later then init.

At init we do not know yet the codec id.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-13 14:36:39 +03:00
Daniel Baluta 453a007be8 codec_adapter: cadence: Introduce cadence_codec_resolve_api
Separate code that finds and assigns API function given an codec_id
into a function.

This makes code cleaner and helps us move finding the api id in another
part of the code.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-13 14:36:39 +03:00
Daniel Baluta 98862784fb codec_adapter: cadence: Introduce cadence_codec_post_init
This new function encapsulates all Cadence API calls at init time. We
introduce this new function because the init API calls need to be
done after we figure out cadence codec api id.

Right now cadence codec api id is hardcoded to DEFAULT_CODEC_ID but
later it will be needed to be determined dyncamically at runtime.

It will be sent from host via sof_ipc_stream_params.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-13 14:36:39 +03:00
Daniel Baluta cf808895cc LICENCE: Add Khronos Group Inc license header
This is introduced with compress_params.h file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-12 19:41:27 +03:00
Daniel Baluta 4ad833098b LICENCE: Add clarification for dual license files
We often need to include interface files from other projects. When the
projects are dual licensed we always go for the more permissive license.

Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-12 19:41:27 +03:00
Daniel Baluta 5f52ab9199 include: ipc: Add compress_params interface file
This file is copied 'as is' from the Linux kernel repo
and will be used to have a common interface for passing
compressed stream params.

Notice that Doxygen doesn't recognize markup style for structure
commenting so we had to escape @ symbols.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-12 19:41:27 +03:00
Tomasz Leman 858eec93ff ipc4: base_fw: return fail for not supported ipc
Base FW is lacking implementation for large config set. Returning 0 is
hiding the existing problem and will lead to false success reports. Tests
using this functionality will fail in later steps, making it difficult to
debug.

However, IPC4_FW_CONFIG have to be exception. All existing tests used by
FW team are using this IPC. Its required to maintain unity of tests for
all platforms.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-04-11 21:48:44 +01:00
Seppo Ingalsuo a10ccbdcb2 Tools: Topology: Add a development topology to RUN SRC on UP2
Add this topology to be able to test SRC playback and capture.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-04-11 21:45:29 +01:00
Chao Song 5eb94a8a80 audio: comp_ext: workaround XCC compatibility with zephyr logging
Multiple use of static inline functions that call Zephyr logging
API across different C files will result in same symbol names
defined in all of the corresponding object files with XCC,
because XCC compiler emits the same symbol names based on the
source file for those static variables inside functions.

If Zephyr logging is used in SOF, we will have log context
redefinition issue with XCC due to above reason.

This patch workarounds the issue by removing the log calls
in static inline functions that are used across multiple C
files if Zephyr is used.

BugLink: https://github.com/zephyrproject-rtos/zephyr/issues/43786

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-04-08 13:43:17 +01:00
Krzysztof Frydryk 27e9635227 ipc4: fix pipeline reset trigger from paused state
When pipeline reset was called from paused state, it was not stopped
beforehand. This resulted in improper device turn-off sequence.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-04-08 13:36:34 +01:00
Vamshi Krishna 39f2626c47 topology1: sof-adl-rt1019-rt5682: add new topology
for amplifier rt1019 SSP1 link is used
for headset rt5682 SSP0 link is used

Signed-off-by: Vamshi Krishna <vamshi.krishna.gopal@intel.com>
2022-04-08 13:20:13 +01:00
Marc Herbert c9ee109296 xtensa-build-zephyr.py: add cavstool.py to staging directory
This is required to read Zephyr logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-08 13:15:38 +01:00
Marc Herbert f9c461009a xtensa-build-zephyr.py: add for loop to install files into staging
Preparation to copy multiple files. Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-08 13:15:38 +01:00
Adrian Bonislawski 5243f0c4ee buffer: dereference before null check fix
This will fix null dereference issue reported by KW

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-04-07 13:49:45 +01:00
Chunxu Li 7b5aa72813 drivers: mtk: refine afe_remove return value
the afe_remove return value is no used, so
change afe_remove return value from int to void

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Chunxu Li 492821a9f7 platform: mtk: add platform dai build support for mt8186
Add platform dai build support
Add platform dai_init

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Chunxu Li eba5396499 platform: mtk: add platform driver support for mt8186
Add support for dai, dma platform driver.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Chunxu Li 63312ced76 drivers: mtk: add driver compile support for mt8186
compile mt8186 drivers

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Chunxu Li 0a03bef10e drivers: mtk: add afe driver for mt8186
Add AFE driver for memif/sinegen
Add afe-dai.c/afe-drv.c/afe-memif.c for AFE common driver

AFE: Audio Front End

The audio front-end essentially consists of voice and audio data paths.

frontend (memory interface):
 UL (uplink for capture)
 DL (downlink for playback)
backend:
 I2S In/Out etc
interconn:
 inter-connection, connect frontends and backends as DSP path

Note:
TEST_SGEN macro define is just for test

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Chunxu Li b5563511d6 platform: mtk: add afe-platform compile support for mt8186
Add afe-platform compile support for mt8186

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Chunxu Li 529b1d0cc2 platform: mtk: add afe-platform support for mt8186
Add memif data for AFE
Add common and regs header for AFE
Add AFE platform for mt8186 audio/dsp

AFE: the abbreviation for Audio Front End

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-04-05 12:23:39 -07:00
Jyri Sarha ad0d4fb3f8 data_blob: Add single buffer mode to save memory with big configurations
The single blob mode keeps only one configuration blob available at
one time and saves the memory otherwise consumed by the second
blob. The down side of this behaviour is that the audio pipeline must
be stopped for the configuration to be updated.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-04-05 17:47:18 +01:00
Jyri Sarha b81c76f854 component: Split data_blob.[ch] out of component.[ch]
The data blob handler functionality is quite independent from the rest
of the generic component code. The component.c and component.h are
already too big so it is better to split the data blob handler
functionality out before adding more features to it.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-04-05 17:47:18 +01:00
Marc Herbert 791efe2094 .github: build again single-threaded and verbose on failure
Building in parallel is much faster but it makes logs unreadable and
build failures impossible to understand. This is especially true when
building with recent ALSA that produces of deprecation warnings.

To show what actually fails, try to build again with a single thread.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-05 14:37:28 +01:00
Marc Herbert bde4858625 topologies: docker --env USE_XARGS, NO_PROCESSORS and VERBOSE
Building in parallel is much faster but it makes logs unreadable and
build failures impossible to understand. This is especially true when
building with recent ALSA that produces of deprecation warnings, see
examples below. For test topologies the problem is even worse: its
XARGS parallel build provides no log at all.

To find what actually fails, it is required to fall back on a single
threaded and verbose build and this is achieved with the variables
USE_XARGS, NO_PROCESSORS and VERBOSE. Pass these through docker-run.sh
and CMake.

Examples from #5608
https://github.com/thesofproject/sof/runs/5717553555?check_suite_focus=true
https://sof-ci.01.org/sofpr/PR5608/build12556/build/tools.txt

ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-05 14:37:28 +01:00
Ranjani Sridharan 3b0fd1e203 topology2: abi: fix size of ABI bytes
The major/minor/patch values are represented with u16 in the FW. So,
change the numbers of bytes to match that of the FW when adding the
ABI to the topology manifest for IPC4. For IPC3, we still only use 3
bytes as there's no clean way to increase the number of bytes without
breaking backwards compatibility with the older kernel. There are no
topologies using topology2 for IPC3 today but it is possible in the
future.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-05 14:37:05 +01:00