Repository navigation
Host-zephyr: limit copy bytes to one period for capture pipeline - #7145
Conversation
aiChaoSONG
left a comment
There was a problem hiding this comment.
the log is not correct, avail_bytes and free bytes are direction dependent.
There was a problem hiding this comment.
for playback, avail_bytes is the bytes available in dma, free_bytes is the free bytes in downstream buffer; but for capture, avail_bytes is the bytes available in buffer, and free bytes is the free bytes in downstream DMA. so the log info here probably is wrong.
There was a problem hiding this comment.
it is just print some information help developer debug when there is a bug exists, to say wrong is not proper, afterall, deleoper always add/remove logs when debug, just print avail_bytes and free_bytes, developer have the sense to justify printed information.
|
@kv2019i , please review this PR |
There was a problem hiding this comment.
I don't understand how this can work... you are combining playback and capture direction avail and free bytes with MIN? so depending on direction isn't the other value like random? So it can be like always 0 or whatever the "balance" between free and avail happens to be... or I just don't understand how free_bytes and avail_bytes works.
There was a problem hiding this comment.
@juimonen, the real change is: change capture copy_bytes from:
copy_bytes = MIN(avail_bytes, free_bytes);
to:
copy_bytes = MIN(hd->period_bytes, MIN(avail_bytes, free_bytes));
Since both playback and capture have same limitation for copy_bytes, then I moved out for save code space.
Please check again.
Limit copy bytes to period bytes for both playback and capture to avoid high load spike. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Limit copy bytes to period bytes for both playback and capture
to avoid high load spike.