summaryrefslogtreecommitdiffstats
path: root/src/modules/alsa/alsa-util.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-11-11 10:48:39 +0100
committerDaniel Mack <daniel@caiaq.de>2009-11-11 10:48:39 +0100
commited7642ebac32bde8d9c47f3a1d8eabf75c3ea986 (patch)
tree9db77a271430da8abf7b6d11079bc660f7428094 /src/modules/alsa/alsa-util.c
parent21ffcd55a5a425870f8f4c3b4933bc7cb352e339 (diff)
parent22946427624afde1d53973fa5a2e9e2041ffc5b7 (diff)
Merge branch 'master' of git://0pointer.de/pulseaudio
Diffstat (limited to 'src/modules/alsa/alsa-util.c')
-rw-r--r--src/modules/alsa/alsa-util.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 0e22d17e..b8d13575 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -43,6 +43,7 @@
#include <pulsecore/once.h>
#include <pulsecore/thread.h>
#include <pulsecore/conf-parser.h>
+#include <pulsecore/core-rtclock.h>
#include "alsa-util.h"
#include "alsa-mixer.h"
@@ -1308,3 +1309,26 @@ const char* pa_alsa_strerror(int errnum) {
return translated;
}
+
+pa_bool_t pa_alsa_may_tsched(pa_bool_t want) {
+
+ if (!want)
+ return FALSE;
+
+ if (!pa_rtclock_hrtimer()) {
+ /* We cannot depend on being woken up in time when the timers
+ are inaccurate, so let's fallback to classic IO based playback
+ then. */
+ pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel.");
+ return FALSE; }
+
+ if (pa_running_in_vm()) {
+ /* We cannot depend on being woken up when we ask for in a VM,
+ * so let's fallback to classic IO based playback then. */
+ pa_log_notice("Disabling timer-based scheduling because running inside a VM.");
+ return FALSE;
+ }
+
+
+ return TRUE;
+}