Commit Graph

7026 Commits

Author SHA1 Message Date
Keyon Jie b619aa1d43 debug: panic: fix log file name error
When the length of the path/file name surpass 32, there is no '\0'
anymore in the panicinfo.filename[] array, which will lead to file name
printing errors on the host side like this:
	.../include/cavs/lib/pm_memory.h\xd8:472

Here copy the last character from the filename together to fix the issue
and eventually got correct output like this:
	.../include/cavs/lib/pm_memory.h:472

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-28 11:52:25 +03:00
Chao Song 3e260cc8de .github: zephyr: upgrade zephyr SDK for APL
The upstream zephyr adds new SDK requirement for APL,
upgrade zephyr SDK version to 0.13.1 for APL build.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2021-09-27 15:16:14 +01:00
Pierre-Louis Bossart 3b3beb0b34 cavs: hda-dma: fix number of DMAs
The number of host and link DMAs need to be aligned on capture and
playback since they can be coupled/decoupled. The existing code
defined 8 link DMA channels for input and output which does not make
any sense.

This patch modifies the number of link DMAs to align with hardware
specs. The values were doubled-checked in the closed-source firmware,
there is no such thing as 8ch link DMA support.

cAVS 1.5/APL:
capture: 7 ch
playback: 6ch

cAVS 1.8+:
capture: 7ch
playbach: 9ch

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-09-27 15:06:00 +01:00
Seppo Ingalsuo b3c9ec46d9 Tools: Test: Audio: Run testbench tests with valgrind
The run with valgrind will error if memory leaks are detected.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-27 12:28:37 +01:00
Marc Herbert 83a992eb49 installer: add new tarball target
To help with the release process, see
https://github.com/thesofproject/sof-bin/commit/d908e5edeb5

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-24 15:04:22 +01:00
Marc Herbert fd57210053 installer: add sof-ctl and sof-probes
Add sof-ctl and sof-probes.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-24 15:04:22 +01:00
Marcin Rajwa 785b747a80 submodule: update rimage to its main branch
This updates SoF rimage submodule to the current TOP
of main branch. Namely from 246ea64 to 8960097, delta change log:

8960097 (HEAD -> main, upstream/main) Revert "ext_manifest: Fix incorrect signature"
0d7f2d4 Do not exit(0) on invalid options or parameters
6e22944 README.md: explain how to run SOF tests on new rimage code
a9faf85 remove '-x' option
241af31 ext_manifest: Fix incorrect signature
4823e87 pkcs: quote the name of key file when logging it
dcfcef8 config: Remove unused, platform specific, memory region definitions
fc4d7b8 rimage: Fix error message content after adsp malloc fail
3e20076 config: Return error value in parse_uint32_* functions when key is not found
ada30c1 config: Explicit state return value for error cases in parse_uint32_* functions
de9177b config: Adjust return type with function name
c4a7456 config: Remove machine_id field
916fc2c config: Remove unused adsp structs
9bf46d3 rimage: Add support for mt8195
aea1969 adsp_config: fix potential overflow in strtol()
9716e10 (origin/master, origin/main) config: Add imx8ulp.toml
b28b993 fixing incorrect data offset in ri_manifest_sign_v1_5
d1553e9 config: add rn toml file to support renoir build
246ea64 config: skl: change image_size to the real SRAM size

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2021-09-23 16:22:15 -05:00
Ming Jen Tai e4e23d47ec Integrate RTNR into sof-adl-max98357a-rt5682
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-09-23 13:50:35 +01:00
Rander Wang a938cec8ba ipc4: add get/set large config support in component ops
Get/set large config are natively supported by ipc4 component,
so add these two ops.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-23 13:29:35 +01:00
Keyon Jie d2bcb65d69 library: memory: (cosmetic) add comment about HP_SRAM_SIZE
Add a comment about the HP_SRAM_SIZE calculation.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-23 12:59:36 +01:00
Keyon Jie 9887d2dffb cmocka: alloc: remove the 200KB+ buffer zone case
We have limited buffer zone which can't afford as big as 200KB+
allocation request on platforms like APL, remove the case.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-23 12:59:36 +01:00
Keyon Jie fc03d17b48 memory: apollolake: reduce the waste of BUFFER block header
The buffer zone will not occupy more than half of the HP SRAM, decrease
the HEAP_BUFFER_COUNT_MAX which can help save about 5KB for us.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-23 12:59:36 +01:00
Allen-KH Cheng ba1eb0d69e timer: mtk: use mtk systimer for mt8195
For driver timer,
use mtk systimer instead of xtensa internal timer.

(xtensa timer clk will affect by dsp clock rate.)

mtk systimer runs at clk at 26M.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-23 12:07:52 +01:00
Marc Herbert e168513f18 .github: testbench: don't use docker to build the testbench
Because it's not needed.

Also add a comment explaining why it's still needed to build topologies
so we can remove it some day and test much faster.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-22 16:29:50 +01:00
Curtis Malainey 4f78c3b053 library: add missing header for ipc4
This header is needed for building IPC4 code

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-22 16:28:57 +01:00
Curtis Malainey 5ffdc575bd ipc4: add missing header
irq_local_disable has no definition without it

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-22 16:28:57 +01:00
Curtis Malainey cc37017565 ipc4: add return value to case
without this we return an uninitialized value

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-22 16:28:57 +01:00
Pierre-Louis Bossart d8a19a4d20 Revert "trace: Kconfig: disable filtering by default"
This reverts commit 9fadef789e.

After multiple trials on a CometLake SoundWire device, this revert to
bring the trace back to what it was seems to be the only solution, the
suggested PR https://github.com/thesofproject/linux/pull/3166 does not
help on this SoundWire device.

We had similar issues with SD offset timeouts and a similar revert
with https://github.com/thesofproject/sof/pull/4578 at the end of
July, there's something that we are missing on what the trace does and
how it impacts the DMA handling.

BugLink: https://github.com/thesofproject/sof/issues/4779
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2021-09-21 11:54:12 +01:00
Oleh Titov ef3a02bf67 config: override: chrome: Add jasperlake_chrome_waves.config
Add Waves override config for jasperlake_chrome.
Enable codec_adapter and Waves codec.
Disable unnecessary components to save resources.

Signed-off-by: Oleh Titov <Otitov@waves.com>
2021-09-21 10:42:36 +01:00
Ranjani Sridharan 3962a73933 ipc: no need to check return value of comp_make_shared
It can never fail.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-09-21 10:17:55 +01:00
Ranjani Sridharan e0f66747e0 comp: remove comp_shared_commit
It does nothing atm and can be re-introduced later when
needed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-09-21 10:17:55 +01:00
Curtis Malainey 4de66271ec ipc: check type before freeing
When freeing we currently implicitly are trusting the ID to match the
type specified in the message. From a security standpoint this is wrong,
never trust the other side. This is the likely cause of how the fuzzer
is leaking memory in pipelines since they have additional allocations
that are not freed when they are treated as a buffer or a component.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-20 11:12:34 +01:00
balapati 853c0a7908 CODEOWNERS: add code owners for amd platforms
Add code owners for amd platforms.

Signed-off-by: balapati <balakishore.pati@amd.com>
2021-09-20 10:47:11 +01:00
balapati f983cb0c55 drivers: amd: renoir: fix for ipc timeout issues
This patch fixes the ipc timeout issues by avoiding
the acquiring of ipc lock in platform ipc driver, which
was already hold by ipc core thread during ipc complete command.

Signed-off-by: balapati <balakishore.pati@amd.com>
2021-09-20 10:47:11 +01:00
balapati ae0113287a platform: amd: renoir: Add debug support for renoir
Add panic code to dump required info during
firmware exceptions.

This patch enables to dump the call stack, debug info
and inform host driver for exceptions in firmware.

Signed-off-by: balapati <balakishore.pati@amd.com>
2021-09-20 10:47:11 +01:00
Liam Girdwood 509eef9c96 byt: align DMA mapping with closed source FW
Align the DMAC usage and channel mappings with the closed source firmware.
This may help with DMA stability when trace is disabled.

Compile tested only as I have no working BYT/CHT HW.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-09-17 17:18:45 +01:00
Liam Girdwood 7e042e9534 dma: bdw and byt dont have DMIC so remove from DMA caps.
Looks like a copy and paste error.

BDW also has SSP as target for DMAC0 which is forbidden by the
direction capability. Align with the direction cap to avoid confusion.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-09-17 17:18:45 +01:00
Marc Herbert df376963df cmake/github: do not download rimage when CONFIG_LIBRARY/testbench
Faster CI and will catch any accidental dependency sneaking in.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Marc Herbert bd01f6fad4 cmake: add the -Irimage #include path only for the modules that need it
Fixes 177d9bd073 ("cmake: defer the rimage build until it's actually
needed.") that corrected the rimage dependency but forgot about the
include.

This allows building the testbench without fetching rimage.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Marc Herbert fd1f631352 cmake: do not download submodules when BUILD_UNIT_TESTS
Faster CI.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Allen-KH Cheng ed5d2feaf6 dma-trace: send ipc msg after update host pointer
before copy section to host, the hist pointer should

be updated.

otherwise, there are some left data in dma buffer and

host don't know.

Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-17 15:00:39 +01:00
Keyon Jie 9fadef789e trace: Kconfig: disable filtering by default
The trace filtering will suppress useful logs and make debugging
difficult, disable it by default.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-16 16:02:29 +01:00
Keyon Jie 2a1f2c7efd alloc: trace error when allocation failed with no condition
No matter if CONFIG_DEBUG_HEAP selected or not, we need to print out
error message when allocation failed. Furthermore, dump the whold heap
usage in case under heap debugging or allocation failure.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2021-09-16 16:02:29 +01:00
Seppo Ingalsuo f47b823cfe Tools: Testbench: File write DAI needs data structures of DAI
Previously the file component stored component data to device
private data similarly as processing components. However the
pipeline treats file as DAI. Without this patch the missing driver
and DAI operation get_init_delay_ms() causes a segfault in pipeline
parameters walk. It is sufficient for the walk to pass to have just
rzalloc() cleared pointers in driver structure.

The file component data is now placed into DAI private data.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-15 14:41:47 +01:00
Rander Wang 93731c5072 ipc4: mixin & mixout: refine mixer behavior for state change
For ipc3 mixer, pipeline will stop at mixer for trigger
and prepare cases, but it is not fit for ipc4, since there
are more than 1 pipeline in the pcm stream, one for mixer and
following components and another one is for front-end components.

This patch divides prepare & trigger function to two parts: common
shared part and part for mixer.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang 15122b2d99 ipc4: mixin & mixout: set sink buffer format
This patch fixes zero-data issues to enable mixin & mixout
set sink buffer format for ipc4

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang b49a170caf ipc4: pipeline: fix dsp panic in multiple pipeline cases
source & sink components are set when pipeline is complete,
so skip these components check when pipeline is set to
complete.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang 97162cdc09 ipc4: pipeline: set schedule component for ipc4 pipeline
Unlike current ipc3 pipeline,  driver will not set schedule
component for ipc4 pipeline. This patch set the last component
of each pipeline as a schedule component.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang 168de3924f ipc4: dai: fix ssp loop-back issue when mixer is enabled
DMA buffer size is in fixed format of 32bit in IPC4 case.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Rander Wang d57286ba18 ipc4: pipeline: apply new pipeline status to ipc4
New pipeline status PRE_START and PRE_RELEASE made
ipc4 pipeline failed. Now integrate the patch to ipc4.
Since ipc3 & ipc4 have different msg reply method,
this reply method will be implemented on each version.

We can't reuse ipc->delayed_response since ipc msg
should be response immediately for ipc4 and fw will
send a fw ipc msg to reply the status of the last msg.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-09-15 14:36:04 +01:00
Curtis Malainey fec3666a4f pipeline: correct cleanup logic
Currently pipeline_xrun_set_limit cannot fail, but the TODO in the
function suggests that is not planned to be true for the future. Lets
fixup the error logic so when that happens we don't leak a pipeline
definition.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-15 14:29:51 +01:00
Curtis Malainey 4366f00249 pipeline: remove pipeline_schedule_config return type
The function cannot fail, so lets remove the extraneous logic

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-15 14:29:51 +01:00
Libin Yang 714518f5e9 topology1: fix a typo of a tplg name in CMakefile
sof-adl-rt1316-l2-mono-rt714-link0 should be
sof-adl-rt1316-l2-mono-rt714-l0

Signed-off-by: Libin Yang <libin.yang@intel.com>
2021-09-15 14:28:34 +01:00
Marc Herbert a487ca9441 Revert "dma-trace: add check to avoid dereference from NULL"
This reverts commit 89ec377cb5.

As commit 7df367451d ("trace: enable trace after it is ready") is
reverted this is not required anymore. See long previous commit message.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-15 14:26:36 +01:00
Marc Herbert f2c13f5e6d Revert "trace: enable trace after it is ready"
This reverts commit 7df367451d.

This restores the ability to use CONFIG_TRACEM (copy everything to
mailbox) without crashing, in other words it fixes #4699

This also fixes the other DSP panic #4676 and removes the need for
logical changes in #4678, which can be reverted too.

commit 7df367451d ("trace: enable trace after it is ready") was meant
to fix a crash when tr_xxx() was used early. However I've used very
early tracing for months and it never caused any crash (see #4334)

I tried adding a tr_err() statement immediately after trace_init(sof) in
primary_core_init() and it works just fine. primary_core_init() runs
extremely early so I don't think it's too demanding not to use an
tr_XXX() before the trace even exists.

The reverted commits confused initializing and enabling.

Reproduction #4683 did not seem to demonstrate anything obvious,
there's not even a link to a failed test run. I don't understand how
playing with spin locks is relevant to this.

Later, reproduction #4759 finally demonstrated the real issue: through
DEBUG_TRACE_PTR(), some tr_XXX() can indeed be called (in very unusal
debug circumstances specific to the original author) before the trace is
initialized. The previous commit in this series fixes that by simply
guarding it with if(trace_get())

     --------

I am _not_ pretending that these reverts make the tracing code bug-free
and perfect again, absolutely not and very far from it. I'm merely
saying that:

- The first reverted commit caused at least two regressions: #4676 and
  #4699

- These two commits added yet another variable (time) in an already
  complex situation with an already existing combinatorial "explosion":
  compile-time Kconfigs, run-time settings, platform-specific bugs
  (#4333, #4573, ...), various races, mbox + DMA, different DMA engines,
  Zephyr vs XTOS, etc.

- Last but not least, we don't want to invest in making the exist trace
  implementation better. We want to switch to the Zephyr implementation
  instead

So let's go back to a previous known good state, I mean _relatively_
good and stay there if we can.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-15 14:26:36 +01:00
Marc Herbert 3ff1dc0277 alloc.c: fix DEBUG_TRACE_PTR() not to trace before trace is initialized
As reported in #4759, #4636 and a few others linked from there.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-15 14:26:36 +01:00
Ranjani Sridharan 4f273961ab buffer: remove buffer core argument in comp_buffer_connect
It can be accessed with the buffer argument.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-09-15 14:19:52 +01:00
Marcin Rajwa 9be072fd7a rimage: remove -x option
This patch removes the unnecessary and unscalable -x option.
This option aims to add an offset to the .data section of
its parent .module section. This is horrible idea because this
offset will vary depend on the compiler used. It is better and
much easier to just store only the .data section so the offset
is always 0.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2021-09-15 14:11:54 +01:00
Allen-KH Cheng 0e71dba119 host: add dma buffer clear
Sometime, we could hear some noise after recording.

In host_prepare, reset dma buffer would be good
in general case to prevent reading uninitialized memory.

Add reset dma buffer zero to avoid unexpected noise

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-14 21:17:43 +01:00
Seppo Ingalsuo 4042959bde Audio: Add to volume component Windows fade ramp type
The new gain ramp type can be selected from topology with
SOF_VOLUME_WINDOWS_FADE (4). The ramp follows function (t/T)^1.75.
The same shape is applied for all transitions: unmute, mute, vol up
and down. Subjectively it sounds somewhat smoother that linear ramp
of same duration.

As optimize and clean up the ramp type error handling is moved to new()
where the ramp function pointer is set. Ramp type does not change after
that.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-09-14 11:04:42 +01:00