Commit Graph

8085 Commits

Author SHA1 Message Date
Marc Herbert 41f171709d CODEOWNERS: add @aborisovich, remove @zrombel
Thank you!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-25 15:07:37 +01:00
Marc Herbert 78f4fd7de9 tools: stop copying v2 topologies to the v1 directory
STOP copying all files
 from dir: sof/tools/build_tools/topology/topology2/cavs/
 to dir:   sof/tools/build_tools/topology/

The original plan discussed in the reviews of commit c0bee428ae
("topology: prepare for Topology2.0") and commit 308a24a92b
("topology2: Add build support") and more recently
mentioned in #4611 was to overwrite in place some v1 topologies with
newer v2 topologies in order to "force" users to upgrade without them
realizing it. This original plan is now being abandoned. v2 topologies
will never overwrite v1 topologies and if ever then certainly not "en
masse". Moreover, v2 topologies will be placed in a new /lib/firmware/
subdirectory. So, partial revert the aforementioned commits. More
specifically. stop installing v2 topologies into the same directory as
v1 topologies.

Note there had never been any actual overwrite of any v1 topology yet
because there had never been any v2 topology of the same name.

At this point in time this gets rid of the following copies:

tools/build_tools/topology: abi.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-cnl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-cnl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-tgl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-2ch-tgl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-cnl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-cnl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-tgl.conf
tools/build_tools/topology: cavs-mixin-mixout-hda-4ch-tgl.tplg
tools/build_tools/topology: cavs-mixin-mixout-hda.conf
tools/build_tools/topology: cavs-mixin-mixout-hda.tplg
tools/build_tools/topology: cavs-passthrough-hdmi.conf
tools/build_tools/topology: cavs-passthrough-hdmi.tplg
tools/build_tools/topology: cavs-sdw.conf
tools/build_tools/topology: cavs-sdw.tplg
tools/build_tools/topology: cavs-tgl-nocodec.conf
tools/build_tools/topology: cavs-tgl-nocodec.tplg
tools/build_tools/topology: nhlt-ace-mtl-nocodec.bin
tools/build_tools/topology: nhlt.bin
tools/build_tools/topology: nhlt-cavs-tgl-nocodec.bin
tools/build_tools/topology: sof-mtl-nocodec.conf
tools/build_tools/topology: sof-mtl-nocodec.tplg

From an "installer/" and sof-bin release perspective, this removes the
following topology that was just added by commit
ba26eeff9d ("topology2: cavs-nocodec: Add support for MTL nocodec
topology"). Installing v2 topologies into a new /lib/firmware/
subdirectory has not been implemented yet.

No other change besides dropping these copies, everything else is the
same.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-25 15:07:12 +01:00
Marc Herbert 3e58f2cf5c installer: explain why we install only sof-*.tplg files
See #4611 for more background.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-25 15:07:12 +01:00
Rander Wang 18d77eb758 ipc4: add format conversion of 24LE to 32LE
This conversion is required by 24LE test in CI

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-25 09:54:30 +01:00
Adrian Warecki b8b84e2dbd ipc4: handler: ipc4_get_large_config_module_instance: Fixed handling of memory allocation error
The value returned by the rballoc function is stored in the global variable
msg_reply.tx_data. If an allocation error occurs, the function returns an
error, but tx_data is overwritten with null. This value is then used in the
ipc_msg_send function which leads to null pointer reference.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-04-25 09:53:06 +01:00
Pierre-Louis Bossart dbdaba93bb topology1: sof-hda-generic: remove digital paths
These paths are not well supported on all devices and lead to errors such as

17:06:06 kernel: HDA Digital: ASoC: dpcm_be_dai_startup() failed at Digital Playback and Capture (-22)
17:06:06 kernel: Digital Playback and Capture: __soc_pcm_open() failed (-22)
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: ASoC: error at snd_soc_dai_startup on Digital Codec DAI: -22
17:06:06 kernel: snd_hda_codec_conexant ehdaudio0D0: didn't find PCM for DAI Digital Codec DAI

We've already removed this digital path for IPC4/topology2, let's also remove this for topology1.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-04-22 14:37:57 -05:00
Peter Ujfalusi e3d0bdc5b5 ipc4: handler: Fix tr_dbg string for ipc4_get_large_config_module_instance()
Only two parameters provided and valid for this function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2022-04-22 11:51:57 +01:00
Eddy Hsu 516b34d875 mux: Clean up processing functions on reset.
Clean up mux/demux processing functions in component
data on reset().

Signed-off-by: Eddy Hsu <eddyhsu@chromium.org>
2022-04-21 17:19:10 +01:00
Eddy Hsu 247c2b28f6 igo_nr: Clean up igo params on component reset
Clean up igo params in component data on reset().

Signed-off-by: Eddy Hsu <eddyhsu@chromium.org>
2022-04-21 14:32:23 +01:00
Rander Wang 01b1de7f83 ipc4: mixer: improve bind support
This issue is found by CI capture test with Linux ipc4 driver.
For a pipeline like module A <-> mixin <-> mixout, mixin is
first bound to mixout then bound to module A in CI test. The
original code assume that module A is first bound to mixin
since windows driver always bind module from data source to
data sink.

This patch adds support for bind sequence in CI test.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-21 14:28:08 +01:00
Rander Wang b9190ed361 ipc4: update pipeline status to ready
Pipeline is ready when it is complete and update
pipeline status in this case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-04-21 14:28:08 +01:00
Eddy Hsu 177551d9df crossover: Clean up stream data and processing functions on reset.
Clean up crossover stream data and processing functions in component
data on reset().

Signed-off-by: Eddy Hsu <eddyhsu@chromium.org>
2022-04-21 13:50:40 +01:00
honglin leng d68eb43857 detect_test/google_hotword_detect: fix comp struct
if sof_ipc_comp_event include flexible array, so it should be the last one of the structures.

Signed-off-by: honglin leng <a909204013@gmail.com>
2022-04-21 13:50:00 +01:00
Eddy Hsu 6b4b39f413 mixer: Clean up processing function on component reset
Clean up mixer processing function in component data on reset().

Signed-off-by: Eddy Hsu <eddyhsu@chromium.org>
2022-04-21 12:06:31 +01:00
Daniel Baluta 64b3b1036b platform: Rename module_init section
.module_init sections is used to keep all components constructor
functions.

Zephyr uses -ffunction-sections option which will create a section for
each function. Unfortunately, this creates a section named .module_init
for the function module_init() used to initialize the processing module
generic layer.

Thus, places module_init() in the constructor area named .module_init
which is wrong.

To avoid this we rename .module_init section for constructors to
.initcall.

Fixes: https://github.com/thesofproject/sof/issues/5662
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-04-21 12:05:32 +01:00
Marc Herbert 236de3f142 xtensa-build-zephyr.py: drop check=True, now the default
Commit 475e09f17d ("xtensa-build-zephyr.py: default to
subprocess.run(check=True)") switched the default value of the
execute_command() function to "True". Remove all the "check=True"
arguments that are now redundant.

Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-21 11:30:09 +01:00
Peter Ujfalusi 809f5cf4df Revert "ipc4: setdx: skip sending ipc response"
This reverts commit 9b3715fc16.

The commit causes the following error:
[  146.052617] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx      : 0x47000000|0x0: MOD_SET_DX [data size: 8]
[  146.556588] sof-audio-pci-intel-tgl 0000:00:1f.3: ipc timed out for 0x47000000|0x0
[  146.556596] sof-audio-pci-intel-tgl 0000:00:1f.3: ctx_save IPC error: -110, proceeding with suspend

The reason is that for IPC4 the reply format is different compared to what
IPC3 is using and also the signaling is different.

If we skip sending the reply, there will be no reply going to be sent to
the host.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2022-04-21 11:10:36 +01:00
Fred Oh af1e38a995 docker_build: add bison and flex to apt install list
There are warnings about bison and flex not available.
Interestingly these were not fatal errors but time to fix them.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-04-20 17:13:42 +01:00
Xiaoyun Wu(Iris) 62ead96614 xtensa-build-all.sh: add ipc4 build support for tgl
Add ipc4 build support for tgl with IPC4_CONFIG_OVERLAY.

If IPC_VERSION is chosen as IPC4, then overlay configuration file
for different platforms will be used automatically without assigning
the configuration file with options.

Different configuration files will be used according to what platform
is building firmware for.

Signed-off-by: Xiaoyun Wu(Iris) <xiaoyun.wu@intel.com>
2022-04-20 16:36:43 +01:00
Andrula Song 89f36491c7 audio: volume: initialize variables before using
initialize the variables for xtensa intrinsics.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-04-20 15:19:54 +01:00
Ranjani Sridharan ba26eeff9d topology2: cavs-nocodec: Add support for MTL nocodec topology
The key difference is the DMIC HW IP version.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-04-20 13:52:33 +01:00
Curtis Malainey 39a913d7da google_rtc_audio_processing: add alloc guards
When doing low mem testing with the mock we should still check our
allocs

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-04-19 12:28:55 -07:00
Adrian Warecki cc24c9cf77 zephyr: wrapper: rballoc_align: Support for the SOF_MEM_FLAG_COHERENT flag
The function rballoc_align did not take into account the passed flags, so
it always incorrectly allocated a cached memory. Added support for the
SOF_MEM_FLAG_COHERENT flag.

Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
2022-04-19 16:51:49 +01:00
Tom Burdick 85a9172030 notifier: Use coherent memory allocation
The notifier struct contains a spin lock which was located in
incoherent memory. This caused an assert on startup when enabling the
build with CONFIG_ASSERT.

At the very least this fix enables building and running with
SPIN_VALIDATE and ASSERT which could help diagnosing issues such
as the panic_dump being garbled.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-04-19 16:49:42 +01:00
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