aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-29 17:08:51 +0100
committerMax Kellermann <max@duempel.org>2009-01-29 18:11:38 +0100
commit9e51844fe1b700a84b9d685c58dd762034477e5a (patch)
tree5d56336d6ee68647b24a1f1e03a8fa6cabdfa64b
parent2e2f8685b19b97cc06b337195be5d12d1bb18d3c (diff)
downloadmpd-9e51844fe1b700a84b9d685c58dd762034477e5a.tar.gz
mpd-9e51844fe1b700a84b9d685c58dd762034477e5a.tar.xz
mpd-9e51844fe1b700a84b9d685c58dd762034477e5a.zip
jack: reduced sleep time to 1ms
When waiting for free space in the ring buffer, the JACK plugin sleeped 10ms until there is enough space. This delay was too large for low-latency setups (<10ms), and created a lot of xruns. Work around that by reducing the sleep time to 1ms. A proper solution for this would be to use an event based approach, and we will do it, just not now.
-rw-r--r--NEWS1
-rw-r--r--src/output/jack_plugin.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 7ec682f69..d1e28aeac 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ ver 0.14.2 (2009/??/??)
* audio outputs:
- jack: allocate ring buffers before connecting
- jack: clear "shutdown" flag on reconnect
+ - jack: reduced sleep time to 1ms
ver 0.14.1 (2009/01/17)
diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c
index 267b8d279..420dd365f 100644
--- a/src/output/jack_plugin.c
+++ b/src/output/jack_plugin.c
@@ -466,7 +466,7 @@ mpd_jack_play(void *data, const char *buff, size_t size)
} else {
/* XXX do something more intelligent to
synchronize */
- my_usleep(10000);
+ my_usleep(1000);
}
}