diff options
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/cmdline.c | 6 | ||||
-rw-r--r-- | src/daemon/daemon-conf.c | 28 | ||||
-rw-r--r-- | src/daemon/daemon-conf.h | 13 | ||||
-rw-r--r-- | src/daemon/daemon.conf.in | 2 | ||||
-rwxr-xr-x | src/daemon/default.pa.in | 4 | ||||
-rw-r--r-- | src/daemon/main.c | 15 |
6 files changed, 44 insertions, 24 deletions
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c index cc3d714b..43a4a326 100644 --- a/src/daemon/cmdline.c +++ b/src/daemon/cmdline.c @@ -52,7 +52,6 @@ enum { ARG_DISALLOW_MODULE_LOADING, ARG_DISALLOW_EXIT, ARG_EXIT_IDLE_TIME, - ARG_MODULE_IDLE_TIME, ARG_SCACHE_IDLE_TIME, ARG_LOG_TARGET, ARG_LOG_META, @@ -88,7 +87,6 @@ static const struct option long_options[] = { {"disallow-module-loading", 2, 0, ARG_DISALLOW_MODULE_LOADING}, {"disallow-exit", 2, 0, ARG_DISALLOW_EXIT}, {"exit-idle-time", 2, 0, ARG_EXIT_IDLE_TIME}, - {"module-idle-time", 2, 0, ARG_MODULE_IDLE_TIME}, {"scache-idle-time", 2, 0, ARG_SCACHE_IDLE_TIME}, {"log-target", 1, 0, ARG_LOG_TARGET}, {"log-meta", 2, 0, ARG_LOG_META}, @@ -352,10 +350,6 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d conf->exit_idle_time = atoi(optarg); break; - case ARG_MODULE_IDLE_TIME: - conf->module_idle_time = atoi(optarg); - break; - case ARG_SCACHE_IDLE_TIME: conf->scache_idle_time = atoi(optarg); break; diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index d7ffc105..279fb7ba 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -64,8 +64,8 @@ static const pa_daemon_conf default_conf = { .realtime_priority = 5, /* Half of JACK's default rtprio */ .disallow_module_loading = FALSE, .disallow_exit = FALSE, + .flat_volumes = TRUE, .exit_idle_time = 20, - .module_idle_time = 20, .scache_idle_time = 20, .auto_log_target = 1, .script_commands = NULL, @@ -98,11 +98,15 @@ static const pa_daemon_conf default_conf = { #ifdef RLIMIT_NPROC ,.rlimit_nproc = { .value = 0, .is_set = FALSE } #endif +#ifdef RLIMIT_NOFILE ,.rlimit_nofile = { .value = 256, .is_set = TRUE } +#endif #ifdef RLIMIT_MEMLOCK ,.rlimit_memlock = { .value = 0, .is_set = FALSE } #endif +#ifdef RLIMIT_AS ,.rlimit_as = { .value = 0, .is_set = FALSE } +#endif #ifdef RLIMIT_LOCKS ,.rlimit_locks = { .value = 0, .is_set = FALSE } #endif @@ -415,8 +419,8 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { { "system-instance", pa_config_parse_bool, NULL }, { "no-cpu-limit", pa_config_parse_bool, NULL }, { "disable-shm", pa_config_parse_bool, NULL }, + { "flat-volumes", pa_config_parse_bool, NULL }, { "exit-idle-time", pa_config_parse_int, NULL }, - { "module-idle-time", pa_config_parse_int, NULL }, { "scache-idle-time", pa_config_parse_int, NULL }, { "realtime-priority", parse_rtprio, NULL }, { "dl-search-path", pa_config_parse_string, NULL }, @@ -444,8 +448,12 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { { "rlimit-stack", parse_rlimit, NULL }, { "rlimit-core", parse_rlimit, NULL }, { "rlimit-rss", parse_rlimit, NULL }, +#ifdef RLIMIT_NOFILE { "rlimit-nofile", parse_rlimit, NULL }, +#endif +#ifdef RLIMIT_AS { "rlimit-as", parse_rlimit, NULL }, +#endif #ifdef RLIMIT_NPROC { "rlimit-nproc", parse_rlimit, NULL }, #endif @@ -484,8 +492,8 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { table[i++].data = &c->system_instance; table[i++].data = &c->no_cpu_limit; table[i++].data = &c->disable_shm; + table[i++].data = &c->flat_volumes; table[i++].data = &c->exit_idle_time; - table[i++].data = &c->module_idle_time; table[i++].data = &c->scache_idle_time; table[i++].data = c; table[i++].data = &c->dl_search_path; @@ -511,10 +519,14 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { table[i++].data = &c->rlimit_fsize; table[i++].data = &c->rlimit_data; table[i++].data = &c->rlimit_stack; - table[i++].data = &c->rlimit_as; table[i++].data = &c->rlimit_core; + table[i++].data = &c->rlimit_rss; +#ifdef RLIMIT_NOFILE table[i++].data = &c->rlimit_nofile; +#endif +#ifdef RLIMIT_AS table[i++].data = &c->rlimit_as; +#endif #ifdef RLIMIT_NPROC table[i++].data = &c->rlimit_nproc; #endif @@ -641,8 +653,8 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) { pa_strbuf_printf(s, "system-instance = %s\n", pa_yes_no(c->system_instance)); 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, "exit-idle-time = %i\n", c->exit_idle_time); - pa_strbuf_printf(s, "module-idle-time = %i\n", c->module_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)); pa_strbuf_printf(s, "default-script-file = %s\n", pa_strempty(pa_daemon_conf_get_default_script_file(c))); @@ -666,12 +678,16 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) { pa_strbuf_printf(s, "rlimit-data = %li\n", c->rlimit_data.is_set ? (long int) c->rlimit_data.value : -1); pa_strbuf_printf(s, "rlimit-stack = %li\n", c->rlimit_stack.is_set ? (long int) c->rlimit_stack.value : -1); pa_strbuf_printf(s, "rlimit-core = %li\n", c->rlimit_core.is_set ? (long int) c->rlimit_core.value : -1); - pa_strbuf_printf(s, "rlimit-as = %li\n", c->rlimit_as.is_set ? (long int) c->rlimit_as.value : -1); pa_strbuf_printf(s, "rlimit-rss = %li\n", c->rlimit_rss.is_set ? (long int) c->rlimit_rss.value : -1); +#ifdef RLIMIT_AS + pa_strbuf_printf(s, "rlimit-as = %li\n", c->rlimit_as.is_set ? (long int) c->rlimit_as.value : -1); +#endif #ifdef RLIMIT_NPROC pa_strbuf_printf(s, "rlimit-nproc = %li\n", c->rlimit_nproc.is_set ? (long int) c->rlimit_nproc.value : -1); #endif +#ifdef RLIMIT_NOFILE pa_strbuf_printf(s, "rlimit-nofile = %li\n", c->rlimit_nofile.is_set ? (long int) c->rlimit_nofile.value : -1); +#endif #ifdef RLIMIT_MEMLOCK pa_strbuf_printf(s, "rlimit-memlock = %li\n", c->rlimit_memlock.is_set ? (long int) c->rlimit_memlock.value : -1); #endif diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index 04a4ebe7..aa9d2981 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -70,9 +70,9 @@ typedef struct pa_daemon_conf { load_default_script_file, disallow_exit, log_meta, - log_time; + log_time, + flat_volumes; int exit_idle_time, - module_idle_time, scache_idle_time, auto_log_target, realtime_priority, @@ -85,7 +85,14 @@ typedef struct pa_daemon_conf { char *config_file; #ifdef HAVE_SYS_RESOURCE_H - pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core, rlimit_rss, rlimit_nofile, rlimit_as; + pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core, rlimit_rss; + +#ifdef RLIMIT_NOFILE + pa_rlimit rlimit_nofile; +#endif +#ifdef RLIMIT_AS + pa_rlimit rlimit_as; +#endif #ifdef RLIMIT_NPROC pa_rlimit rlimit_nproc; #endif diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in index 00a95932..69d17f26 100644 --- a/src/daemon/daemon.conf.in +++ b/src/daemon/daemon.conf.in @@ -53,6 +53,8 @@ ; disable-remixing = no ; disable-lfe-remixing = yes +; flat-volumes = yes + ; no-cpu-limit = no ; rlimit-fsize = -1 diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in index 7de4c071..5d69926b 100755 --- a/src/daemon/default.pa.in +++ b/src/daemon/default.pa.in @@ -32,6 +32,7 @@ ### Automatically restore the volume of streams and devices load-module module-device-restore load-module module-stream-restore +load-module module-card-restore ### Load audio drivers statically (it's probably better to not load ### these drivers manually, but instead use module-hal-detect -- @@ -76,9 +77,6 @@ load-module module-native-protocol-unix #load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 description="RTP Multicast Sink" #load-module module-rtp-send source=rtp.monitor -### Enable flat volumes where possible -load-module module-flat-volume - ### Automatically restore the default sink/source when changed by the user during runtime load-module module-default-device-restore diff --git a/src/daemon/main.c b/src/daemon/main.c index 9c419efc..936c214d 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -298,11 +298,15 @@ static void set_all_rlimits(const pa_daemon_conf *conf) { #ifdef RLIMIT_NPROC set_one_rlimit(&conf->rlimit_nproc, RLIMIT_NPROC, "RLIMIT_NPROC"); #endif +#ifdef RLIMIT_NOFILE set_one_rlimit(&conf->rlimit_nofile, RLIMIT_NOFILE, "RLIMIT_NOFILE"); +#endif #ifdef RLIMIT_MEMLOCK set_one_rlimit(&conf->rlimit_memlock, RLIMIT_MEMLOCK, "RLIMIT_MEMLOCK"); #endif +#ifdef RLIMIT_AS set_one_rlimit(&conf->rlimit_as, RLIMIT_AS, "RLIMIT_AS"); +#endif #ifdef RLIMIT_LOCKS set_one_rlimit(&conf->rlimit_locks, RLIMIT_LOCKS, "RLIMIT_LOCKS"); #endif @@ -821,6 +825,8 @@ int main(int argc, char *argv[]) { pa_log_debug(_("Running on host: %s"), s); pa_xfree(s); + pa_log_debug(_("Found %u CPUs."), pa_ncpus()); + pa_log_info(_("Page size is %lu bytes"), (unsigned long) PA_PAGE_SIZE); #ifdef HAVE_VALGRIND_MEMCHECK_H @@ -885,6 +891,8 @@ int main(int argc, char *argv[]) { else pa_log_info(_("Dude, your kernel stinks! The chef's recommendation today is Linux with high-resolution timers enabled!")); + pa_rtclock_hrtimer_enable(); + #ifdef SIGRTMIN /* Valgrind uses SIGRTMAX. To easy debugging we don't use it here */ pa_rtsig_configure(SIGRTMIN, SIGRTMAX-1); @@ -901,7 +909,6 @@ int main(int argc, char *argv[]) { c->default_n_fragments = conf->default_n_fragments; c->default_fragment_size_msec = conf->default_fragment_size_msec; c->exit_idle_time = conf->exit_idle_time; - c->module_idle_time = conf->module_idle_time; c->scache_idle_time = conf->scache_idle_time; c->resample_method = conf->resample_method; c->realtime_priority = conf->realtime_priority; @@ -910,6 +917,7 @@ int main(int argc, char *argv[]) { c->disable_lfe_remixing = !!conf->disable_lfe_remixing; c->running_as_daemon = !!conf->daemonize; c->disallow_exit = conf->disallow_exit; + c->flat_volumes = conf->flat_volumes; pa_assert_se(pa_signal_init(pa_mainloop_get_api(mainloop)) == 0); pa_signal_new(SIGINT, signal_callback, c); @@ -963,11 +971,6 @@ int main(int argc, char *argv[]) { goto finish; } - if (c->default_sink_name && !pa_namereg_get(c, c->default_sink_name, PA_NAMEREG_SINK, TRUE) && conf->fail) { - pa_log_error(_("Default sink name (%s) does not exist in name register."), c->default_sink_name); - goto finish; - } - #ifdef HAVE_FORK if (daemon_pipe[1] >= 0) { int ok = 0; |