Commit Graph

9595 Commits

Author SHA1 Message Date
Ranjani Sridharan f7dd181e99 topology2: Use input/output pin consistently
Use the input/output pin terminology consistently to align with the
kernel driver and avoid any confusion.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-08 11:52:22 +02:00
Andy Ross 3f5c0baba1 scripts: Add fuzz test wrapper
Simple script to explain how fuzz testing works

Signed-off-by: Andy Ross <andyross@google.com>
2023-02-08 11:47:56 +02:00
Andy Ross 0c64a43c89 platform/posix: Fix header warning
Transitive header order no longer declares struct sof for us here.  No
need to pull in a full header as we only use pointers to it.

Signed-off-by: Andy Ross <andyross@google.com>
2023-02-08 11:47:56 +02:00
Andy Ross 6c5608d9e7 fuzz: Whitebox component creation
The TPLG_COMP_NEW message type works by matching a 128 bit UUID to a
runtime list of drivers.  That's too much depth for even directed
fuzzing to find randomly.

So whitebox that command: leverage the fact that the first four bytes
of the message are being ignored anyway (that field is the message
length, which we get externally from the fuzzing rig and overwrite).
Treat the first byte as a magic number indicating the command type
(0xff in this case being "comp_new") and the second a parameter
interpreted as a driver index.  Then fix up the fields manually so it
gets through the logic in helper.c:get_drv() successfully and tries to
create a random component.

Signed-off-by: Andy Ross <andyross@google.com>
2023-02-08 11:47:56 +02:00
Jaska Uimonen f63e5357fd topology2: enable BT offload in cavs-rt5682
Add bluetooth pipeline to rt5682 topologies.

Co-developed-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-07 16:37:11 +00:00
Jaska Uimonen af970d6705 topology2: bluetooth pipeline fixes
Fixes for adding bluetooth pipeline to real codec topologies:

- change bt pipe copier indexes from 5-6 to 7-8 for not to collide with
  main level topologies. This indexing is now aligned with nocodec and
  rt5682 topologies.
- add big route indexes (50x) for not to collide with main level
  topologies.
- introduce BT_ID to separate from BT_INDEX to match machine driver.
- align bt-ssp-config-lbm.conf and bt-ssp-config.conf hw_config names.
- switch BT_PB_HOST_PIPELINE_SINK and BT_PB_DAI_PIPELINE_SRC as the route
  was defined wrong way around. This was compensated by route definition
  in cavs-nocodec-bt.

Co-developed-by: Uday M Bhat <uday.m.bhat@intel.com>
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
Co-developed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-07 16:37:11 +00:00
Serhiy Katsyuba e6e441ced5 ipc4: add IPC4 gateway
Adds IPC4 gateway. IPC4 gateway transfers audio between host
and DSP without DMA: via memory window (audio payload) and IPC4
messages (commands).

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-02-07 16:27:20 +00:00
Serhiy Katsyuba 10b3c35c67 ipc4: fix IPC reply log message
Wrong (uninitialized) reply.extension value was printed in log as
msg_reply (not reply) is actually passed to ipc_msg_send().

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-02-07 16:27:20 +00:00
Serhiy Katsyuba 8d8481f448 ipc-common: Fix to allow IPC messages of max size
Messages up to SOF_IPC_MSG_MAX_SIZE should be supported.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-02-07 16:27:20 +00:00
Zhang Peng a273b87560 topology: Add to generate sof-imx8ulp-9x9-btsco-16k.tplg for imx8ulp-9x9
Use sof-imx8ulp-btsco.m4 to generate two tplg file for imx8ulp-9x9:
the one supports sample rate 8k, the other supports sample rate 16k.
Then sof can support two sample rate: 8k, 16k by instead tplg file
on imx8ulp-9x9.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2023-02-07 17:17:24 +02:00
Zhang Peng af9c1f54b6 topology: Add to generate sof-imx8ulp-btsco-16k.tplg for imx8ulp
Use sof-imx8ulp-btsco.m4 to generate two tplg file for imx8ulp:
the one supports sample rate 8k, the other supports sample rate 16k.
Then sof can support two sample rate: 8k, 16k by instead tplg file
on imx8ulp.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2023-02-07 17:17:24 +02:00
Zhang Peng b6515d101b drivers: imx: sai: Set clk div according to fclk on imx8ulp platform
Frame clk can be 8k or 16k on imx8ulp platform. Then we need to set
right clk div according to frame clk.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2023-02-07 17:17:24 +02:00
Jaska Uimonen 4d735045a0 west.yml: upgrade rimage to 7bc3cfc
upgrade rimage to
7bc3cfc946

7bc3cfc config: mtl: add smart amp test module config
3da7739 config: correct module config load_type
bc7d49d config: align module_type with mtl for tgl and tgl-h
bdf48ee config: tgl-cavs: add fir and iir eq module config

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-07 14:46:53 +00:00
Guennadi Liakhovetski 0f7c8be8fa topology2: nocodec: add a second level copier
Insert a second copier into the DMIC0 stream to generate a total of
three PCMs from it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-07 11:30:59 +00:00
Guennadi Liakhovetski ce14849b5d topology2: remove a superfluous copier in nocodec
Use the simplified pipeline with just one module-type copier
connecting two pipelines.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-07 11:30:59 +00:00
Rander Wang a33a96b342 topology2: add second capture stream for DMIC0
The second capture stream can be used as a reference stream for user.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-02-07 11:30:59 +00:00
Guennadi Liakhovetski 426b113071 topology2: add support for simplified copier module
Currently copier components of the module type are used in pairs -
one on each pipeline, connecting to each other. This isn't necessary.
It's enough to have one such copier component on the side, that does
forking. Add a single-copier capture pipeline variane and switch
DMIC over to it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-07 11:30:59 +00:00
Rander Wang 4b0f1bbb9d topology2: add gain and copier in DMIC0 pipeline
This patch will support multiple capture streams with DMIC. The pcm stream
is composed of two pipelines: (1) copier host <- gain <- copier module
(2) copier module <-gain <- copier DMIC. We need to use copier module
to connect two pipelines because of the restriction with the ref FW that
the gain module can only be connected to modules that are in the same
pipeline

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-02-07 11:30:59 +00:00
Damian Nikodem df5eaf07cd ipc4: save information about pipeline attributes
During create a new pipeline, information about their attributes
is lost and not saved anywhere. This change store the pipeline
attributes from IPC extension message in pipeline structure.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-02-06 15:41:28 +02:00
Damian Nikodem 3aa972fe67 pipeline: add attributes field in pipeline structure
Added attributes field to store attribute values from IPC
extension message. The attribute field will be used to store
information about ULP and AUTONOMOUS_RESET support by pipeline.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2023-02-06 15:41:28 +02:00
Jyri Sarha b2fcf89884 topology2: hdmi-generic.conf: Increase channels_max to 8 for HDMI 1-4
Allow multichannel audio support for HDMI 1, 2, 3 and optional 4. This
change allows maximum of 8 (7+1) channels, provided the connected
displays EDID allows it.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-02-06 12:27:04 +02:00
Peter Ujfalusi d9bbe6edd1 include: ipc4: copier: Move struct definitions to base-config.h
Move the ipc4_module_instance_props and it's dependencies since they are
not copier related at all.
ipc4_in_out_gateway and ipc4_cfg_param_id_data is moved also.

The ipc4_base_module_cfg_ext should not be in a copier.h either. It is a
generic base_cfg_ext struct, not copier specific in any way.

With the move drop the priv_param_length from the struct as attaching
binary blobs after the base_cfg_ext is not supported by definition.
Modules should be using MOD_INIT_INSTANCE + LARGE_CONFIG_SET messages to
receive their configurations and parameter blobs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-02-03 13:48:39 -08:00
Ranjani Sridharan 2dd8a85fad topology2: Intel: Remove hdmi-4th.conf
Use the new feature to conditionally includes conf nodes to add the DAI,
pieplines, PCM and route for HDMI4 in hdmi-generic.conf.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-03 13:56:27 +00:00
Ranjani Sridharan 59171fdd62 topology2: Intel: sdw-amp-generic: Remove alh-2nd-spk.conf
Use the new feature to be able to include conf nodes directly to add the
second speaker conditionally and remove alh-2nd-spk.conf.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-03 13:56:27 +00:00
Libin Yang 9a6b50c4e9 topology2: set sof-mtl-max98357a-rt5682 DMIC0 pcm id to 99
Set sof-mtl-max98357a-rt5682 pcm id to 99 to make it the same in topology1.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-03 14:49:47 +02:00
Libin Yang f421fb4f34 topology2: set sof-hda-generic DMIC0 pcm id to 6
UCM requires sof-hda-generic DMIC0 PCM ID to be 6.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-03 14:49:47 +02:00
Libin Yang f6cdefa177 topology2: use parameter DMIC0_PCM_ID for DMIC0 pcm id setting
Different platforms are using the same dmic-generic.conf.
But the DMIC0 PCM ID are different for different platforms. So
let's use parameter DMIC0_PCM_ID for the DMIC0 pcm id setting.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-03 14:49:47 +02:00
Seppo Ingalsuo 1a4b95748f Audio: EQ FIR: Get in prepare() channels count from sink stream
In IPC4 prepare() the source stream channels count is not always
set, it depends on topology. However the sink channels count
has been just set by IPC4 params function that gets it from
component's base configuration.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-02 21:42:10 +00:00
Seppo Ingalsuo 932e52a612 Audio: EQ IIR: Changes for IPC4
This patch contains the changes to work in IPC4 firmware.

In process the input_buffers[0].size (frame_count) need to be
checked to skip IIR processing with zero frames.

In prepare() call to eq_iir_params() is added to get sink
buffer parameters from IPC4 base_cfg. Also for EQ initialization
the sink stream channels count can be used instead of source because
it has been just set correctly. Depending on topology the source
stream channels count can be still invalid in component prepare
phase.

The eq_iir_verify_params() is done only in IPC3. Note that the
buffer flags set has no impact any more in prepare phase. The
function is left for possible later fixes since there is no harm
from doing it.

The IIR initialize from blob is moved to a common function for
prepare() and process(). The processing function select difference
in IPC3 and IPC4 is handled there.

The format convert capable IIR copy functions are excluded from
IPC4 build as unused.

In process() to get channels count from source stream. The
mod->stream_params is not availablein IPC4.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-02 21:37:46 +00:00
Seppo Ingalsuo 2079074b75 Audio: EQ IIR: On-the-fly passthrough/configured processing function
This patch helps to save MCPS when all IIR channels are set
to bypass mode. If no IIR state delays are allocated it is
safe to use the efficient bypass processing function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-02 21:37:46 +00:00
Ranjani Sridharan b9c075a9ad eq_iir: Use the new module interface
Use the module interface instead of the comp drv interface for the
EQ IIR component.

In processing functions the dev structure is changed to the new mod
structure.

In filter initialize functions the mod structure provides the
configuration.

The eq_iir_init() function is converted to follow the module init
conventions.

The params() and cmd() functions are removed since they are done
in module adapter. The set/get config functions are added to handle
the binary blob set/get.

The copy() function is changed to module adapter eq_iir_process()
form. Data is processed from input_buffers[0] to output_buffers[0].

The eq_iir_prepare() is changed to set the frame and byte alignment
for module adapter. The sink streams size check is removed since
it is done in module adapter.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-02 21:37:46 +00:00
Ranjani Sridharan 6a00221722 topology2: common: Add new class definitions for input/output audio formats
The existing class definition for audio_format works only for widgets
with exactly 1 input pin (Pin index 0) and 1 output pin (Pin index 0).

Add two new classes that can be used to define the audio formats for any
pin. These classes use the same tokens are the existing audio_format
class and therefore can be used alongside the existing audio_format
instances with non-zero pin indices.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-02 17:12:18 +02:00
Ranjani Sridharan 08eb8ff630 topology2: widget-common: Add 2 new tokens for input/output audio format counts
And set them to be the same number as the num_audio_formats in all the
current widget objects. This is in preparation to remove
num_audio_formats as there will be widgets with different number of
supported formats for each sink/source pin.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-02 17:12:18 +02:00
Piotr Makaruk d8c935885b hda: enable chain dma with ipc4 only
Hda chain work only with IPC4 compatible boards, therefore additional
compilation dependency in Kconfig has to be added.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-02-02 16:11:01 +02:00
Jaska Uimonen 0d2ab551f5 coherent: set CONFIG_INCOHERENT as default in mtl
Config INCOHERENT for cache is not set by default for mtl platform, thus
set it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-02-02 13:23:28 +02:00
Pin-chih Lin 7f80908f28 topology1: set Speakers PPL running on C1 by default
For Intel platforms, C0 is on by default for processes necessary to
run in low power cases, while C1..3 for processes with higher loads.
This commit moves the default core to C1 for Speakers pipeline.

At the same time, we found this commit can resolve the DSP panic
issue on builds with 3P post-processing solutions running on Speakers
pipeline.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-02-01 16:56:49 +00:00
Pin-chih Lin cc0d9f09e4 topology1: define SPK_PLAYBACK_CORE for Speakers running core
Defines the target core ID for Speakers and Echo Reference pipelines
explicitly. When GOOGLE_RTC_PROCESSING is defined, it will be set to
the same ID as DMIC48K pipeline.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-02-01 16:56:49 +00:00
Seppo Ingalsuo d472a2e73d Tools: Test: Audio: Fix BITS_OUT in test run configuration
This patch fixes a mistake with test run configuration for
testbech tests where input and output word lengths are not
the same.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-01 16:39:20 +00:00
Yong Zhi 594e3f7da9 topology2: cavs-rt5682: add reference capture for MAX98357A speaker amp
Use lbm_mode to loopback playback data for PCM27.
Add copier module in DAI BE for demux function.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-02-01 14:49:05 +00:00
Kai Vehmanen f5b7dea110 topology2: bt-generic: allow override PCM name
Do not hardcode PCM name to "Port2".

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-02-01 14:22:50 +02:00
Kai Vehmanen 39a7be72e5 topology2: bt-generic: fix PCM stream name definitions
Fix the mechanism to override the stream name in PCM caps.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-02-01 14:22:50 +02:00
Marcin Szkudlinski 1f9005bf5e IPC: modify comp_new to accept IPC4 structures at entry
There's no need to translate ipc4_module_init_instance struct
to leagacy sof_ipc_comp before calling comp_new
More important - IPC4 contains different set of information,
like proc_domain (LL/DP), not included in IPC3

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-02-01 14:17:13 +02:00
Adrian Warecki d33af9ffbd platform: ace: watchdog: Add ll watchdog support
This commit adds watchdog support in zephyrs ll domain for ace platform.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Adrian Warecki 21f1aec447 idc: Add secondary core crashed notification
Added a new notification about the crash of the secondary core. It is
directed to the primary core. Only failure detected by watchdog is
supported at this moment.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Adrian Warecki dbeb0b9fdd ipc4: notification: Add watchdog timeout notification structure
Added notification structure for a watchdog timeout.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Adrian Warecki d1acc3d69e ipc4: notification: Code formatting
Fixed indentation in define and line break in comment.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Adrian Warecki c14a052534 zephyr: ll: watchdog: Add watchdog support in ll domain
Added a new LL_WATCHDOG option to the platform Kconfig. Created library
header for watchdog in ll. Added watchdog support to zephyrs ll scheduler
domain.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Adrian Warecki 52e378c3fb samples: detect_test: Don't include ipc4 structures when using ipc3
Despite using ipc3 some ipc4 header files were still included. Added #if to
solve this problem.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Ranjani Sridharan 543cf93eb2 topology2: copier: Add a new attribute
The dma_buffer_size is only applicable from the host/dai copiers and
can be calculated using the ibs/obs in the base_cfg in the kernel.

So in preparation for removing the dma_buffer_size token from the audio
format objects, add a new attribute, deep_buffer_dma_ms, in the copier
that will be used to the send the deep buffer DMA size to the kernel.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-02-01 11:19:10 +02:00
Chao Song 47947fe64d MTL: enable smart_amp_test module
Enable building smart_amp_test module for MTL.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2023-01-31 11:39:29 +00:00