summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/cmdline.c11
-rw-r--r--src/daemon/daemon-conf.c19
-rw-r--r--src/daemon/daemon-conf.h3
-rw-r--r--src/daemon/daemon.conf.in5
-rwxr-xr-xsrc/daemon/default.pa.in6
-rw-r--r--src/daemon/dumpmodules.c2
-rw-r--r--src/daemon/main.c19
-rwxr-xr-xsrc/daemon/start-pulseaudio-x11.in2
8 files changed, 40 insertions, 27 deletions
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
index d78089e1..ecb38486 100644
--- a/src/daemon/cmdline.c
+++ b/src/daemon/cmdline.c
@@ -31,6 +31,7 @@
#include <pulse/xmalloc.h>
#include <pulse/i18n.h>
+#include <pulse/util.h>
#include <pulsecore/core-util.h>
#include <pulsecore/strbuf.h>
@@ -109,15 +110,8 @@ static const struct option long_options[] = {
};
void pa_cmdline_help(const char *argv0) {
- const char *e;
-
pa_assert(argv0);
- if ((e = strrchr(argv0, '/')))
- e++;
- else
- e = argv0;
-
printf(_("%s [options]\n\n"
"COMMANDS:\n"
" -h, --help Show this help\n"
@@ -172,7 +166,8 @@ void pa_cmdline_help(const char *argv0) {
" -C Open a command line on the running TTY\n"
" after startup\n\n"
- " -n Don't load default script file\n"), e);
+ " -n Don't load default script file\n"),
+ pa_path_get_filename(argv0));
}
int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d) {
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index ac6cc8aa..664e4fde 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -85,6 +85,7 @@ static const pa_daemon_conf default_conf = {
.system_instance = FALSE,
.no_cpu_limit = FALSE,
.disable_shm = FALSE,
+ .lock_memory = FALSE,
.default_n_fragments = 4,
.default_fragment_size_msec = 25,
.default_sample_spec = { .format = PA_SAMPLE_S16NE, .rate = 44100, .channels = 2 },
@@ -446,6 +447,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
{ "no-cpu-limit", pa_config_parse_bool, &c->no_cpu_limit, NULL },
{ "disable-shm", pa_config_parse_bool, &c->disable_shm, NULL },
{ "flat-volumes", pa_config_parse_bool, &c->flat_volumes, NULL },
+ { "lock-memory", pa_config_parse_bool, &c->lock_memory, NULL },
{ "exit-idle-time", pa_config_parse_int, &c->exit_idle_time, NULL },
{ "scache-idle-time", pa_config_parse_int, &c->scache_idle_time, NULL },
{ "realtime-priority", parse_rtprio, c, NULL },
@@ -595,16 +597,14 @@ FILE *pa_daemon_conf_open_default_script_file(pa_daemon_conf *c) {
return f;
}
-
-static const char* const log_level_to_string[] = {
- [PA_LOG_DEBUG] = "debug",
- [PA_LOG_INFO] = "info",
- [PA_LOG_NOTICE] = "notice",
- [PA_LOG_WARN] = "warning",
- [PA_LOG_ERROR] = "error"
-};
-
char *pa_daemon_conf_dump(pa_daemon_conf *c) {
+ static const char* const log_level_to_string[] = {
+ [PA_LOG_DEBUG] = "debug",
+ [PA_LOG_INFO] = "info",
+ [PA_LOG_NOTICE] = "notice",
+ [PA_LOG_WARN] = "warning",
+ [PA_LOG_ERROR] = "error"
+ };
pa_strbuf *s;
char cm[PA_CHANNEL_MAP_SNPRINT_MAX];
@@ -630,6 +630,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
pa_strbuf_printf(s, "no-cpu-limit = %s\n", pa_yes_no(c->no_cpu_limit));
pa_strbuf_printf(s, "disable-shm = %s\n", pa_yes_no(c->disable_shm));
pa_strbuf_printf(s, "flat-volumes = %s\n", pa_yes_no(c->flat_volumes));
+ pa_strbuf_printf(s, "lock-memory = %s\n", pa_yes_no(c->lock_memory));
pa_strbuf_printf(s, "exit-idle-time = %i\n", c->exit_idle_time);
pa_strbuf_printf(s, "scache-idle-time = %i\n", c->scache_idle_time);
pa_strbuf_printf(s, "dl-search-path = %s\n", pa_strempty(c->dl_search_path));
diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h
index 9cec189f..dd69e048 100644
--- a/src/daemon/daemon-conf.h
+++ b/src/daemon/daemon-conf.h
@@ -73,7 +73,8 @@ typedef struct pa_daemon_conf {
disallow_exit,
log_meta,
log_time,
- flat_volumes;
+ flat_volumes,
+ lock_memory;
int exit_idle_time,
scache_idle_time,
auto_log_target,
diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in
index fcd2513a..d119716d 100644
--- a/src/daemon/daemon.conf.in
+++ b/src/daemon/daemon.conf.in
@@ -27,6 +27,8 @@
; system-instance = no
; disable-shm = no
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
+; lock-memory = no
+; no-cpu-limit = no
; high-priority = yes
; nice-level = -11
@@ -35,7 +37,6 @@
; realtime-priority = 5
; exit-idle-time = 20
-; module-idle-time = 20
; scache-idle-time = 20
; dl-search-path = (depends on architecture)
@@ -55,8 +56,6 @@
; flat-volumes = yes
-; no-cpu-limit = no
-
; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
index fa0683e1..a35ff8ff 100755
--- a/src/daemon/default.pa.in
+++ b/src/daemon/default.pa.in
@@ -49,11 +49,11 @@ load-module module-augment-properties
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
-.ifexists module-hal-detect@PA_SOEXT@
-load-module module-hal-detect
+.ifexists module-udev-detect@PA_SOEXT@
+load-module module-udev-detect
.else
### Alternatively use the static hardware detection module (for systems that
-### lack HAL support)
+### lack udev support)
load-module module-detect
.endif
diff --git a/src/daemon/dumpmodules.c b/src/daemon/dumpmodules.c
index 0ffc0fc0..92470b49 100644
--- a/src/daemon/dumpmodules.c
+++ b/src/daemon/dumpmodules.c
@@ -71,6 +71,8 @@ static void long_info(const char *name, const char *path, pa_modinfo *i) {
if (i->usage)
printf(_("Usage: %s\n"), i->usage);
printf(_("Load Once: %s\n"), pa_yes_no(i->load_once));
+ if (i->deprecated)
+ printf(_("DEPRECATION WARNING: %s\n"), i->deprecated);
}
if (path)
diff --git a/src/daemon/main.c b/src/daemon/main.c
index a2324516..58f8d660 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -40,6 +40,10 @@
#include <liboil/liboil.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
+
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
@@ -946,9 +950,7 @@ int main(int argc, char *argv[]) {
valid_pid_file = TRUE;
}
-#ifdef SIGPIPE
- signal(SIGPIPE, SIG_IGN);
-#endif
+ pa_disable_sigpipe();
if (pa_rtclock_hrtimer())
pa_log_info(_("Fresh high-resolution timers available! Bon appetit!"));
@@ -962,6 +964,17 @@ int main(int argc, char *argv[]) {
pa_rtsig_configure(SIGRTMIN, SIGRTMAX-1);
#endif
+ if (conf->lock_memory) {
+#ifdef HAVE_SYS_MMAN_H
+ if (mlockall(MCL_FUTURE) < 0)
+ pa_log_warn("mlockall() failed: %s", pa_cstrerror(errno));
+ else
+ pa_log_info("Sucessfully locked process into memory.");
+#else
+ pa_log_warn("Memory locking requested but not supported on platform.");
+#endif
+ }
+
pa_memtrap_install();
pa_assert_se(mainloop = pa_mainloop_new());
diff --git a/src/daemon/start-pulseaudio-x11.in b/src/daemon/start-pulseaudio-x11.in
index 391a6d3c..c57c489d 100755
--- a/src/daemon/start-pulseaudio-x11.in
+++ b/src/daemon/start-pulseaudio-x11.in
@@ -19,6 +19,8 @@
set -e
+[ -z "$PULSE_SERVER" ]
+
@PA_BINARY@ --start "$@"
if [ x"$DISPLAY" != x ] ; then