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: sof-mtl-rt5650: enable dts playback #20

Closed
wants to merge 786 commits into from

Conversation

macchian
Copy link
Owner

@macchian macchian commented Nov 6, 2023

enable dts pipeline on rt5650 speaker(I2S0) and headphone(I2S1).

iuliana-prodan and others added 30 commits October 13, 2023 09:13
…nvalid"

This reverts 'commit e847c8b ("module_adapter: avoid module
init crash in case of ipc data invalid")'.

No data is not an invalid case for mixer, for example.

Fixes: thesofproject#8265
Signed-off-by: Iuliana Prodan <[email protected]>
This patch adds the widget class dcblock and a sample
bytes configuration blobs.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch uses cavs-benchmark-hda.conf to build topologies to
test components in a simple playback and capture configuration.

host copier --> component --> DAI copier
host copier <-- component <-- DAI copier

The built topologies are
sof-hda-benchmark-dcblock16/24/32-tgl.tplg

The shell script bench_comp_generate.sh is added to conveniently
generate include files needed to build new test topologies for
component with s16/s24/s32 format.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds DRC test topologies build.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds IIR EQ topologies build.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch adds FIR EQ topologies build.

Signed-off-by: Seppo Ingalsuo <[email protected]>
name

rt713 and rt1713 are in different SoundWire links. So, no DAI type will
be appended to DAI link name. We should use default stream name in
the topology.

Signed-off-by: Bard Liao <[email protected]>
This is fixup for 689e8e9

Incorrect list pointer has been used

Signed-off-by: Marcin Szkudlinski <[email protected]>
Based on this we select proper firmware in order to
support multi-fifo.

Signed-off-by: Daniel Baluta <[email protected]>
MICFIL can support up to 8 channels. In order for this to work
we need to use multi-fifo script.

Signed-off-by: Daniel Baluta <[email protected]>
On i.MX8MP PDM fifo has 32 entries (each with 4 bytes).

Signed-off-by: Daniel Baluta <[email protected]>
In order to enable PDM we need to use Multi-fifo support
and mcu_2_sai RAM script.

This script defines watermark level as follows:

r7 = Watermark
    bit0~11: watermark level(wml*fifo_number)
    bit15~12: to do-fifo number
    bit16~19: fifo offset
    bit27~24: sw done selector
    bit28~31: # audio channels in one frame, 0: 1 channel,1: 2 channels
    bit23: sw done enabled

Configuration parameters should come from DAI (PDM in our specific case)
but there is no easy way to forward such information so we just make
use of some default configuration, 4 fifos, 1 channel per fifo, sw done
enabled.

Signed-off-by: Daniel Baluta <[email protected]>
With multi-fifo we need to enable done bit from software
as we have multiple fifos.

For this we make use of sw_done_sel configurations bits and
write proper bits into SDMA_DONE0 register.

For more information see `SDMA DONE0 Configuration
(SDMAARMx_DONE0_CONFIG)` SDMA register from i.MX8 reference manual.

Signed-off-by: Daniel Baluta <[email protected]>
The first playback PCM is for AEC mic input via SSP0 LBM. The second
playback PCM is for AEC reference via SSP2 LBM. The first capture
PCM is the AEC output.

The AEC (mockup) can be run and tested with the topology like
this:

$ aplay -Dhw:0,0 mic_clip.wav &
$ aplay -Dhw:0,2 ref_clip.wav &
$ arecord -Dhw:0,0 -f dat -d 10 output.wav

With AEC mockup version output.wav is mix of microphone
and reference.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch modifies script example_dblock.m to create in
addition to existing default coefficients blob with parameter
R=0.98 a set of blobs those provide (-3 dB) cut-off frequencies
20, 30, 40, 50, 100, 200 Hz for 16 kHz and 48 kHz for various
usages. Human understandable parameters for blobs helps to select
the configuration for the needed dcblock usage.

The parameter value R for given frequencies is calculated
with iterative function dcblock_rval_calculate(). A closed
form equation might be possible to derive from the transfer
function. If such is found this function can be replaced with
quicker equation -- or with more advanced faster converging
iteration.

The topology blob export functions are also modified to add
comment line for exact build command.

Signed-off-by: Seppo Ingalsuo <[email protected]>
We still have tomlc99 as a git submodule for now.

Signed-off-by: Marc Herbert <[email protected]>
For ease of use add sdma script code directly in the sdma
header file.

Signed-off-by: Daniel Baluta <[email protected]>
MICFIL needs multi-fifo SDMA script so select HAVE_SDMA_FIRMWARE.

Signed-off-by: Daniel Baluta <[email protected]>
Setting the in bit depth for the second audio format in the
host-gateway-capture object results in resetting the channel count to 2.
The in_bit_depth is set to 32-bit by default for all audio formats in
host-gateway-capture class already.

Fixes: 7a11e27 ('topology2: host-gateway-capture: Replace audio_format objects')
Signed-off-by: Ranjani Sridharan <[email protected]>
Use the input_audio_format/output_audio_format objects explicitly.

Signed-off-by: Ranjani Sridharan <[email protected]>
Use input_output_format/output_audio_format explicitly. Additionally,
this patch introduces the used of the CombineArrays feature in the
topology2 compiler to generate multiple audio format objects from the
attribute array combinations.

Signed-off-by: Ranjani Sridharan <[email protected]>
This change can drop in TGL platform 2ch 48 kHz gain component
peak load e.g. from 16.7 to 7.09 MCPS CPU_PEAK(MAX) reported by
sof_perf_analyzer.py. The peak varies a bit time. If several
gain instances ramp simulatenously in stream start, the peak
MCPS consumption could be source for xruns and glitches if overall
load is high.

The change with linear curve is barely audible. The
computationally heavier Windows fade exponential curve is required
only with Windows OS. Since Windows is not using ALSA topologies
this change does not impact it.

Signed-off-by: Seppo Ingalsuo <[email protected]>
This patch changes all cavs-nocodec.conf based topologies to
use exponential Windows fade curve_type in gain components. It
is done to ensure the ramp gets tested after change of gain
curve_type default to linear.

The gain in included deep buffer playback pipeline (hw:0,31) and
in mixer pipeline (hw:0,41) are not changed because they are used
also in normal topologies. Also in capture direction DMIC raw
(hw:0,10) remains curve_type 2. Other gains are curve_type 1
Windows fade.

Signed-off-by: Seppo Ingalsuo <[email protected]>
The num_output_pins was set for pass-through path but missed in normal
path. Without it Linux kernel driver wouldn't set second output pin
format for dai copier which connects smart amp and gain module.

Signed-off-by: Rander Wang <[email protected]>
Separate the input & output audio format.

Signed-off-by: Rander Wang <[email protected]>
remove space to align with coding standard.

Signed-off-by: Baofeng Tian <[email protected]>
Will first check whether have same target volume, if same,
then only calculate one channel and copy to other channels.

Signed-off-by: Baofeng Tian <[email protected]>
Add config to control peak volume code need build or not.

Signed-off-by: Baofeng Tian <[email protected]>
ranj063 and others added 27 commits November 22, 2023 09:41
These dont exist anymore.

Signed-off-by: Ranjani Sridharan <[email protected]>
…IG_LIBRARY is set

This is already defined in logging.c when a known logging method is not
set.

Signed-off-by: Ranjani Sridharan <[email protected]>
Fix the typecasting in a couple of places and compiler attributes to
prevent the following compilation errors:

ipc4/handler.c:1007:45: error: pointer targets in initialization of ‘const uint8_t *’
			{aka ‘const unsigned char *’} from ‘const char *’ differ in signedness [-Werror=pointer-sign]
 1007 |                 const uint8_t *end_offset = data + data_off_size;
      |                                             ^~~~
ipc4/handler.c:1040:57: note: expected ‘const char *’ but argument is of type ‘uint8_t *’ {aka ‘unsigned char *’}

ipc4/module.h:67:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__aligned’
   67 | } __packed __aligned(4);

Signed-off-by: Ranjani Sridharan <[email protected]>
Clarify the inline comment in zephyr_ll_task_insert_unlocked()
explaining the task priority semantics. The old text is not clear on
what is "high priority". Make it explicit that 0 is the highest priority
and that the tasks are executed in order of task priority.

Signed-off-by: Kai Vehmanen <[email protected]>
runtime_stream_params is a container for all
parameters of a stream
Add an API call to retrieve it

Signed-off-by: Marcin Szkudlinski <[email protected]>
add get buffer ID to sink/src api

Signed-off-by: Marcin Szkudlinski <[email protected]>
One major difference in IPC4 versus IPC3 is that each pipeline
will get a separate SET_PIPELINE_STATE command. This is in stark
contrast to IPC3 where host sends STREAM_TRIG_START and firmware
is expected to propagate the state change to all connected
pipelines in the graph.

Change the code such that when pipeline component trigger is executed in
IPC4 build, propagation is stopped whenever we reach another pipeline.

This prevents bugs stemming from IPC3 related logic to propagate
pipeline triggers, interfering with IPC4 usages like in bug 8481.

To avoid false -ENODATA errors, drop IPC4 support for this capability.
The check added in commit b154132 ("ipc4: check pipeline priority
for error report") covers most cases, but this relies on host to send
the SET_PIPELINE_STATE calls in particular order. This unfortunately is
not a mandatory order to follow, so logic to check upstream pipeline
status to conclude downstream is in permanent -ENODATA state, is not as
solid as it is for IPC3. As this may lead to hard to debug errors (e.g.
when changing pipeline priorities in topologies which again affects the
order of the SET_PIPELINE_STATE), better to simply disable this feature
for IPC4.

Link: thesofproject#8481
Signed-off-by: Kai Vehmanen <[email protected]>
Fix a side-effect of commit 068f143 ("ipc4: handler: Use separate
loops for pipeline state phases") where the order of pipeline
triggers was changed when the trigger handling was delayed to
the pipeline thread. If host asked for pipelines to be triggered
in order 2, 1, 0, the actual trigger order might end up as 0, 1, 2
based on how LL scheduler runs the pipeline tasks (0 is run first).

Fix the issue by adding a blocking wait to the IPC thread between
each delayed trigger.

Link: thesofproject#8481
Signed-off-by: Kai Vehmanen <[email protected]>
Update Zephyr to bring in following Zephyr commit:
efc32081893d soc: intel_adsp: cavs: mask idc interrupt
before halting cpu

Link: thesofproject#8492

Signed-off-by: Rander Wang <[email protected]>
Create a Kconfig for each module and include them from src/audio/Konfig.

Signed-off-by: Andrula Song <[email protected]>
Update the basefw config query.

Signed-off-by: Rander Wang <[email protected]>
If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report
fw_context_save is supported to host. Driver will assume fw doesn't
support this feature if it is not reported.

Signed-off-by: Rander Wang <[email protected]>
Removed unused includes from a header files.

Signed-off-by: Pawel Dobrowolski <[email protected]>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Extracted struct sof_audio_stream_params and enum sof_ipc_frame definitions
get_sample_bytes, get_sample_bitdepth and get_frame_bytes functions to a
new files in the module directory to separate an shared interface used by
sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Moved header files to the module directory to separate an shared interface
used by sof and native loadable modules.

Signed-off-by: Adrian Warecki <[email protected]>
Use of a separated module headers when building native loadable libraries.

Signed-off-by: Adrian Warecki <[email protected]>
Added building a static library containing common functions for modules
provided by sof. Native loadable modules are statically linked to it.

Signed-off-by: Adrian Warecki <[email protected]>
Add HiFi4 implementation of DRC.

Signed-off-by: Andrula Song <[email protected]>
Windows driver always set sample type of MSB for 24/32 format but SOF FW
supports 24/32 LSB type for non-copier modules. So FW will convert the
input MSB 24/32 to LSB 24/32 and process it and convert it back to MSB
24/32 when exiting gtw.

Signed-off-by: Rander Wang <[email protected]>
Signed-off-by: Damian Nikodem <[email protected]>
Store/apply config blob in a cache to avoid that
cfg.data will be released after prepare.

Signed-off-by: barry.jan <[email protected]>
Open tree for 2.9 development now that stable-v2.8 is branched out.

Signed-off-by: Kai Vehmanen <[email protected]>
enable dts pipeline on rt5650 speaker(I2S0) and headphone(I2S1).

Signed-off-by: Mac Chiang <[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.