Commit Graph

7462 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 2bd41aaf26 platform: remove MAX_CORE_COUNT
MAX_CORE_COUNT is a duplicate of CONFIG_MAX_CORE_COUNT, remove the
former and use the latter instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-12-16 20:26:24 +00:00
Guennadi Liakhovetski e50613385e zephyr: ll-scheduler: implement ordered scheduling
Add .schedule_task_before and .schedule_task_after hooks.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-12-16 11:26:17 +00:00
Guennadi Liakhovetski fbe9172f4c zephyr: ll-scheduler: simplify the ll-scheduling worker
Currently the Zephyr ll-scheduler avoids holding a lock for the
entire duration of its scheduling run by using a temporary list.
However, this means, that tasks, added to the list while the
scheduler is running, cannot be ordered properl WRT already queued
tasks. To fix this this patch removes the temporary list. Instead it
now takes care to manually find next tasks with the lock held and
releases the lock when running tasks.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-12-16 11:26:17 +00:00
Pierre-Louis Bossart 0bef266966 topology1: sof-hda-generic: use mixer-based pipelines for analog playback
Convert playback pipeline on analog output to have a mixer so adding a
deep-buffer pipeline will be simpler.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 02041297ac topology: sof-hda-generic: prepare addition of deep-buffer support
Just move of definitions, no functionality change

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 29e46af073 topology1: pipe-eq-iir-eq-fir-volume-playback: remove duplicate volume
The same volume information is present twice, remove the one that
seems out of place in the pipeline.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart cfb3ac5b00 topology1: add pipe-mixer-eq-iir-eq-fir-volume-dai-playback.m4
mix/merge of parts coming from pipe-mixer-volume-dai-playback.m4 and
pipe-eq-iir-eq-fir-volume-playback.m4

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 43dacdc016 topology1: soundwire: split headphone pipe in host- and dai-parts
Prepare for the introduction of deep buffer support

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart 9f4af6b013 topology1: soundwire: fix misleading comment on ALH buffer format
All platforms use s24le for ALH, fix misleading comment.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart e8b8854e3a topology1: soundwire: move cnl-rt5682 to development directory
This topology was used initially on UpExtreme but isn't shipped in any
commercial device.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart fb03464dd5 topology1: fix comments in pipe-mixer-volume-dai-playback.m4
buffer information and formatting was incorrect

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Pierre-Louis Bossart fad16d8330 topology1: rename pipe-mixer-dai-playback to pipe-mixer-volume-dai-playback
To include deep buffer for HDaudio topologies, we need the ability to
replace volume by some other component (e.g. eq-iir-eq-fir-volume)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-12-16 11:13:59 +00:00
Seppo Ingalsuo e917018f62 Audio: Selector: Check config.sel_channel vs. stream channels count
The optimized copy() functions could output data outside source
buffer without this check. The test in params() checked only
channel select parameter vs. max channels count. The changed code
checks it vs. actual stream channels count. There's in params() a
channels count check so this one could be modified.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-12-16 09:51:17 +00:00
Seppo Ingalsuo 252a61c9ad Audio: Select: Optimize data copy operations
This patch replaces the per sample done circular copies with
audio_stream_read/write_frag_s16/32() functions calls with
max. length linear copies.

The original copy function for >1ch sink is just 1:1 copy
from source to sink without controllable channel select. This
patch preserves the functionality and implements the copy with
memcpy().

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-12-16 09:51:17 +00:00
Marc Herbert eb34437522 topology: redirection to workaround hardcoded alsatplg permissions
Use a redirection to work around hardcoded alsatplg permissions.
See bug https://github.com/alsa-project/alsa-utils/issues/126

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-14 10:39:14 +00:00
Marc Herbert 4538a07b02 topology: new add_alsatplg_command() CMake macro to reduce duplication
Less copy/paste/diverge => more maintenance.

Zero visible change, pure copy/paste reduction.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-14 10:39:14 +00:00
Dirk Su d2a3ec2273 sof_ri_info: add ADL Intel prod key to list of known keys
Extracted from
https://github.com/thesofproject/sof-bin/blob/main/v1.9.x/sof-v1.9.2/intel-signed/sof-adl.ri

Signed-off-by: Dirk Su <dirk.su@canonical.com>
2021-12-14 10:38:18 +00:00
Ranjani Sridharan f4287dd3e8 topology2: cavs: Set audio formats for all topologies
Set audio formats and new attributes for all modules in the CAVS
topologies.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan a4b8d11678 topology2: pipelines: cavs: Add audio formats for all pipeline modules
Add audio formats and all new attributes for all modules in the
cavs pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan 4d23794607 topology2: mixin/mixout: Add audio formats and new attributes
Add audio format objects and num_audio_formats attribute.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan eb96d21caf topology2: gain: Add new attributes for gain
Add audio format objects and num_audio_formats attribute for gain.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan 6631743209 topology2: common: Add new class definition for audio_format
Add definition for audio format class for defining the input and output
audio formats for each components in cavs topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan eb013c738b topology2: copier: Add extra attributes
Add some new attributes along with math expression to calculate the
attribute "is_pages".

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan 0c517d4af7 topology2: copier: remove stale comment
All known DAI types added already.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan d523e67e6e topology2: tokens: Add additional tokens needed for cavs topologies
Add all tokens required for cavs topologies.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2021-12-14 10:33:16 +00:00
Ranjani Sridharan d0c3965808 topology2: cavs: Add some commonly used definitions for cavs topologies
Used for setting audio format attributes and copier attributes.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-14 10:33:16 +00:00
Peter Ujfalusi 96f5e739a5 Audio: Volume: Drop unused hvol support (host mmap volume)
The cd->hvol always remain NULL, there is no code path which would
configure it which makes the mapped volume unusable and unused.

The kernel does not use this feature either.

Remove all related code to this non supported feature.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2021-12-13 11:52:05 +00:00
Kai Vehmanen 5a007b8074 include: add missing tplg tokens to kernel/tokens.h
It seems most of the tokens added in ABI3.18-3.20 have not been
added at all to tokens.h. This is problematic as this is the main
interface reference and used by multiple tools in SOF repository
(the tplg parser and testbench).

Align definitons to latest in Linux kernel tree current ABI3.20
implementation in the firmware repository.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-12-13 11:45:23 +00:00
balapati 926fc9ad7d topology1: Add sof-rn-rt5682-max98360, sof-rn-rt5682-rt1019
Add topology support for max98360,rt1019 speaker amplifiers
for amd renoir platform.

Signed-off-by: balapati <balakishore.pati@amd.com>
2021-12-13 11:38:06 +00:00
Brent Lu 25f61384f9 topology: sof-adl-max98360a-rt5682-2way: rename macro
The macro 2_WAY_SPK is renamed 2CH_2WAY to specify it's a L/R 2-way
system.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2021-12-13 11:33:33 +00:00
Brent Lu 6c13aad711 topology: sof-adl-max98360a-rt5682-4ch: add new topology
Add support for four max98360a speaker amplifiers running in TDM mode
which format is 8 slots with 32 bit slot/sample width on ADL boards.

This topology implements a 4-channel pipeline directly to speaker
amplifiers so audio effects need to be done in user space.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2021-12-13 11:33:33 +00:00
Marc Herbert 07c63c1f99 topology1: build the production topologies one level down
Move generated *.conf and *.tplg v1 files down from:

  build_tools/topology/topology1/*.{conf,tplg}

_to:

  build_tools/topology/topology1/production/*.{conf,tplg}

... then copy/"install" the production/* subdirectory two levels up.

This fixes the race condition #5067 that also copied a random number of
development/ and dsp_enhancement/ topologies, sometimes even truncating
these.

In other words, this commit REMOVES the following two copies:

build_tools/topology/development/       # randomly corrupted copy, removed
build_tools/topology/dsp_enhancement/   # randomly corrupted copy, removed

build_tools/topology/topology1/development/    # real build dir, unchanged
build_tools/topology/topology1/dsp_enhancement # real build dir, unchanged

Production topologies are copied only to help with the v1->v2
transition. That duplication makes the build directory confusing enough,
no need to extend that copy to development topologies. A single instance
of development topologies in the build directory is enough.

This removal may break some CI script(s): this is perfect because such
CI script(s) were copying randomly corrupted data.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-13 10:57:20 +00:00
Ranjani Sridharan 3e1c160e50 topology1: fix errors due to newline in list generator
The recent changes to the string parser in alsa-lib cause the topology
builds to break for some topologies. Avoid adding a newline for the bytes
data for the MUXDEMUX config by introducing a new macro for creating lists
without new lines between items.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-08 21:13:23 +00:00
Ranjani Sridharan db041556ce topology1: sof-cml-src-rt5682: remove extra space after values
The string parser in alsa-lib is sensitive to these now. So fix it.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-08 21:13:23 +00:00
Ranjani Sridharan 7aedc1604d topology2: cavs-*-hdmi: replace the use of @args with Define
The Define block replaces the use of @args for topology2 in the alsatplg
compiler. So replace all users.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-12-08 21:11:40 +00:00
Lionel Koenig 5a1bd4682e mux: Change iterator type to uint32_t
uint8_t iterator does not work for period size above 256 frames.
Using large buffers (>5ms @ 48kHz) without this patch results
in the copy being an infinite loop.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2021-12-08 21:04:34 +00:00
Marc Herbert 7aa1b28070 sof_ri_info: assert Python version is 3.6 or above.
As reported by Bartosz, Python 3.5.2 fails with the relatively cryptic
TypeError: invalid file: PosixPath('sof-tgl.ri'). Make this failure much
less cryptic.

As of December 2021 Python 3.5 is completely out of support and 3.6 will
be soon https://www.python.org/downloads/

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-08 20:45:07 +00:00
Zhang Peng 350fc6c66d topology: 8ulp: Change sample rate to 8K
As changed SAI to 8Khz, then modify tplg file to
match this.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-12-08 10:51:07 +02:00
Zhang Peng 0caa10e469 include: drivers: sai: Change the vaule of SAI_CLOCK_DIV
For BT module not support 16Khz sample rate anymore,
we need to change sai sample rate to 8Khz to match
BT.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-12-08 10:51:07 +02:00
Daniel Baluta 903a94e097 audio: drc: Select DRC dependencies
DRC needs some math functions brought in by CONFIG_NUMBERS_NORM and
CONFIG_MATH_DECIBELS.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-12-07 13:48:39 -08:00
Rander Wang 7c6186acb6 ipc4: handler: add module power setting support
There are two types of power setting ops: set_d0ix and
set_dx. set_d0ix will disable power gating on core 0 and
set_dx will power up the specific core.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 10:21:46 +00:00
Marc Herbert 60be65b567 check patch: allow C99 comments
This is a logical revert of eb45907

Based on recently merged #4941, C99 comments are now OK. I never found
any rationale or even written down coding style for excluding them in
the first place.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-06 09:58:32 +00:00
Rander Wang 235255bc44 test: add format S24_3LE in volume test
The format is added to make volume test pass.
The implementation will be added later.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 09:55:59 +00:00
Rander Wang 671e635077 ipc4: refine buffer size
Audio driver only create single buffer but SOF requires
double buffer. Since obs should be equal to ibs, buffer
size will be set to obs * 2.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 09:55:59 +00:00
Rander Wang a1dbb624b4 ipc4: copier: refine format conversion path
Add more cases to go normal path.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 09:55:59 +00:00
Rander Wang b363cc0acc ipc4: copier: add support for container format
Ipc4 stream have container size and valid sample size.
In windows system, container size is normally 32bit
and valid sample size is 16bit or 24bit rely on system
setting. Currently host and dai component are included
by copier module to manage gateway. These two components
don't support container size and all the code is designed
for the case that container size is always equal to valid
sample size.

To avoid affecting current IPC3, this patch adds endpoint
buffer to support host or dai in a way that endpoint buffer
uses the same container and valid size and copier will do
the conversion between endpoint buffer and ipc4 buffer since
copier also supports format conversion.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 09:55:59 +00:00
Rander Wang 4b022085a4 ipc4: add stream format conversion function for ipc4
Move the format conversion function to header file
since it will be shared by ipc4 modules

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 09:55:59 +00:00
Rander Wang 5c4c8e29b8 ipc4: stream: add container format for ipc4
Sample format is alway equal to container format for
ipc3 case but it is not true for ipc4, .e.g sample format
is S16_LE but container format will be S32_LE. This patch
adds container_fmt for ipc4 to do stream copy.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-12-06 09:55:59 +00:00
Yong Zhi 47b159fca3 topology: set default values for C_CONTROLBYTES string members
When the string fields left empty, the alsa topology parser treats
SND_CONFIG_TYPE_STRING type config as -EINVAL, so set defauls values.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2021-12-03 10:39:35 +00:00
Marc Herbert c30dffcc35 zephyr/cmake: BUILD_ALWAYS for smex and sof-logger
Discovered the hard way that the Zephyr build assumes sof-logger is
always up to date when present. It's not clear from cmake's
ExternalProject documentation why that is the case. In any case
BUILD_ALWAYS fixes the issue and takes very little time because it does
not rebuild sof-logger from scratch. BUILD_ALWAYS is already used for
XTOS.

Fixes commit f6c71c21d0 ("zephyr/CMakeLists.txt: build smex and
sof-logger")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-03 10:21:20 +00:00