Commit Graph

9525 Commits

Author SHA1 Message Date
Libin Yang f494b4c583 topology2: dmic-wov: fixup output_pin_binding
src_pin_binding has been renamed to output_pin_binding.
Fixup the name.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-14 10:07:08 +02:00
Libin Yang ace472f726 topology2: wov-detect: set num_xxx_audio_format
Set num_input_audio_formats and num_output_audio_formats for wov widget.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-14 10:07:08 +02:00
Libin Yang 857fb4c4fe topology2: wov: add D0i3 support
Add D0i3 support by setting attribute capture_compatible_d0i3.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-14 10:07:08 +02:00
Libin Yang eb36d58725 topology2: update the WoV config data
Now the abi header is changed and the config data is send through
large_config ipc message instead of init_instance ipc message.
Update the config data accordingly.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-14 10:07:08 +02:00
Libin Yang cbb4c277e5 topology2: wov-detect: set the virtual widget name
Set the virtual widget name.

Signed-off-by: Libin Yang <libin.yang@intel.com>
2023-02-14 10:07:08 +02:00
Guennadi Liakhovetski 7b8da69176 module-adapter: allow different statuses
The following problem is observed when testing pause functionality:

in a case of a playback stream host -> mixin -> mixout -> DAI where
host and mixin belong to the pipeline A and mixout and DAI belong to
pipeline B, pipeline B is scheduled before A. So at start we get:
scheduler start
B: no data
A: read 1 period of data
scheduler sleep
(1 period of data pending in pipeline A)
scheduler start
B: send 1 period of data out
A: read 1 period of data
scheduler sleep
(1 period of data pending in pipeline A)
PAUSE
RELEASE
scheduler start
B: old data before sleep isn't sent because A is PAUSED
A: read 1 period of data
scheduler sleep
(2 periods of data pending in pipeline A)
...

With repeated pause-release cycles this leads to buffer overrun. To
fix this allow sending out data by pipeline B when A is still paused.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-13 13:02:43 +00:00
Michal Bukowski aaac08a082 cavs: memory bank powerup flow adjustment
Memory banks enablement flow is adjusted to recommended approach.
Power status should  be read twice to ensure ebb readiness

Signed-off-by: Michal Bukowski <michal.bukowski@intel.com>
2023-02-13 11:01:35 +00:00
Pin-chih Lin eedd76ae37 module_adapter: waves: fix unfreed rballoc memory block
There is a rballoc() call during module_init() lacking the
correspondent rfree() on module_free(). Replace it with
module_allocate_memory() to ensure the memory to be freed
by module_adapter.

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2023-02-13 12:49:03 +02:00
Jyri Sarha 62b676727b topology2: Use new attribute references notation in route definitions
Changes all routes of form:
Object.Base {
	route.1 {
		source copier.host..1
		sink	gain..1
	}
	route.2 {
		source	gain..1
		sink mixin..1
	}
}

to

Object.Base {
	route.1 {
		source copier.host.$index.1
		sink	gain.$index.1
	}
	route.2 {
		source	gain.$index.1
		sink mixin.$index.1
	}
}

E.g. change ".." notation where the route index is expanded in between
the dots to explicit reference to the route index.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2023-02-10 14:17:13 +02:00
Andrula Song f9c3cfccfe Audio: Mixer: Remove the prime operations for unaligned samples
Remove the unliaged operations since we use the frame aligned API
in mixer process function while get the available frames. Simplify
the code and get better performance for 16/24 bit process(save about
18% cycles) for HiFi version.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-02-10 13:30:44 +02:00
Andrula Song 671f79819d Audio: Mixer: Use frame aligned API
Use frame aligned API to reduce the division calculation in mixer
process function.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-02-10 13:30:44 +02:00
Piotr Makaruk 6009c21c66 hda: Maintain dma buffer alignment
Hda chain dma buffer require aligning after its size recalculation.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-02-10 13:14:43 +02:00
Peter Ujfalusi 3bc70b6251 sof-ctl: Add initial support for handling blobs for IPC4
For IPC4 we are re-using the sof_abi_hdr to encapsulate the blob from/to
user space with minor deviation from IPC3:
- ABI magic is different
- the type is used as param_id in IPC4 (it carries the same functionality)

The IPC type can be specified with -i and defaults to 3 (IPC3).

-p is added as a new option for param_id, but -t and -p will do the same
thing.

After reading a blob, print a message for unexpected ABI magic number, but
do not block the execution.

To generate a header for 100 bytes payload:

For IPC3:
sof-ctl -g 100 -t 2
sof-ctl -i 3 -g 100 -t 2

For IPC4:
sof-ctl -i 4 -g 100 -p 2

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-02-10 10:53:55 +00:00
Peter Ujfalusi c630c8ec77 include: kernel: Update ABI definition for IPC4 support
With IPC4 the sof_abi_hdr is only used between user space and the kernel,
it is not sent to the firmware.
The magic number for IPC3 and IPC4 also differs to avoid mixing blobs
created for different IPC versions.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-02-10 10:53:55 +00:00
Guennadi Liakhovetski c7498318be ipcgtw: initialise a global list statically
Initialising a list head to NULL makes no sense and checking whether
it's initialised every time a constructor function is called is
redundant, initialise the list head statically instead.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-09 15:23:43 +00:00
Guennadi Liakhovetski afcbe880c4 list: add a static list head initialiser
To statically initialise a list do something like
static struct list_item item = LIST_INIT(item);

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-09 15:23:43 +00:00
Daniel Baluta f4be6ecc64 Audio: SRC: Make stage buffer_start to be aligned at 8-byte boundary
sbuf length is empirically found and used to compute buffer_start.

buffer_start address is used by some instructions that require
8-byte aligned addresses:

See: src/audio/src/src_hifi4.c:
220	/* Load two data samples from two channels */
221	AE_L32X2F24_XC(d0, dp, inc); /* r0, l0 */

buffer_start = cd->delay_lines + cd->param.sbuf_length

Then we make sure cd->delay_lines is aligned to 8 and we only add
multiple by 8 lenghts.

Suggested-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-02-09 11:49:15 +02:00
Peter Ujfalusi bcc14074cd smart_amp_test: Split the module config and blob receiving for IPC4
During the component create (module init) we are not receiving the blob
containing the sof_smart_amp_config, only the base_cfg and base_cfg_ext is
received.
The sof_smart_amp_config content will be sent via large_config_set at a
later time.

Introduce a new IPC4 only struct to store the base and pin configurations
and handle the IPC3 / IPC4 init differently.

The blob received via large_config_set must be the same format as the blob
with IPC3.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-02-08 14:59:17 +00:00
Guennadi Liakhovetski 7a6dd62031 eq-iir: fix address space notation
eq_iir_set_alignment() should use the  __sparse_cache annotation for
both its arguments.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-08 14:52:53 +00:00
Guennadi Liakhovetski 89f7aa0abd platform: remove support for Baytrail and Cherrytrail
Remove all support for Baytrail and Cherrytrail platforms, they
aren't supported on the "main" branch any more. To build SOF for them
use the "table-v2.2" branch.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-08 13:36:04 +00:00
Guennadi Liakhovetski e34a137183 platform: switch default to Tiger Lake
Cannon Lake isn't supported any more, switch default to Tiger Lake.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-02-08 13:36:04 +00:00
Rander Wang 208c2049f4 topology2: deep buffer: use 32 bits to align with other pipelines
Now deep buffer uses S24_LE but other pipelines use S32_LE internal format
. Chrome team found a bug that deep buffer can't work well with I2S codec
since fw only support S32_LE for I2S now.

This patch will use S32_LE to align with current requirement

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-02-08 13:35:32 +00:00
Yong Zhi 8dc72986e7 topology2: speaker-echo-ref: fix hardcoded dai_index
Do not hardcode dai_index to 1.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-02-08 13:34:18 +00:00
Seppo Ingalsuo 46bcb14ff6 Tools: Topology2: Add EQ configuration blobs
This patch adds a number of generic or effect type of blobs
to enable use of equalizers in topology2.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-08 12:01:32 +02:00
Seppo Ingalsuo 7c10e1e515 Tools: sof-ctl: Add IPC4 EQ blobs for testing
This patch adds a number of FIR and IIR blobs to apply in
run-time with sof-ctl.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-08 12:01:32 +02:00
Seppo Ingalsuo e26ef3a08c Tools: Tune: EQ: Code cleanup with no functional changes
Use of isempty() instead of length() to the check for non-empty
variable can avoid warnings in executing code in Matlab.

The unnecessary print of variable to console is removed. E.g.
struct bs, or biquad transfer function zeros vector a.

In system() command no need to store the console output, just
check the return status.

In switch-case statements no need for comma after case and
otherwise.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-08 12:01:32 +02:00
Seppo Ingalsuo 5ddbd34ba9 Tools: Tune: EQ: Add tplg2 blobs create
This patch contains the changes to export EQ blobs in both tplg1
IPC3 and tplg2 IPC4 formats.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-08 12:01:32 +02:00
Seppo Ingalsuo 5aa9a9e484 Tools: Tune: EQ: Matlab compatibility fix for parametric EQ
Every endif is changed to end. The endif works only in Octave.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-08 12:01:32 +02:00
Seppo Ingalsuo a0df1a6120 Tools: sof-ctl: Move IPC3 examples to subdirectory
This patch moves the existing .txt blobs for sof-ctl to directory
ipc3. There will be a similar new ipc4 directory.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-02-08 12:01:32 +02:00
Kai Vehmanen ad9f659556 mixin-mixout: handle congestion corner case without assert
If one mixout (A) is not able to process data, the 'sinks_free_frames'
will be truncated compared other mixout buffers. When the mixin process
is producing data to another mixout buffer (B), the number of already
mixed frames may be larger than 'sinks_free_frames'. Further it is
possible this mixout (B) has pending frames, leading to a larger
'start_frame' value.

This is a valid and possible scenario, but will trigger
  assert(sinks_free_frames >= start_frame)
in current code.

As 'frames_to_copy' is already correctly calculated as limited to
available free frames across all mixouts, no extra logic is needed when
this condition happens. Mixin is not able to proceed until the congested
mixout (A) has room again for further samples.

Link: https://github.com/thesofproject/sof/issues/6896
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-02-08 11:57:07 +02:00
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