From 1cfd549ead97218e042289846916fca7fc96e930 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Fri, 8 May 2026 00:07:29 +0300 Subject: [PATCH 1/3] topology2: Increase widget default value for stack from 4k to 8k The widget specific stack requirement works in such a way that all components in a pipeline have their stack requirements, and the pipeline stack size will be the highest of those values. I am not sure if this is actually the best method. I am not sure what factors affect the required stack size for a pipeline, but for now this will have to do. So 4k is not enough for all pipelines, and these generic numbers are here to guarantee that everything works until we have fine tuned values for all the modules. So increase the number to 8k to guarantee functionality. Signed-off-by: Jyri Sarha --- tools/topology/topology2/include/components/widget-common.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology2/include/components/widget-common.conf b/tools/topology/topology2/include/components/widget-common.conf index 43ac5691c778..b6aef0ce77af 100644 --- a/tools/topology/topology2/include/components/widget-common.conf +++ b/tools/topology/topology2/include/components/widget-common.conf @@ -176,6 +176,6 @@ DefineAttribute."shared_bytes_requirement" { # These default values are here until we have measured module specific numbers stack_bytes_requirement 8192 -interim_heap_bytes_requirement 4096 +interim_heap_bytes_requirement 8192 lifetime_heap_bytes_requirement 16384 shared_bytes_requirement 4096 \ No newline at end of file From 235755fb0a7e20b956ee11f47becb0b25b3fe39f Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Tue, 2 Jun 2026 23:28:42 +0300 Subject: [PATCH 2/3] topology2: Remove lifetime and shared -bytes_requirement widget attributes Remove tokens lifetime_heap_bytes_requirement and shared_bytes_requirement and turn interim_bytes_requirement back into heap_bytes_requirement. These new types are not after all needed. The vregions code can handle the division between lifetime linear allocs and traditional interim heap autonomously. And shared memory does not need to be separately configured, vregion_alloc_coherent_align() can allocate shared memory from the same heap. Fixes: 83390bd3f90b ("topology2: Add lifetime and shared -bytes_requirement widget attributes") Signed-off-by: Jyri Sarha --- .../topology2/include/common/tokens.conf | 4 +-- .../include/components/widget-common.conf | 27 +++---------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/tools/topology/topology2/include/common/tokens.conf b/tools/topology/topology2/include/common/tokens.conf index 48b498280130..d03092360591 100644 --- a/tools/topology/topology2/include/common/tokens.conf +++ b/tools/topology/topology2/include/common/tokens.conf @@ -28,9 +28,7 @@ Object.Base.VendorToken { scheduler_domain 418 domain_id 419 stack_bytes_requirement 420 - interim_heap_bytes_requirement 421 - lifetime_heap_bytes_requirement 422 - shared_bytes_requirement 423 + heap_bytes_requirement 421 } "2" { diff --git a/tools/topology/topology2/include/components/widget-common.conf b/tools/topology/topology2/include/components/widget-common.conf index b6aef0ce77af..14ccd8fcf86a 100644 --- a/tools/topology/topology2/include/components/widget-common.conf +++ b/tools/topology/topology2/include/components/widget-common.conf @@ -149,33 +149,12 @@ DefineAttribute."stack_bytes_requirement" { token_ref "comp.word" } -## Interim Heap size requirement in bytes for this component. -## Used for resources that may change in size or be freed during the lifetime of the component. -## In practice this means anything allocated outside module's init() call-back. -DefineAttribute."interim_heap_bytes_requirement" { - # Token set reference name and type - token_ref "comp.word" -} - -## Lifetime heap memory allocation requirement in bytes for this component. -## This token's value indicates the amount of allocated memory needed at component init phase -## and used over the lifetime of the component until the component is destroyed. -## In practice this means anything allocated in init() call-back. -DefineAttribute."lifetime_heap_bytes_requirement" { - # Token set reference name and type - token_ref "comp.word" -} - -## Shared memory allocation requirement in bytes for this component. -## This token's value indicates the amount of shared memory the component may need to allocated. -## Shared memory may be shared to other components. -DefineAttribute."shared_bytes_requirement" { +## Heap size requirement in bytes for this component. +DefineAttribute."heap_bytes_requirement" { # Token set reference name and type token_ref "comp.word" } # These default values are here until we have measured module specific numbers stack_bytes_requirement 8192 -interim_heap_bytes_requirement 8192 -lifetime_heap_bytes_requirement 16384 -shared_bytes_requirement 4096 \ No newline at end of file +heap_bytes_requirement 24576 From c9b21d65b4cbf3d5185c852d2e161497b2069779 Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Fri, 8 May 2026 00:15:42 +0300 Subject: [PATCH 3/3] topology2: cavs-nocodec.conf: Fine tune SRC DP memory requirements Fine tune SRC DP memory requirements to values that should satisfy all use-cases, without using too much memory. Signed-off-by: Jyri Sarha --- tools/topology/topology2/cavs-nocodec.conf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index fea906f98741..52d603c0eb3c 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -698,9 +698,9 @@ IncludeByKey.PASSTHROUGH { IncludeByKey.SRC_DOMAIN { "DP" { core_id $DP_SRC_CORE_ID - domain_id 123 - stack_bytes_requirement 4096 - heap_bytes_requirement 8192 + domain_id 0 + stack_bytes_requirement 2048 + heap_bytes_requirement "$[(24 * 1024)]" } } } @@ -1382,9 +1382,9 @@ IncludeByKey.PASSTHROUGH { IncludeByKey.SRC_DOMAIN { "DP" { core_id $DP_SRC_CORE_ID - domain_id 123 - stack_bytes_requirement 4096 - heap_bytes_requirement 8192 + domain_id 0 + stack_bytes_requirement 2048 + heap_bytes_requirement "$[(24 * 1024)]" } }