Commit Graph

8642 Commits

Author SHA1 Message Date
Adrian Warecki 2e7329685b ipc_get_ppl_comp: Prefer returning a dai component
Before the introduced optimization in
commit <95f6f88be705> ipc: Simplication of the ipc_get_ppl_comp function
this function first walks a list of components looking for dai,
then it again walks the list looking for a component which
connecting two pipelines. Optimization changed the behavior,
and the first matching dai or connector was returned. This
patch reverts to the previous behavior. Pipelines connector
is only returned if no dai is found.

Fixes #6003

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-15 09:01:58 +01:00
Andrula Song 12d660b088 Audio: copier: add hifi version implementation of apply_attenuation
add hifi version implementation of apply_attenuation, using xtensa
instructions can save about 74% cycles than the original one.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-07-15 08:55:11 +01:00
Serhiy Katsyuba 9d2857fe37 mixin/mixout all topologies support
Adds possibility to connect single mixin to multiple
mixouts. This allows for all possible mixin/mixout
topologies.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-07-13 09:47:09 +01:00
Balakishorepati 2d252c965c platform: amd: Add window information
Add sram window structure to update window info
to host.

configure dma descriptor base and count during firmware bootup.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-07-13 09:27:35 +01:00
Balakishorepati d37107bdc3 drivers:amd: add support to change aclk
Add support to configure aclk based on active stream requests.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-07-13 09:27:35 +01:00
Pierre-Louis Bossart 4be016befc topology1: sof-tgl-rt711-rt1308: use EXT_AMP_REF for rt1316
RT1316 is exposed by the machine driver as having an echo reference,
so the indices are different from the regular ones.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Pierre-Louis Bossart 04df9161cb topology1: sof-tgl-rt711-rt1308: make BT_OFFLOAD a CMakeFiles parameter
Somehow we assumed that all ADL platforms support BT_OFFLOAD. Wrong,
this is only valid for Chromebooks and needs to be set externally in
the CMakeFiles definitions.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Pierre-Louis Bossart 7666716e12 topology1: CMakeLists: add topology for HP Omen 16
RT711 on link0 and RT1316 on link3.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Pierre-Louis Bossart e70fd0fbf7 topology1: sof-tgl-rt711-rt1308: make amplifier link configuration
HP Omen 16 devices have an amplifier on link3, add the required
configuration macro.

BugLink: https://github.com/thesofproject/linux/issues/3727
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-12 09:34:39 +01:00
Peter Ujfalusi 5693934983 volume: Update outdated function parameter documentation
With the module conversion the parameter 'dev' of most function changed to
'mod', update the doxygen comment to generate correct information.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2022-07-12 09:15:03 +01:00
Adrian Warecki c4f4c978af copier: New pipeline latency calculation algorithm
New algorithm for calculating the pipeline latency based on
the number of buffered data blocks between the first and last
component.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki e8c34fd62e component: New function comp_get_base_module_cfg
Created new function comp_get_base_module_cfg which allows
to get component's base configuration. This function is still
access a component's private data in ugly way but it allows
solve this issue easier in the future.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki 95f6f88be7 ipc: Simplication of the ipc_get_ppl_comp function
The ipc_get_ppl_comp function has been simplified by removing
the duplicate loop. Now the component list is only reviewed once
and both conditions are checked simultaneously.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki d7e3d2b091 ipc4: Change declaration of node_id in ipc4_copier_gateway_cfg
Declare node_id in ipc4_copier_gateway_cfg structure as aproprietary type.
This change makes easier to reference the node_id field. Thanks to it,
you don't have to wonder what type the value should be casted. It make our
work easier and minimize the risk of a mistake.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki 910f4be6ff copier: Add processed data counters
Added total processed data counters and function to read it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki 37225cda01 comp_dev: Remove unused position field from comp_dev structure
The position field was ambiguous and is no longer used.
It has been deleted.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki fe583cf8a0 host: Introduce total_data_processed counter in host_data
The counting of processed data has been moved from a component
device structure to the components private data. Added a new
function for reading it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki c563e6e633 dai: Introduce total_data_processed counter in dai_data
The counting of processed data has been moved from a component
device structure to the components private data. Added a new
function for reading it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki 838fbd16c1 comp_ops: Add new method to get total data processed
I have added a new function to the component's api that allows
to read the total number of processed data by it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki 123737f4ad dai: Removed unused start_position field
Removed from the dai_data structure the unused field start_position.
The assigned value was never used.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Adrian Warecki 87ccc5cae8 dai: Remove unused fields from dai_data structure
Removed unused dai_pos and dai_pos_blks fields from dai_data
structure. No pointer was assigned to dai_pos.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-07-12 09:13:24 +01:00
Pierre-Louis Bossart 9d9c28848d topology1: generate new sof-hda-generic version for 2ch PDM1
Generate 2 files for 1 and 2ch cases.

These topologies can be used by setting

options snd-sof-pci tplg_filename=<file>

in /etc/modprobe.d/alsa-base.conf

BugLink: https://github.com/thesofproject/sof/issues/5989
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-11 15:52:25 +01:00
Pierre-Louis Bossart 73fd9248e0 topology1: intel-generic-dmic: add macro to enable PDM1 for 2ch cases
There are multiple cases where we cannot detect that PDM1 is used
instead of the default PDM0.

BugLink: https://github.com/thesofproject/sof/issues/5989
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-07-11 15:52:25 +01:00
Adrian Bonislawski ef39318ee4 dai-zephyr: add a DAI COPY trigger
Add a DAI COPY trigger to be called before dma_copy

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-07-11 09:31:38 +01:00
Marc Herbert 33f27d3477 xtensa-build-zephyr.py: speed up thanks to an _actually_ shallow clone
This will significantly speed up CI in some cases.

Fixes commit ffdf001eee ("xtensa-build-zephyr.py: clone zephyr with
--depth 5")

When I added --depth 5 to git clone in that commit I naively assumed git
fetch would "inherit" that. I think it does but only when fetching an
_existing_ (and shallow) branch, not when fetching something new.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-11 09:22:32 +01:00
Lionel Koenig 912cf91ca6 google_rtc: Do not rely on component type.
Remove the assumption that the AEC reference was coming from a DEMUX.
It now uses the fact that the AEC reference comes from another pipeline
in order to detect it is the reference signal.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-07-08 21:28:26 +01:00
Fred Oh 9fc3833a5d docker: dump git log to a file before deleting projects
To track the docker images, need to keep all the hashes of the projects
builts in the image. Log git tree information to
/home/sof/work/sof_git_hash.txt in the docker image.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-07-08 21:27:27 +01:00
Fred Oh 85d68d0921 docker: change indentation and add HOME variable
No functionality change. Add some logs and minor clean up.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-07-08 21:27:27 +01:00
Bard Liao 606857bca5 topology2: cavs-passthrough-hdmi: use hdmi-generic.conf
hdmi-generic.conf can be used for all topologies with HDMI
support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-07-07 11:58:00 +01:00
Bard Liao 96ac486b58 topology2: add HDMI support on SDW
Create a hdmi-generic.conf and use it in cavs-sdw.conf to add
HDMI support

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-07-07 11:58:00 +01:00
Bard Liao c97fb30f97 topology2: sdw-cavs: add dmic support
Add PCH DMIC support for MTL RVP with dmic01 id = 2 and dmic16k id = 3.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-07-07 11:58:00 +01:00
Bard Liao 73f4f86d73 topology2: remove pipeline format parameter
The "format" parameter is never used by IPC4. And it should not be
mandatory.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-07-07 11:58:00 +01:00
Marc Herbert 5dfaf0bf80 sof_ri_info: memory layout: find 'tgl' in ___/build_tgl_xcc/sof.ri
Extend the search for the platform code in directory names when there is
no sof-tgl.ri match.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 11:53:11 +01:00
Marc Herbert 0f365400eb sof_ri_info: explain why memory layout is empty
It was not obvious at all that the expected memory layout is inferred
from the filename.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 11:53:11 +01:00
Marc Herbert 7eb5ffcc4b Exclude dai-legacy.h from doxygen to avoid clashes with dai-zephyr.h
This fixes the sof-docs build and stops producing a dai-drivers-api.html
garbage that randomly mixed the two .h files.

```
Warning: Duplicate target detected:
    group__sof__dai__drivers_1ga8c720c310f408b2f97ce014562d6a910
sof-docs/api/dai-drivers-api.rst:4: WARNING: Duplicate ID:
   "group__sof__dai__drivers_1ga8c720c310f408b2f97ce014562d6a910".
sof-docs/api/dai-drivers-api.rst:4: WARNING: Duplicate explicit target name:
   "group__sof__dai__drivers_1ga8c720c310f408b2f97ce014562d6a910".

sof/sof-docs/api/dai-drivers-api.rst:6: WARNING:
  Duplicate declaration, const struct device* dai::drv
```

(Temporarily?) fixes commit 015ec63c4d ("zephyr: add glue code to
use zephyr dai drivers") that introduced a lot of duplication with
dai-zephyr.h. See more details at
https://github.com/thesofproject/sof/pull/5731#issuecomment-1175630147

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 10:52:45 +01:00
Marc Herbert 31b14782d2 Exclude audio/coefficients/src/src_ipc4_*.h from doxygen
Fixes doxygen warning:

warning: Included by graph for 'src.h' not generated, too many
nodes (111), threshold is 50. Consider increasing DOT_GRAPH_MAX_NODES.

This code is generated and pollutes doxygen output anyway.

Temporary, manual solution until the `\cond` directive is also generated
by the sof/tools/tune/src/*export*.m script(s)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 10:49:04 +01:00
Marc Herbert 1be730182d Exclude audio/coefficients/src/src_ipc4_int32_table.h from doxygen
Fixes doxygen warning:

warning: Include graph for 'src_ipc4_int32_table.h' not generated, too
many nodes (89), threshold is 50. Consider increasing
DOT_GRAPH_MAX_NODES.

This code is generated and pollutes doxygen output anyway.

Temporary, manual solution until the `\cond` directive is also generated
by the sof/tools/tune/src/*export*.m script(s)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 10:49:04 +01:00
Marc Herbert 4c3ea714fa .github: doxygen: use the newer and better FAIL_ON_WARNINGS
Unlike the older 'YES', FAIL_ON_WARNINGS reports all warnings.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 10:49:04 +01:00
Marc Herbert ceacbefd03 .github: doxygen: upgrade to Ubuntu 22.04
This should upgrade doxygen from version 1.8.17 to 1.9.1

This will hopefully provide FAIL_ON_WARNINGS and fix issues like
https://github.com/doxygen/doxygen/issues/7970

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-07 10:49:04 +01:00
Xiaoyun Wu(Iris) 1e467a106f xtensa-build-zephyr: Auto pamam completion for --fw-naming
There are some restrictions when --fw-naming is set to 'AVS' for the
sake of providing reasonable FW outputs that make sense.

Restriction 1: When argument fw_naming is set as AVS, IPC4 ipc version
will be automatically chosen.

This is because --fw-naming 'AVS' is added for supporting IPC4 SOF build by
nature.

Restriction 2: When argument fw_naming is set as AVS, using platform
subdirectories will be automatically chosen.

The reason is that the platform subdirectories actually belong to the
"AVS" naming scheme, we must enable using platform subdirectories when
building FW in AVS naming convention.

This also ensure that we can tell firmwares of different platforms apart
by organizing them in different subdirectories.

Signed-off-by: Xiaoyun Wu(Iris) <xiaoyun.wu@intel.com>
2022-07-06 22:05:02 +01:00
Iris Wu 762f63bf8b xtensa-build-zephyr: add option to build FW in cavs naming style
Add argument option --fw-naming for specifying FW output with its
filename set with AVS style(filename as dsp_basefw.bin specifically)
OR SOF style(filename as sof-{platform}.ri). SOF style is by default.

This will be useful when building SOF+Zephyr IPC4 FW, because
dsp_basefw.bin will be loaded by default when snd_sof_pci parameter
ipc_type is set to 1 (which indicates running IPC4 mode).

Signed-off-by: Iris Wu <xiaoyun.wu@intel.com>
2022-07-06 22:05:02 +01:00
Marc Herbert 4d03c269c2 .github: add sof-docs build to Github Actions
From time to time sof-docs regressions are introduced in sof.git. This
introduces a random and sometimes long delay between when the regression
is introduced and when it is found. A recent example is
https://github.com/thesofproject/sof/pull/5731#issuecomment-1175630147
where the doxygen comments were duplicated. Doxygen alone did not mind,
then the sof-docs build failed much later which took multiple people a
lot of time to understand and bisect.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-06 22:02:21 +01:00
Andrula Song 4b4b752a14 Audio: Copier: optimize the usage of read frag
Optimize the read frags of copier module in function
apply_attenuation. By using the optimized function
audio_stream_samples_without_wrap_s32, we can reduce
the address judgment and save about 60% MCPS.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-07-04 16:26:58 +01:00
Marc Herbert 7c5bf651f8 xtensa-build-zephyr: copy ALL cavstool*.py scripts
Quoting https://github.com/zephyrproject-rtos/zephyr/pull/46880#pullrequestreview-1020096140

> No complaints about the code here. Just a general comment:

> I do worry that as cavstool grows features (first to add the test
> integration support, now the new client/server architecture) that
> we're obscuring the core code that does the loading behind a big
> facade of other stuff that also has to be run In Just The Right Way to
> make things work. That impedes development flow. It might be time to
> split the code up so that a minimal "just run this file please" tool
> can continue to be maintained.`

Long story short: `cavstool.py` is likely to be split in the future.

To be readi-er, copy the entire `zephyr/soc/xtensa/intel_adsp/tools/`
directory.

Copying the entire directory also copies scripts that will never be used
on a test device like `cavstool_client.py`. They're small Python script
sso we don't care: keep it simple.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-07-04 15:56:34 +01:00
Ranjani Sridharan e5b29d1a9d pipeline: Add a pending flag to the pipeline trigger
When the host pipeline and DAI pipelines have the same scheduling
period, the host pipeline will be prioritized over the DAI pipeline when
the scheduler picks a task to execute after receiving a pipeline trigger
IPC.

But in the case that the host pipeline's scheduling period is larger
than that of DAI pipeline, the DAI pipeline task will likely get
executed before the host pipeline gets the chance to execute the trigger
command. And when this happens, the state of the aborted flag is
insufficient to determine if the pipeline task should be kept running or
completed. For example, consider the mixer based pipelines in the
nocodec topology:

 PCM0 (pipeline 11, 1ms period) ---> Volume -----|
                                     V
                                   Mixer (Pipeline 1, 1ms)----> SSP0
                                    ^
 PCM3 (pipeline 7, 10ms period ) ---> Volume -----|

When PCM 3 is started and the START trigger completes, the aborted flag
for pipelines 7 iand pipeline 1 will be reset. And when PCM 3 is paused,
the PAUSE trigger is scheduled for both the pipelines 7 and 1. But since
pipeline 1 has a lower latency requirement than pipeline 7, it gets
scheduled first and because it is not the host pipeline, the trigger is
not executed and the aborted flag is not set, the task gets completed and
a subsequent release for PCM 3 ends up in an IPC timeout.

To fix this, add a new flag called pending to the pipeline trigger that
can be set when a pipeline trigger is scheduled for a pipeline. This flag
must be cleared when the first component in the pipeline executes it's
trigger op. This flag combined with the aborted flag are sufficient to
prevent the IPC timeouts for the cases where the DAI pipeline task executes
ahead of the host pipeline when the trigger has not been executed yet.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-07-04 15:55:56 +01:00
Ranjani Sridharan f8bbef3357 pipeline-schedule: clear aborted flag for non-host connected pipelines
Consider the mixer-based pipeline in the nocodec topologies:
  PCM0 (pipeline 11) ---> Volume -----|
				      V
                                    Mixer (Pipeline 1)----> SSP0
				     ^
  PCM3 (pipeline 7) ---> Volume -----|

When PCM0 is started it triggers pipelines 7 and 1. When PCM3 is
started followed by PCM0, it will trigger pipelines 11 and 1. But since
pipeline 1 is already is started, it's aborted flag will be set.
But the aborted flag is never cleared for pipeline 1 because it is
not the host pipeline.

Fix this, by clearing the aborted flag for non-host pipelines in
pipeline_task_cmd()

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-07-04 15:55:56 +01:00
Bard Liao 67daf2ecf5 topology2: add num_audio_formats for gain
We should set num_audio_formats in pipelines when we remove the
default value from gain.conf.
Otherwise, we will see below error with cavs-mixin-mixout-hda-2ch-tgl.tplg
tplg: ready widget id 2 pipe 1 type 6 name : gain.1.1 stream none

Fixes: 773a05a3 ('topology2: add S24LE support')
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-07-04 15:53:06 +01:00
Yong Zhi 45f6d6fa59 topology2: cavs: hda: add tplg build for mtl
Add the topology for skl_hda_dsp_generic machine.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-07-04 15:28:47 +01:00
Guennadi Liakhovetski 7a2e0e1e17 multiband-drc: fix buffer acquisition
Instead of acquiring and releasing buffers locally multiple times,
do that once for .copy() and .prepare() methods.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-07-01 11:11:23 +01:00
Guennadi Liakhovetski c323efee44 drc: fix buffer acquisition
Instead of acquiring and releasing buffers locally multiple times,
do that once for .copy() and .prepare() methods.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-07-01 11:11:23 +01:00