Commit Graph

1680 Commits

Author SHA1 Message Date
Jaska Uimonen 7be11aaf28 topology2: add auxiliary data classes for ssp
Auxiliary data can be added at the end of ssp data blob to enable for
example early clocks for certain platform. Add intel_ssp_aux_config.conf
that includes all possible aux data classes. These can be used inside
ssp hw_configs and will be embedded as tlv data after basic data blob.

Example of using mn_config class inside hw_config:

Object.Base.hw_config."SSP0_0" {
	id              0
	mclk_freq       38400000
	bclk_freq       256000
	tdm_slot_width  16
	format          "DSP_A"
	bclk            "codec_provider"
	fsync           "codec_provider"
	fsync_freq      16000

	Object.Base.mn_config."MN_0" {
		m_div   100
		n_div   200
	}
}

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-12-22 16:45:24 +00:00
Libin Yang 14474447d4 topology2: cavs-nocodec add wov support
Add the definitions of wov in cavs-nocodec.conf.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 2584500c35 topology2: add dmic-wov.conf
The dmic-wov.conf file implements the WOV feature. The connection is

DMIC ------> KPB ------------------------------> host_copier
              |                                    ^
              |                                    |
              |----> micsel ----> wov ------> virtual_widget

The DMIC and KPB is on DAI ppl.
The host_copier is on Host ppl.
The micsel, wov and virtual is on wov ppl.

The connection between host_copier and virtual_widget is a
virtual connection. The virtual_widget doesn't exist in the FW.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang ef37adc288 topology2: add dai-kpb-be pipeline
dai-kpb-be pipeline contains a copier DAI component and a kpb component.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 62075a44e3 topology2: add wov-detect pipeline
wov-detect pipeline contains a micsel component, a wov component
and a virtual component. micsel component accepts 2 channels audio data and
output 1 channel audio data to the wov component. wov's keyword is a clap.
The virtual component is only used by the driver, and the FW will not
know that there is a virtual component in the pipeline. The virtual
component is used to connect the pipeline to a host copier pipeline
as per drivers requirement.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang 884322bfb9 topology2: add wov support
Add the wov module support. The keyword of the wov is the sound
of clap.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang a1a458efc5 topology2: add kpb support
Add the kpb component support. kpb component is used to transfer
the data to the proper pipeline based on the WOV component events.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang b554075d7e topology2: add micsel support
Add the audio channel selection component support.
In case 1 output channel is selected, the component provides
the selected channel on output. In case 2 or 4 channels are selected on
output, the component works in a passthrough mode.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Libin Yang fbfdd6936f topology2: move payload_with_output_fmt into process token set
The token payload_with_output_fmt is process module specific,
so set it as a process module token.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Libin Yang <libin.yang@intel.com>
2022-12-22 09:58:44 +00:00
Pin-chih Lin fc497eb448 topology: remove default param config from DTS control
In DTS module m4 file, the default control bytes used to have a
12-byte redundant param {0x0000, 0x000c, 0x0000}, the param id is
0 (the first 4-byte).

For DTS SDK version >= 1.0.8, error is reported while getting the
param with id=0.

This commit removes the redundant param from default control bytes.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-21 13:31:09 +00:00
Kai Vehmanen 1a7a36a84c sof-logger: ensure NULL string is not passed to printf/fprintf
Due to allocation failures, or invalid content in dictionary,
"params" entries in "struct proc_ldc_entry" may be NULL.

In print_entry_params(), the NULL entries may be passed
as arguments to fprintf(). While e.g. glibc handles these without
error, this is not guaranteed behaviour and may result in segfault
on some platforms.

Fix the issue by aborting program if allocation fails and
explicitly handling the cases when asprintf_entry_text returns
NULL.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-21 13:03:44 +00:00
Gongjun Song 89b1f5054a topology1: add sof-rpl-rt711-l0-rt1318-l12
Add sof-rpl-rt711-l0-rt1318-l12. This tplg doesn't include any
local MICs.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-21 12:12:04 +00:00
Gongjun Song 0144769229 topology1: add sof-rpl-rt711-l2-rt1316-l01
Add sof-rpl-rt711-l2-rt1316-l01. This tplg doesn't include any
local MICs.

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-12-21 12:12:04 +00:00
Guennadi Liakhovetski 84b2dd2ae9 logger: check localtime() return value
localtime() can return NULL in error cases. Check the return value
before dereferencing it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-21 10:13:00 +00:00
Marc Herbert 2dfaee6a7d logger: convert.c: move global_config->logs_header to the heap
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
complete, leaving a confusing mix of globals and locals.

This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive because
convert's() stack lifespan is practically the same as a global but let's
simplify things anyway.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-21 09:36:27 +00:00
Marc Herbert 327a26bf8a logger: make "global_config" truly global
Finish the job that commit 5b29dae9c8 ("logger: Create global
convert_config variable to avoid spaghetti code.") started but did not
finish, leaving behind a supposedly "global" variable that is actually a
confusing global pointer to a struct local to the main() function.

This confuses some static analyzer complaining that stack values are
being returned, see #6858 and #6738. This is a false positive
because the main()'s stack lifespan is the same as a global but let's
simplify things anyway.

Also stop using 'extern' in .c files, use a proper .h file instead.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-21 09:36:27 +00:00
Kai Vehmanen 80adcdf36a sof-logger: print error if -u uart option is given with no infile
sof-logger -u 115200 -d /lib/firmware/sof-foo.ldc

Leads to silent failure as a NULL is passed to open(). Add
explicit error handling for this case.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 19:37:17 +02:00
Seppo Ingalsuo 9f74088c7c Tools: Topology1: Add to development topologies DRC for UP2 board
This patch adds to development topologies build of minimal topologies
sof-apl-pcm512x-drc.tplg and sof-apl-pcm512x-mdrc.tplg for testing.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-20 15:42:59 +00:00
Kai Vehmanen 4bec5b292c logger: exit with error if calloc fails
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after calloc.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 11:47:01 +02:00
Kai Vehmanen 4d64893b86 sof-logger: exit with error if malloc fails
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after malloc.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 11:45:34 +02:00
Pin-chih Lin b581aa52e9 topology: add waves-integrated tplg file for RT1019 codec
Add topology case {WAVES + RT1019 CODEC}

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-19 16:41:32 +00:00
Ajye Huang cdcbdae705 topology: sof-adl-nau8825: add variant with nau8318 amplifier
Adding support for nau8318 Amplifier.

sof-adl-nau8318-nau8825:
    nau8825 headphone connects SSP0 link.
    nau8318 Amp speakers connects SSP1 link.
    bluetooth offload uses SSP2 link.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
2022-12-16 13:44:30 +02:00
Bard Liao 080363ece9 topology2: add sdw spk feedback pcm
This commit create a PCM that can pass amplifier feedback to user space.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-16 12:56:53 +02:00
Yong Zhi 2cfa90d324 topology2: cavs-rt5682: add deep buffer support on headset
Deep buffer is mixed with ssp0 stream.
Override mixout copier audio_format.1 from 32/24 to 32/32 for I2S.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-12-15 12:23:00 +00:00
Bard Liao 99a65fc7d7 topology2: cavs-sdw: fix DEEP_BUFFER_PIPELINE_SINK
mixout-gain-dai-copier-playback.2 pipeline id has been changed to 1.
Need to change mixout.2.1 to mixout.1.1 as well.

Fixes: f0a010052b ("topology2: cavs-sdw: group route and pipeline index")
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-14 17:03:45 +00:00
Chunxu Li b0ae15a0bc topology1: mt8186: support 1ms pipeline capture period
Default support 1ms period capture pipeline to update host
position more precisely.

Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
2022-12-14 14:37:49 +00:00
Pierre-Louis Bossart c91326bda2 topology1: add ADL Rooks County laptop LAPRC710
Amplifier is on link 2, not 3, in this platform

Fixes: https://github.com/thesofproject/linux/issues/4088
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-12-14 13:59:56 +00:00
Bard Liao 113064cbf7 topology2: cavs-sdw: add Speaker and Microphone pcm
Add Speaker PCM to cavs-sdw topology. We need to set NUM_SDW_AMPS=1 in
CMakeLists.txt if there is only one amplifier in the device and set
NUM_SDW_AMPS=2 if there are two amplifiers.
Set SDW_DMIC=1 if there is a SDW DMIC, like rt714 in the device.
The 2nd ALH copier stream name should be the same as the 1st ALH
copier, and no need to connect to the route.
The 2nd ALH copier data will be set to the 1st ALH copier's gateway config
in the aggregated mode.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-09 15:54:18 +00:00
Bard Liao 1faf055755 topology2: cavs-sdw: use macro to define SDW jack stream and id
Define macro for SoundWire jack stream name and BE id.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-09 15:54:18 +00:00
Bard Liao f0a010052b topology2: cavs-sdw: group route and pipeline index
A topology may be constructed by some .conf files. We may use a
duplicated route index or pipeline index by accident. This commit
suggests a rule to assign route and pipeline index.
We have a consistent pcm id. For example,
Jack out: 0
Jack in: 1
Speaker: 2
Microphone: 4

We can use a simple formula to assign the route and pipeline index
for each pcm.
The formula this commit suppests is pcm id * 10 ~ pcm id * 10 + 9.
That is 0 ~ 9 for pcm 0, 10 ~ 19 for pcm 1, and so on.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-09 15:54:18 +00:00
Rander Wang 8818e50b6a topology2: hda: share deep buffer conf setting
Deep buffer is mixed with HDA analog.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-05 14:32:20 +00:00
Rander Wang c4f6b3dfc5 topology2: sdw: share the deep buffer conf setting
Deep buffer is mixed with Jack out.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-05 14:32:20 +00:00
Rander Wang 73aeccc6ad topology2: nocodec: add deep buffer support
Deep buffer is mixed with ssp0 stream.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-05 14:32:20 +00:00
Rander Wang 9ec745b1de topology2: add common deep buffer support
It will be shared by I2S, HDA and SDW platforms

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-05 14:32:20 +00:00
Bard Liao f6f9b62d5a topology2: add ssp multi stream capture
Add ssp multi stream capture support.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-02 16:51:16 +00:00
Bard Liao efca29469f Topology2: pipeline: gain-capture: add 16 bit format support
16 bit format was missed in the pipeline.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-02 16:51:16 +00:00
Seppo Ingalsuo f6b8b0e485 Tools: Test: In src_test.m do quick test without specify in/out rates
If the rates are an empty vector [] the default rates are used. This
allows test command "src_test(32, 32, [], [], 0, 0);" to do a quick
test without plots with default 8 - 192 kHz in/out matrix.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 15:30:14 +00:00
Seppo Ingalsuo 082672ea9f Tools: Test: In src_test.m prevent error with empty plot handle
Octave errors if plot handle is empty, Matlab doesn't. This can
happen if frequency response test data read fails. In that case
an empty plot window is stored as indication of error.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 15:30:14 +00:00
Seppo Ingalsuo 48bf7af183 Tools: Test: Prevent in src_test.m unnecessary window open
This speeds up src_test.m with no plot window opening for rate
that is not supported in the conversions matrix. No output file
returns failure -1.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 15:30:14 +00:00
Seppo Ingalsuo dccae1c5b2 Tools: Test: Audio: Reduce testing verbosity in test measure scripts
These prints are normally not useful and slow down test with a
lot of scrolled text output.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 15:30:14 +00:00
Seppo Ingalsuo 155137b878 Tools: Test: Timeout src_test.m after 300k copy() iterations
This prevents testbench run freeze from src_test.m. Function
test_run_src() passes to testbench option -C that limits the number
iterations to 300k that corresponds to 5 min of audio.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 15:30:14 +00:00
Yong Zhi a4e5fea520 topology2: Add rt5682+max98357a support
Add sof-mtl-max98357a-rt5682 topology which supports
RT5682 headset and MAX98357A speaker amplifiers.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-12-02 15:09:56 +00:00
Ranjani Sridharan b0c5b08d63 topology2: sof-ace-tplg: Rename sof-mtl-sdw
To it's actual name sof-mtl-rt711-4ch.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-02 13:13:25 +00:00
Ranjani Sridharan 3a98634714 topology2: avs-tplg: Build ADL nocodec tplg
This will avoid having to rename the TGL tplg on ADL devices.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-02 13:13:25 +00:00
Seppo Ingalsuo 689b91e6f2 Tools: Topology1: Add sof-hda-generic topology with SRC
This patch adds to sof-hda-generic.m4 macros HSSFX, HSSFX_FILTER1,
and HSSFX_FILTER2 those can be used to customize stream effect
for PCM 30. The macro defaults to volume so the default topology
build is not impacted.

The CMakeLists.txt in development is updated to build topologies
sof-hda-generic-src.tplg, sof-hda-generic-2ch-src.tplg, and
sof-hda-generic-4ch-src.tplg. The stream effect is set with HSSFX
to src-volume.

The pipeline pipe-host-src-volume-playback.m4 is added. It is similar
as pipe-host-volume-playback.m4 but a sample rate converter (SRC)
is added after PCM, before volume. The PCM capability is changed to
min 8000, max 192000 Hz.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-02 12:33:56 +00:00
Ranjani Sridharan 0bdf8e3d31 topology2: rename cavs-passthrough-hdmi.conf
Rename it to sof-hda-generic.conf.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-30 16:55:18 -08:00
Ranjani Sridharan d25f775108 topology2: sof-ace-tplg: Build sof-hda-generic-2ch topology
This will be needed for MTL.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-30 16:55:18 -08:00
Ranjani Sridharan e303098d2a topology2: Remove the cavs folder
This folder contains definitions for both CAVS and ACE. So remove the
incorrect folder naming and move everything one level up.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-30 16:55:18 -08:00
Ranjani Sridharan 5444cd2097 topology2: build the topologies in the right folder
The CAVS topologies need to be in the avs-tplg folder and the MTL
topologies need to be in sof-ace-tplg folder. Also, change the output
file names to the names expected by the kernel and the NHLT binary files
to match the topology file names.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-11-30 16:55:18 -08:00
Pin-chih Lin ff7861f222 topology: fix DMICPROC undefined issue for intel-generic-dmic
Adds fatal assertion in intel-generic-dmic.m4 for DMICPROC is not
defined in upper m4, and fixes a potential risk of assertion by
sof-tgl-max98357a-rt5682.m4.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-11-28 17:05:25 +00:00