]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r230845:
authormav <mav@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 8 Jun 2012 13:22:50 +0000 (13:22 +0000)
committermav <mav@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 8 Jun 2012 13:22:50 +0000 (13:22 +0000)
commit11c544cbb8dc96ae7fc5c530da6daf4439ae2d37
tree309d7b15009047a270c8cf01e8ff13804bcd4d46
parent91b2708144df797921a873c06e802cf41cfce5ec
MFC r230845:
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.

git-svn-id: svn://svn.freebsd.org/base/stable/8@236754 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/sound/pcm/buffer.c
sys/dev/sound/pcm/buffer.h
sys/dev/sound/pcm/channel.c