[RFC] dai: dma_buffer: fix pop noise issue when start playback#2573
[RFC] dai: dma_buffer: fix pop noise issue when start playback#2573lgirdwood merged 1 commit intothesofproject:masterfrom
Conversation
|
@RanderWang PR looks good to me, lets wait for other people to review. I wonder if you could share with us more about your tools for fixing this kind of bugs. So, I assume you are using audacity? and also a separate machine to capture the output from DUT? |
No, I enable loop-back feature which routes stream data from playback to capture. This feature may be supported by codec or vendor audio IP. |
There was a problem hiding this comment.
@tlauda fyi
@RanderWang the SSP FIFO may be another pop source at stream start. i.e. it could have some stale data from previous playback that is not flushed. This would be obvious if the pop was always <= 16 samples. If so, you could hopefully manually clear it by writing 16 0s to the FIFO (and clearing overrun status bit).
IIRC there was an SSP FIFO clear already. 992f081 Don't know if this is enough though? |
src/audio/dai.c
Outdated
There was a problem hiding this comment.
does this also force the zeroed data to be written back?
There was a problem hiding this comment.
good question. This function does it.
static inline void buffer_zero(struct comp_buffer *buffer)
{
tracev_buffer_with_ids(buffer, "stream_zero()");
bzero(buffer->stream.addr, buffer->stream.size);
if (buffer->caps & SOF_MEM_CAPS_DMA)
dcache_writeback_region(buffer->stream.addr,
buffer->stream.size);
}
Thanks @lgirdwood . We also clear FIFO in sdw master controller. |
|
Since aplay with speaker is blocked by #2570 on latest master branch, only tested it with headphone. Pop noise is gone except has slight noise when switch foreground from background during aplay. Same result as cml-010-hotfix2 branch. |
|
SOFCI TEST |
@xiulipan It is not caused by my PR. |
|
@RanderWang What is not caused by your PR? |
This PR just clear a DMA buffer used by GP-DMA in prepare function. Null sof log in failed case to prove it is connected to this PR. |
The pop noise is generated by invalid data in dma buffer. Since all buffers are cleared by pipeline_comp_prepare except dma buffer, so clear it to zero to avoid pop noise. Signed-off-by: randerwang <rander.wang@linux.intel.com>
572102f to
4127a9c
Compare
|
Jenkins CI known issues. |
Another type of pop noise.
The pop noise is generated by invalid data in dma buffer.
Since all buffers are cleared by pipeline_comp_prepare except
dma buffer, so clear it to zero to avoid this issue.