Skip to content

Commit 18c17e1

Browse files
committed
audio: eq_iir: fix silent output in pass-through mode
Commit 1061bcd ("audio: eq_iir: switch to source/sink processing API") placed the memcpy_s() call of eq_iir_pass() inside an assert(). On Zephyr builds without CONFIG_ASSERT, assert() expands to an empty statement and the argument is not evaluated, so no data is copied to the sink. The sink is still committed, resulting in silence. This is hit e.g. on Intel PTL with the HDA topology, where the EQ IIR blob sets all channels to bypass and the pass-through function is used. Playback to PCM0 completes without errors but no audio is heard. Fix by evaluating memcpy_s() outside of assert(). Fixes: 1061bcd ("audio: eq_iir: switch to source/sink processing API") Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent fc9e50e commit 18c17e1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/audio/eq_iir/eq_iir.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ void eq_iir_pass(struct processing_module *mod, const struct cir_buf_source *sou
325325
const uint8_t *src = source->ptr;
326326
uint8_t *dst = sink->ptr;
327327
size_t bytes = frames * cd->frame_bytes;
328+
int ret;
328329

329330
while (bytes) {
330331
size_t src_contiguous = (const uint8_t *)source->buf_end - src;
@@ -337,7 +338,8 @@ void eq_iir_pass(struct processing_module *mod, const struct cir_buf_source *sou
337338
continue;
338339
}
339340

340-
assert(!memcpy_s(dst, dst_contiguous, src, copy));
341+
ret = memcpy_s(dst, dst_contiguous, src, copy);
342+
assert(!ret);
341343
bytes -= copy;
342344
src = source_cir_buf_wrap(src + copy, source->buf_start, source->buf_end);
343345
dst = cir_buf_wrap(dst + copy, sink->buf_start, sink->buf_end);

0 commit comments

Comments
 (0)