alsa: Set the rewind safeguard proportionally to sample spec
commitf97faae006c0acbcd33056008196f3651fe5b0d3
authorColin Guthrie <cguthrie@mandriva.org>
Sat, 4 Sep 2010 10:58:05 +0000 (4 11:58 +0100)
committerColin Guthrie <cguthrie@mandriva.org>
Tue, 14 Sep 2010 07:32:51 +0000 (14 08:32 +0100)
treec374ed4356e5615d191a79653b07bcee5f6ac27d
parentd30d22dfb8640431405b3d0f15455b29e817c167
alsa: Set the rewind safeguard proportionally to sample spec

Currently when rewinding alsa, a fixed value of 256 bytes is used,
which represents 1.33ms @ 48kHz (2ch, 16bit). This is typically fine
and due to DMA constraints we would not want to rewind less than this.

However with more demanding sample specs, (e.g. 8ch 192kHz 32bit)
256 bytes is likely not sufficient, so calculate what 1.33ms would
be and use which ever value is bigger.

Discussed with David Henningsson and Pierre-Louis Bossart here:
 http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/7286
src/modules/alsa/alsa-sink.c