Commit Graph

9358 Commits

Author SHA1 Message Date
Pierre-Louis Bossart 57e976ec38 topology1: add missing ADL-es8336 topologies.
The ADL integration was botched with missing topologies and errors in
topology names in the kernel.

Link: https://github.com/thesofproject/linux/issues/4111
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2023-01-04 15:58:07 +00:00
Adrian Bonislawski fef58eea86 dai-zephyr: check max block count supported by DMA
Check max block count supported by DMA using new Zephyr API
This will allow to prepare a correct config regardless of
specific DMA capabilities

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2023-01-04 16:40:51 +02:00
Marc Herbert 0658767b72 .github/sparse-zephyr: docker pull in a separate step
This saves a lot of scrolling in the next, most popular build step.

Missed in previous commit 52223eba2d (".github/zephyr: docker pull in
a separate step")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-01-04 13:51:19 +02:00
Baofeng Tian d8c2a42d80 sof debug and trace: change sof log level for some modules
Change some log level from info to dbg, those changed place are
not reporting errors, just information, so no risk and can be change
back when debugging.

From performance perspective, before and after:
Before:[11.86] <inf> ll_schedule: ll timer avg 2329, max 2887, overruns 0
after: [11.52] <inf> ll_schedule: ll timer avg 2226, max 2789, overruns 0

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-01-04 13:22:17 +02:00
Pin-chih Lin f42d015d59 topology: add more make cases for ADL
Adds cases {MAX09360A + RTNR + GOOGLE_RTC_AUDIO} and
{CS35L41 + WAVES}.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-01-03 14:03:05 -08:00
Brent Lu c06669e1e5 Audio: fix compile error for COMP_CROSSOVER
Linker fails to link iir_df2t() function when COMP_CROSSOVER is
enabled. Need to select MATH_IIR_DF2T in Kconfig to build the
iir_df2t() function as well.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-12-29 20:03:33 +02:00
Marc Herbert 8dd1fce6da .github/zephyr: fix uploads overwriting each other
From
https://github.com/actions/upload-artifact#uploading-to-the-same-artifact

> Warning: Be careful when uploading to the same artifact via multiple
> jobs as artifacts may become corrupted.

Fix bug where IPC3 and IPC4 builds were randomly overwriting each
other and the same bug with different Zephyr revisions.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-29 11:59:08 +02:00
Brent Lu 8a394bb526 topology: sof-jsl-rt5682: add sof-jsl-rt5682.tplg
This topology supports JSL boards which implement ALC5682I-VD/VS on
SSP0 port without speaker amplifier.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-12-27 12:39:12 +00:00
Marc Herbert e13c42e56f README.md: add link to discord.com/zephyr#sof channel
add link to discord.com/zephyr#sof channel

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-23 11:13:31 +00:00
Marc Herbert b40568b1ab README.md: fix Github status badges
- Remove Travis badge (about time!)
- Remove badge that shows the status of the last, random PR that was
  submitted.
- Add status of the new Daily Actions as recently implemented by Andrey.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-23 11:13:31 +00:00
Marc Herbert c6e7011e1e xtensa-build-zephyr.py: convert sof-info/ text files from CRLF to LF
Building on Windows generates CRLF text files. Standardize checksums to
LF files.

As usual, files in the build directory are left untouched.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-23 11:02:21 +00:00
Marc Herbert e75fcd1b45 xtensa-build-zephyr.py: search "strip" in string, not in pathlib
Fixes pylint warning "E1135 (unsupported-membership-test)". Not sure
this warning is valid because the code worked anyway but it does not
hurt.

Fixes commit bc394916d0 ("xtensa-build-zephyr.py: switch type of
InstFile() names to pathlib")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-23 11:02:21 +00:00
Marc Herbert 52223eba2d .github/zephyr: docker pull in a separate step
This saves a lot of scrolling in the next, most popular build step.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-23 11:00:38 +00:00
Jaska Uimonen 7be11aaf28 topology2: add auxiliary data classes for ssp
Auxiliary data can be added at the end of ssp data blob to enable for
example early clocks for certain platform. Add intel_ssp_aux_config.conf
that includes all possible aux data classes. These can be used inside
ssp hw_configs and will be embedded as tlv data after basic data blob.

Example of using mn_config class inside hw_config:

Object.Base.hw_config."SSP0_0" {
	id              0
	mclk_freq       38400000
	bclk_freq       256000
	tdm_slot_width  16
	format          "DSP_A"
	bclk            "codec_provider"
	fsync           "codec_provider"
	fsync_freq      16000

	Object.Base.mn_config."MN_0" {
		m_div   100
		n_div   200
	}
}

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-12-22 16:45:24 +00:00
Serhiy Katsyuba 3f26bf172d ipc4: copier: Add support for ALH multi-gateways
Adds ALH multi-gateway feature: functionality to mux/demux data from/into
multiple gateways.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-12-22 13:51:28 +00:00
Libin Yang 14474447d4 topology2: cavs-nocodec add wov support
Add the definitions of wov in cavs-nocodec.conf.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 2584500c35 topology2: add dmic-wov.conf
The dmic-wov.conf file implements the WOV feature. The connection is

DMIC ------> KPB ------------------------------> host_copier
              |                                    ^
              |                                    |
              |----> micsel ----> wov ------> virtual_widget

The DMIC and KPB is on DAI ppl.
The host_copier is on Host ppl.
The micsel, wov and virtual is on wov ppl.

The connection between host_copier and virtual_widget is a
virtual connection. The virtual_widget doesn't exist in the FW.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang ef37adc288 topology2: add dai-kpb-be pipeline
dai-kpb-be pipeline contains a copier DAI component and a kpb component.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 62075a44e3 topology2: add wov-detect pipeline
wov-detect pipeline contains a micsel component, a wov component
and a virtual component. micsel component accepts 2 channels audio data and
output 1 channel audio data to the wov component. wov's keyword is a clap.
The virtual component is only used by the driver, and the FW will not
know that there is a virtual component in the pipeline. The virtual
component is used to connect the pipeline to a host copier pipeline
as per drivers requirement.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 884322bfb9 topology2: add wov support
Add the wov module support. The keyword of the wov is the sound
of clap.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang a1a458efc5 topology2: add kpb support
Add the kpb component support. kpb component is used to transfer
the data to the proper pipeline based on the WOV component events.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang b554075d7e topology2: add micsel support
Add the audio channel selection component support.
In case 1 output channel is selected, the component provides
the selected channel on output. In case 2 or 4 channels are selected on
output, the component works in a passthrough mode.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang fbfdd6936f topology2: move payload_with_output_fmt into process token set
The token payload_with_output_fmt is process module specific,
so set it as a process module token.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Guennadi Liakhovetski 8dfb2c8f4e mixin-mixout: fix address space mismatch
Fix address space conflicts caused by bf7aa04890 ("mixout: Convert
component to use the module adapter")

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-22 09:54:18 +00:00
Guennadi Liakhovetski 2f6a6bb4c6 module-adapter: fix address space mismatch
Fix address space mismatch, caused by 133eecb132 ("module_adapter: Add
APIs for coherent module source info access").

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-22 09:54:18 +00:00
Guennadi Liakhovetski 0144741651 coherent: allocate memory in coherent_init()
Allocating objects, intended for use with the coherent API must use
specific flags and align allocation size on a cache-line size
boundary. To rid users of these details integrate allocation and
freeing into coherent_init*() and coherent_free*() respectively.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-22 09:13:48 +00:00
Andrey Borisovich 80af480ecc soc: ace: fix IPC D3 power state entry
This patch fixes D3 issue - now platform enters and wakes up from
D3 correctly on first iteration. This had been achieved using Zephyr
cpu function call that redirects D3 flow to power down assembly code
sending IPC response to host just before powering down.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-22 09:43:35 +02:00
Tomasz Leman 8368a6c9f4 west.yml: upgrade zephyr to 720787f75a
Zepych update: total of 73 commits.

Changes include adding power domains to DMA interfaces and allowing to
skip context save during d3.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-21 18:20:36 +02:00
Adrian Bonislawski 7c623256cb library_manager: fix dma_deinit order
Fixes commit f90f5f9a14
dma ptr should be checked before dma->z_dev

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-12-21 14:42:24 +00:00
Arsen Eloglian f0a14a3f41 platform: ace: dma: update buffer period count
Fix dma buffer period count with proper value.

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-12-21 13:54:44 +00:00
Tomasz Leman 3f05c792c3 zephyr: ipc: refactor of pg prevent
Preventing d0i3 state during IPC processing in case if a host previously
allowed for power state transitions. Transition can occur only in the
Idle thread and this lock acts as a safeguard in case of the remaining
threads to be non active (e.g. waiting for a semaphore).

The advantage of this solution is that we do not risk bypassing the
prevent. PM state lock (get and put) require that their calls be
balanced. One more put or get will result with hard to debug error. For
example we can end up with permanent prevent on power gating.

Original code introduced here: ae4e037b0

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-21 13:35:08 +00:00
Pin-chih Lin 5270e631c3 dts: handle zero config size case in set_configuration
The generic module_set_configuration function returns 0 early when
the coming config size is 0. In aspect of DTS module, receiving 0
from module_set_configuration call means either config is obtained
succesfully or no config (size is 0). The present code doesn't
handle the latter case.

This commit handles the case in DTS module by early return.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-21 13:31:09 +00:00
Pin-chih Lin fc497eb448 topology: remove default param config from DTS control
In DTS module m4 file, the default control bytes used to have a
12-byte redundant param {0x0000, 0x000c, 0x0000}, the param id is
0 (the first 4-byte).

For DTS SDK version >= 1.0.8, error is reported while getting the
param with id=0.

This commit removes the redundant param from default control bytes.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-21 13:31:09 +00:00
Kai Vehmanen 1a7a36a84c sof-logger: ensure NULL string is not passed to printf/fprintf
Due to allocation failures, or invalid content in dictionary,
"params" entries in "struct proc_ldc_entry" may be NULL.

In print_entry_params(), the NULL entries may be passed
as arguments to fprintf(). While e.g. glibc handles these without
error, this is not guaranteed behaviour and may result in segfault
on some platforms.

Fix the issue by aborting program if allocation fails and
explicitly handling the cases when asprintf_entry_text returns
NULL.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-21 13:03:44 +00:00
Gongjun Song 89b1f5054a topology1: add sof-rpl-rt711-l0-rt1318-l12
Add sof-rpl-rt711-l0-rt1318-l12. This tplg doesn't include any
local MICs.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-21 12:12:04 +00:00
Gongjun Song 0144769229 topology1: add sof-rpl-rt711-l2-rt1316-l01
Add sof-rpl-rt711-l2-rt1316-l01. This tplg doesn't include any
local MICs.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-21 12:12:04 +00:00
Tomasz Leman fa0456e5a8 audio: dai-zephyr/host-zephyr: stop dma only once
Until now, one dma channel could be stopped multiple times without any
problems. From commit af6d827b64 on zephyr it is required that the start
and stop calls be perfectly balanced.

Zephyr device power manager stores an internal counter. Counter is
incremented if device is used and decremented on device release. In this
case when we call dma_start() and dma_stop().

If dma_stop() is called more times than dma_start() power manager will
reaport a error -EALREADY.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-12-21 12:06:35 +00:00
Andrey Borisovich 7531094050 .github/workflows: zephyr workflow windows-build uploads artifacts
Github allows to store build artifacts for 90 days after the build.
Somebody might want to examine the output of the build, now can
easily download everything that job produces.
In example, compile_commands.json file contains all compilation
commands in verbose that are not visible in the build log
by default.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich f51f296572 .github/workflows: added concurrency group to Zephyr workflow
Recently new feature had been introduced to Github actions
"concurrency" that allows to define a name for a group of workflows
that will cause old workflow to stop if the new one had been created
and the group name matches.
This improves usage of resources in SOF project by cancelling
running workflows when pushes to pull requests are done frequently
before old jobs are completed.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich 30c43c6dff .github/workflows: renamed Zephyr workflow "build" job to "build-linux"
Zephyr workflow had been added new build-windows job.
It makes sense to rename old "build" job yo "build-linux"
for consistency.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich df1ba22230 .github/workflows: added Windows CI job to Zephyr workflow
Added new job to Zephyr workflow running on windows-latest.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Andrey Borisovich b34cb8bfbb xtensa-build-zephyr.py: change install tree print to ASCII style
During testing of Windows CI workflow on windows-latest turned out
that github action console has issues rendering python
anytree.RenderTree graph with default style of
anytree.render.ContStyle (continuous vertical and horizontal lines).
Tests on local machines in cmd, pwershell and msys shells
proves, that all shells can render the graph (while powershell
does not do this correctly and graph is malformed).
Changing graph style to ASCII resolves the issue with Github actions.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-12-21 11:46:28 +00:00
Guennadi Liakhovetski 96686cfcde ipc: ipc4: do not access memory beyond object boudaries
With IPC4 only two 32-bit values are copied from the host in the
common part, anything beyond that must be copied separately. Those
two values are stored in a global msg_data.msg_in object. Therefore
always when reading from it only up to 8 bytes should be read. In
most cases it is also the case, because the target object has the
same size, but in case of SOF_IPC4_MOD_INIT_INSTANCE this isn't the
case, there special care must be taken.

Also remove a redundant NULL check where NULL cannot appear.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski 84b2dd2ae9 logger: check localtime() return value
localtime() can return NULL in error cases. Check the return value
before dereferencing it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski d5e97949a2 selector: avoid array overflow
Check source and sink channels to avoid accessing beyond array
boundaries.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski 24062b456e volume: fix a potentially uninitialised array
Make sure there's at least one channel in the volume configuration.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Guennadi Liakhovetski 0b295ebe96 copier: avoid array overflow
Fix a case of a possible array overflow, detected by static code
analysis.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Marc Herbert 2dfaee6a7d logger: convert.c: move global_config->logs_header to the heap
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
complete, leaving a confusing mix of globals and locals.

This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive because
convert's() stack lifespan is practically the same as a global but let's
simplify things anyway.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-21 09:36:27 +00:00
Marc Herbert 327a26bf8a logger: make "global_config" truly global
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
finish, leaving behind a supposedly "global" variable that is actually a
confusing global pointer to a struct local to the main() function.

This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive
because the main()'s stack lifespan is the same as a global but let's
simplify things anyway.

Also stop using 'extern' in .c files, use a proper .h file instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-21 09:36:27 +00:00
Kai Vehmanen 80adcdf36a sof-logger: print error if -u uart option is given with no infile
sof-logger -u 115200 -d /lib/firmware/sof-foo.ldc

Leads to silent failure as a NULL is passed to open(). Add
explicit error handling for this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 19:37:17 +02:00