Commit Graph

2370 Commits

Author SHA1 Message Date
Andy Ross 17f46a71ee uuid: Use new UUID registry pervasively
Strip out all the literall UUID management from existing C code (the
API itself still works for any out-of-tree or test code users) and
exclusively use the new, much simpler, SOF_DEFINE_REG_UUID() macro
which sources IDs from the registry by name.

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Andy Ross 51a5fb9c80 uuid: Add app-global UUID registry
Add a very simple uuid-registry.txt file containing all known UUIDs in
the tree, use it to generate a C header (the script validates it in
the process) that can then be used for a simplified
SOF_DEFINE_REG_UUID() mechanism that avoids the risk and temptation
temptation of components incorrectly implementing UUIDs.

The intent is that in the longer term, this file can be used by other
downstream tooling (manifest and topology generation) to more easily
reference known IDs by name in a way that avoids duplication and
error.

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Andy Ross fdb039ef5f everywhere: Normalize UUID naming
UUIDs are defined with both a string name (used mostly just for trace
output on legacy xtos builds) and a symbol name used as a global
variable to tie the struct to e.g. component driver definitions.  And
because human beings are allowed to type them in, they have been
somewhat inconsistently defined.  Normalize them so the string name
and the symbol name match (the symbol has a "_uuid" suffix).

Some of these rules are fairly regular:

* Some of the component drivers added a "_comp" to the global symbol
  name and some didn't.  Strip the ones that included it.

* Some naming liked dashes where underscores would be present in a
  symbol name (e.g. "dw-dma" for dw_dma_uuid).  Unify the conventions
  so all name strings are valid C symbols.

* Applying those rules produces a collision between "dai" UUIDs
  defined in dai.c, dai_legacy.c and dai_zephyr.c, so the latter two
  have been renamed to "dai_legacy" and "dai_zephyr".

And in a handful of spots the code just wasn't consistent.  These
UUIDs have been manually renamed, generally trying to pick a name the
corresponds to the original string name, or to the C file that defines
them if that seems impractical:

    Orig. String Name      Orig. Symbol     New Unified Name
    =================      ============     ================
    Maxim DSM              smart_amp        maxim_dsm
    Passthru Amp           smart_amp        passthru_smart_amp
    agent_work             agent_work_task  agent_work
    cadence_codec          cadence          cadence_codec
    channel_map            chmap            chmap
    comp_task              idc_comp_task    idc_comp
    component              comp             component
    dp_schedule            dp_sched         dp_sched
    dts_codec              dts              dts
    edf_schedule           edf_sched        edf_sched
    google_hotword_detect  ghd              google_hotword
    ipcgw                  ipcgtw           ipcgw
    irq_818x               irq_mt818x       irq_mt818x
    kd_test                keyword          keyword
    ll_schedule            ll_sched         ll_sched
    memory                 mem              mem
    micfil_dai             micfil           micfil
    mix_in                 mixin            mixin
    mix_out                mixout           mixout
    modules                intel            modules
    passthrough_codec      passthrough      passthrough
    pga                    volume           volume
    posix_ipc_task         ipc_task         ipc_task
    schedule               sch              schedule
    spi_completion         spi_compl_task   spi_completion
    waves_codec            waves            waves
    zll_schedule           zll_sched        zll_sched

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Andy Ross a3c1b75808 uuid: Rename DECLARE_SOF(_RT)?_UUID() -> SOF_DEFINE_UUID()
Complete the unification of the diverged UUID APIs with a big rename.
Call it "DEFINE" instead of "DECLARE" since this is in fact a C struct
definition and not just a declaration of a type or extern symbol.

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Pierre-Louis Bossart c97bba3d3b topology2: fix HDMI dailink offsets for RT711-based RVPs
removing NUM_HDMIS=0 was not enough, the offsets need to be modified
as well.

While we're at it, make sure all RT711-based RVPs use the same
formatting, ADL had the setting buried in the middle of the chain of
macros.

Closes: https://github.com/thesofproject/linux/issues/5094
Fixes: 75ed6960b8 ("topology2: enable HDMI for all SoundWire production topologies")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-07-05 15:09:54 +03:00
Seppo Ingalsuo e4b4ac7b4c Tools: Tune: Common: Add checks for file open failures
This patch adds checks and errors for fopen() failures. The check
is useful with setup scripts paths changes. Aborting the script
avoids the errors in blob exports to be missed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-07-04 14:32:50 +03:00
Seppo Ingalsuo 7f212411cc Audio: DRC: Tune: Move DRC setup scripts to module directory
The purpose of this patch is to consolidate all the files
those belong to the DRC module. The top level function names
are changed to have sof_ prefix to avoid conflict with possible
other similar files.

Note: A small fix is needed after similar patch for EQ
is merged since some functions for DRC blob are used from
there.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-07-04 14:32:50 +03:00
Pierre-Louis Bossart 75ed6960b8 topology2: enable HDMI for all SoundWire production topologies
For some reason we still have NUM_HDMIS=0 in production topologies,
that's a miss. We have no reason to keep those initial developer
settings.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-07-04 13:36:27 +03:00
Seppo Ingalsuo f122cea825 Audio: SRC: Tune: Move SRC setup scripts to module directory
The purpose of this change is to consolidate the files those
belong to the SRC module. This commit only moves the files. The
next commits are fixing the issues caused by the move.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-26 14:42:11 +01:00
Andy Ross bbd25c4a59 topology2: mtl-rt5650: Add configuration for AEC w/o DTS
Combinatorics get hard with all the features, but it's really useful
to be able to test features in isolation.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-25 17:05:14 +01:00
Jaroslaw Stelter df39f0147e tools: rimage: config: add PTL config
Add base PTL config derived from MTL.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2024-06-24 16:15:41 +02:00
Ranjani Sridharan 9b7fffd0d5 tools: plugin: tplg: Fix a couple of memory leaks
Free the memory allocated for tplg base and available input/output
formats when the topology is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2024-06-19 21:16:52 +03:00
Seppo Ingalsuo 3da8e64745 Tools: Topology2: Update sof-hda-efx-generic controls names
The controls names for IIR, FIR need to be same as in
sof-hda-generic for UCM to find the controls and set up
the components for processing.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-19 14:16:09 +03:00
Yong Zhi 9c334976c4 tools: plugin: README: remove reference to tgl-nocodec
Fix the tplg name to match the actual name used in example.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-06-18 14:29:11 +01:00
Andy Ross d0c220d15c buffer: Move pipeline_id down into stream params
The pipeline_id has historically been part of the comp_buffer struct,
but that is being deprecated as a public API.  So move it down into
the contained sof_audio_stream_params struct where it can be found by
new style sink/source code.

Note that the actual value of the pipeline ID is a little ambiguous:
on IPC3, the buffer is defined by the user in the .tplg file as part
of a specific pipeline with a known ID.  With IPC4 topology, the
buffers are implicitly created and will be assigned the ID of their
source (!)  component.  It is legal to define a connection across two
pipelines, and there's no ability here to recover both pipeline IDs.

Signed-off-by: Andy Ross <andyross@google.com>
2024-06-18 14:25:20 +03:00
Peter Ujfalusi e137e9bcb8 topology2: common: pcm_caps: Change the periods_max from 1024 to 256
HDA host DMA has limitation on the number of BDL entries which translates
to number of periods, this limit is 256.

The Chrome ALSA compliance test is eagerly try to use as many periods as
it can which exceeds the BDL limit and the stream cannot be started.

Fixes: b3a6d1c570 ("topology2: common: pcm_caps: Increase periods_max from 16 to 1024")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-06-14 11:03:12 +03:00
Seppo Ingalsuo 1470e6c585 Tools: Topology2: Use rates instead of rate_min/max in benchmark
The rate_min/rate_max is obsolete, should use rates with
list of rates to support. Without this change the playback
of non-48 kHz content happens with 48 kHz rate with pitch
shift effect. Aplay shows only a warning.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-13 10:37:19 +03:00
Guennadi Liakhovetski 8795e0f0ad src: src_lite depends on src, make this explicit
src_lite uses all the code as src only with a different set of
coefficients. Make this obvious in Kconfig and in TOML.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-13 10:36:15 +03:00
Seppo Ingalsuo 65bad5c0c1 Tools: Testbench: Fix load of MFCC component
The load of MFCC fails with testbench due to missing call of
sys_comp_module_mfcc_interface_init() in common_test.c
testbench initialize.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-06-10 17:20:59 +01:00
Peter Ujfalusi c1ad36d592 topology2: Add new tokens 'playback/capture_pause_supported' as false by default
We need to face with reality that the pause/resume is a feature that is not
well tested (end users are using audio via audio servers and they don't
use pause/resume) causing constant issues with no real life benefit:
With IPC4 multiple pause/resume will make the delay reporting to be
exponentially shoot out, making the reported delay to be unusable.

Looks like suspend/resume with paused stream has been broken for a long
time and just got noticed (since it was not tested).

Add a new token to allow selected PCMs to advertise pause support and
keep it false by default.

The kernel side will allow ignoring the flag to keep the pause advertised
for continued testing while protecting accidental use of it by users.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://github.com/thesofproject/linux/issues/5035
2024-06-07 16:39:39 +01:00
Bard Liao 8af48c03d3 Topology2: sof-mtl-sdw-cs42l42-l0-max98363-l2: add SDW_AMP_FMT_24=true
Max98363 doesn't support 32 bit format. Use 24 bit format instead.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2024-05-30 14:07:17 +03:00
Seppo Ingalsuo 10de58da07 Tools: Topology2: Remove unnecessary NHLT binary from EFX topologies
The NHLT binary is not needed in these audio processing development
and test topologies. With the current build options the NHLT would
work only with cAVS2.5 platforms (TGL). Without NHLT add these are
safe to use in all platforms where the NHLT blob is retrieved from
BIOS.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-27 13:06:32 +03:00
Iuliana Prodan 00664d091a topology: imx: Add a variable for schedule domain
Add DMA_DOMAIN variable and based on this we set
SCHEDULE_DOMAIN to SCHEDULE_TIME_DOMAIN_DMA, otherwise
is SCHEDULE_TIME_DOMAIN_TIMER.

Now, only i.MX8MP is using SCHEDULE_TIME_DOMAIN_DMA.
Therefore the DMA_DOMAIN is added only for 8MP topologies.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2024-05-23 19:17:56 +03:00
Seppo Ingalsuo a8f2b845ce Tools: Topology2: Define only same channels counts for DMIC0 dai-copier
This patch defines e.g. for sof-hda-generic-2ch.tplg DMIC0 only
stereo formats as s16/24/32. Similarly for e.g. sof-hda-generic-4ch.tplg
only four channels formats are defined.

The reduction of input formats options avoids the issue with kernel
that it possibly selects invalid channels count for DMIC0 DAI when
the channels count in connected pipelines varies due to processing
components.

The output formats are reduced similarly since copier always has
the same input and output channels count.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-23 14:32:12 +03:00
Seppo Ingalsuo b6f1bba44f Tools: Topology1: Change name of default DRC test blob
The tplg1 blobs are still used with IPC3 testbench test pipelines.

The updated script example_drc.m exports the blob used for DRC
test with name "speaker_default" so, the blob file name to include
to test pipeline is changed. The blob content is same as before.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-22 16:20:03 +01:00
Seppo Ingalsuo 1ff7c36363 Tools: Tune DRC: Export DRC for DMIC capture and cleanup filenames
A DRC blob for capture dmic_default is created. It boosts the capture
by 10 dB when the signal level is low.

The name of speaker blob is changed to speaker_default. The name with
endpoint name first helps to organize them e.g. in UCMv2 blobs data
directories.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-22 16:20:03 +01:00
Ranjani Sridharan f38f118b93 plugin: noise_suppression_interface: Query available devices
Query the list of available devices and use the NPU if available,
otherwise compile the model for the CPU.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2024-05-22 15:20:05 +01:00
Seppo Ingalsuo 8c71b7ef48 Audio: TDFB: Fix firmware crash caused by TDFB sink format set
The code in tdfb_params() was incorrect for a component that can
have different number of channels in source and sink. The update
of sink format can it worst case crash the successive component
in pipeline if the source channels count has changed from the
value the component has been initialized for.

The channels count need to be retrieved from input and output pins
information in extended IPC4 base config. To get the extension the
rimage toml files need to add for TDFB component the line
init_config = "1".

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-22 15:17:44 +01:00
Pierre-Louis Bossart 69249fb75b topology2: add mtl-rt712 topologies version
For some reason the sof-mtl-rt712-l0 topology was not created despite
being listed in the kernel, and we now need the rt712 VB support with
an additional SmartMic path.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2024-05-16 18:11:29 +03:00
Seppo Ingalsuo b02a852053 Tools: Topology2: Add benchmark topologies for TDFB component
This patch adds s16/s24/s32 format test topologies for the
time domain fixed beamformer component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-14 14:42:46 +01:00
Guennadi Liakhovetski 753e363f0f mixin-mixout: make modular
Convert mixin-mixout to a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00
Guennadi Liakhovetski 9c3a3e9f33 lnl: convert to modular toml
Convert LNL to a modular TOML layout. Many modules have different
configurations for different platforms. In this version we put them
all in respective TOML files directly. If desired, they can be later
extracted into per-platform files. This can be done on a per-module
basis, in which case individual commits will be small.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-09 10:47:34 +01:00
Seppo Ingalsuo a81a235ae6 Tools: Topology2: Intel: Add 16 and 24 bit DMIC DAI copier format option
This patch allows the kernel to choose 16 bit format if the DMIC
NHLT is missing the recommended 32 bit mode blob. The 24 bits is
also in theory possible so it is added for completeness.

The DAI copier is converting the output format for internal pipelines
into S32_LE format, so the other operation is not impacted. For systems
with 32 bit DMIC NHLT there is no impact.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-09 11:19:12 +03:00
Kai Vehmanen d533d4290e topology2: common_definitions: improve SAMPLE_TYPE documentation
Clarify documentation of SAMPLE_TYPE_MSB_INTEGER sample type
value and fix documentation of SAMPLE_TYPE_LSB_INTEGER. These
definitions are often confused with integer endianness, which is
not related. Clarify this better.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-05-09 11:14:12 +03:00
Bard Liao 4a761f6d60 Topology2: add mtl rt713 rt1318 rt1713 support
Two configurations for sof-mtl-rt713-l0-rt1318-l12-rt1713-l3 and
sof-mtl-rt713-l0-rt1318-l1-rt1713-l3.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2024-05-08 09:56:31 +01:00
Seppo Ingalsuo 07c9043516 Tools: Topology2: Use for LNL own platform configuration lnl.conf
The new lnl.conf is copy of mtl.conf but DMIC_DRIVER_VERSION needs
to be increased by one for a small registers change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-06 12:33:41 +03:00
Seppo Ingalsuo 03dbc7ba2c Tools: Tune: EQ: Normalize IIR and FIR separately
This allows more freedom to scale the equalizers. Common criteria
resulted with safe scaling to unnecessarily silent result or
risk for audible clipping in the equalizer.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-05-03 21:02:34 +03:00
Yong Zhi 18ab8c2468 topology2: cavs-rt5682: expose spk core_id for overriding
Port from nocodec topology for multi-core validation.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2024-04-30 13:17:42 +03:00
Seppo Ingalsuo e8fcaf6958 Tools: Tune: Crossover: Cleanup blob files paths
This patch moves blobs for crossover component into
sub-directory "crossover" to clean up clutter from
ctl/ipc3 and ipc4 level.

The patch also adds export of blobs for IPC4 mode that
was missing.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-29 14:07:25 +01:00
Seppo Ingalsuo 70449a3d70 Tools: Tune: EQ: Cleanup produced blob files structure
To remove clutter from upper level this patch changes
generated files naming from e.g. "ipc4/eq_fir_loudness.blob" to
"ipc4/eq_fir/loudness.blob". It helps to find the blob files
from directory that has same name as the target component.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-29 14:07:25 +01:00
Seppo Ingalsuo ec4e2a9cf9 Tools: Tune: EQ: Rename configuration blobs to use .blob
We have both .bin and .blob file name suffixes in use for
similar byte controls initialize files. The scripts those
generate files with .bin are changed to .blob.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-29 14:07:25 +01:00
Seppo Ingalsuo 4f46135fba Tools: Tune: EQ: The function eq_blob_write.m is deleted
The replacement is sof_ucm_blob_write.m.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-29 14:07:25 +01:00
Seppo Ingalsuo b5bd60c1f0 Tools: Tune: EQ: Create highpass blobs and add 100 Hz version
There were no bytes control binary blobs for highpass filters.
This patch adds export of them and adds a 100 Hz filter option.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-29 14:07:25 +01:00
Seppo Ingalsuo 25e105026d Tools: Tune: Use common/sof_ucm_blob_write.m for binary blob export
The sof_ucm_blob_write.m is an updated copy of blob_write that
exports binary blobs with header that is suitable for ALSA UCM's
cset-tlv command. The UCM requires binary files so the default
binary export is changed for every component setup script to this
format.

The ASCII decimal numbers .txt format export remains suitable for
sof-ctl tool.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-04-29 14:07:25 +01:00
Kai Vehmanen 278ecc5b74 topology2: intel: bt-generic.conf: fix rate constraints
Commit c77a4feb2f ("topology2: pcm_caps: Remove defaults for
rate_min/rate_max") changed how rate constraints are described in
topology. After this change, the rate_min/max was ignored by SOF Linux
driver and the rate was incorrectly limited to 48000Hz for these
topologies.

Fix this issue by enumerating the supported sampling rates with "rates".

Link: https://github.com/thesofproject/sof/issues/9067
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-26 13:04:35 +01:00
Laurentiu Mihalcea 65b8a32f27 nxp: imx8ulp: switch to native Zephyr drivers and timer domain
Switch to Zephyr native drivers and timer domain. This
includes:
	1) Switching all imx8ulp topologies to timer domain.
	2) Disabling Zephyr DMA domain
	3) Various interrupt-related fixes via Kconfig-related
	ifdef logic.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-25 14:12:41 +03:00
Peter Ujfalusi aa60e65c6b topology2: intel: deep-buffer: Adjust the buffer_size_min only
There is no benefit on changing the period/buffer size_max as it is set
by default to a reasonably large value already.
What matters is the buffer_size_min: it needs to be larger than the
amount of data that one DMA burst will transfer, which is equal to the
DeepBuffer size. For safety reasons the minimum buffer size has to be
larger than this.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-04-24 16:27:52 +03:00
Peter Ujfalusi bba6a4cb04 topology2: common: pcm_caps: Revisit default period and buffer sizes
Increase the default period_size_max to a much larger value which is
commonly used by sound cards from 16384 to 2097152.

Adjust the buffer_size limits to minimum 384 (2 * period_size_min) and the
maximum to 4194304 (2 * period_size_max).

Applications do not need to use these large buffers, but there is no
technical reason to not allow them, like they available on other sound
hardware.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-04-24 16:27:52 +03:00
Peter Ujfalusi b3a6d1c570 topology2: common: pcm_caps: Increase periods_max from 16 to 1024
There is no technical reason to limit how many periods applications use.
Generic sound cards tends to allow 32768 periods (period size range
is 16 - 524288) but that is an overshot, let's raise the limit to 1024.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-04-24 16:27:52 +03:00
Laurentiu Mihalcea 9737e124bc nxp: imx8/imx8x: switch to native Zephyr drivers and timer domain
This commit includes all necessary changes for switching
to timer domain and Zephyr native drivers on imx8 and imx8x.
This consists of:
	1) Switching all imx8 topologies to timer domain.
	2) Disabling Zephyr DMA domain
	3) Various interrupt-related fixes via Kconfig-related
	ifdef logic.

This commit includes all necessary changes for switching
to native Zephyr drivers on imx8/imx8x.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-23 12:20:31 +01:00