mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
ALSA: aloop: fix clear capture buf at wrong time
We need to use uniform current jiffies to avoid the delta_capt too fast and the playback data is cleared. Change-Id: I15e46a3857d76ca37b01a4af4c4d331ec41febfc Signed-off-by: Xing Zheng <zhengxing@rock-chips.com>
This commit is contained in:
@@ -498,15 +498,16 @@ static unsigned int loopback_pos_update(struct loopback_cable *cable)
|
||||
cable->streams[SNDRV_PCM_STREAM_CAPTURE];
|
||||
unsigned long delta_play = 0, delta_capt = 0;
|
||||
unsigned int running, count1, count2;
|
||||
unsigned long cur_jiffies = cycles_to_jiffies();
|
||||
|
||||
running = cable->running ^ cable->pause;
|
||||
if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) {
|
||||
delta_play = cycles_to_jiffies() - dpcm_play->last_jiffies;
|
||||
delta_play = cur_jiffies - dpcm_play->last_jiffies;
|
||||
dpcm_play->last_jiffies += delta_play;
|
||||
}
|
||||
|
||||
if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) {
|
||||
delta_capt = cycles_to_jiffies() - dpcm_capt->last_jiffies;
|
||||
delta_capt = cur_jiffies - dpcm_capt->last_jiffies;
|
||||
dpcm_capt->last_jiffies += delta_capt;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user