01087a57c7
* Based on wip/pulseaudio by kamil@ Changelog: Automatic routing more likely to change profile OS X and NetBSD support improvements Systemd journal logging for clients New LFE balance programming interface Module-dbus-protocol improvements More flexible configuration file handling pulsecore-8.0.so moved to a private directory New script for measuring memory consumption Various bug fixes and small improvements
32 lines
974 B
C
32 lines
974 B
C
$NetBSD: patch-src_modules_module-detect.c,v 1.4 2016/01/22 19:29:11 ryoon Exp $
|
|
|
|
Hack to set proper sound device on NetBSD.
|
|
|
|
--- src/modules/module-detect.c.orig 2014-01-23 18:57:55.000000000 +0000
|
|
+++ src/modules/module-detect.c
|
|
@@ -122,6 +122,17 @@ static int detect_oss(pa_core *c, int ju
|
|
FILE *f;
|
|
int n = 0, b = 0;
|
|
|
|
+#if defined(__NetBSD__)
|
|
+/*
|
|
+ * Assume primary sound device is used (/dev/audio).
|
|
+ * And only primary sound device will be used (n=1).
|
|
+ */
|
|
+ char args[64];
|
|
+ pa_snprintf(args, sizeof(args), "mmap=0 device=/dev/audio");
|
|
+ if (!pa_module_load(c, "module-oss", args))
|
|
+ exit(1);
|
|
+ n = 1;
|
|
+#else /* __linux__ or __FreeBSD__ */
|
|
if (!(f = pa_fopen_cloexec("/dev/sndstat", "r")) &&
|
|
!(f = pa_fopen_cloexec("/proc/sndstat", "r")) &&
|
|
!(f = pa_fopen_cloexec("/proc/asound/oss/sndstat", "r"))) {
|
|
@@ -173,6 +184,7 @@ static int detect_oss(pa_core *c, int ju
|
|
}
|
|
|
|
fclose(f);
|
|
+#endif
|
|
return n;
|
|
}
|
|
#endif
|