summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/pulseaudio
diff options
context:
space:
mode:
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>2015-05-22 21:51:53 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-24 07:19:21 +0100
commit5246fc09a7bf9e5c2e619d2c8db0294998d37001 (patch)
tree7fde6d3d54fc08ff9bd5be7b193d0982d08117da /meta/recipes-multimedia/pulseaudio
parent5d71a49b89658c9b0a0f8044a20304a26824886d (diff)
downloadpoky-5246fc09a7bf9e5c2e619d2c8db0294998d37001.tar.gz
pulseaudio: client-conf: Add allow-autospawn-for-root
This is related to enabling PulseAudio in Sato images. Sato doesn't have regular users; the graphical session is run as root. PulseAudio disables autospawning for root, but in Sato that's not the desired behaviour. This patch allows autospawning to be enabled for root in systems where that makes sense. (From OE-Core rev: 7bd867031556303d1601dff5174ecbec636b4aff) Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio')
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch92
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb1
2 files changed, 93 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
new file mode 100644
index 0000000000..d19eb7c19b
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
@@ -0,0 +1,92 @@
1From 1cb5647f76dc8cd7bacbce2a64fac9e6c2dc3b16 Mon Sep 17 00:00:00 2001
2From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
3Date: Tue, 28 Apr 2015 14:32:43 +0300
4Subject: [PATCH] client-conf: Add allow-autospawn-for-root
5
6Usually autospawning for root is a bad idea, since it can easily
7interfere with other users' PulseAudio instances, but in embedded
8environments where only root exists, autospawning is fine.
9
10Upstream-Status: Submitted [http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23549]
11
12Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
13---
14 man/pulse-client.conf.5.xml.in | 9 +++++++++
15 src/pulse/client-conf.c | 1 +
16 src/pulse/client-conf.h | 1 +
17 src/pulse/client.conf.in | 1 +
18 src/pulse/context.c | 2 +-
19 5 files changed, 13 insertions(+), 1 deletion(-)
20
21diff --git a/man/pulse-client.conf.5.xml.in b/man/pulse-client.conf.5.xml.in
22index 1002dbe..0058490 100644
23--- a/man/pulse-client.conf.5.xml.in
24+++ b/man/pulse-client.conf.5.xml.in
25@@ -71,6 +71,15 @@ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
26 </option>
27
28 <option>
29+ <p><opt>allow-autospawn-for-root=</opt> Allow autospawning also for root.
30+ Takes a boolean value, defaults to <opt>no</opt>. If the <opt>autospawn
31+ </opt> option is disabled, this option has no effect. Autospawning for
32+ root is disabled by default, because running PulseAudio as root will
33+ interfere with regular users' PulseAudio instances. This option should be
34+ enabled only in environments where there are no regular users at all.</p>
35+ </option>
36+
37+ <option>
38 <p><opt>daemon-binary=</opt> Path to the PulseAudio daemon to
39 run when autospawning. Defaults to a path configured at compile
40 time.</p>
41diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
42index 83331f8..0474583 100644
43--- a/src/pulse/client-conf.c
44+++ b/src/pulse/client-conf.c
45@@ -138,6 +138,7 @@ void pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_e
46 { "default-server", pa_config_parse_string, &c->default_server, NULL },
47 { "default-dbus-server", pa_config_parse_string, &c->default_dbus_server, NULL },
48 { "autospawn", pa_config_parse_bool, &c->autospawn, NULL },
49+ { "allow-autospawn-for-root", pa_config_parse_bool, &c->allow_autospawn_for_root, NULL },
50 { "cookie-file", pa_config_parse_string, &c->cookie_file_from_client_conf, NULL },
51 { "disable-shm", pa_config_parse_bool, &c->disable_shm, NULL },
52 { "enable-shm", pa_config_parse_not_bool, &c->disable_shm, NULL },
53diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
54index eac705a..131393a 100644
55--- a/src/pulse/client-conf.h
56+++ b/src/pulse/client-conf.h
57@@ -38,6 +38,7 @@ typedef struct pa_client_conf {
58 char *cookie_file_from_application;
59 char *cookie_file_from_client_conf;
60 bool autospawn, disable_shm, auto_connect_localhost, auto_connect_display;
61+ bool allow_autospawn_for_root;
62 size_t shm_size;
63 } pa_client_conf;
64
65diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in
66index 26b7790..69830ef 100644
67--- a/src/pulse/client.conf.in
68+++ b/src/pulse/client.conf.in
69@@ -23,6 +23,7 @@
70 ; default-dbus-server =
71
72 ; autospawn = yes
73+; allow-autospawn-for-root = no
74 ; daemon-binary = @PA_BINARY@
75 ; extra-arguments = --log-target=syslog
76
77diff --git a/src/pulse/context.c b/src/pulse/context.c
78index 4bc445f..d6c3f6d 100644
79--- a/src/pulse/context.c
80+++ b/src/pulse/context.c
81@@ -976,7 +976,7 @@ int pa_context_connect(
82 if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
83
84 #ifdef HAVE_GETUID
85- if (getuid() == 0)
86+ if (!c->conf->allow_autospawn_for_root && getuid() == 0)
87 pa_log_debug("Not doing autospawn since we are root.");
88 else {
89 c->do_autospawn = true;
90--
911.9.3
92
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb
index fb33c7c85d..465b224641 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb
@@ -2,6 +2,7 @@ require pulseaudio.inc
2 2
3SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \ 3SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
4 file://0001-padsp-Make-it-compile-on-musl.patch \ 4 file://0001-padsp-Make-it-compile-on-musl.patch \
5 file://0001-client-conf-Add-allow-autospawn-for-root.patch \
5 file://volatiles.04_pulse \ 6 file://volatiles.04_pulse \
6" 7"
7SRC_URI[md5sum] = "b691e83b7434c678dffacfa3a027750e" 8SRC_URI[md5sum] = "b691e83b7434c678dffacfa3a027750e"