dts: fix memory allocation failed and move the pipeline to different core - #11230
joechengxperi wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Replace the undefined heap symbol with SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR adds DTS-specific SoundWire topologies, configurable core placement, and a PTL heap adjustment to address endpoint switching and allocation failures.
Changes:
- Adds DTS SDCA topology targets.
- Applies
DTS_CORE_IDto DTS pipelines and widgets. - Adds PTL virtual-heap configuration.
| File | Summary |
|---|---|
tools/topology/topology2/production/tplg-targets-sdca-generic.cmake |
Adds DTS SDCA topology targets. |
tools/topology/topology2/platform/intel/sdw-jack-dts.conf |
Applies configurable core affinity to jack DTS pipelines. |
tools/topology/topology2/platform/intel/sdw-amp-dts.conf |
Applies configurable core affinity to amplifier DTS pipelines. |
tools/topology/topology2/cavs-sdw.conf |
Defines the default DTS core. |
app/overlays/ptl/dts_overlay.conf |
Attempts to configure the PTL virtual heap, but uses an undefined Kconfig symbol and does not change the heap size. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| CONFIG_LLEXT_HEAP_SIZE=64 | ||
| CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n | ||
| CONFIG_SOF_STACK_SIZE=8192 | ||
| CONFIG_SOF_ZEPHYR_VIRTUAL_HEAP_SIZE=0x80000 |
There was a problem hiding this comment.
@joechengxperi This should change CONFIG_SOF_ZEPHYR_HEAP_SIZE due to a recent rename. See commit 5cf6f9c
There was a problem hiding this comment.
| { | ||
| index 21 | ||
| core_id $DTS_CORE_ID | ||
| core $DTS_CORE_ID |
There was a problem hiding this comment.
I think only one of them is needed and I think it's core, could you check?
There was a problem hiding this comment.
Yes, it's confusing the tplg compiler doesn't catch this, but for the pipeline widget, only "core" is needed.
But I won't block because of this, "core" is the pipeline level token (SOF_TKN_SCHED_CORE for Linux kernel) and "core_id" is the widget token (SOF_TKN_COMP_CORE_ID in Linux kernel). For a pipeline, both can be set, but only "core" is needed as Linux driver will force same values.
This is confusing I admit and we should improve this for topology developers.
| core_id $DTS_CORE_ID | ||
|
|
||
| Object.Widget.pipeline.1 { | ||
| core $DTS_CORE_ID |
There was a problem hiding this comment.
right, I think pipeline widgets use core, while processing components use core_id
kv2019i
left a comment
There was a problem hiding this comment.
Please fix the Kconfig name due to recent rename. Minor comments otherwise (other comments not blocking).
| CONFIG_LLEXT_HEAP_SIZE=64 | ||
| CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n | ||
| CONFIG_SOF_STACK_SIZE=8192 | ||
| CONFIG_SOF_ZEPHYR_VIRTUAL_HEAP_SIZE=0x80000 |
There was a problem hiding this comment.
@joechengxperi This should change CONFIG_SOF_ZEPHYR_HEAP_SIZE due to a recent rename. See commit 5cf6f9c
| { | ||
| index 21 | ||
| core_id $DTS_CORE_ID | ||
| core $DTS_CORE_ID |
There was a problem hiding this comment.
Yes, it's confusing the tplg compiler doesn't catch this, but for the pipeline widget, only "core" is needed.
But I won't block because of this, "core" is the pipeline level token (SOF_TKN_SCHED_CORE for Linux kernel) and "core_id" is the widget token (SOF_TKN_COMP_CORE_ID in Linux kernel). For a pipeline, both can be set, but only "core" is needed as Linux driver will force same values.
This is confusing I admit and we should improve this for topology developers.
| SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,NUM_HDMIS=0,\ | ||
| DEEP_BUF_SPK=true" | ||
|
|
||
| "cavs-sdw\;sof-sdca-jack-id0-dts\;SDW_JACK_OUT_STREAM=Playback-SimpleJack,\ |
DTS library would allocate memory failed when there are multiples apps are launched and endpoint switches at the same time. Incease the size to avoid this issue Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
Add DTS_CORE_ID and let the pipeline could run on approriate core Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
Enable DTS topology for SDCA and set to different cores for speaker/heapdhone pipeline to avoid resource not enough Signed-off-by: Joe Cheng <joe.cheng@xperi.com>
65f79fd to
39e2cb6
Compare

This PR is to resolve the issue Google reported that audio device would lost when there are two applications running and switch endpoint simultaneously.