summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@intel.com>2010-07-13 15:27:40 -0500
committerColin Guthrie <cguthrie@mandriva.org>2010-07-13 22:10:39 +0100
commitcb55b00ccd25d965b1222e74375aee05427a449b (patch)
tree3b6883655fa4471045c30e14a65693351defddb6
parent3ede7e4c01e0c429d4b6ac7a3eb25d7e6753ba21 (diff)
alsa: disable rewinds when using ALSA plugins
This is required to when playing on a52: device, rewind is broken in those plugins. Credits to Michael Rans <mcarans@yahoo.co.uk> for finding this workaround, and Tanu Kaskinen <tanuk@iki.fi> for providing valuable feedback. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
-rw-r--r--src/modules/alsa/alsa-sink.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 2995c3ceb..2e54dbe73 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -953,7 +953,12 @@ static int update_sw_params(struct userdata *u) {
}
pa_sink_set_max_request_within_thread(u->sink, u->hwbuf_size - u->hwbuf_unused);
- pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);
+ if (pa_alsa_pcm_is_hw(u->pcm_handle))
+ pa_sink_set_max_rewind_within_thread(u->sink, u->hwbuf_size);
+ else {
+ pa_log_info("Disabling rewind_within_thread for device %s", u->device_name);
+ pa_sink_set_max_rewind_within_thread(u->sink, 0);
+ }
return 0;
}
@@ -1906,7 +1911,12 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
(double) pa_bytes_to_usec(u->hwbuf_size, &ss) / PA_USEC_PER_MSEC);
pa_sink_set_max_request(u->sink, u->hwbuf_size);
- pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
+ if (pa_alsa_pcm_is_hw(u->pcm_handle))
+ pa_sink_set_max_rewind(u->sink, u->hwbuf_size);
+ else {
+ pa_log_info("Disabling rewind for device %s", u->device_name);
+ pa_sink_set_max_rewind(u->sink, 0);
+ }
if (u->use_tsched) {
u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, &requested_ss), &u->sink->sample_spec);