alsa-utils/alsaloop
Ruslan Bilovol ec8717d588 alsaloop: reduce cumulative error caused by non-atomic samples calculation
When doing loopback between two audio card with
same sampling frequency, I noticed slow increase
of pitch_diff.

When I changed order of get_queued_playback_samples()
vs get_queued_capture_samples(), I noticed same drift
of pitch_diff but if was decreasing this time.

This seems to be caused by non-atomic consecutive
snd_pcm_delay() invocation for playback then for
capture. snd_pcm_delay() measures delay between
read/write call and actual ADC/DAC operation.

So while we get this value for playback path in
get_queued_playback_samples(), next call to
get_queued_capture_samples() will happen a little
bit later so snd_pcm_delay() may return incorrect
value.

Be interleaving get_queued_{playback,capture}_samples()
order, we divide this small error between playback
and capture paths. I do not see any issues anymore
with one-way drift of pitch_diff.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2020-03-11 09:45:10 +01:00
..
alsaloop.1 Several formatting fixes for manpages. 2013-05-16 10:38:13 +02:00
alsaloop.c Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
alsaloop.h Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
control.c Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
effect-sweep.c Change FSF address (Franklin Street) 2017-11-14 14:28:53 +01:00
Makefile.am Makefiles - use AM_CPPFLAGS instead INCLUDES 2014-05-07 10:55:59 +02:00
pcmjob.c alsaloop: reduce cumulative error caused by non-atomic samples calculation 2020-03-11 09:45:10 +01:00
test.sh alsaloop: fixes, added -W/--wake option 2010-10-14 11:17:25 +02:00