aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pcm/buffer.h
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2012-01-31 21:46:28 +0000
committerAlexander Motin <mav@FreeBSD.org>2012-01-31 21:46:28 +0000
commitfd578f6543f851b8fe357b72430096ccef522973 (patch)
tree2012a4dabad4764bfb16499b24258fef489e4849 /sys/dev/sound/pcm/buffer.h
parentf11c7f63056671247335df83a3fe80b94c6616ac (diff)
Make sound(4) more flexible in setting soft buffer and block sizes when
hardware imposes strict limitations on hard buffer and block sizes. Previous code set soft buffer to be no smaller then hard buffer. On some cards with fixed 64K physical buffer that caused up to 800ms play latency. New code allows to set soft buffer size down to just two blocks of the hard buffer and to not write more then that size ahead to the hardware buffer. As result of that change I was able to reduce full practically measured record-playback loop delay in those conditions down to only about 115ms with theoretical playback latency of only about 50ms. New code works fine for both vchans and direct cases. In both cases sound(4) tries to follow hw.snd.latency_profile and hw.snd.latency values and application-requested buffer and block sizes as much as limitation of two hardware blocks allows. Reviewed by: silence on multimedia@
Notes
Notes: svn path=/head/; revision=230845
Diffstat (limited to 'sys/dev/sound/pcm/buffer.h')
-rw-r--r--sys/dev/sound/pcm/buffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h
index d079cdbad4f7..8cee01237ad3 100644
--- a/sys/dev/sound/pcm/buffer.h
+++ b/sys/dev/sound/pcm/buffer.h
@@ -74,6 +74,7 @@ int sndbuf_remalloc(struct snd_dbuf *b, unsigned int blkcnt, unsigned int blksz)
void sndbuf_reset(struct snd_dbuf *b);
void sndbuf_clear(struct snd_dbuf *b, unsigned int length);
void sndbuf_fillsilence(struct snd_dbuf *b);
+void sndbuf_fillsilence_rl(struct snd_dbuf *b, u_int rl);
void sndbuf_softreset(struct snd_dbuf *b);
void sndbuf_clearshadow(struct snd_dbuf *b);