Commit Graph

9760 Commits

Author SHA1 Message Date
Paul Olaru 908876cc5f audio: mixer: Improve handling of inactive input streams
The old code does not deal correctly with input streams going away
without everything stopping. This commit ensures only active streams are
considered as mixer input, and the other streams are ignored (considered
zeroed out).

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2023-04-04 10:06:59 +03:00
Ranjani Sridharan 362a0781f2 topology2: Remove dma_buffer_size attribute
There's been a recent kernel change to compute the DMA buffer size using
the ibs/obs. So this attribute no longer needs to be set in the
topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-03-31 20:41:07 +03:00
Fred Oh 2de0b86ac3 topology2: cavs-nocodec: set dmic 4 channels for MTL
MTL nocodec devices have been configured with DMIC 4 channels.
The topology should be aligned with it.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-03-30 10:41:26 -07:00
Seppo Ingalsuo 5b3c350d73 Platform: Library: Remove dummy function dai_assign_group()
This should avoid error in tools/oss-fuzz build:

sof_ep/install/lib/libsof.a(dai.c.o):
in function `dai_assign_group':
dai.c:(.text.dai_assign_group[dai_assign_group]+0x0):
multiple definition of `dai_assign_group';
/usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
sof_ep/install/lib/libsof.a(dai-legacy.c.o):dai-legacy.c:
(.text.dai_assign_group[dai_assign_group]+0x0): first defined here

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-30 11:42:42 +01:00
Seppo Ingalsuo fade78d895 Drivers: Host: Timer: Add dummy platform_dai_wallclock() function
This avoids tools/oss-fuzz build fail to issue

dai-legacy.c:
(.text.dai_comp_trigger_internal[dai_comp_trigger_internal]+0xaca):
undefined reference to `platform_dai_wallclock'

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 97c7f59906 host: cmake: fix module adapter builds for host
Currently host build of module adapter builds the module adapter core
for each module. Lets only build it once on host.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood b5aaf6d068 testbench: strip out threading for pure xt-run usage.
Strip out all the threading and cache debug to become a pure xt-run
application. This removes a lot of code, including in the host LL
scheduler.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 3eb03b9982 host: add support to build SOF as a static library.
Support a static library target for SOF.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 968e0404ed tools: tplg_parser: abstract topology APIs in preparation for IPC4
Abstract the topology APIs to provide support for other IPC ABIs and
further simplify the codebase. Makse sure all public APIs have the tplg
prefix and make sure private APIs are in the correct places.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Liam Girdwood 2d4d11d050 gitignore: ignore testbench test results files
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-03-30 11:42:42 +01:00
Kwasowiec, Fabiola 694dd4d4a5 peakvol: prevent division by zero
When calculating the time_ratio, a situation may occur
where cd->initial_ramp is equal to zero. To avoid dividing
by zero it is necessary to insert an additional condition

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-03-30 10:08:11 +01:00
Baofeng Tian 13d5800424 dai-zephyr: remove callback notifier, call callback directly
This is a follow up with #7330, remove dai zephyr part callback
register/unregister, call callback function directly at notifier
event place.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-03-29 15:22:58 +03:00
Chao Song 843fd70e91 topology2: cavs-nocodec: include SSP1 pipelines conditionally
There is pinmux conflict between SSP1 and DMIC
on MTL RVP, add a new nocodec topology target
for MTL, on which only SSP0 and SSP2 are enabled.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-03-29 15:17:48 +03:00
Fred Oh 7bc3bde203 west.yml: update zephyr revision to fix MTL pause-resume
There is a merged MTL dmic fix.
https://github.com/zephyrproject-rtos/zephyr/pull/56209

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-03-29 15:09:23 +03:00
Ajye Huang 5aa1545686 topology: sof-adl-rt1019-rt5682: add bluetooth offload uses SSP2 link
Adding support for Bluetooth offload.

sof-adl-rt1019-rt5682, and sof-adl-rt1019-rt5682-waves:
    rt5682 headphone connects SSP0 link.
    rt1019 Amp speakers connects SSP1 link.
    bluetooth offload uses SSP2 link.
Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
2023-03-29 15:05:48 +03:00
Marcin Szkudlinski c4a6713f70 src: src should not use buffers when using module API
Src can module API, but is still getting data from buffers
What more dangerous, it is calling buffer_acquire on source
and sink.
Both buffers have already been taken by module adapter, so
it may lead to deadlocks.

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-03-29 11:41:16 +02:00
Kwasowiec, Fabiola 17b539f1c8 set_attenuation: adding checker based on config data
Adding attenuation checking based on the frame_fmt
from the config of the module instead of calling
sink->stream.frame_fmt, because sending IPC_SET_ATTENUATION
before calling module_prepare results in an error,
because at this stage the sink values are not yet set
(sink->stream.frame_fmt is zero)

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-03-28 16:25:34 +03:00
Seppo Ingalsuo 4e605c888b Arch: Host: Update atomic functions for gcc and xt-xcc
This patch adds for host gcc build the updated atomic
operations. These are intended to replace the previous
__sync built-ins. For more information see
https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html .

The atomic functions for xcc are fake but sufficient for
host arch build for static single-thread testbench.

Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-28 10:40:38 +01:00
Jaska Uimonen e9cfb64f0d zephyr: cavs: use zephyr pm, clk and dma glue
Start using zephyr pm_runtime, clk and dma glue code in cavs25 native
drivers build. Move the files from ace/lib into zephyr/lib.

Also update west.yaml to related zephyr commit as power related
files have been moved to zephyr side.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-03-27 12:37:26 +03:00
Alaa Emad 51156a7c0a drivers: imx: ipc: remove unnecessary blank line
Remove unnecessary blank line after '{' as reported
by checkpatch:

"CHECK: Blank lines aren't necessary after an open
brace '{'".

Signed-off-by: Alaa Emad <eng.alaaemad.ae@gmail.com>
2023-03-27 12:33:31 +03:00
MARUTHI MACHANI 00b2bf65ed topology1: topology changes to enable tdm without virtual dai.
topology changes to enable tdm without virtual dai.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-03-24 16:40:10 +00:00
MARUTHI MACHANI b5d6af9ca2 driver:amd:enabling tdm without virtual dai's
Enabling tdm without using virtual dai's.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-03-24 16:40:10 +00:00
MARUTHI MACHANI 14f08e69e7 platform:amd:enabling tdm without virtual dai's
Enabling tdm without using virtual dai's.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-03-24 16:40:10 +00:00
MARUTHI MACHANI 9249271df9 platform:amd:configuration to support mux as module adapter
Configuration to support mux as module adapter.

Signed-off-by: MARUTHI MACHANI <maruthi.machani@amd.com>
2023-03-24 16:40:10 +00:00
Marc Herbert c47221f22b .github/ipc_fuzzer.yml: add new scripts/fuzz.sh
Should avoid future regressions like the one fixed by #7318

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-24 16:20:23 +00:00
Marc Herbert f41ad4329d scripts/fuzz.sh: add timeout feature and stdout redirection
Also add getopts and a very crude help. Should be enough to get started
in CI.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-24 16:20:23 +00:00
Marc Herbert f09f3ae00b scripts/fuzz.sh: various cosmetic fixes
- Create new setup() function
- Separate export for set -e compatibility
- Don't use the generic `build` directory but a more specific
 `build-fuzz` instead.
- De-hardcode zephyr path thanks to west
- shellcheck clean

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-24 16:20:23 +00:00
Guennadi Liakhovetski e95723ace1 host: make DMA reload threshold configurable
Add Kconfig options to specify when to reload DMA, by default it will
reload 4ms before the buffer is empty (or full).

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-24 08:17:33 -07:00
Guennadi Liakhovetski e1831cb07a host: reload host DMA less frequently
This should reduce DRAM access frequency and allow deeper power
saving modes, particularly when using Deep Buffer PCMs.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-24 08:17:33 -07:00
Guennadi Liakhovetski d9771be5b8 host: (cosmetic) remove an unused variable
"flags" in host_copy_normal() aren't used, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-24 08:17:33 -07:00
Piotr Makaruk 27641bf9fe dai: host: add fast mode
Add fast mode which enables to support unlimited transfer size (more than
ibs/obs) between a dma buffer and the copier. Enable it to satisfy
specific module requirements to guarantee enough data size to decoders or
from encoders since the pcm audio period size does not apply to variable
size frame.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-03-24 13:47:04 +01:00
Marc Herbert 1b95f4c7b3 .github/zephyr.yml: add a temporary submodules/west consistency check
Real-world experience has proved again that big READMEs are not enough,
not even when they're only a couple lines away as the one added in
commit 8fd351ea9a ("west.yml: add warning to keep git submodules in
sync"). Only some failure / red color stand a chance.

It also seems some people rarely use "git status". This was discovered
in commit d9eb16aa66 ("cmake: add warning when git submodule changes
are found") but is still surprising.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-23 19:04:38 +02:00
Marc Herbert 6838224286 .github/zephyr: test new fancy --filter=tree:0 cloning option
Test new, fancy and impressive looking git --filter optimization on
non-critical "manifest check". Extend it later to other checks if it
hasn't caused any issue.

https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
https://github.com/zephyrproject-rtos/west/issues/638#issuecomment-1478925589

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-23 19:04:38 +02:00
Alaa Emad 8f23a22b5f drivers: imx: sdma: add blank line after declaration
Add blank line after struct declaration as reported
by checkpatch:

"WARNING: Missing a blank line after declarations"

Signed-off-by: Alaa Emad <eng.alaaemad.ae@gmail.com>
---
changes in v2:
	-edit subject line to include the file name.
	-edit commit message
2023-03-23 14:32:45 +02:00
Alaa Emad defd773198 drivers: imx: timer: remove unnecessary blank line
Remove unnecessary blank line before a close brace as reported
by checkpatch:

"CHECK: Blank lines aren't necessary before a close brace '}'"

Signed-off-by: Alaa Emad <eng.alaaemad.ae@gmail.com>
---
change in v2:
	-edit subject line to include the file name.
2023-03-23 14:32:45 +02:00
Alaa Emad d2cde75daa drivers: imx: interrupt-irqsteer: remove unnecessary blank lines
Remove unnecessary blank lines before a close brace
as reported by checkpatch script

"CHECK: Blank lines aren't necessary before a close brace '}'"

Signed-off-by: Alaa Emad <eng.alaaemad.ae@gmail.com>
---
change in v2:
	edit subject line
2023-03-23 14:32:45 +02:00
Guennadi Liakhovetski ac910714f4 coherent: fix allocation size
When adding object allocation to the coherent API the size alignment
was misplaced, re-opening a possibility for cache corruption when
sharing cache lines with adjacent allocations. Add alignment to all
coherent object allocations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-22 19:00:49 +02:00
Kai Vehmanen 1ba94cffbf rimage: update to 343b6d863d
Update submodule to match revision used in west.yml.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-03-22 15:48:52 +02:00
Kai Vehmanen 7d5c3238e3 west.yml: upgrade zephyr to e40859f7
Total of 1128 commits, including following related to
dma-dw/intel_adsp/sparse/dmic/xtensa:

e40859f78712 Revert "dma: dw: Do not program SAR/DAR and CTL_HI/LO when using HW LLI"
7a85983ebcf2 xtensa: remove ELF section address rewriting
b32b321f502a dma: dw: Poll to check for channel disable with timeout
6226f9e6e44f dma: dw: fix the return value check
08d9efb202cc dma: dw: Do not program SAR/DAR and CTL_HI/LO when using HW LLI
045c68673491 dma: dw: Add a debug utility function
bd705e68b048 soc: xtensa: esp32: increase shared memory region
9854c915ffdf intel_adsp: cpu init refactor
9d5c21d58003 dts: xtensa: nxp: remove unused include
68c1cafb411e intel_adsp: dts: ace: lower case 71C00 to fix DTC warning
a8c0123d3c54 intel_adsp: cmake: add_custom_command(.mod) to fix incremental build
b00c63e7640c footprint: ci: Remove audio SOF samples
1efaa94bc64b drivers: audio: dmic_nrfx_pdm: drop -pin support
8ef2cd20d90a Drivers: DAI: Intel: DMIC: Shorten unmute ramp time
eead89e7f22d soc: intel_adsp: cavstool.py: simplify asyncio.run() call
cdae0bb7596e boards: intel_adsp_ace15_mtpm uses xcc-clang toolchain for twister

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-03-22 15:48:52 +02:00
Marc Herbert df440ba0ba sof/ipc/common.h: add missing #include <ipc/stream.h>
Also move system headers stdbool.h and stdint.h last to avoid them being
accidentally included.

Fixes commit b91e253f65 ("include: sof: debug: Split panic.h into
Zephyr and XTOS-specific headers") that broke `scripts/fuzz.sh` because
it stopped `sof/ipc/common.h` from accidentally getting `ipc/stream.h`
through `panic.h`.

Fixes:

```
src/include/sof/ipc/common.h:126:15: warning: declaration of
 'struct sof_ipc_host_buffer' will not be visible outside of
 this function [-Wvisibility]
                            struct sof_ipc_host_buffer *ring,
                                   ^
```

```
sof/src/ipc/ipc3/host-page-table.c:151:5: error: conflicting types
for 'ipc_process_host_buffer'
int ipc_process_host_buffer(struct ipc *ipc,
    ^

sof/zephyr/../src/include/sof/ipc/common.h:125:5: note: previous
declaration is here:
int ipc_process_host_buffer(struct ipc *ipc,
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-22 13:28:25 +00:00
Marc Herbert 8caa0e27a4 sof/ipc/msg.h: add missing #include <ipc/trace.h>
`msg.h` needs `ipc/trace.h` for `sof_ipc_dma_trace_posn`

Fixes commit b91e253f65 ("include: sof: debug: Split panic.h into
Zephyr and XTOS-specific headers") that broke `scripts/fuzz.sh` because
it stopped `ipc/msg.h` from accidentally getting `ipc/trace.h` through
`panic.h`.

Fixes:

```
src/include/sof/ipc/msg.h:146:34: warning: declaration of
  'struct sof_ipc_dma_trace_posn' will not be visible outside
  of this function [-Wvisibility]
void ipc_build_trace_posn(struct sof_ipc_dma_trace_posn *posn);
```

```
sof/src/trace/dma-trace.c:160:23: warning: incompatible pointer
types passing 'struct sof_ipc_dma_trace_posn *' to parameter of
type 'struct sof_ipc_dma_trace_posn *' [-Wincompatible-pointer-types]
        ipc_build_trace_posn(&sof->dmat->posn);
                             ^~~~~~~~~~~~~~~~
sof/zephyr/../src/include/sof/ipc/msg.h:146:58: note: passing argument
 to parameter 'posn' here
void ipc_build_trace_posn(struct sof_ipc_dma_trace_posn *posn);
```

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-22 13:28:25 +00:00
Andrula Song abd81a1383 Audio: Dcblock: Add HiFi3 implementation of dcblock
Add HiFi3 implementation of dcblock processing functions.
Compared with generic C version, the 16 bit format can save
about 48.1% cycles, and 48.4% for 24 bit format and 52.6%
for 32 bit.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-03-21 22:17:01 +00:00
Guennadi Liakhovetski 9aa2c13356 build: upgrade to the current rimage upstream
Upgrade to the present rimage upstream version to fix tgl building
with Zephyr main branch head.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-03-21 22:14:11 +00:00
Przemyslaw Blaszkowski 332dd4a10f aria: configure stream params
Configure in/out buffer stream params.
In Windows scenarios, unconfigured values were causing zero-division
exception in audio_stream_get_avail_frames.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-03-21 21:54:25 +00:00
Przemyslaw Blaszkowski c27c5df676 aria: fix buffer size calculation in init
For calculating sample group size, sample container size should be
taken instead of valid bit depth.

Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com>
2023-03-21 21:54:25 +00:00
Seppo Ingalsuo aedb5f286f Drivers: DW: Set DMA lli_desc->sar and lli_desc->dar
This patch fixes DMIC capture for TGL platform in IPC3 mode. The
error seen in firmware trace is:

ERROR dmic_irq_handler(): full fifo A or PDM overrun
ERROR dw_dma_get_data_size(): xrun detected

The set of sar and dar is restored to driver. It was removed
with function dw_dma_mask_address() when removing support for
BDW and HSW platforms. The two first lines removed from the
function are needed for all platforms. The lines were added
to where the function was originally called.

Fixes commit d80635054f
("platform: remove support for Broadwell and Haswell")

Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-21 18:21:37 +02:00
Ranjani Sridharan e5fe974880 drivers: dw: Poll with timeout after disabling channel
It is recommended to poll with timeout after disabling the channel to
ensure that the channel has been actually disabled.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-03-21 16:06:14 +02:00
Kai Vehmanen fd31818931 coherent: fix cache flush logic if coherent is not the first member
If coherent object is at non-zero offset, the init call ends
up invalidating data cache outside the allocated buffer.

All current users of "struct coherent" have the object as
the first member, so nothing is broken with current code.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-03-20 20:36:41 +02:00
Seppo Ingalsuo e0d8078fa7 Tools: Testbench: Avoid need linux kernel headers in build
This patch adds simplified linux/types.h into testbench headers
to enable include of ALSA asoc.h to build without other difficult
kernel headers content.

The CMakeLists.txt files are updated to make a build time copy of
asoc.h to subdirectory include of the build directories. The new
directory is added to headers path.

This change avoids build fail with xcc toolchain that can't use the
gcc toolchain headers from the system where the ALSA headers are
located.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-03-20 19:33:55 +02:00
Ranjani Sridharan a6a80ec97a dai-zephyr: Fix the ordering of DAI and DMA triggers
During start trigger, the DMA is be started first followed by the DAI. The
same order should also apply for the release triggers. Conversely, during
stop/pause the DAI must be stopped first before the DMA.

But some platforms cannot handle the conventional ordering during the
stop/pause triggers. Add a new config,
COMP_DAI_STOP_TRIGGER_ORDER_REVERSE, that will be used to reverse the
DMA and DAI trigger order during stop/pause. Also, fix the stop case to
use the new config to reverse the ordering instead of
COMP_DMA_SUSPEND_DRAIN.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-03-20 19:33:33 +02:00