Commit 20d9a26d authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA: snd-aloop - fix capture buffer silence

In a special case, some old samples are left in the capture ring buffer.
Fix it.
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 1446c5fb
...@@ -347,7 +347,7 @@ static void copy_play_buf(struct loopback_pcm *play, ...@@ -347,7 +347,7 @@ static void copy_play_buf(struct loopback_pcm *play,
unsigned int bytes) unsigned int bytes)
{ {
struct snd_pcm_runtime *runtime = play->substream->runtime; struct snd_pcm_runtime *runtime = play->substream->runtime;
char *src = play->substream->runtime->dma_area; char *src = runtime->dma_area;
char *dst = capt->substream->runtime->dma_area; char *dst = capt->substream->runtime->dma_area;
unsigned int src_off = play->buf_pos; unsigned int src_off = play->buf_pos;
unsigned int dst_off = capt->buf_pos; unsigned int dst_off = capt->buf_pos;
...@@ -385,8 +385,10 @@ static void copy_play_buf(struct loopback_pcm *play, ...@@ -385,8 +385,10 @@ static void copy_play_buf(struct loopback_pcm *play,
dst_off = (dst_off + size) % capt->pcm_buffer_size; dst_off = (dst_off + size) % capt->pcm_buffer_size;
} }
if (clear_bytes > 0) if (clear_bytes > 0) {
clear_capture_buf(capt, clear_bytes); clear_capture_buf(capt, clear_bytes);
capt->silent_size = 0;
}
} }
#define BYTEPOS_UPDATE_POSONLY 0 #define BYTEPOS_UPDATE_POSONLY 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment