Commit Graph

8931 Commits

Author SHA1 Message Date
Adrian Bonislawski 82e628fe10 up_down_mixer: LOG_MODULE_REGISTER for zephyr logging
This will fix build with zephyr logging enabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-09 11:26:26 +01:00
Adrian Bonislawski 55f4a29f24 dai-zephyr: fix dai_get_fifo_depth
This will fix dai_get_fifo_depth() and return correct value

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-09 11:25:34 +01:00
Kai Vehmanen 50e9b3069f coherent: fix building with CONFIG_ASSERT=y
arch_is_in_isr() is not an exported function. Use k_is_in_isr()
instead.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-09 11:25:04 +01:00
Guennadi Liakhovetski 1e9a709ee7 ll-schedule: degrade an error message to a warning
SOF always tries to register both scheduling domains - timer and DMA,
even though the DMA domain isn't used in current topologies on newer
architectures and isn't supported under Zephyr. Degrade the error
message printed upon each boot due to this lack of support to a
warning.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-09-09 11:23:52 +01:00
Fred Oh 8136e514bf host-testbench.sh: add FullTest variable and set 0 by default
FullTest variable is by default 0. When fulltest is required,
set the variable and run the script like,

$ FullTest=1 ./scripts/host-testbench.sh

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Fred Oh 6b744bcc63 host-testbench.sh: use process_test.m for 8 components
Expand to more components with process_test. Components for test are
volume, eq-iir, eq-fir, dcblock, drc, multiband-drc, src and tdfb.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Fred Oh fe7f44e287 .github: add octave packages for testbench
process_test requires octave. Before running octave,
signal and io pakcages should be loaded.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Fred Oh 51abaff072 Tools: Testbench: add suffix to keep all the logs
When series of tests are run, only last result with same component is
saved. Make unique output filename. For now adding bits per sample
at the end of file, all the logs can be saved.

Ideally datetime string would be good. I keep it as FIXME.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Fred Oh d9d5842654 Tools: Testbench: add fulltest parameter in process_test
fulltest param to control quick chirp test only or full test
including all quality tests.

As minor clean up, unused parameter in thdnf_mask() and test_run_process()
is removed.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Fred Oh 7eb9863cdc Tools: Testbench: apply common indentation for functions
No functional change. Set common function indentation and add comment
sections for better readability.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Fred Oh 86e6e4e5b0 Tools: Testbench: fix typo in copyright year
Obvious typo in copyright year, it is 2022.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2022-09-07 22:09:33 +01:00
Guennadi Liakhovetski b17a467c7d copier: handle an allocation failure correctly
Buffer allocation can fail, return an error instead of dereferencing
a NULL pointer.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-09-07 22:01:41 +01:00
Guennadi Liakhovetski b1c514d6cd mixin-mixout: use the _thread coherent API version consistently
Threaded and unthreaded versions of the coherent API must not be
mixed. Use the threaded version consistently.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-09-07 21:56:27 +01:00
Guennadi Liakhovetski f37ab591bb mixin: allocate .mixed_data_info as uncached
mixin-mixout uses the coherent API to access the .mixed_data_info
array, therefore it has to be allocated as uncached, otherwise
initialisation changes get discarded by cache invalidation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-09-07 21:56:27 +01:00
Adrian Bonislawski 26b48aa221 probes: enable by default
This will enable probes by default for CAVS platforms

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-07 21:54:47 +01:00
Adrian Bonislawski dac5759fe6 probes: add IPC4 support
Add IPC4 support for extraction & injection probes
IPC4 header changes, checksum calculation
moved checksum from header to the end of data packet

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-07 21:54:47 +01:00
Jaroslaw Stelter de889c554b library_manager: module_adapter: Enable build of library manager and IADK modules
Add the library manager and IADK modules to build.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Jaroslaw Stelter e76c236801 module_adapter: Fix iadk module component compilation.
The patch introduced in this commit:
SHA-1: 68345fb168
* module_adapter: Add support for IPC4 in module_adapter_new
broke previous implementation of iadk_modules.c, sice loadable
modueles needs congiguration size to be passed from IPC handler
to the module code. These changes resolves that issue.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Jaroslaw Stelter 359326b8db library_manager: Fix library_manager compilation issue
Fix typo. Add changes required after removing some old definitions.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Jaroslaw Stelter a363e882ea zephyr: rtos: Allow memory operations to be called from cpp code
The memcpy_s() function is called from CPP code in IADK modules.
Declare it as extern "C" when header included in CPP code.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Serhiy Katsyuba dde3db52c3 ipc4: fix memory corruption when running unbinded copier
Running a pipeline with unbinded copier leads to memory
corruption. Normally pipeline should not be started with
unbinded components, however, this still can happen due to
a bug in test or driver.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-09-07 15:16:35 +01:00
Rander Wang 1394832fd7 topology2: add more audio formats support for deep buffer pipeline
Add 32bits/32bits support for deep buffer.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-09-07 13:33:51 +01:00
Rander Wang 26b8406c28 topology2: add more audio formats support for host-mixin pipeline
Add 24bits/32bits support for gain

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-09-07 13:33:51 +01:00
Keqiao Zhang 0e4208d85b xtensa-build-zephyr.py: copy mtrace-reader.py to tools folder
we will switch to using this new logging tool, copy it to the tools
folder, then it will be uploaded to CI storage after building.

Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com>
2022-09-07 13:17:54 +01:00
Vamshi Krishna Gopal f660b66067 ghd: Fix build error for ghd
Size parameter is moved from
struct sof_ipc_reply to struct sof_ipc_cmd_hdr.
Added changes accordingly.

Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>
2022-09-07 13:17:11 +01:00
Adrian Bonislawski f8c89ed211 ipc4: invalidate cache for set large config message
Cache issue can occur when several set large config messages
were sent one after another

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-09-07 13:16:19 +01:00
Rander Wang 2ad89eb0d3 topology2: add deep buffer support on sdw platforms
Sdw platforms will support deep buffer

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-09-06 22:06:23 +01:00
Rander Wang ba03937264 topolog2: add deep buffer support on HDA platforms
Deep buffer uses large 100ms dma buffer size and
it also enables lp mode.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-09-06 22:06:23 +01:00
Seppo Ingalsuo baec9c1b28 Test: cmocka: Add tests for auditory functions library
Add test for psy_hz_to_mel(), psy_mel_to_hz(), psy_get_mel_filterbank(),
and psy_apply_mel_filterbank_16/32(). All the test data in C header
files was created with script ref_auditory.m.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-09-06 22:05:03 +01:00
Seppo Ingalsuo 06b849586c Math: Add Auditory functions library
This patch adds a psycho-acoustics and auditory system related
functions library. Currently the library provides functions for Mel
frequency scale. Functions are provided to convert between Mel and
Hz, initialize a Mel filter bank and apply Mel filter bank to
convert a linear power spectrum into an auditory power spectrum.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-09-06 22:05:03 +01:00
Ranjani Sridharan b9889d52d0 module_adapter: Modify reset API
Modify the definition of the reset API in the module adapter interface
to make sure that it should reset the module state back to
MODULE_INITIALIZED and free all memory that was allocated during the
prepare() callback. With this change, stopping and restarting streams
will always be guaranteed to invoke the module's prepare() callback.
Also, fix the passthrough and cadence codec implementation to follow the
new definition.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-09-06 22:02:10 +01:00
Kai Vehmanen 1912eb82c8 ipc4: fix IPC message queueing with IPC4
The list fields in the ipc_msg objects used by IPC4 stack, are not
initialized properly. This breaks the queueing logic in ipc_msg_send()
when it checks for "if (list_is_empty(&msg->list))". As a result,
if a IPC could not be sent immediately as the driver is busy, it would
not properly be resent later.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-06 21:45:53 +01:00
Kai Vehmanen 59ffb8390a ipc4: handle attempts to reuse the notify object safely
ipc_send_buffer_status_notify() uses a static ipc_msg object
to send the notifications. In normal circumstances, notifications
are never queued as they are sent as high-priority messages,
but this is still possible. Requeing the same object can potentially
lead to memory corruption as the caller is modifying the message
object, while it may in fact be in use still.

To avoid this, check in ipc_send_buffer_status_notify() whether
the IPC message queue has the notify object, and if yes, skip
the message. The buffer status notifications can be safely dropped
in error case, as host can read the log buffer status directly from
the SRAM window.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-06 21:45:53 +01:00
Kai Vehmanen a394d88039 ipc4: logging: throttle notifications to host
If something unexpected happens and logging subsystem is flooded
with messages, do not make the matter worse by flooding the host
with IPCs. This implements a lower threshold for how often
notifications can be sent to host.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-06 21:45:53 +01:00
Kai Vehmanen fa11388e08 ipc4: logging: fix use of k_uptime_delta()
Fix incorrect usage of k_uptime_delta() that leads to incorrect
decisions when to send the BUFFER_NOTIFY IPC.

k_uptime_delta() not only calculates the delta, but also stores the
current uptime to the argument passed as reftime. This breaks the logic
in code as mtrace_notify_last_sent was updated unintentionally.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-06 21:45:53 +01:00
Daniel Baluta 0488ffee32 zephyr: Fix DRC module compilation
Add DRC files to Zephyr compilation to avoid failures like this:

sof/src/audio/drc/drc_generic.c:188: undefined reference to
`drc_lin2db_fixed'

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-09-06 21:40:06 +01:00
Rander Wang 6b119f9a86 ipc4: volume: set volume config when volume is initialized
Found one issue on Linux platform that the initialized volume setting
by alsamixer doesn't make effect when playback is started. The reason
is that the volume config set is skipped when volume module is just
initialized. Now volume will be set when it is initialized. At this
time cd->channels is not initialized so use channal count in module
config.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-09-06 15:38:01 +01:00
Liam Girdwood c3c94fc515 header: rtos: use rtos specific version of wait.h
Code can now include <rtos/wait.h> and uses native Zephyr 64
cycle API instead of SOF version.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-09-06 15:37:21 +01:00
Seppo Ingalsuo c23c8ac5d3 Drivers: DMIC: Fix risk for overflow in unmute ramp calculation
This patch adds cast to int64_t for the multiplication and adds 32 bit
saturation to ensure overflow of the product is not possible.

This function is used to calculate ramp time in IPC4 NHLT blob mode
where the time is not passed from topology. Currently rates up to
48 kHz remain under product int32_t range, so normally there is no
issue. However 96 kHz rate would always result to incorrect
LOGRAMP_TIME_MIN_MS (10 ms).

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-09-06 13:52:47 +01:00
Gongjun Song 2c902ec2c0 fix function name error
Correct the function name "volume_ctrl_set_cmd()" to
"volume_set_config()".

Signed-off-by: Gongjun Song <gongjun.song@intel.com>
2022-09-06 13:51:22 +01:00
Seppo Ingalsuo 98a911ed53 Audio: TDFB: Fix suspicious looking Q_MULTSR_32X32 macro usage
This patch adds to header file sof/audio/format.h two new macros
for 16 * 16 fractional multiply. It's identical to 32 bit but the
name suggests that operands are 16 bit where case to int32_t is
sufficient for the product.

- The calculation of cd->max_frames is changed use Q_MULTSR_16X16()
- Max_lag calculation is added type cast to int64_t though it does
  not overflow with 48 kHz. But it could overflow with 96 kHz rate.
- A comment about 64 bit type is added to calculation of thr
- src_x and src_y calculation is done with Q_MULTSR_16X16()
- az_slow calculation is done with Q_MULTSR_16X16
- deg calculation is done with Q_MULTSR_16X16

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-09-06 13:15:21 +01:00
Kai Vehmanen 86ad3798e1 ipc4: add debug logs for RX/TX messages
Add logs for all inbound and outbound IPC messages using a similar
logging style as used by Linux SOF driver.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-09-06 10:11:25 +01:00
Chao Song 809e3d0ebd zephyr: deprecate zephyr.h and use kernel.h header
The zephyr header zephyr.h should be only used with
CONFIG_LEGACY_INCLUDE_PATH, which is deprecate by both
Zephyr and SOF.

The latest zephyr main will complain if zephyr.h is
used but CONFIG_LEGACY_INCLUDE_PATH disabled.

This patch deprecates zephyr.h and uses kernel.h instead,
so that we don't break with latest zephyr.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-09-06 09:59:15 +01:00
Serhiy Katsyuba dfc3888baa ipc4: fix copier crash
Buffer params (like stream format) are usually setup by component's
params() handler. params() is called before pipeline start. When copier
is binded with component on another pipeline, it might happen that
copier copy() is already running while other component params() was not
yet executed (by other pipiline).

Processing buffer with uninitialized params usually leads to crash:
division by 0 channels when calculating frames.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-09-06 09:57:08 +01:00
Serhiy Katsyuba 3912ac95a1 ipc4: fix copier set sink format handling
When gateway is copier's source, this should not prevent
from calling "set sink format" for sink pin 0.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-09-06 09:57:08 +01:00
Marc Herbert 9e546b4b84 scripts/test-repro-build.sh: leave only TGL
Other platforms are not supported anymore in the main branch.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:30:02 +01:00
Marc Herbert 42dd33fb06 zephyr/docker-run.sh: add comments about image versions
Explain how to use this script with a different image version.

Docker image versions and tags tend to confuse new users.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:28:30 +01:00
Marc Herbert 4bf26d09c1 zephyr/docker-run.sh: add missing '-i' option
This makes it possible to run interactive commands like:

  ./sof/zephyr/docker-run.sh /bin/bash

Fixes commit 02c1269144 ("Add new, convenience zephyr/docker-run.sh
script")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:28:30 +01:00
Marc Herbert dfc6b46e1d scripts/docker-run.sh: fix wrong "id -n" command -> "id -u"
Fixes commit d09844ab98 ("zephyr/docker-build.sh: match UID with
'adduser' instead of 'chgrp -R'")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:28:30 +01:00
Krzysztof Frydryk b9dc0f1bb9 library manager: fix outdated include path
Fix spinlock.h include path as in 1629a1f72c

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-09-02 18:25:27 +01:00