Skip to content

Commit 3aff459

Browse files
singalsulgirdwood
authored andcommitted
Audio: SRC: Increase length of internal buffer
The too small size of this buffer caused a new 11025 to 8000 Hz conversion pipeline to freeze due to impossible condition in source/internal/sink buffers. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent 8024351 commit 3aff459

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/audio/src/src.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
#define MAX_FIR_DELAY_SIZE_XNCH (PLATFORM_MAX_CHANNELS * MAX_FIR_DELAY_SIZE)
5353
#define MAX_OUT_DELAY_SIZE_XNCH (PLATFORM_MAX_CHANNELS * MAX_OUT_DELAY_SIZE)
5454

55+
/* Coefficient to convert internal min. block multiple to buffer size between
56+
* stages 1 and 2. This is empirically found value plus a tenth that avoids
57+
* condition where processing can't happen due to run out of this buffer. Use Q4.12.
58+
*/
59+
#define SBUF_LENGTH_MULTIPLIER Q_CONVERT_FLOAT(2.4, 12)
60+
5561
static const struct comp_driver comp_src;
5662

5763
LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL);
@@ -196,7 +202,8 @@ int src_buffer_lengths(struct src_param *a, int fs_in, int fs_out, int nch,
196202
* variable number of blocks to process per each stage
197203
* there is no equation known for minimum size.
198204
*/
199-
a->sbuf_length = 2 * nch * stage1->blk_out * r1;
205+
a->sbuf_length = Q_MULTSR_32X32(nch * stage1->blk_out * r1,
206+
SBUF_LENGTH_MULTIPLIER, 0, 12, 0);
200207
}
201208

202209
a->src_multich = a->fir_s1 + a->fir_s2 + a->out_s1 + a->out_s2;

0 commit comments

Comments
 (0)