summaryrefslogtreecommitdiff
path: root/src/rmd_opendev.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2020-11-13 21:58:22 -0800
committerVito Caputo <vcaputo@pengaru.com>2020-11-13 21:58:22 -0800
commit2341ddfcd96f72cc4ee2c4f1e091ff2306caf62a (patch)
treee187d80e74565d643b53159739a15b99be97b120 /src/rmd_opendev.c
parentb9e0c2ce4c0e8a93f6227bc71bcab5292389b1b4 (diff)
opendev: bump granularity of audio capture periods
This only applies to ALSA, but the av-sync precision is entirely dependent on the granularity of what ALSA refers to as "periods". The pdata->avd delay is decremented by the audio capture in period aligned steps, meaning the smallest decrement it can possibly do is the period size. Between these period sized intervals, rmdGetFrames kind of flies blind if the FPS is high enough for frametime to be substantially smaller than the period time. A smaller period does increase the ALSA capture overhead, basically increasing the number of times ALSA returns data to userspace, kind of like a higher interrupt rate. But it seems negligible for a modern system.
Diffstat (limited to 'src/rmd_opendev.c')
-rw-r--r--src/rmd_opendev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rmd_opendev.c b/src/rmd_opendev.c
index c8460d9..e5347a3 100644
--- a/src/rmd_opendev.c
+++ b/src/rmd_opendev.c
@@ -52,7 +52,7 @@ snd_pcm_t *rmdOpenDev( const char *pcm_dev,
{
snd_pcm_t *mhandle;
snd_pcm_hw_params_t *hwparams;
- unsigned int periods = 2;
+ unsigned int periods = 4;
unsigned int exactrate = *frequency;
// The compiler might warn us because the expansion starts with
© All Rights Reserved