aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2016-11-10 05:54:29 +0800
committerjbeich <jbeich@FreeBSD.org>2016-11-10 05:54:29 +0800
commited29042726450c45bcae8515b0d3f852dcbef071 (patch)
tree5742ad5d3caca68e6daf9e941548e1c076088c63 /audio
parent5b295a78c0c927432c8d6b4defceea41ed0f13d8 (diff)
downloadfreebsd-ports-gnome-ed29042726450c45bcae8515b0d3f852dcbef071.tar.gz
freebsd-ports-gnome-ed29042726450c45bcae8515b0d3f852dcbef071.tar.zst
freebsd-ports-gnome-ed29042726450c45bcae8515b0d3f852dcbef071.zip
audio/pulseaudio: respect hw.snd.default_unit
PR: 211684 Submitted by: lightside <lightside@gmx.com> Reviewed by: Tobias Kortkamp <t@tobik.me> Approved by: maintainer timeout (3 months) MFH: 2016Q4 (notorious for affecting www/firefox)
Diffstat (limited to 'audio')
-rw-r--r--audio/pulseaudio/Makefile1
-rw-r--r--audio/pulseaudio/files/patch-src_modules_module-detect.c46
-rw-r--r--audio/pulseaudio/files/pkg-message.in12
3 files changed, 52 insertions, 7 deletions
diff --git a/audio/pulseaudio/Makefile b/audio/pulseaudio/Makefile
index 59e2de57203e..d9da1eadde8a 100644
--- a/audio/pulseaudio/Makefile
+++ b/audio/pulseaudio/Makefile
@@ -6,6 +6,7 @@
PORTNAME= pulseaudio
PORTVERSION= 9.0
+PORTREVISION= 1
CATEGORIES= audio
MASTER_SITES= http://freedesktop.org/software/pulseaudio/releases/
diff --git a/audio/pulseaudio/files/patch-src_modules_module-detect.c b/audio/pulseaudio/files/patch-src_modules_module-detect.c
index a762c22ceb1c..0566d3eb567c 100644
--- a/audio/pulseaudio/files/patch-src_modules_module-detect.c
+++ b/audio/pulseaudio/files/patch-src_modules_module-detect.c
@@ -1,12 +1,54 @@
--- src/modules/module-detect.c.orig 2016-05-10 12:28:04 UTC
+++ src/modules/module-detect.c
-@@ -160,8 +160,7 @@ static int detect_oss(pa_core *c, int ju
+@@ -160,11 +160,48 @@ static int detect_oss(pa_core *c, int ju
continue;
} else if (sscanf(line, "pcm%u: ", &device) == 1) {
- /* FreeBSD support, the devices are named /dev/dsp0.0, dsp0.1 and so on */
- pa_snprintf(args, sizeof(args), "device=/dev/dsp%u.0", device);
+ pa_snprintf(args, sizeof(args), "device=/dev/dsp%u", device);
++ pa_module *m = pa_module_load(c, "module-oss", args);
- if (!pa_module_load(c, "module-oss", args))
+- if (!pa_module_load(c, "module-oss", args))
++ if (!m)
++ continue;
++
++ if (!pa_endswith(line, "default"))
++ continue;
++
++ char *p = strrchr(line, '>');
++
++ if (p)
++ p = strchr(p, '(');
++
++ if (!p)
continue;
++
++ if (!c->default_sink && (strstr(p, "play") || (strstr(p, "p:") && !strstr(p, "(0p:")))) {
++ uint32_t idx = PA_IDXSET_INVALID;
++ pa_sink *s;
++ PA_IDXSET_FOREACH(s, c->sinks, idx) {
++ if (s->module == m) {
++ if (!pa_namereg_set_default_sink(c, s))
++ pa_log_error("failed to set default sink for device: /dev/dsp%u", device);
++
++ break;
++ }
++ }
++ }
++
++ if (!c->default_source && (strstr(p, "rec") || (strstr(p, "r:") && !strstr(p, "/0r:")))) {
++ uint32_t idx = PA_IDXSET_INVALID;
++ pa_source *s;
++ PA_IDXSET_FOREACH(s, c->sources, idx) {
++ if (s->module == m) {
++ if (!pa_namereg_set_default_source(c, s))
++ pa_log_error("failed to set default source for device: /dev/dsp%u", device);
++
++ break;
++ }
++ }
++ }
+ }
+
+ n++;
diff --git a/audio/pulseaudio/files/pkg-message.in b/audio/pulseaudio/files/pkg-message.in
index 21e5598e8ee3..95f1894e421a 100644
--- a/audio/pulseaudio/files/pkg-message.in
+++ b/audio/pulseaudio/files/pkg-message.in
@@ -1,8 +1,10 @@
+Pulseaudio tries to determine default values for FreeBSD OSS driver at first
+start, based on /dev/sndstat output. The hw.snd.default_unit sysctl may affect
+these values, but restart of the Pulseaudio might be needed to rescan it again,
+e.g. `pacmd exit`.
-Pulseaudio doesn't know about the hw.snd.default_unit=3 sysctl for the
-FreeBSD OSS driver that is used to select the active input/output. So
-for Pulseaudio we also need to tell it which input/output to use. The
-difference is that Pulseaudio has separate input and output configure lines.
+Pulseaudio has separate input and output configure lines. You can change them
+with using following commands:
To change the default sink (output):
# pacmd set-default-sink 3
@@ -11,7 +13,7 @@ To change the default source (input):
This can also be set in %%PREFIX%%/etc/pulse/default.pa
-Replace the number '3' with the new default your want to set.
+Replace the number '3' with the new default you want to set.
The audio/freedesktop-sound-theme is needed if the default sound files