diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/caps.c | 5 | ||||
-rw-r--r-- | src/daemon/daemon-conf.c | 36 | ||||
-rw-r--r-- | src/daemon/daemon-conf.h | 1 | ||||
-rw-r--r-- | src/daemon/daemon.conf.in | 3 | ||||
-rwxr-xr-x | src/daemon/default.pa.in | 5 | ||||
-rw-r--r-- | src/daemon/main.c | 8 | ||||
-rwxr-xr-x | src/daemon/system.pa.in | 5 |
7 files changed, 39 insertions, 24 deletions
diff --git a/src/daemon/caps.c b/src/daemon/caps.c index f7b6658b..707b5323 100644 --- a/src/daemon/caps.c +++ b/src/daemon/caps.c @@ -34,6 +34,7 @@ #include <pulsecore/macro.h> #include <pulsecore/core-error.h> #include <pulsecore/log.h> +#include <pulsecore/core-util.h> #ifdef HAVE_SYS_CAPABILITY_H #include <sys/capability.h> @@ -112,9 +113,9 @@ void pa_drop_caps(void) { #ifndef __OPTIMIZE__ /* Valgrind doesn't not know set_caps, so we bypass it here -- but - * only in development builts.*/ + * only in development builds.*/ - if (getenv("VALGRIND") && !pa_have_caps()) + if (pa_in_valgrind() && !pa_have_caps()) return; #endif diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 77da3f7e..939b25d7 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -84,7 +84,8 @@ static const pa_daemon_conf default_conf = { .disable_shm = FALSE, .default_n_fragments = 4, .default_fragment_size_msec = 25, - .default_sample_spec = { .format = PA_SAMPLE_S16NE, .rate = 44100, .channels = 2 } + .default_sample_spec = { .format = PA_SAMPLE_S16NE, .rate = 44100, .channels = 2 }, + .shm_size = 0 #ifdef HAVE_SYS_RESOURCE_H ,.rlimit_fsize = { .value = 0, .is_set = FALSE }, .rlimit_data = { .value = 0, .is_set = FALSE }, @@ -429,6 +430,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { { "disable-remixing", pa_config_parse_bool, NULL }, { "disable-lfe-remixing", pa_config_parse_bool, NULL }, { "load-default-script-file", pa_config_parse_bool, NULL }, + { "shm-size-bytes", pa_config_parse_size, NULL }, #ifdef HAVE_SYS_RESOURCE_H { "rlimit-fsize", parse_rlimit, NULL }, { "rlimit-data", parse_rlimit, NULL }, @@ -494,65 +496,66 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { table[26].data = &c->disable_remixing; table[27].data = &c->disable_lfe_remixing; table[28].data = &c->load_default_script_file; + table[29].data = &c->shm_size; #ifdef HAVE_SYS_RESOURCE_H - table[29].data = &c->rlimit_fsize; - table[30].data = &c->rlimit_data; - table[31].data = &c->rlimit_stack; - table[32].data = &c->rlimit_as; - table[33].data = &c->rlimit_core; - table[34].data = &c->rlimit_nofile; - table[35].data = &c->rlimit_as; + table[30].data = &c->rlimit_fsize; + table[31].data = &c->rlimit_data; + table[32].data = &c->rlimit_stack; + table[33].data = &c->rlimit_as; + table[34].data = &c->rlimit_core; + table[35].data = &c->rlimit_nofile; + table[36].data = &c->rlimit_as; #ifdef RLIMIT_NPROC - table[36].data = &c->rlimit_nproc; + table[37].data = &c->rlimit_nproc; #endif #ifdef RLIMIT_MEMLOCK #ifndef RLIMIT_NPROC #error "Houston, we have a numbering problem!" #endif - table[37].data = &c->rlimit_memlock; + table[38].data = &c->rlimit_memlock; #endif #ifdef RLIMIT_LOCKS #ifndef RLIMIT_MEMLOCK #error "Houston, we have a numbering problem!" #endif - table[38].data = &c->rlimit_locks; + table[39].data = &c->rlimit_locks; #endif #ifdef RLIMIT_SIGPENDING #ifndef RLIMIT_LOCKS #error "Houston, we have a numbering problem!" #endif - table[39].data = &c->rlimit_sigpending; + table[40].data = &c->rlimit_sigpending; #endif #ifdef RLIMIT_MSGQUEUE #ifndef RLIMIT_SIGPENDING #error "Houston, we have a numbering problem!" #endif - table[40].data = &c->rlimit_msgqueue; + table[41].data = &c->rlimit_msgqueue; #endif #ifdef RLIMIT_NICE #ifndef RLIMIT_MSGQUEUE #error "Houston, we have a numbering problem!" #endif - table[41].data = &c->rlimit_nice; + table[42].data = &c->rlimit_nice; #endif #ifdef RLIMIT_RTPRIO #ifndef RLIMIT_NICE #error "Houston, we have a numbering problem!" #endif - table[42].data = &c->rlimit_rtprio; + table[43].data = &c->rlimit_rtprio; #endif #ifdef RLIMIT_RTTIME #ifndef RLIMIT_RTTIME #error "Houston, we have a numbering problem!" #endif - table[43].data = &c->rlimit_rttime; + table[44].data = &c->rlimit_rttime; #endif #endif @@ -670,6 +673,7 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) { pa_strbuf_printf(s, "default-sample-channels = %u\n", c->default_sample_spec.channels); pa_strbuf_printf(s, "default-fragments = %u\n", c->default_n_fragments); pa_strbuf_printf(s, "default-fragment-size-msec = %u\n", c->default_fragment_size_msec); + pa_strbuf_printf(s, "shm-size-bytes = %lu\n", (unsigned long) c->shm_size); #ifdef HAVE_SYS_RESOURCE_H pa_strbuf_printf(s, "rlimit-fsize = %li\n", c->rlimit_fsize.is_set ? (long int) c->rlimit_fsize.value : -1); pa_strbuf_printf(s, "rlimit-data = %li\n", c->rlimit_data.is_set ? (long int) c->rlimit_data.value : -1); diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index 309a1428..90329268 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -111,6 +111,7 @@ typedef struct pa_daemon_conf { unsigned default_n_fragments, default_fragment_size_msec; pa_sample_spec default_sample_spec; + size_t shm_size; } pa_daemon_conf; /* Allocate a new structure and fill it with sane defaults */ diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in index ea09fe09..c672d420 100644 --- a/src/daemon/daemon.conf.in +++ b/src/daemon/daemon.conf.in @@ -26,6 +26,7 @@ ; use-pid-file = yes ; system-instance = no ; disable-shm = no +; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB ; high-priority = yes ; nice-level = -11 @@ -39,7 +40,7 @@ ; dl-search-path = (depends on architecture) -; load-defaul-script-file = yes +; load-default-script-file = yes ; default-script-file = @PA_DEFAULT_CONFIG_FILE@ ; log-target = auto diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in index 5f35e3ec..7032038d 100755 --- a/src/daemon/default.pa.in +++ b/src/daemon/default.pa.in @@ -48,6 +48,11 @@ load-module module-hal-detect load-module module-detect .endif +### Automatically load driver modules for Bluetooth hardware +#.ifexists module-bluetooth-discover@PA_SOEXT@ +#load-module module-bluetooth-discover +#.endif + ### Load several protocols .ifexists module-esound-protocol-unix@PA_SOEXT@ load-module module-esound-protocol-unix diff --git a/src/daemon/main.c b/src/daemon/main.c index a9e8ed46..bc8bc63e 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -646,9 +646,9 @@ int main(int argc, char *argv[]) { conf->disable_shm = TRUE; } - if (conf->system_instance && conf->exit_idle_time > 0) { + if (conf->system_instance && conf->exit_idle_time >= 0) { pa_log_notice(_("Running in system mode, forcibly disabling exit idle time!")); - conf->exit_idle_time = 0; + conf->exit_idle_time = -1; } if (conf->cmd == PA_CMD_START) { @@ -793,6 +793,8 @@ int main(int argc, char *argv[]) { pa_log_debug(_("Compiled with Valgrind support: no")); #endif + pa_log_debug(_("Running in valgrind mode: %s"), pa_yes_no(pa_in_valgrind())); + #ifdef __OPTIMIZE__ pa_log_debug(_("Optimized build: yes")); #else @@ -854,7 +856,7 @@ int main(int argc, char *argv[]) { pa_assert_se(mainloop = pa_mainloop_new()); - if (!(c = pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_shm))) { + if (!(c = pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_shm, conf->shm_size))) { pa_log(_("pa_core_new() failed.")); goto finish; } diff --git a/src/daemon/system.pa.in b/src/daemon/system.pa.in index f6052c4b..27e42815 100755 --- a/src/daemon/system.pa.in +++ b/src/daemon/system.pa.in @@ -34,8 +34,9 @@ load-module module-esound-protocol-unix .endif load-module module-native-protocol-unix -### Automatically restore the volume of playback streams -load-module module-volume-restore +### Automatically restore the volume of streams and devices +load-module module-stream-restore +load-module module-device-restore ### Automatically restore the default sink/source when changed by the user during runtime load-module module-default-device-restore |