mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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.
This commit is contained in:
parent
771fb0b59b
commit
c47d689613
2 changed files with 10 additions and 4 deletions
|
|
@ -78,6 +78,9 @@
|
||||||
#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- Sleep at least 10ms on each iteration */
|
#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- Sleep at least 10ms on each iteration */
|
||||||
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms -- Wakeup at least this long before the buffer runs empty*/
|
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms -- Wakeup at least this long before the buffer runs empty*/
|
||||||
|
|
||||||
|
#define SMOOTHER_WINDOW_USEC (10*PA_USEC_PER_SEC) /* 10s -- smoother windows size */
|
||||||
|
#define SMOOTHER_ADJUST_USEC (1*PA_USEC_PER_SEC) /* 1s -- smoother adjust time */
|
||||||
|
|
||||||
#define SMOOTHER_MIN_INTERVAL (2*PA_USEC_PER_MSEC) /* 2ms -- min smoother update interval */
|
#define SMOOTHER_MIN_INTERVAL (2*PA_USEC_PER_MSEC) /* 2ms -- min smoother update interval */
|
||||||
#define SMOOTHER_MAX_INTERVAL (200*PA_USEC_PER_MSEC) /* 200ms -- max smoother update interval */
|
#define SMOOTHER_MAX_INTERVAL (200*PA_USEC_PER_MSEC) /* 200ms -- max smoother update interval */
|
||||||
|
|
||||||
|
|
@ -1756,8 +1759,8 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
||||||
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
|
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
|
||||||
|
|
||||||
u->smoother = pa_smoother_new(
|
u->smoother = pa_smoother_new(
|
||||||
DEFAULT_TSCHED_BUFFER_USEC*2,
|
SMOOTHER_ADJUST_USEC,
|
||||||
DEFAULT_TSCHED_BUFFER_USEC*2,
|
SMOOTHER_WINDOW_USEC,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
5,
|
5,
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,9 @@
|
||||||
#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */
|
#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */
|
||||||
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms */
|
#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_MIN_INTERVAL (2*PA_USEC_PER_MSEC) /* 2ms */
|
||||||
#define SMOOTHER_MAX_INTERVAL (200*PA_USEC_PER_MSEC) /* 200ms */
|
#define SMOOTHER_MAX_INTERVAL (200*PA_USEC_PER_MSEC) /* 200ms */
|
||||||
|
|
||||||
|
|
@ -1567,8 +1570,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);
|
pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
|
||||||
|
|
||||||
u->smoother = pa_smoother_new(
|
u->smoother = pa_smoother_new(
|
||||||
DEFAULT_TSCHED_BUFFER_USEC*2,
|
SMOOTHER_ADJUST_USEC,
|
||||||
DEFAULT_TSCHED_BUFFER_USEC*2,
|
SMOOTHER_WINDOW_USEC,
|
||||||
TRUE,
|
TRUE,
|
||||||
TRUE,
|
TRUE,
|
||||||
5,
|
5,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue