aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRicardo Biehl Pasquali <pasqualirb@gmail.com>2018-12-30 11:53:54 -0200
committerRicardo Biehl Pasquali <pasqualirb@gmail.com>2019-01-08 13:06:18 -0200
commit535a6bac9a576b4d8553a295669a07c5609d4ab3 (patch)
treede01ce3119382456b457ce751ac96e16823901c0 /src
parentc8eb9c98a65c63090de7354441528718f6390fc9 (diff)
pcm: Get appl_ptr and avail_min after prepare
appl_ptr becomes zero in prepare action. avail_min is the same as when it was set in software parameters. Signed-off-by: Ricardo Biehl Pasquali <pasqualirb@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/pcm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pcm.c b/src/pcm.c
index f22e721..289b426 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -1192,6 +1192,9 @@ int pcm_prepare(struct pcm *pcm)
if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_PREPARE) < 0)
return oops(pcm, errno, "cannot prepare channel");
+ /* get appl_ptr and avail_min from kernel */
+ pcm_sync_ptr(pcm, SNDRV_PCM_SYNC_PTR_APPL|SNDRV_PCM_SYNC_PTR_AVAIL_MIN);
+
return 0;
}