Skip to content

Commit c4f302f

Browse files
softwareckilgirdwood
authored andcommitted
ipc4: helper: Use ibs in components buffer size calculation
The ibs/obs should be equal between components. However, some modules (like kpb) produce different data sizes on output pins. Unfortunately, only one ibs/obs can be specified in the modules configuration. To avoid creating too small buffer choose the maximum value between ibs and obs. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
1 parent 7fefb0d commit c4f302f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ipc/ipc4/helper.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,18 @@ __cold int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect)
562562

563563
/* create a buffer
564564
* in case of LL -> LL or LL->DP
565-
* size = 2*obs of source module (obs is single buffer size)
565+
* The ibs / obs should be equal between components. However, some modules
566+
* (like kpb) produce different data sizes on output pins. Unfortunately, only
567+
* one ibs/obs can be specified in the modules configuration. To avoid creating
568+
* too small a buffer, we choose the maximum value between ibs and obs.
569+
*
570+
* size = 2*max(obs of source module, ibs of destination module)
571+
* (obs and ibs is single buffer size)
566572
* in case of DP -> LL
567573
* size = 2*ibs of destination (LL) module. DP queue will handle obs of DP module
568574
*/
569575
if (source->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL)
570-
buf_size = obs * 2;
576+
buf_size = MAX(ibs, obs) * 2;
571577
else
572578
buf_size = ibs * 2;
573579

0 commit comments

Comments
 (0)