Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topology2: dts: add dts support #15

Open
wants to merge 153 commits into
base: master
Choose a base branch
from
Open

topology2: dts: add dts support #15

wants to merge 153 commits into from

Conversation

macchian
Copy link
Owner

@macchian macchian commented Oct 6, 2023

This commit adds the topology2 file for DTS. The processing chain is EQ IIR - DTS.

The topology file with DTS is sof-mtl-max98357a-rt5682-ssp2-ssp0-dts.tplg.

Signed-off-by: Joe Cheng [email protected]
Signed-off-by: Mac Chian [email protected]

ranj063 and others added 30 commits September 11, 2023 10:17
When we added the flags to disable SSP0 and SSP1 on the UP2, we took the
shortcut of just removing the PCMs in topology but left the pipelines
and widgets in the topology in. While this works in practice to prevent
us from testing those SSPs, the right way is to also remove those
pipelines also when the SSPs are disabled.

This stops tplgtool2.py from complaining constantly about this
inconsistency since thesofproject/sof-test#1079
which made the sof-test verify-tplg-binary.sh fail every time:

```
tplgtool2.py sof-glk-nocodec.tplg

ERROR: No pcm id=0 for widget=PCM0C
ERROR: No pcm id=1 for widget=PCM1C
ERROR: No pcm id=0 for widget=PCM0P
ERROR: No pcm id=1 for widget=PCM1P
ERROR: tplgtool2.py returned 4
```

This change affects only sof-apl-nocodec and sof-glk-nocodec.

Signed-off-by: Marc Herbert <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
This commit removes coherent.h from struct comp_buffer

As sharing status of a buffer is known at creation time, it is
enough to create a buffer in shared (not cached mem alias)
when it will be used by several cores

Signed-off-by: Marcin Szkudlinski <[email protected]>
to verify that shared structures are used in a proper way
a debug check is introduced

If compiled with COHERENT_CHECK_NONSHARED_CORES flag
each usage of shared structures will be verified
against proper memory alias usage

Signed-off-by: Marcin Szkudlinski <[email protected]>
as buffer pointer now is not swapping between cached
and uncached aliases, there's no need to convert pointers
in notifier events

Signed-off-by: Marcin Szkudlinski <[email protected]>
This patch adds the topology2 files for multiband-DRC. The EFX
processing chain is gain - IIR - FIR - DRC or Multiband-DRC. The
DRC selection is done with macro EFX_DRC_COMPONENT and values
"singleband" and "multiband".

The multiband-drc has two ALSA controls, bytes and switch. The
switch control switches the processing on and off.

The generated topology files with multiband-drc are:

sof-hda-efx-mbdrc-generic.tplg
sof-hda-efx-mbdrc-generic-2ch.tplg
sof-hda-efx-mbdrc-generic-4cg.tplg

The topology files with DRC are as before:

sof-hda-efx-mbdrc-generic.tplg
sof-hda-efx-mbdrc-generic-2ch.tplg
sof-hda-efx-mbdrc-generic-4cg.tplg

The configuration blob default is updated to what is generated
by the current example_multiband_drc.m configuration script. The
pass-through blob is set as default for tplg2. The topology 1
blobs are updated similarly.

Signed-off-by: Seppo Ingalsuo <[email protected]>
struct audio_stream __sparse_cache => struct audio_stream
struct comp_buffer __sparse_cache => struct comp_buffer
struct sof_source __sparse_cache => struct sof_source
struct sof_sink __sparse_cache => struct sof_sinkurce

this commit is 100% generated by editor find/replace
+ one cosmetic change (intent correction to make checkpatch happy)

Signed-off-by: Marcin Szkudlinski <[email protected]>
Prev commit removing __sparse was a pure editor action,
this commit is removing some other __sparse annotations and
mappings that must have been done manually

This commit contains "safe" changes only

Signed-off-by: Marcin Szkudlinski <[email protected]>
after removal of __Sparse some of lines may be
formatted differently.

This commit contains cosmetic changes only

Signed-off-by: Marcin Szkudlinski <[email protected]>
Tone component has been without maintenance and validation,
and there is no interface to control sound generation from
user space so it will be deprecated and removed from successive
release.

Signed-off-by: Seppo Ingalsuo <[email protected]>
Data provided by source interface cannot be modified in any way
by the module using source API.
Mark pointers as const

Signed-off-by: Marcin Szkudlinski <[email protected]>
DP queue is a lockless circular buffer
providing safe consumer/producer cached operations cross cores

prerequisites:
 1) incoming and outgoing data rate MUST be the same
 2) Both data consumer and data producer declare
    max chunk sizes they want to use (IBS/OBS)

required Buffer size:
	- 2*MAX(IBS,OBS) if the larger of IBS/OBS
          is multiplication of smaller
	- 3*MAX(IBS,OBS) otherwise

The queue may work in 2 modes
1) local mode
   in case both receiver and sender are located on
   the same core and cache coherency
   does not matter. dp_queue structure is located in cached memory
   In this case DP Queue is a simple ring buffer

2) shared mode
   In this case we need to writeback cache when new data
   arrive and invalidate cache on secondary core.
   dp_queue structure is located in shared memory

dpQueue is a lockless consumer/producer safe buffer.
It is achieved by having only 2 shared variables:

 write_offset - can be modified by data producer only
 read_offset - can be modified by data consumer only

 as 32 bit operations are atomic, it is multi-thread and multi-core save

There some explanation needed how free_space and
available_data are calculated

number of avail data in circular buffer may be calculated as:
	data_avail = write_offset - read_offset
  and check for wrap around
	if (data_avail < 0) data_avail = buffer_size + data_avail

The problem is when write_offset == read_offset,
!!! it may mean either that the buffer is empty
    or the buffer is completely filled !!!

To solve the above issue having only 2 variables mentioned before:
 - allow both offsets to point from 0 to DOUBLE buffer_size
 - when calculating pointers to data, use:
         data_bufer[offset % buffer_size]
 - use double buffer size in wrap around check when calculating
   available data

And now:
  - write_offset == read_offset
		always means "buffer empty"
  - write_offset == read_offset + buffer_size
		always means "buffer full"

  - data_avail = write_offset - read_offset
	if (data_avail < 0) data_avail = 2 * buffer_size + data_avail

Signed-off-by: Marcin Szkudlinski <[email protected]>
Module adapter interfaces are a collection of methods, implementing
the API, they never change. Make them const.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
rfree(NULL) is valid, remove a redundant NULL check.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
platform.h isn't needed in smart_amp_test.h, remove it from there.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
move component data out of source file to avoid ipc3 and ipc4
usage in src source file.

Signed-off-by: Baofeng Tian <[email protected]>
create new files to cover ipc3 and ipc4 specific code.

Signed-off-by: Baofeng Tian <[email protected]>
previously, these headers are located in include directory.
Now, move it to src/audio/src/ directory, since these headers
are only used by src module.

Signed-off-by: Baofeng Tian <[email protected]>
rename it from src to coef to reflect the real content inside.

Signed-off-by: Baofeng Tian <[email protected]>
module_init in ipc4_init_module_instance() is completely overwritten,
no need to initialise it.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
This patch helps to find the right tool to create the setup blobs.

Signed-off-by: Seppo Ingalsuo <[email protected]>
When an IDC message is received from another core, the receiver core
doesn't have any useful data for it in cache. Writing back the cache
can corrupt the message data. Cache has to be invalidated instead.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
Host based mailbox needs to be fixed in another place. It's here
now until rtos partitioning is done.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Add maths directory for host.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Host build should not depend on testbench symbols. Also add timestamp to
the trace log.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Add the posix headers for use with the SOF ALSA plugin.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
And add the POSIX prefix.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Add missing platform definitions for CPU freq, DAI definitions etc.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Fix the base_fw.h file to add the missing preprocessor directive.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Add a new kconfig option to build the shared library modules that can be
used to run the pipelines on the host with the testbench or the ALSA
plugin.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
The structs sof_ipc4_control_msg_payload and sof_ipc4_ctrl_value_chan
match the similar structures in Linux kernel SOF IPC4 driver.

Signed-off-by: Seppo Ingalsuo <[email protected]>
tmleman and others added 29 commits September 28, 2023 07:53
ACE_1.5 and ACE_2.0 use only two clocks for DSP cores. First is WOVRCO and
second is ACE IPLL.

IPLL allows to configure it to work like LP RING Oscillator Clock or HP
RING Oscillator Clock. Currently, the driver does not allow this, so I
remove the frequency that cannot be achieved anyway.

Clocks frequencies:
WOV: 38.4 MHz
IPLL: 393.216 MHz

Signed-off-by: Tomasz Leman <[email protected]>
Changing max clock frequency for FPGA configuration.

Signed-off-by: Tomasz Leman <[email protected]>
Zepych update: total of 736 commits.

492517b918 west.yml: Update NXP HAL SDK to 2.14
a5d1fd9857 soc: adsp: clk: update clock switch flow
9656056b19 dts: adsp: ace20: remove lp clock
50f0e223e8 dts: adsp: ace15: remove lp clock
cf6d5f95b6 adsp: clk: ace: select ipll if wovrco is unavailable
2d835e1b29 dts: adsp: ace20: replace hp with ipll clock
dcecda859c dts: adsp: ace15: replace hp with ipll clock
2f2689e3d3 intel_adsp: ace15: shim: update wovrco request bit
ea9dd59460 yamllint: bindings: add ipll clock index
1ddabfa8d8 dai: intel: dmic: fix shadow variable
b26921d776 dai: intel: dmic: New functions for writing fir coefficients
cba9ec10c3 dai: intel: tgl: dmic: Refactor of dai_nhlt_dmic_dai_params_get function
c28e8ba9ba dai: intel: dmic: Add pdm_base and pdm_idx variables in blob parser
2452aaad50 dai: intel: dmic: Separate fir configuration code into function
f74fd8edaf dai: intel: ace: dmic: Add dai_dmic_start_fifo_packers function
76d03e798f dai: intel: ace: dmic: Using the WAIT_FOR macro in waiting functions
3fbaed4de9 dai: intel: ace: dmic: Refactor of dai_nhlt_dmic_dai_params_get function
d7672af838 dai: intel: dmic: Combine PDM registers definitions
8ea53d49b6 dai: intel: dmic: nhlt: Move debug print code to a separate functions
81944c5c62 dai: intel: dmic: Move definitions of nhlt structures to a new file

Signed-off-by: Tomasz Leman <[email protected]>
remove buffer ops from samples

this is a continuation of changes
from commit 4a03699

Signed-off-by: Tobiasz Dryjanski <[email protected]>
remove buffer ops from dai, dai-legacy, dai-zephyr

this is a continuation of changes
from commit 4a03699

Signed-off-by: Tobiasz Dryjanski <[email protected]>
remove buffer ops from  host-legacy, host-zephyr

this is a continuation of changes
from commit 4a03699

Signed-off-by: Tobiasz Dryjanski <[email protected]>
remove one unneeded newline

Signed-off-by: Tobiasz Dryjanski <[email protected]>
At the beginning, we have two build jobs in github
action to build IPC3 and IPC4 firmware for TGL/TGL-H.

The PR thesofproject#8048
switches cAVS2.5 configs to use IPC4 by default and
empties the cAVS2.5 overlay files. After the change,
the xtensa-build-zephyr.py script is building the
same IPC4 firmware with or without '-i IPC4' option.
So we have two jobs running different build command
but build the same IPC4 firmware.

Recently, commit 5004d0f ("zephyr.yml: remove ipc
option for zephyr build") removes '-i IPC4' option
in github action for TGL/TGL-H IPC4 build. So we have
duplicated jobs to build firmware for TGL and TGL-H
in the end.

This patch removes the duplicated build job which previously
is used to build IPC3 firmware for TGL/TGL-H and obsolete
comments.

Signed-off-by: Chao Song <[email protected]>
Fix build with CONFIG_LIBRARY.

Signed-off-by: Ranjani Sridharan <[email protected]>
Add the fallthrough to prevent the error seen with shared
library build:
"handler.c:312:20: error: this statement may fall through
[-Werror=implicit-fallthrough=]"

Signed-off-by: Ranjani Sridharan <[email protected]>
Add support for the SOF shared library modules to work with IPC4.
The main changes in the patch involve support for triggering pipelines
in the IPC context when running on the host and support for fetch the
component driver with the INIT_MODULE_INSTANCE IPC. Currently, we use a
hardcoded table to match the module ID with UUIDs. This will be modified
in the future to make it scale for all modules.

Signed-off-by: Ranjani Sridharan <[email protected]>
Add the deconfig file for building the SOF ALSA plugin with IPC4.

Signed-off-by: Ranjani Sridharan <[email protected]>
…nes for IPC4

Update the struct tplg_comp_info to add some new fields needed for
parsing module information for IPC4. Also, introduce a couple of new
structures to save the pipeline info and fix the path to the peak_volum
header.

Signed-off-by: Ranjani Sridharan <[email protected]>
The SOF ALSA plugin allows SOF topologies to be run on the host. The plugin
is still WIP with many rough edges that need refined before production
deployment, however the plugin is usable today as a rapid development
framework for SOF infrastructure and processing.

Features that are function in the current implementation
 * aplay & arecord usage working today
 * modules are loaded as SO shared libraries.
 * topology is parsed by the plugin and pipelines associated with the requested PCM ID are loaded
 * pipelines run as individual userspace threads
 * pipelines can be pinned to efficency cores
 * pipelines can use realtime priority.
 * alsa sink and alsa source modules available.
 * pipelines can block (non blocking and mmap todo)
 * 16-bit playback and capture support. Other formats to be added soon

Signed-off-by: Ranjani Sridharan <[email protected]>
Signed-off-by: Liam Girdwood <[email protected]>
buffer_acquire and buffer_release are no longer in use
remove stubs from the code

Signed-off-by: Marcin Szkudlinski <[email protected]>
This patch fixes a confusing error message typo in module_adapter.c.

Signed-off-by: Seppo Ingalsuo <[email protected]>
Mutex protected module_source_info was an old failed attempt to support
cross-core connection of mixin and mixout. That functionality was never
properly tested as FW did not support cross-core connections there.

For connected mixin and mixout located on same core, that functionality
is not needed. For cross-core connection, that functionality creates
dead-lock.

Signed-off-by: Serhiy Katsyuba <[email protected]>
The_very_long_variable names make it hard to modify
the code and keep to under-100-characters coding
guidelines of the codebase.

Signed-off-by: Kai Vehmanen <[email protected]>
Zepych update: total of 853 commits.

Changes include:

i8c4eec7ac6 intel_adsp: boot_complete must be done PRE_KERNEL_1
1fc16e6565 release: Zephyr 3.5.0-rc1
c910dc81a6 sys_clock: header: minor cleanup and doxygenization
b9f8b91692 kernel: sys_clock: remove stray z_enable_sys_clock prototype
cc2a558707 kernel: move more internal smp calls into internal domain
a1c7bfbc63 kernel: remove unused z_init_thread_base from kernel.h
209ff606be kernel: move internal smp calls to a internal header
e19f21cb27 kernel: move z_is_thread_essential out of public kernel header
f0c7fbf0f1 kernel: move sched_priq.h to internal/ folder
e6f1090553 kernel: Integrate object core statistics
1d5d674e0d kernel: Add initial k_obj_core_stats infrastructure
6df8efe354 kernel: Integrate object cores into kernel
55db86e512 kernel: Add initial obj_core infrastructure
eb1e5a161d kernel: FIFO and LIFO have their own sections
9bedfd82a2 kernel: Refactor CPU usage
baea37aeb4 kernel: Re-factor sys_mem_blocks definition
2f003e59e4 kernel: Re-factor k_mem_slab definition
41e0a4a371 llext: Linkable loadable extensions
4289359eb2 modules: mcux: fix HAS_CMSIS_CORE selection
1194a35aa2 xtensa: cast char* to void* during stack dump with %p
fcf22e59b8 xtensa: mark arch_switch ALWAYS_INLINE
b2f7ea0523 soc: xtensa/intel_adsp/ace: fix _end location
e560bd6b8c boards: intel_adsp: fix board compatible
b4998c357e mm_drv: tlb: Fix compile time warning
759e07bebe intel_adsp: move memory window setup to PRE_KERNEL_1

Signed-off-by: Tomasz Leman <[email protected]>
Set priority for aec stream so that driver can trigger pipeline based on
pipeline priority.

Signed-off-by: Rander Wang <[email protected]>
The echo-ref pipeline ie the DAI capture pipeline involving the speaker
codec is already part of the list of pipelines that gets set up and
triggered when the DMIC capture starts. Therefore, there's no need for
the echo-ref PCM to explicitly start the reference capture. So, remove
it and connect the codec DAI to the google-rts-aec module directly.

Signed-off-by: Ranjani Sridharan <[email protected]>
The DMIC capture path should support both 4ch and 2ch audio formats.
Also, since the Google AEC module only support 16-bit input format,
modify the output of the refeence capture DAI accordingly.

Signed-off-by: Ranjani Sridharan <[email protected]>
The blob contains the input/output audio formats but these are already
passed during module init based on hw_params. So no need to have the
byte control for it.

Signed-off-by: Ranjani Sridharan <[email protected]>
This patch adds to enum ipc4_curve_type in peak_volume.h
ramp types for linear and logarithmic with and without zero
crossings detect. The conversion function
ipc4_curve_type_convert() converts the type into
enum sof_volume_ramp for use in volume.c.

The set_volume_ipc4() is changed to use the convert function
and the restriction to select other than windows fade type also
is removed.

Signed-off-by: Seppo Ingalsuo <[email protected]>
The windows fade, windows no fade, and linear and handled
the switch-case statement change into volume.c.

In IPC4 the ramp can be disabled with zero curve duration or with
no fade type. The ramp duration convert multiplication can be passed
with the no fade type.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds the other SOF volume ramp types linear and
logarithmic with and without zero crossings detect mode to gain
widget class. The names of fade values are changed to be similar
as in enum sof_volume_ramp, since there is a specific curve
shape required for Windows OS.

Signed-off-by: Seppo Ingalsuo <[email protected]>
In preparation for changing it, see
thesofproject#8178

No functional change yet.

Signed-off-by: Marc Herbert <[email protected]>
In preparation for changing it, see
   thesofproject#8178

No functional change yet.

Signed-off-by: Marc Herbert <[email protected]>
This commit adds the topology2 file for DTS. The processing chain is EQ IIR - DTS.

The topology file with DTS is sof-mtl-max98357a-rt5682-ssp2-ssp0-dts.tplg.

Signed-off-by: Joe Cheng <[email protected]>
Signed-off-by: Mac Chian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.