summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-source.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-09-09 12:29:59 +0200
committerColin Guthrie <cguthrie@mandriva.org>2010-09-14 08:47:11 +0100
commit1ff360c7b107ba5710cc084183fb1c4bc49cd6af (patch)
tree1662173ed0e257b572eb17cf760b304198ed46d9 /src/modules/alsa/alsa-source.c
parent1c29f5582d3638a32271d8882de7c22579a42c6f (diff)
alsa: make defines for smoother configuration
Make new defines for the smoother window size and adjust time constants instead of reusing some unrelated constant. Increase the smoother window size even more because the bigger it is, the better. Since we have a 200ms max update interval and the max smoother history is 64 entries, 10seconds is a good default. Decrease the smoother adjust time to 1 second. The previous value of 4 seconds was too much to adapt quickly after a resume.
Diffstat (limited to 'src/modules/alsa/alsa-source.c')
-rw-r--r--src/modules/alsa/alsa-source.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 10f0d74e..0ad0fbca 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -73,6 +73,9 @@
#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms */
+#define SMOOTHER_WINDOW_USEC (10*PA_USEC_PER_SEC) /* 10s */
+#define SMOOTHER_ADJUST_USEC (1*PA_USEC_PER_SEC) /* 1s */
+
#define SMOOTHER_MIN_INTERVAL (2*PA_USEC_PER_MSEC) /* 2ms */
#define SMOOTHER_MAX_INTERVAL (200*PA_USEC_PER_MSEC) /* 200ms */
@@ -1570,8 +1573,8 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
u->smoother = pa_smoother_new(
- DEFAULT_TSCHED_BUFFER_USEC*2,
- DEFAULT_TSCHED_BUFFER_USEC*2,
+ SMOOTHER_ADJUST_USEC,
+ SMOOTHER_WINDOW_USEC,
TRUE,
TRUE,
5,